vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Request: Hottest Discussion Topics (https://vborg.vbsupport.ru/showthread.php?t=2336)

08-09-2000 08:06 AM

I'm looking for a hack that would allow us to post a list of the five most recent threads that have been updated on the front page of our site. We're currently using a PERL script on SitePoint.com that does that for UBB, but we're upgrading to vBulletin in the next week and we want to continue the "Hottest Discussion Topics" box on the front pages of our sites.

08-09-2000 08:54 AM

hi ya matt, as a forum member at sitepoint akka prequel i love that you're moving to vbulletin :D

here's a few threads concerning similar hacks...

http://www.vbulletin.com/forum/showt...?threadid=1476
http://www.vbulletin.com/forum/showt...p?threadid=249
http://www.vbulletin.com/forum/showt...?threadid=2153
http://www.vbulletin.com/forum/showt...p?threadid=655

08-09-2000 09:43 AM

well matt i found what i think you want
http://www.vbulletin.com/forum/showt...p?threadid=655

i had problems using it as you will read

08-09-2000 10:33 AM

OK here is what I have for you.....This will display the last 5 threads that were posted to on your homepage.

Check out the result here:

http://www.extremeforums.com/include/active.inc.php

Place the code below into a file called "active.inc.php"

Code:

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

require("config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$query = "SELECT * FROM thread ORDER BY lastpost DESC LIMIT $maxthreads";
$resultlatest = mysql_query($query,$db);
while ($latest_array = mysql_fetch_array($resultlatest)) {
echo "<FONT SIZE=\"2\" FACE=\"Verdana, Arial, Helvetica, sans-serif\">&nbsp;°
<A HREF=\"http://www.extremeforums.com/forums/showthread.php?threadid=$latest_array[threadid]\">$latest_array[title]</A></FONT><BR>";
}
 
?>

On your homepage (where you want the list to appear add this code:
Code:

include("/full/path/to/active.inc.php");


Also you can edit the "echo" statement however you like....i just have them appear in a bulleted list with the font face that matches my site

Hope this helps,
~Chris


[Edited by TechTalk on 08-09-2000 at 07:34 AM]

08-09-2000 02:06 PM

we have a number of hacks that to a variety of variations on this theme on our home page.

09-04-2000 04:04 AM

Do you have anymore similar hacks, TechTalk? Like a display of the top posters, etc? Other such things I can use on normal PHP pags? :)

09-04-2000 04:08 AM

Quote:

Originally posted by TWTCommish
Do you have anymore similar hacks, TechTalk? Like a display of the top posters, etc? Other such things I can use on normal PHP pags? :)

Yea ive released some others in this forum. Heres some links to get you started:
http://www.vbulletin.com/forum/showt...?threadid=2284
http://www.vbulletin.com/forum/showt...?threadid=2285
http://www.vbulletin.com/forum/showt...?threadid=2286
http://www.vbulletin.com/forum/showt...?threadid=2283

HTH

~Chris

09-04-2000 04:12 AM

Thanks man!

Got a problem with your original hack though...

I created the active.inc.php file and uploaded it to the forums/admin directory...I then stuck this line in my test.php file:

include("forums/admin/active.inc.php");

I got this error:

Fatal error: Failed opening required 'config.php' (include_path='') in forums/admin/active.inc.php on line 5

Any idea whats wrong?

09-04-2000 04:18 AM

Quote:

Originally posted by TWTCommish
Thanks man!

Got a problem with your original hack though...

I created the active.inc.php file and uploaded it to the forums/admin directory...I then stuck this line in my test.php file:

include("forums/admin/active.inc.php");

I got this error:

Fatal error: Failed opening required 'config.php' (include_path='') in forums/admin/active.inc.php on line 5

Any idea whats wrong?

Yep. Right before :
Code:

require("config.php");
Add:
Code:

chdir("forums/admin");
That should do it ;)

~Chris

09-04-2000 01:30 PM

Still no luck. :(

Here's my active.inc.php file:

Code:


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

chdir("forums/admin");
require("config.php");

$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$query = "SELECT * FROM thread ORDER BY lastpost DESC LIMIT $maxthreads";
$resultlatest = mysql_query($query,$db);
while ($latest_array = mysql_fetch_array($resultlatest)) {
echo "<FONT SIZE=\"2\" FACE=\"Verdana, Arial, Helvetica, sans-serif\">&nbsp;°
<A HREF=\"http://www.extremeforums.com/forums/showthread.php?threadid=$latest_array[threadid]\">$latest_array[title]</A></FONT><BR>";
}
 
?>

It has been uploaded into the forums/admin directory.

I use this line to call the file: include("forums/admin/active.inc.php");

I get this error: Fatal error: Failed opening required 'config.php' (include_path='') in forums/admin/active.inc.php on line 6

Line 6 is the one requesting config.php - I'm perplexed! :)

09-04-2000 01:33 PM

Nevermind! Got it to work! Thanks!

09-04-2000 06:49 PM

Thanks alot!

I was just planning to start figuring this out myself when I read this

great work

N.

slideboxer 12-24-2001 06:49 PM

I've gotten this hack to work but I'd like it to do a bit more than simply list the Thread title. Could someone please share the code to display the forum, thread title, poster, last posted and possibly include text from the latest post? Much like the "last XX posts" hack.

Thank you much


All times are GMT. The time now is 01:52 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.01105 seconds
  • Memory Usage 1,743KB
  • 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
  • (5)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete