Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

A bug at panel_editor.php

Asked Modified Viewed 2,570 times
N
NL-LINK
N
  • Junior Member, joined since
  • Contributed 45 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions
asked
Junior Member

Can anyone help every time i add a code to the panel it says"Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in /home/nlcom/public_html/BigBoss/administration/panel_editor.php(128) : eval()'d code on line 2" i always check and still dont know the problem.
0 replies

7 posts

M
Matonor
M
Impossible things are there to be made possible
  • Veteran Member, joined since
  • Contributed 1,022 posts on the community forums.
  • Started 3 threads in the forums
answered
Veteran Member

You did not output your code correctly. It's not a bug.
We can't help you without having a look at your panel code of course.
0 replies
N
NL-LINK
N
  • Junior Member, joined since
  • Contributed 45 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions
answered
Junior Member

<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: panel_editor.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once THEMES."templates/admin_header.php";
include LOCALE.LOCALESET."admin/panels.php";

if (!checkrights("P"wink || !defined("iAUTH"wink || $_GET['aid'] != iAUTH) { redirect("../index.php"wink; }

$temp = opendir(INFUSIONS);
while ($folder = readdir($temp)) {
if (!in_array($folder, array(".",".."wink) && strstr($folder, "_panel"wink) {
if (is_dir(INFUSIONS.$folder)) $panel_list[] = $folder;
}
}
closedir($temp); sort($panel_list); array_unshift($panel_list, "none"wink;

if (isset($_POST['save'])) {
$error = "";
$panel_name = stripinput($_POST['panel_name']);
if ($panel_name == ""wink $error .= $locale['470']."<br />";
if ($_POST['panel_filename'] == "none"wink {
$panel_filename = "";
$panel_content = addslash($_POST['panel_content']);
$panel_type = "php";
} else {
$panel_filename = stripinput($_POST['panel_filename']);
$panel_content = "";
$panel_type = "file";
}
$admin_password = isset($_POST['admin_password']) ? $_POST['admin_password'] : "";
$panel_side = isnum($_POST['panel_side']) ? $_POST['panel_side'] : "1";
$panel_access = isnum($_POST['panel_access']) ? $_POST['panel_access'] : "0";
if ($panel_side == "1" || $panel_side == "4"wink {
$panel_display = "0";
} else {
$panel_display = isset($_POST['panel_display']) ? "1" : "0";
}
if (isset($_GET['panel_id']) && isnum($_GET['panel_id'])) {
if ($panel_name) {
$data = dbarray(dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_id='".$_GET['panel_id']."'"wink);
if ($panel_name != $data['panel_name']) {
$result = dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_name='$panel_name'"wink;
if (dbrows($result)) { $error .= $locale['471']."<br />"; }
}
}
if ($panel_type == "php" && $panel_content == ""wink { $error .= $locale['472']."<br />"; }
if ((!isset($_COOKIE[COOKIE_PREFIX.'admin']) || md5($_COOKIE[COOKIE_PREFIX.'admin']) != $userdata['user_admin_password']) && md5(md5($admin_password)) != $userdata['user_admin_password']) {
$error .= $locale['474']."<br />";
}
if (!$error) {
$result = dbquery("UPDATE ".DB_PANELS." SET panel_name='$panel_name', panel_filename='$panel_filename', panel_content='$panel_content', panel_access='$panel_access', panel_display='$panel_display' WHERE panel_id='".$_GET['panel_id']."'"wink;
}
opentable($locale['480']);
echo "<div style='text-align:center'><br />\n";
if ($error) {
echo $locale['481']."<br /><br />\n".$error."<br />\n";
} else {
echo $locale['482']."<br /><br />\n";
}
echo "<a href='panels.php".$aidlink."'>".$locale['486']."</a><br /><br />\n";
echo "<a href='index.php".$aidlink."'>".$locale['487']."</a><br /><br />\n";
echo "</div>\n";
closetable();
if (!isset($_COOKIE[COOKIE_PREFIX.'admin']) && md5(md5($admin_password)) == $userdata['user_admin_password']) {
setcookie(COOKIE_PREFIX."admin", md5($admin_password), time() + 3600, "/", "", "0"wink;
}
} else {
if ($panel_name) {
$result = dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_name='$panel_name'"wink;
if (dbrows($result) != 0) { $error .= $locale['471']."<br />"; }
}
if ($panel_type == "php" && $panel_content == ""wink { $error .= $locale['472']."<br />"; }
if ($panel_type == "file" && $panel_filename == "none"wink { $error .= $locale['473']."<br />"; }
if ((!isset($_COOKIE[COOKIE_PREFIX.'admin']) || md5($_COOKIE[COOKIE_PREFIX.'admin']) != $userdata['user_admin_password']) && md5(md5($admin_password)) != $userdata['user_admin_password']) {
$error .= $locale['474']."<br />";
}
if (!$error) {
$result = dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_side='$panel_side' ORDER BY panel_order DESC LIMIT 1"wink;
if (dbrows($result) != 0) { $data = dbarray($result); $neworder = $data['panel_order'] + 1; } else { $neworder = 1; }
$result = dbquery("INSERT INTO ".DB_PANELS." (panel_name, panel_filename, panel_content, panel_side, panel_order, panel_type, panel_access, panel_display, panel_status) VALUES ('$panel_name', '$panel_filename', '$panel_content', '$panel_side', '$neworder', '$panel_type', '$panel_access', '$panel_display', '0'wink"wink;
}
opentable($locale['483']);
echo "<div style='text-align:center'><br />\n";
if ($error) {
echo $locale['484']."<br /><br />\n".$error."<br />\n";
} else {
echo $locale['485']."<br /><br />\n";
}
echo "<a href='panels.php".$aidlink."'>".$locale['486']."</a><br /><br />\n";
echo "<a href='index.php".$aidlink."'>".$locale['487']."</a><br /><br />\n";
echo "</div>\n";
closetable();
if (!isset($_COOKIE[COOKIE_PREFIX.'admin']) && md5(md5($admin_password)) == $userdata['user_admin_password']) {
setcookie(COOKIE_PREFIX."admin", md5($admin_password), time() + 3600, "/", "", "0"wink;
}
}
} else {
if (isset($_POST['preview'])) {
$panel_name = stripinput($_POST['panel_name']);
$panel_filename = $_POST['panel_filename'];
$panel_content = isset($_POST['panel_content']) ? stripslash($_POST['panel_content']) : "";
$admin_password = isset($_POST['admin_password']) ? $_POST['admin_password'] : "";
$panel_side = $_POST['panel_side'];
$panel_access = $_POST['panel_access'];
$panelon = isset($_POST['panel_display']) ? " checked='checked'" : "";
$panelopts = $_POST['panel_side'] == "1" || $_POST['panel_side'] == "4" ? " style='display:none'" : " style='display:block'";
$panel_type = $panel_filename == "none" ? "php" : "file";
if ((isset($_COOKIE[COOKIE_PREFIX.'admin']) && md5($_COOKIE[COOKIE_PREFIX.'admin']) == $userdata['user_admin_password']) || md5(md5($admin_password)) == $userdata['user_admin_password']) {
opentable($panel_name);
if ($panel_type == "file"wink {
@include INFUSIONS.$panel_filename."/".$panel_filename.".php";
} else {
eval($panel_content);
}
$panel_content = phpentities($panel_content);
closetable();
if (!isset($_COOKIE[COOKIE_PREFIX.'admin']) && md5(md5($admin_password)) == $userdata['user_admin_password']) {
setcookie(COOKIE_PREFIX."admin", md5($admin_password), time() + 3600, "/", "", "0"wink;
}
} else {
$panel_content = phpentities($panel_content);
}
}
if ((isset($_GET['action']) && $_GET['action'] == "edit"wink && (isset($_GET['panel_id']) && isnum($_GET['panel_id']))) {
$result = dbquery("SELECT * FROM ".DB_PANELS." WHERE panel_id='".$_GET['panel_id']."'"wink;
if (dbrows($result)) {
$data = dbarray($result);
$panel_name = $data['panel_name'];
$panel_filename = $data['panel_filename'];
$panel_content = phpentities(stripslashes($data['panel_content']));
$admin_password = "";
$panel_type = $data['panel_type'];
$panel_side = $data['panel_side'];
$panel_access = $data['panel_access'];
$panelon = $data['panel_display'] == "1" ? " checked='checked'" : "";
$panelopts = $panel_side == "1" || $panel_side == "4" ? " style='display:none'" : " style='display:block'";
} else {
redirect(FUSION_SELF.$aidlink);
}
}
if (isset($_GET['panel_id']) && isnum($_GET['panel_id'])) {
$action = FUSION_SELF.$aidlink."&amp;panel_id=".$_GET['panel_id'];
opentable($locale['450']);
} else {
if (!isset($_POST['preview'])) {
$panel_name = "";
$panel_filename = "";
$panel_content = "openside(\"name\"wink;\n"." echo \"content\";\n"."closeside();";
$admin_password = "";
$panel_type = "";
$panel_side = "";
$panel_access = "";
$panelon = "";
$panelopts = " style='display:none'";
}
$action = FUSION_SELF.$aidlink;
opentable($locale['451']);
}
$user_groups = getusergroups(); $access_opts = "";
while(list($key, $user_group) = each($user_groups)){
$sel = ($panel_access == $user_group['0'] ? " selected='selected'" : ""wink;
$access_opts .= "<option value='".$user_group['0']."'$sel>".$user_group['1']."</option>\n";
}
echo "<form name='editform' method='post' action='$action'>\n";
echo "<table cellpadding='0' cellspacing='0' class='center'>\n<tr>\n";
echo "<td class='tbl'>".$locale['452']."</td>\n";
echo "<td class='tbl'><input type='text' name='panel_name' value='$panel_name' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n";
if (isset($_GET['panel_id']) && isnum($_GET['panel_id'])) {
if ($panel_type == "file"wink {
echo "<tr>\n<td class='tbl'>".$locale['453']."</td>\n";
echo "<td class='tbl'><select name='panel_filename' class='textbox' style='width:200px;'>\n";
for ($i=0;$i < count($panel_list);$i++) {
echo "<option".($panel_filename == $panel_list[$i] ? " selected='selected'" : ""wink.">".$panel_list[$i]."</option>\n";
}
echo "</select></td>\n</tr>\n";
}
} else {
echo "<tr>\n<td class='tbl'>".$locale['453']."</td>\n";
echo "<td class='tbl'><select name='panel_filename' class='textbox' style='width:200px;'>\n";
for ($i=0;$i < count($panel_list);$i++) {
echo "<option".($panel_filename == $panel_list[$i] ? " selected='selected'" : ""wink.">".$panel_list[$i]."</option>\n";
}
echo "</select>&nbsp;&nbsp;<span class='small2'>".$locale['454']."</span></td>\n</tr>\n";
}
if (isset($_GET['panel_id']) && isnum($_GET['panel_id'])) {
if ($panel_type == "php"wink {
echo "<tr>\n<td valign='top' class='tbl'>".$locale['455']."</td>\n";
echo "<td class='tbl'><textarea name='panel_content' cols='95' rows='15' class='textbox' style='width:98%'>".$panel_content."</textarea></td>\n";
echo "</tr>\n";
}
} else {
echo "<tr>\n<td valign='top' class='tbl'>".$locale['455']."</td>\n";
echo "<td class='tbl'><textarea name='panel_content' cols='95' rows='15' class='textbox' style='width:98%'>".$panel_content."</textarea></td>\n";
echo "</tr>\n";
}
if ((!isset($_COOKIE[COOKIE_PREFIX.'admin']) || md5($_COOKIE[COOKIE_PREFIX.'admin']) != $userdata['user_admin_password']) && md5(md5($admin_password)) != $userdata['user_admin_password']) {
echo "<tr>\n<td class='tbl'>".$locale['456']."</td>\n";
echo "<td class='tbl'><input type='password' name='admin_password' value='".$admin_password."' class='textbox' style='width:150px;' /></td>\n";
echo "</tr>\n";
}
if (!isset($_GET['panel_id']) || !isnum($_GET['panel_id'])) {
echo "<tr>\n<td class='tbl'>".$locale['457']."</td>\n";
echo "<td class='tbl'><select name='panel_side' class='textbox' style='width:150px;' onchange=\"showopts(this.options[this.selectedIndex].value);\">\n";
echo "<option value='1'".($panel_side == "1" ? " selected='selected'" : ""wink.">".$locale['420']."</option>\n";
echo "<option value='2'".($panel_side == "2" ? " selected='selected'" : ""wink.">".$locale['421']."</option>\n";
echo "<option value='3'".($panel_side == "3" ? " selected='selected'" : ""wink.">".$locale['425']."</option>\n";
echo "<option value='4'".($panel_side == "4" ? " selected='selected'" : ""wink.">".$locale['422']."</option>\n";
echo "</select></td>\n</tr>\n";
}
echo "<tr>\n<td class='tbl'>".$locale['458']."</td>\n";
echo "<td class='tbl'><select name='panel_access' class='textbox' style='width:150px;'>\n".$access_opts."</select></td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='center' colspan='2' class='tbl'>\n";
echo "<div id='panelopts'".$panelopts."><input type='checkbox' id='panel_display' name='panel_display' value='1'".$panelon." /> ".$locale['459']."</div>\n";
echo "<br />\n";
if (isset($_GET['panel_id']) && isnum($_GET['panel_id'])) {
if ($panel_type == "php"wink {
echo "<input type='hidden' name='panel_filename' value='none' />\n";
}
echo "<input type='hidden' name='panel_side' value='".$panel_side."' />\n";
}
echo "<input type='submit' name='preview' value='".$locale['460']."' class='button' />\n";
echo "<input type='submit' name='save' value='".$locale['461']."' class='button' /></td>\n";
echo "</tr>\n</table>\n</form>\n";
closetable();
}

echo "<script type='text/javascript'>
function showopts(panelside) {
var panelopts = document.getElementById('panelopts'wink;
var paneldisplay = document.getElementById('panel_display'wink;
if (panelside == 1 || panelside == 4) {
panelopts.style.display = 'none';
paneldisplay.checked = false;
} else {
panelopts.style.display = 'block';
}
}
</script>\n";

require_once THEMES."templates/footer.php";
?>
Edited by NL-LINK on 19-07-2008 21:28,
0 replies
N
NL-LINK
N
  • Junior Member, joined since
  • Contributed 45 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions
answered
Junior Member

Thats my file code.
0 replies
N
NL-LINK
N
  • Junior Member, joined since
  • Contributed 45 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions
answered
Junior Member

I did copy the code correly but still say the same.
0 replies
N
NL-LINK
N
  • Junior Member, joined since
  • Contributed 45 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions
answered
Junior Member

I have been trying to use embed codes for panels.
0 replies
N
NL-LINK
N
  • Junior Member, joined since
  • Contributed 45 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions
answered
Junior Member

<object width="480" height="418" id="VideoPlayer"><param name="movie" value="http://www.g4tv.com/lv3/26963" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><embed src="http://www.g4tv.com/lv3/26963" type="application/x-shockwave-flash" name="VideoPlayer" width="480" height="418" allowScriptAccess="always" allowFullScreen="true" /></object>

Not only that every thing i put like embed code or imgas/google adds it doesn work.
0 replies
N
NL-LINK
N
  • Junior Member, joined since
  • Contributed 45 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions
answered
Junior Member

Forget it i fixed it.
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 7 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

M
M
Impossible things are there to be made possible
  • Veteran Member, joined since
  • Contributed 1,022 posts on the community forums.
  • Started 3 threads in the forums
N
N
  • Junior Member, joined since
  • Contributed 45 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet