vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Active topics ? how did you do it tech talk ? (https://vborg.vbsupport.ru/showthread.php?t=2658)

08-23-2000 01:12 PM

Okay i thought i'd start a new thread ... how did tech talk do the today's active topics code hack to include it on a non vb page..

i have added most of the includes that tech talk released on my test index page at

now all i am missing are

1. active topics includes
2. displaying total threads
3. displaying total posts
4. displaying total registered members
5. displaying most recent registered member

any help is appreciated :D


[Edited by eva2000 on 01-04-2001 at 12:43 PM]

08-23-2000 05:13 PM

[Edited by eva2000 on 01-04-2001 at 12:44 PM]

08-23-2000 07:01 PM

Ok ill try to help a little here. To show the newest registered member make a new file called "newestmember.inc.php" and place the code below into it.

See it in action here:
http://www.extremeforums.com/include...member.inc.php

Here is the code:

Code:

<?php
require("/full/path/to/admin/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$query = "select * from user order by userid desc limit 1";
$resultlatest = mysql_query($query,$db);
$latest_array = mysql_fetch_array($resultlatest);
echo "<FONT FACE=\"Verdana, Arial, Helvetica, sans-serif\" SIZE=\"2\"><b>Greetings to our newest member, <a href=\"http://www.extremeforums.com/forums/member.php?action=getinfo&userid=$latest_array[userid]\" target=_blank>$latest_array[username]</a> !</b></font>";
?>

------------------------------------------------------------

For the total number of members make a file called "totalmembers.inc.php" and place the following code into it:
Code:

<?php
require("/full/path/to/admin/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$query = "select * from user";
$resultlatest = mysql_query($query,$db);
$num = mysql_num_rows($resultlatest);
echo "<FONT FACE=\"Verdana, Arial, Helvetica, sans-serif\" SIZE=\"2\">There are currently <b>$num</b> registered members.</font>";
?>

See this one in action here:
http://www.extremeforums.com/include...embers.inc.php

------------------------------------------------------------

For the total posts make a new file called "totalposts.inc.php" and include the following:
Code:

<?php
require("/full/path/to/admin/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$query = "select * from post";
$resultlatest = mysql_query($query,$db);
$num = mysql_num_rows($resultlatest);
echo "<FONT FACE=\"Verdana, Arial, Helvetica, sans-serif\" SIZE=\"2\">There are currently <b>$num</b> posts on the forums.</font>";
?>

See an example here:
http://www.extremeforums.com/include/totalposts.inc.php

------------------------------------------------------------

For the total threads make a file called "totalthreads.inc.php" and include the following:
Code:

<?php
require("/full/path/to/admin/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$query = "select * from thread";
$resultlatest = mysql_query($query,$db);
$num = mysql_num_rows($resultlatest);
echo "<FONT FACE=\"Verdana, Arial, Helvetica, sans-serif\" SIZE=\"2\">There are currently <b>$num</b> threads on the forums.</font>";
?>

Here is the example:
http://www.extremeforums.com/include...hreads.inc.php

------------------------------------------------------------

Hope this helps ;)

If you have any questions just let me know

~Chris

08-23-2000 07:04 PM

Oh and BTW....your active topics looks nice ;) Mine will show you any threads that were posted to today. If you want it here is the code:

Code:

<?php
// Set this to the max number of threads you want to display
$maxthreads = 100;

require("/full/path/to/admin/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$query = "SELECT * FROM thread WHERE to_days(now())=to_days(from_unixtime(lastpost)) AND forumid <> 34 AND forumid <> 33 ORDER BY dateline DESC LIMIT $maxthreads";
$resultlatest = mysql_query($query,$db);
while ($latest_array = mysql_fetch_array($resultlatest)) {
echo "<img src=\"images/smalldoc.gif\" width=\"12\" height=\"12\" alt=\">\" border=\"0\" align=\"absmiddle\"><FONT SIZE=\"2\" FACE=\"Verdana, Arial, Helvetica, sans-serif\">
<A HREF=\"http://www.extremeforums.com/forums/showthread.php?threadid=$latest_array[threadid]\">$latest_array[title]</A></FONT><BR>";
}
 
?>

~Chris

08-23-2000 07:47 PM

thanks techtalk it works perfectly and can be seen at http://www.animeboards.net :D

the only thing i had to do was add the chdir before require command in each php file you had above
Code:

<?php
chdir("/home/usr1/www.animeboards.net/htdocs/forums");
require("/home/usr1/www.animeboards.net/htdocs/forums/admin/config.php");


08-23-2000 07:49 PM

Glad you got it working ;) Strange about the change dir thingy...I never had to do that before :confused:

~Chris

08-23-2000 08:33 PM

*** dances around *** thanks again tech talk... just amazing what you can do with vbulletin :D

08-23-2000 08:36 PM

whoops... forgot one slight addition... how do you display the Active users ?

just the top part which says

Currently there are x members and x guests on the forums.

08-23-2000 08:40 PM

nice hack, but i want to exclude the private forums (TechTalk's active hack).

is this possible?

08-23-2000 09:03 PM

that's what i did i excluded forums by not specifying them

i.e. for me

Code:

<?
require("/home/usr1/www.animeboards.net/htdocs/forums/admin/config.php");

        $num_active = 10;
        $num_chars  = 90;

        $db=mysql_connect($servername,$dbusername,$dbpassword);
        mysql_select_db($dbname);

        $querylatest="select * from thread where forumid='1' or forumid='2' or forumid='3' or forumid='4' or forumid='5' or forumid='6' or forumid='7' or forumid='8' or forumid='9' or forumid='10' or forumid='11' or forumid='12' or forumid='13' or forumid='14' or forumid='15' or forumid='16' or forumid='17' or forumid='18' or forumid='19' or forumid='20' or forumid='22' or forumid='23' or forumid='25' or forumid='26' or forumid='27' or forumid='28' or forumid='29' or forumid='30' or forumid='31' or forumid='32' or forumid='34' or forumid='35' or forumid='36' or forumid='37' or forumid='38' order by lastpost desc limit $num_active";

        $resultlatest = mysql_query($querylatest,$db);

        print("<center><table width=\"100%%\" cellspacing=\"0\" cellpadding=\"2\">");

        while ($latest_array = mysql_fetch_array($resultlatest)) {
       
        // Get Forum Infomation
        $query_forum = "select * from forum where forumid='$latest_array[forumid]'";
        $result_forum = mysql_query($query_forum,$db);
        $forum_info_array = mysql_fetch_array($result_forum);
       
        printf("<tr><td colspan=\"2\" bgcolor=\"#87A4C2\"><b><font color=\"#000000\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">%s: %s</font></b></td></tr>",$forum_info_array["title"],$latest_array["title"]);

        // split the date up a bit
        $datestr1 = substr($latest_array["dateline"],0,10);
        $datetime = substr($latest_array["dateline"],11,8);       
        printf ("<tr valign=\"top\"><td width=\"15%%\" bgcolor=\"#B9B9B9\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><b>%s</b><br>Updated: %s<br>Replies: %s</font></td>", $latest_array["postusername"], $datetime, $latest_array["replycount"]);

        $querythread="select * from post where threadid='$latest_array[threadid]' order by dateline asc limit 1";

        $result_thread_text= mysql_query($querythread,$db);

        $result_thread_array = mysql_fetch_array($result_thread_text);
        printf ("<td width=\"85%%\" bgcolor=\"#cccccc\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><img src=\"/forums/images/icons/icon%s.gif\">?Last Post By: %s<hr>%s...<br><a href=\"/forums/showthread.php?threadid=%s\">Click here for more</font></td></tr>",$result_thread_array["iconid"],$latest_array["lastposter"],substr(strip_tags($result_thread_array["pagetext"]),0,$num_chars),$latest_array["threadid"]);
        printf ("<tr><td colspan=\"2\" width=\"100%%\">?</td></tr>");
        }

        printf ("</table></center>");
?>

the part where is shows

forumid='1' or forumid='2' etc... it tells which forums to show... so leaving it out, hides the private forums :)


All times are GMT. The time now is 02:20 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01063 seconds
  • Memory Usage 1,761KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete