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.
Sign In
Not a member yet? Click here to register.

Custom page on a Custom Panel

I'm trying to put a custom page onto a custom panel so that it is editable via the web GUI. I have a Panel named Admin Panel centered on the main site where only Administrators can see. I have a custom page that holds the HTML/PHP for the icons and links.

I just cant seem to get the custom page to display in the panel.. I get this error:

Quote

Warning: include(viewpage.php?id=2) [function.include]: failed to open stream: No such file or directory in /************/******/******/themes/templates/panels.php(78) : eval()'d code on line 2

Warning: include(viewpage.php?id=2) [function.include]: failed to open stream: No such file or directory in /******/******/******/******/themes/templates/panels.php(78) : eval()'d code on line 2

Warning: include() [function.include]: Failed opening 'viewpage.php?id=2' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /******/******/******/******/themes/templates/panels.php(78) : eval()'d code on line 2
Well ... quite simply is a PHP-Fusion announces that no such file or directory that you specify.
Cant understand why you need this... But:

Quote

$_GET['id']=2;
include(BASEDIR.'viewpage.php'wink;
@Yodix: Thanx. I already knew that. Hence this is why i was asking for help.

@PolarFox: Thank you. The reason I was doing this was to have a panel for Administrator view only. Kinda like a Dashboard for external site editing (ie. Members Roles, Fire Incidents), I and along with another friend run a Fire department website. Your code did not work either. I had to go into the database and remove it from the panel.
..and if you are refering to the asterisks i remove my actual path for my installation for this post.

Quote

Yodix wrote:
Well ... quite simply is a PHP-Fusion announces that no such file or directory that you specify.
@mmccoy, in the admin panel to specify default page: viewpage.php
index.php do so:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]<?php
$_GET['page_id']=1;
require_once "maincore.php";
require_once BASEDIR.$settings['opening_page'];
?>[/syntaxhighlighter]
where 1 - the page number for the main page
@mmccoy: I've earliere made a code that can do what you asking for:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]opentable("Admin Panel"wink;

include LOCALE.LOCALESET."custom_pages.php";

$page_id="1"; // Define the page_id nr.

if (isset($page_id) && !isNum($page_id)) redirect("index.php"wink;

$result = dbquery("SELECT * FROM ".DB_CUSTOM_PAGES." WHERE page_id='".$page_id."'"wink;
if (dbrows($result) != 0) {
$data = dbarray($result);

if (checkgroup($data['page_access'])) {
eval("?>".stripslashes($data['page_content'])."<?php "wink;
} else {
echo "<center><br />\n".$locale['400']."\n<br /><br /></center>\n";
}
} else {

echo "<center><br />\n".$locale['402']."\n<br /><br /></center>\n";
}

closetable();[/syntaxhighlighter]
- take a look at this line in the code:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]$page_id="1"; // Define the page_id nr.[/syntaxhighlighter]
Thread Information
Author
Replies
7 posts
Views
2,811 times
Last Post
Last updated on 9 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: smokeman, PolarFox, mmccoy, jikaka, Yodix