2005-12-01, 09:53 PM
2005-12-01, 10:50 PM
Simulationcity Wrote:What I'd like is a script that I could use to put a login/register bar on my website and a forum stats script that shows the forum stats.When you say "forum stats", what exact forum stats would you like to display? Also, what kind of page extension will the script go on? (html, php etc.)
2005-12-01, 10:56 PM
On the file portal.php there is a line about Forum Stats I am working on the stats part by taking out the important code and placing it in empty file.
This is what I have so far:
But I get this error:
Suggestions?
I'm a n00b at php.
This is what I have so far:
<?php
define("KILL_GLOBALS", 1);
// set the path to your forums directory here (without trailing slash)
$forumdir = "/";
// end editing
if(!chdir($forumdir) && $forumdir)
{
die("\$forumdir is invalid!");
}
$templatelist = "portal_welcome,portal_welcome_membertext,portal_stats,portal_search,portal_whosonline_memberbit,portal_whosonline,portal_latestthreads_thread_lastpost,portal_latestthreads_thread,portal_latestthreads,portal_announcement_numcomments_no,portal_announcement,portal_announcement_numcomments,portal";
require "global.php";
require "inc/functions_post.php";
require "inc/functions_user.php";
global $settings, $theme, $templates;
// Get Forum Statistics
if($mybb->settings['portal_showstatsh'] != "no")
{
$stats = $cache->read("stats");
$threadsnum = $stats['numthreads'];
$postsnum = $stats['numposts'];
$membersnum = $stats['numusers'];
if(!$stats['lastusername'])
{
$newestmember = "<b>no-one</b>";
}
else
{
$newestmember = "<a href=\"".$mybb->settings[bburl]."/member.php?action=profile&uid=$stats[lastuid]\">$stats[lastusername]</a>";
}
eval("\$stats = \"".$templates->get("portal_stats")."\";");
}
?>
But I get this error:
Quote:Warning: main(): open_basedir restriction in effect. File(./inc/init.php) is not within the allowed path(s): (/home2/simulati/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home2/simulati/public_html/forums/global.php on line 12
Warning: main(./inc/init.php): failed to open stream: Operation not permitted in /home2/simulati/public_html/forums/global.php on line 12
Warning: main(): open_basedir restriction in effect. File(./inc/init.php) is not within the allowed path(s): (/home2/simulati/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home2/simulati/public_html/forums/global.php on line 12
Warning: main(./inc/init.php): failed to open stream: Operation not permitted in /home2/simulati/public_html/forums/global.php on line 12
Fatal error: main(): Failed opening required './inc/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/simulati/public_html/forums/global.php on line 12
Suggestions?
I'm a n00b at php.
2005-12-01, 11:21 PM
Okay, no problem. First, save that code you wrote, inside your forum directory (the same directory your forum is). Then let me know where the new file is located, and where you want your new page to be located in relation to your forum directory.
2005-12-02, 12:54 AM
2005-12-04, 07:33 PM
I've been trying for about 4 days to make a login banner for a website and I now get the banner and the links at the top and all the info at the bottom. I deleted some stuff and I get this:
[attachment=1682]
Quote:Parse error: parse error, unexpected '\"', expecting '(' in /home2/simulati/public_html/forums/portallogin.php on line 114
[attachment=1682]
2006-02-24, 09:46 PM
Search for:
eval "$welcome = ("$templates->get ("portal_welcome")")";
Replace with:eval("\$welcome = \"".$templates->get("portal_welcome")."\";");