View Single Post
  #76  
Old 05-16-2001, 12:45 PM
Imperitus
Guest
 
Posts: n/a
Default

Juan, Sorry about that. Here is a version of the side bar without the welcome message stuff that is causing your problem. It should work and give you everything else from that part of the script.

side.php
--------

<?php
error_reporting(0);
require("GVCP_Config.php");

mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
mysql_select_db("$DBName") or die("Unable to access the News");

$sqlquery = "SELECT username FROM user ORDER by posts desc LIMIT 0,1";
$latest = mysql_query($sqlquery);
$daname = mysql_result($latest,"username");

$sqlquery2 = "SELECT userid FROM user ORDER by posts desc LIMIT 0,1";
$latest2 = mysql_query($sqlquery2);
$id = mysql_result($latest2,"userid");

print "<font color=$sidetextcolor> Most active user:</font> <a href=$path/member.php?action=getinfo&userid=$id><b> $daname </b></a>";
print "<hr noshade size=1 color=$hrcolor>";

$sqlquery = "SELECT username FROM user ORDER by joindate desc LIMIT 0,1";
$latest = mysql_query($sqlquery);
$daname = mysql_result($latest,"username");

$sqlquery2 = "SELECT userid FROM user ORDER by joindate desc LIMIT 0,1";
$latest2 = mysql_query($sqlquery2);
$id = mysql_result($latest2,"userid");

print "<font color=$sidetextcolor> Newest Member:</font> <a href=$path/member.php?action=getinfo&userid=$id><b> $daname</b></a>";
print "<hr noshade size=1 color=$hrcolor>";

$sqlquery = "SELECT * FROM user";
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);

print "<font color=$sidetextcolor> Number of users:</font> <a href=$path/memberlist.php><b> $number </b></a>";

print "<hr noshade size=1 color=$hrcolor><font color=$sidetextcolor><b>Last 10 active topics:</b></font><br>";

$sqlquery = "SELECT * FROM thread WHERE visible !=0 ORDER by lastpost DESC LIMIT 0,$active";
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);

$i = 0;

if ($number < 1) {
print "<font color=$sidetextcolor><CENTER><P>There are no active topics...</CENTER></font>";
}
else {
while ($number > $i) {

$title = mysql_result($result,$i,"title");
$theid = mysql_result($result,$i,"threadid");
$numcheck = mysql_result($result,$i,"replycount");
$numie = ($numcheck+1);
$lastposter = mysql_result($result,$i,"lastposter");



print " <a href=$path/showthread.php?threadid=$theid>$title </a><br><font size=-2 color=$sidetextcolor> Posts: <b> $numie </b> Last post by:<b> $lastposter</b></font><br>";


$i++;
}
}
print"<hr noshade size=1 color=$hrcolor>";

$sqlquery = "SELECT threadid FROM thread WHERE forumid !=36 AND visible !=0 ORDER by replycount desc LIMIT 0,1";
$result = mysql_query($sqlquery);
$threadid = mysql_result($result,"threadid");

$titquery = "SELECT title FROM thread WHERE threadid = $threadid";
$titresult = mysql_query($titquery);
$title = mysql_result($titresult,"threadid");

$postquery = "SELECT replycount FROM thread WHERE threadid = $threadid";
$postresult = mysql_query($postquery);
$posts = mysql_result($postresult,"replycount");

$viewquery = "SELECT views FROM thread WHERE threadid = $threadid";
$viewresult = mysql_query($viewquery);
$views = mysql_result($viewresult,"views");

$posterquery = "SELECT postusername FROM thread WHERE threadid = $threadid";
$posterresult = mysql_query($posterquery);
$poster = mysql_result($posterresult,"postusername");

print "<font color=$sidetextcolor><b>Most active topic ever:</b></font><br>
<a href=$path/showthread.php?threadid=$threadid>$title</a><br>
<font size=-2 color=$sidetextcolor>By: <b>$poster</b> Replies: <b>$posts</b> Views: <b>$views</b></font>";

?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01067 seconds
  • Memory Usage 1,771KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete