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-24-2000 05:15 AM

thanks, works perfect!

08-24-2000 08:56 AM

well you have to thank shri, tech talk and jimf :D

08-24-2000 09:03 AM

oh yeah 1 last thing is i need is the code to make the ctive users show up on a non vb page

something like

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

08-29-2000 11:14 PM

Hi eva2000,

I tried your .txt examples but they were redirecting to your main forums page. I need Code help on the following stuff please?

1. Show Most Active Posters (number of active posters as variable)
example: Most Active Posters
POster 1 (number of posts)
Poster 2 (number of posts)
etc.

2. Show Last ($UNANSWERED TOPICS)

3. Show Forum Categories and Forums in Directory Tree Form
example:
Category 1
Forum 1 (number of posts)
Forum 2 (number of posts)
Forum 3 (number of posts)
Category 2
Forum 4 (number of posts)

Thanks and you guys rock!!!

08-30-2000 12:55 AM

okay here it is thanks to techtalk for these :D

1. http://animeboards.net/topposters.txt
2. http://animeboards.net/deadtopics.txt
3. don't know about that one but you could add the forum display one that techtalk did http://animeboards.net/forumlist.txt several times and select which forums you want each php include to display

in the above example

Code:

AND forumid != 21 AND forumid != 22 etc
displays those forums...

you could do 2 includes for 2 categories and specify only the forums within that category

08-30-2000 03:54 AM

For the active Forums hack above you could change the SQL statement from
Code:

$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";

to
Code:

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

The second is shorter but both require you to change the code every time you add a new public forum. Now since you mark a forum as private or not then you can also use "where private='1'" in your SQL statement which shortens the whole SQL statement to:
Code:

$querylatest="select * from thread where select private != '1' from forum and thread.forumid=forum.forumid
order by lastpost desc limit $num_active";

Since I don't know that the forum table is called I just called it forum for simplicities sake.

Now I just have to learn PHP so I can understand what the rest of it does. :)


[Edited by wluke on 08-30-2000 at 01:04 AM]

08-31-2000 02:21 PM

Hi everyone.
This is my first post ever, and I'm very new to PHP and MySQL, though I'm good enough to be dangerous. That's why I need your help.

Let's say I have a forum in which only I post news items for my site. No postings by public allowed, though I don't know if that will make a difference to the hack.

I see the code you guys have been slinging around here, but cannot make enough progress in hacking it.

I want to take the very last item that's posted in my "private" forum for site news, and pull it into my homepage, with the headline and post time above it.

Possible? I know so. How, though?

Please help.

09-08-2000 11:36 AM

Quote:

Originally posted by wluke
to
Code:

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

The second is shorter but both require you to change the code every time you add a new public forum. Now since you mark a forum as private or not then you can also use "where private='1'" in your SQL statement which shortens the whole SQL statement to:
Code:

$querylatest="select * from thread where select private != '1' from forum and thread.forumid=forum.forumid
order by lastpost desc limit $num_active";


note to those that asked about my frontpage at http://animeboards.net - i have yet to change the code to the above posted by wluke

so does the below

Code:

$querylatest="select * from thread where select private != '1' from forum and thread.forumid=forum.forumid
order by lastpost desc limit $num_active";

show all forums and hide all private forums (more than 1 private forum) ?

09-08-2000 12:11 PM

I need the active topics .txt for the 12 last active topics you have down the middle of your page Eva2000

Please. Thanks.

09-08-2000 01:39 PM

somehow all those links i did above are valid ? strange oh well

here's the last 12 active threads in the middle column
Code:

<?

        $num_active = 12;
        $num_chars  = 95;

        $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='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>");
?>

i haven't tried replacing it with wluke's suggestion for the $querylatest= yet

Code:

$querylatest="select * from thread where select private != '1' from forum and thread.forumid=forum.forumid
order by lastpost desc limit $num_active";



All times are GMT. The time now is 09:33 AM.

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.01150 seconds
  • Memory Usage 1,754KB
  • 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
  • (9)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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