Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6
Author Message
nefar
Regular
Regular



Joined: Sep 20, 2004
Posts: 79

PostPosted: Sat Sep 10, 2005 12:28 pm Reply with quote

Hi,
Ahh man, everything always goes great till you're 95% done on an install lol. I got a copy of 7.6 3.0 and am almost done and ready to let some members make accounts and I just ran into a problem. I went to add some news to the front page and clicked on the admin/news icon to get.

Parse error: parse error, unexpected T_ELSE in /home/public_html/test/admin/modules/messages.php on line 373

Right when you think everythign is going great Wink I haven't really installed a multitude of addons and i've been good about keeping backup files of the ones I need to edit. I don't recall having to do any editing on the messages.php file but I suppose I could be mistake.

NsN groups/html newsletter/somminare menu/sentinel

code for file in question:
Code:
<?php


/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/*                                                                      */
/************************************************************************/
/*         Additional security & Abstraction layer conversion           */
/*                           2003 chatserv                              */
/*      http://www.nukefixes.com -- http://www.nukeresources.com        */
/************************************************************************/

if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
global $prefix, $db;
$aid = substr("$aid", 0,25);
$row = $db->sql_fetchrow($db->sql_query("SELECT radminsuper FROM " . $prefix . "_authors WHERE aid='$aid'"));
if ($row['radminsuper'] == 1) {

/*********************************************************/
/* Messages Functions                                    */
/*********************************************************/

function MsgDeactive($mid) {
    global $prefix, $db;
    $mid = intval($mid);
    $db->sql_query("update " . $prefix . "_message set active='0' WHERE mid='$mid'");
    Header("Location: admin.php?op=messages");
}

function messages() {
    global $admin, $admlanguage, $language, $bgcolor1, $bgcolor2, $prefix, $db, $multilingual;
    include ("header.php");
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _MESSAGESADMIN . "</b></font></center>";
    CloseTable();
    echo "<br>";
    if ($admlanguage == "") {
       $admlanguage = $language; /* This to make sure some language is pre-selected */
    }
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _ALLMESSAGES . "</b></font><br><br><table border=\"1\" width=\"100%\" bgcolor=\"$bgcolor1\">"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>" . _ID . "</b></td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>" . _TITLE . "</b></td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\">&nbsp;<b>" . _LANGUAGE . "</b>&nbsp;</td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\" nowrap>&nbsp;<b>" . _VIEW . "</b>&nbsp;</td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\">&nbsp;<b>" . _ACTIVE . "</b>&nbsp;</td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\">&nbsp;<b>" . _FUNCTIONS . "</b>&nbsp;</td></tr>";
    $result = $db->sql_query("SELECT mid, title, content, date, expire, active, view, mlanguage from " . $prefix . "_message");
    while ($row = $db->sql_fetchrow($result)) {
    $mid = intval($row['mid']);
    $title = $row['title'];
    $content = $row['content'];
    $mdate = $row['date'];
    $expire = intval($row['expire']);
    $active = intval($row['active']);
    $view = intval($row['view']);
    $mlanguage = $row['mlanguage'];
    if ($active == 1) {
   $mactive = "" . _YES . "";
    } elseif ($active == 0) {
   $mactive = "" . _NO . "";
    }
    if ($view == 1) {
   $mview = "" . _MVALL . "";
    } elseif ($view == 2) {
   $mview = "" . _MVANON . "";
    } elseif ($view == 3) {
   $mview = "" . _MVUSERS . "";
    } elseif ($view == 4) {
   $mview = "" . _MVADMIN . "";
    } elseif ($view == 5) {
   $mview = ""._SUBUSERS."";
    }
   if ($mlanguage == "") {
   $mlanguage = "" . _ALL . "";
   }
   echo "<tr><td align=\"right\"><b>$mid</b>"
       ."</td><td align=\"left\" width=\"100%\"><b>$title</b>"
       ."</td><td align=\"center\">$mlanguage"
       ."</td><td align=\"center\" nowrap>$mview"
       ."</td><td align=\"center\">$mactive"
       ."</td><td align=\"right\" nowrap>(<a href=\"admin.php?op=editmsg&mid=$mid\">" . _EDIT . "</a>-<a href=\"admin.php?op=deletemsg&mid=$mid\">" . _DELETE . "</a>)"
       ."</td></tr>";

    }
    echo "</table></center><br>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _ADDMSG . "</b></font></center><br>";
    echo "<form action=\"admin.php\" method=\"post\">"
   ."<br><b>" . _MESSAGETITLE . ":</b><br>"
   ."<input type=\"text\" name=\"add_title\" value=\"\" size=\"50\" maxlength=\"100\"><br><br>"
   ."<b>" . _MESSAGECONTENT . ":</b><br>"
   ."<textarea name=\"add_content\" rows=\"15\" wrap=\"virtual\" cols=\"60\"></textarea><br><br>";
    if ($multilingual == 1) {
   echo "<b>" . _LANGUAGE . ": </b>"
       ."<select name=\"add_mlanguage\">";
   $handle=opendir('language');
   while ($file = readdir($handle)) {
       if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
           $langFound = $matches[1];
           $languageslist .= "$langFound ";
       }
   }
   closedir($handle);
   $languageslist = explode(" ", $languageslist);
   sort($languageslist);
   for ($i=0; $i < sizeof($languageslist); $i++) {
       if($languageslist[$i]!="") {
      echo "<option value=\"$languageslist[$i]\" ";
      if($languageslist[$i]==$language) echo "selected";
      echo ">".ucfirst($languageslist[$i])."</option>\n";
       }
   }
   echo "<option value=\"\">" . _ALL . "</option></select><br><br>";
    } else {
   echo "<input type=\"hidden\" name=\"add_mlanguage\" value=\"\">";
    }
    $now = time();
    echo "<b>" . _EXPIRATION . ":</b> <select name=\"add_expire\">"
   ."<option value=\"86400\" >1 " . _DAY . "</option>"
   ."<option value=\"172800\" >2 " . _DAYS . "</option>"
   ."<option value=\"432000\" >5 " . _DAYS . "</option>"
   ."<option value=\"1296000\" >15 " . _DAYS . "</option>"
   ."<option value=\"2592000\" >30 " . _DAYS . "</option>"
   ."<option value=\"0\" >" . _UNLIMITED . "</option>"
   ."</select><br><br>"
   ."<b>Active?</b> <input type=\"radio\" name=\"add_active\" value=\"1\" checked>" . _YES . " "
   ."<input type=\"radio\" name=\"add_active\" value=\"0\" >" . _NO . "";
    echo "<br><br><b>" . _VIEWPRIV . "</b> <select name=\"add_view\">"
   ."<option value=\"1\" >" . _MVALL . "</option>"
   ."<option value=\"2\" >" . _MVANON . "</option>"
   ."<option value=\"3\" >" . _MVUSERS . "</option>"
   ."<option value=\"4\" >" . _MVADMIN . "</option>"
   ."<option value=\"5\" >" . _SUBUSERS . "</option>"
   ."</select><br><br>"
   ."<input type=\"hidden\" name=\"op\" value=\"addmsg\">"
   ."<input type=\"hidden\" name=\"add_mdate\" value=\"$now\">"
   ."<input type=\"submit\" value=\"" . _ADDMSG . "\">"
   ."</form>";
    CloseTable();
    include ("footer.php");
}

function editmsg($mid) {
    global $admin, $prefix, $db, $multilingual;
    include ("header.php");
    $mid = intval($mid);
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _MESSAGESADMIN . "</b></font></center>";
    CloseTable();
    echo "<br>";
    $row = $db->sql_fetchrow($db->sql_query("SELECT title, content, date, expire, active, view, mlanguage from " . $prefix . "_message WHERE mid='$mid'"));
    $title = $row['title'];
    $content = $row['content'];
    $mdate = $row['date'];
    $expire = intval($row['expire']);
    $active = intval($row['active']);
    $view = intval($row['view']);
    $mlanguage = $row['mlanguage'];
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _EDITMSG . "</b></font></center>";
    if ($active == 1) {
   $asel1 = "checked";
   $asel2 = "";
    } elseif ($active == 0) {
   $asel1 = "";
   $asel2 = "checked";
    }
    if ($view == 1) {
   $sel1 = "selected";
   $sel2 = "";
   $sel3 = "";
   $sel4 = "";
   $sel5 = "";
    } elseif ($view == 2) {
   $sel1 = "";
   $sel2 = "selected";
   $sel3 = "";
   $sel4 = "";
   $sel5 = "";
    } elseif ($view == 3) {
   $sel1 = "";
   $sel2 = "";
   $sel3 = "selected";
   $sel4 = "";
   $sel5 = "";
    } elseif ($view == 4) {
   $sel1 = "";
   $sel2 = "";
   $sel3 = "";
   $sel4 = "selected";
   $sel5 = "";
    } elseif ($view == 5) {
   $sel1 = "";
   $sel2 = "";
   $sel3 = "";
   $sel4 = "";
   $sel5 = "selected";
    }
    if ($expire == 86400) {
   $esel1 = "selected";
   $esel2 = "";
   $esel3 = "";
   $esel4 = "";
   $esel5 = "";
   $esel6 = "";
    } elseif ($expire == 172800) {
   $esel1 = "";
   $esel2 = "selected";
   $esel3 = "";
   $esel4 = "";
   $esel5 = "";
   $esel6 = "";
    } elseif ($expire == 432000) {
   $esel1 = "";
   $esel2 = "";
   $esel3 = "selected";
   $esel4 = "";
   $esel5 = "";
   $esel6 = "";
    } elseif ($expire == 1296000) {
   $esel1 = "";
   $esel2 = "";
   $esel3 = "";
   $esel4 = "selected";
   $esel5 = "";
   $esel6 = "";
    } elseif ($expire == 2592000) {
   $esel1 = "";
   $esel2 = "";
   $esel3 = "";
   $esel4 = "";
   $esel5 = "selected";
   $esel6 = "";
    } elseif ($expire == 0) {
   $esel1 = "";
   $esel2 = "";
   $esel3 = "";
   $esel4 = "";
   $esel5 = "";
   $esel6 = "selected";
    }
    echo "<form action=\"admin.php\" method=\"post\">"
   ."<br><b>" . _MESSAGETITLE . ":</b><br>"
   ."<input type=\"text\" name=\"title\" value=\"$title\" size=\"50\" maxlength=\"100\"><br><br>"
   ."<b>" . _MESSAGECONTENT . ":</b><br>"
   ."<textarea name=\"content\" rows=\"15\" wrap=\"virtual\" cols=\"60\">$content</textarea><br><br>";
    if ($multilingual == 1) {
   echo "<b>" . _LANGUAGE . ": </b>"
       ."<select name=\"mlanguage\">";
   $handle=opendir('language');
   while ($file = readdir($handle)) {
       if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
           $langFound = $matches[1];
           $languageslist .= "$langFound ";
       }
   }
   closedir($handle);
   $languageslist = explode(" ", $languageslist);
   sort($languageslist);
   for ($i=0; $i < sizeof($languageslist); $i++) {
       if($languageslist[$i]!="") {
      echo "<option value=\"$languageslist[$i]\" ";
      if($languageslist[$i]==$mlanguage) echo "selected";
      echo ">".ucfirst($languageslist[$i])."</option>\n";
       }
   }
   if ($mlanguage == "") {
       $sellang = "selected";
   } else {
           $sellang = "";
   }
   echo "<option value=\"\" $sellang>" . _ALL . "</option></select><br><br>";
    } else {
   echo "<input type=\"hidden\" name=\"mlanguage\" value=\"\">";
    }
    echo "<b>" . _EXPIRATION . ":</b> <select name=\"expire\">"
   ."<option name=\"expire\" value=\"86400\" $esel1>1 " . _DAY . "</option>"
   ."<option name=\"expire\" value=\"172800\" $esel2>2 " . _DAYS . "</option>"
   ."<option name=\"expire\" value=\"432000\" $esel3>5 " . _DAYS . "</option>"
   ."<option name=\"expire\" value=\"1296000\" $esel4>15 " . _DAYS . "</option>"
   ."<option name=\"expire\" value=\"2592000\" $esel5>30 " . _DAYS . "</option>"
   ."<option name=\"expire\" value=\"0\" $esel6>" . _UNLIMITED . "</option>"
   ."</select><br><br>"
   ."<b>Active?</b> <input type=\"radio\" name=\"active\" value=\"1\" $asel1>" . _YES . " "
   ."<input type=\"radio\" name=\"active\" value=\"0\" $asel2>" . _NO . "";
    if ($active == 1) {
   echo "<br><br><b>" . _CHANGEDATE . "</b>"
       ."<input type=\"radio\" name=\"chng_date\" value=\"1\">" . _YES . " "
       ."<input type=\"radio\" name=\"chng_date\" value=\"0\" checked>" . _NO . "<br><br>";
    } elseif ($active == 0) {
   echo "<br><font class=\"tiny\">" . _IFYOUACTIVE . "</font><br><br>"
       ."<input type=\"hidden\" name=\"chng_date\" value=\"1\">";
    }
    echo "<b>" . _VIEWPRIV . "</b> <select name=\"view\">"
   ."<option name=\"view\" value=\"1\" $sel1>" . _MVALL . "</option>"
   ."<option name=\"view\" value=\"2\" $sel2>" . _MVANON . "</option>"
   ."<option name=\"view\" value=\"3\" $sel3>" . _MVUSERS . "</option>"
   ."<option name=\"view\" value=\"4\" $sel4>" . _MVADMIN . "</option>"
   ."<option name=\"view\" value=\"5\" $sel5>" . _SUBUSERS . "</option>"
   ."</select><br><br>"
   ."<input type=\"hidden\" name=\"mdate\" value=\"$mdate\">"
   ."<input type=\"hidden\" name=\"mid\" value=\"$mid\">"
   ."<input type=\"hidden\" name=\"op\" value=\"savemsg\">"
   ."<input type=\"submit\" value=\"" . _SAVECHANGES . "\">"
   ."</form>";
    CloseTable();
    include ("footer.php");
}

function savemsg($mid, $title, $content, $mdate, $expire, $active, $view, $chng_date, $mlanguage) {
    global $prefix, $db;
    $mid = intval($mid);
    $title = stripslashes(FixQuotes($title));
    $content = stripslashes(FixQuotes($content));
    if ($chng_date == 1) {
   $newdate = time();
    } elseif ($chng_date == 0) {
   $newdate = $mdate;
    }
    $result = $db->sql_query("update " . $prefix . "_message set title='$title', content='$content', date='$newdate', expire='$expire', active='$active', view='$view', mlanguage='$mlanguage' WHERE mid='$mid'");
    Header("Location: admin.php?op=messages");
}

function addmsg($add_title, $add_content, $add_mdate, $add_expire, $add_active, $add_view, $add_mlanguage) {
    global $prefix, $db;
    $title = stripslashes(FixQuotes($add_title));
    $content = stripslashes(FixQuotes($add_content));
    $result = $db->sql_query("insert into " . $prefix . "_message values (NULL, '$add_title', '$add_content', '$add_mdate', '$add_expire', '$add_active', '$add_view', '$add_mlanguage')");
    if (!$result) {
   exit();
    }
    Header("Location: admin.php?op=messages");
}

function deletemsg($mid, $ok=0) {
    global $prefix, $db;
    if($ok) {
   $result = $db->sql_query("delete from " . $prefix . "_message where mid='$mid'");
       if (!$result) {
       return;
       }
   Header("Location: admin.php?op=messages");
    } else {
   include("header.php");
   GraphicAdmin();
   OpenTable();
   echo "<center><font size=\"4\"><b>" . _MESSAGESADMIN . "</b></font></center>";
   CloseTable();
   echo "<br>";
   OpenTable();
   echo "<center>" . _REMOVEMSG . "";
   echo "<br><br>[ <a href=\"admin.php?op=messages\">" . _NO . "</a> | <a href=\"admin.php?op=deletemsg&amp;mid=$mid&amp;ok=1\">" . _YES . "</a> ]</center>";
       CloseTable();
   include("footer.php");
    }
}

