PDA

View Full Version : Latest XX unanswered topics.


Cloughie
10-03-2001, 01:29 PM
Exaclty as seen on progresstalk.com

Anyone have this hack or is there one?

I have searched btw :D

Admin
10-03-2001, 01:50 PM
What would you like to order this by?
i.e Top XX latest threads with no reply?

That is quite easy to do:
<?php
error_reporting(7);

require("./global.php");

$whereforum="";
// if you would like to select threads only from one forum,
// uncomment the following line and replace 1 with the ID
// of that forum.
// $whereforum="AND forumid='1'";

// how many threads would like to display?
$threadnum="10";

// path to your vBulletin? (no trailing slash please)
$pathtovb="http://www";

$threadlist="";

$allthreads=$DB_site->query("SELECT threadid,title FROM thread WHERE replycount='0' $whereforum ORDER BY dateline LIMIT $threadnum");
while ($thread=$DB_site->fetch_array($allthreads)) {
if ($threadlist!="")
$threadlist.="<br>";
$threadlist.="<a href=\"$pathtovb/showthread.php?threadid=$thread[threadid]\">$thread[title]</a>";
}

?>
Pretty adjustable to your needs methinks.

Just upload to your forum's folder, and include using SSI.

Cloughie
10-03-2001, 02:12 PM
Thank you very much Firefly! I am gonna try this soon :)

Thanks again!

Cloughie
10-03-2001, 03:15 PM
Hey I put in the code and called it new.php

I then tried to run http://www.wannabebigforums.com/new.php to test it before I incuded it in the forums and got a blank screen :(

Heres my php file..


<?php

error_reporting(7);

require("./global.php");

$whereforum="";
// if you would like to select threads only from one forum,
// uncomment the following line and replace 1 with the ID
// of that forum.
// $whereforum="AND forumid='1'";

// how many threads would like to display?
$threadnum="10";

// path to your vBulletin? (no trailing slash please)
$pathtovb="http://www.wannabebigforums.com";

$threadlist="";

$allthreads=$DB_site->query("SELECT threadid,title FROM thread WHERE replycount='0' $whereforum ORDER BY dateline LIMIT $threadnum");
while ($thread=$DB_site->fetch_array($allthreads)) {
if ($threadlist!="")
$threadlist.="<br>";
$threadlist.="<a href=\"$pathtovb/showthread.php?threadid=$thread[threadid]\">$thread[title]</a>";
}

?>

Cloughie
10-03-2001, 03:17 PM
also out of curiousity how hard is it to make it the last XX threads in the last 24 hours?

That might save some old unanswered posts showing up?

Just wondered, may chose to keep it like it is :)

Admin
10-03-2001, 03:23 PM
LOL, I am so dumb. :p
Forgot to echo the stuff. ;)

<?php

error_reporting(7);

require("./global.php");

$whereforum="";
// if you would like to select threads only from one forum,
// uncomment the following line and replace 1 with the ID
// of that forum.
// $whereforum="AND forumid='1'";

// how many threads would like to display?
$threadnum="10";

// path to your vBulletin? (no trailing slash please)
$pathtovb="http://www.wannabebigforums.com";

// timeframe? (in hours)
$hours="24";

$threadlist="";

$datecut=time()-($hours*60*60);
$allthreads=$DB_site->query("SELECT threadid,title FROM thread WHERE replycount='0' AND dateline>='$datecut' $whereforum ORDER BY dateline LIMIT $threadnum");
while ($thread=$DB_site->fetch_array($allthreads)) {
if ($threadlist!="")
$threadlist.="<br>";
$threadlist.="<a href=\"$pathtovb/showthread.php?threadid=$thread[threadid]\">$thread[title]</a>";
}

echo "$threadlist";

?>
(include last 24 hours)

Cloughie
10-03-2001, 03:40 PM
would this interfere with tubedogs top xx posters?

Its just I get the new.php working fine..

So I add this to phpinclude..

ob_start();
require("/home/wbbforum/www/topposters.php");
$noreplytopic = ob_get_contents();
ob_end_clean();

I then use $noreplytopic in one of my templates and it shows the top XX posters ???? So I had top xx posters twice??

Cloughie
10-03-2001, 03:41 PM
my fault.. I am stupid..

I copied the php include from the topposters one..

D'oh I feel stupid now ha ha

Cloughie
10-03-2001, 03:42 PM
ok I changed it to new.php

I then got this,..

Fatal error: Cannot redeclare stripslashesarray() in /home/wbbforum/public_html/global.php on line 10

Any ideas?

Cloughie
10-03-2001, 04:30 PM
sorted it../

Removed the require global from the php file..

Andy R
06-11-2002, 04:15 AM
What about listing all forums except hidden (moderators) forum?

Can that be done by uncommenting the $whereforum line & excluding a certain froum?

Logician
06-11-2002, 10:10 AM
Originally posted by organic-hosting
What about listing all forums except hidden (moderators) forum?

Can that be done by uncommenting the $whereforum line & excluding a certain froum?

Replace:

$allthreads=$DB_site->query("SELECT threadid,title FROM thread WHERE replycount='0' $whereforum ORDER BY dateline LIMIT $threadnum");

AS:

$allthreads=$DB_site->query("SELECT threadid,title FROM thread WHERE replycount='0' AND (forumid=X OR forumid=Y OR forumid=Z) ORDER BY dateline LIMIT $threadnum");

(Replace X,Y,Z and if you need to add more forums use "OR forumid=N" format)

MalaK_3araby
08-09-2002, 11:16 AM
Thanks all.

how would i modify this to specify the forumid in the url?
i.e: http://yoursite/vb/new.php?&forumid=3

Logician
08-21-2002, 07:08 AM
Originally posted by MalaK_3araby
Thanks all.

how would i modify this to specify the forumid in the url?
i.e: http://yoursite/vb/new.php?&forumid=3
Replace:

$whereforum="";

AS:

$whereforum="AND forumid='".$forumid."'";

However this may not be a good idea if your users are allowed to use this script since they can access hidden forums with this method..

Automated
01-16-2003, 12:35 PM
SOrry i dont follow this, could someone please put it simply for me? I am quite lost :(

Thanks
Matthew

Automated
01-17-2003, 11:46 AM
Please............... Someone

Smoothie
01-18-2003, 04:24 AM
May I offer an alternative? This is the one I use, works great.
https://vborg.vbsupport.ru/showthread.php?s=&threadid=34155&highlight=virgin+topics