switch ($op){

    case "messages":
    messages();
    break;

    case "editmsg":
    editmsg($mid, $title, $content, $mdate, $expire, $active, $view, $chng_date, $mlanguage);
    break;

    case "addmsg":
    addmsg($add_title, $add_content, $add_mdate, $add_expire, $add_active, $add_view, $add_mlanguage);
    break;

    case "deletemsg":
    deletemsg($mid, $ok);
    break;

    case "savemsg":
    savemsg($mid, $title, $content, $mdate, $expire, $active, $view, $chng_date, $mlanguage);
    break;

}

} else {
    echo "Access Denied";
}

?>


Anyone have any clue what would cause this. I really hate to start all over again. Thanks for any info in advance.
 
View user's profile Send private message ICQ Number
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6437

PostPosted: Sun Sep 11, 2005 10:28 pm Reply with quote

Doesn't look like there's anything wrong with line 373, but this isn't a 7.6 file. It looks like 7.5 or earlier - in 7.6, the admin.php can be renamed - in this file, it's hard-coded.

_________________
I search, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
nefar







PostPosted: Tue Sep 13, 2005 1:46 pm Reply with quote

Odd I had the change admin.php in config. But since you pointed that out I deleted my install and put a fresh copy of 7.6 3.1 in. So far my install has gone well and no parse error. Now I'm at the stage of instaling nsn groups but there are a ton of "edits" that don't match up ;( So it's back to research.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©