vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   [RELEASE] Show dead topics on non vb page (https://vborg.vbsupport.ru/showthread.php?t=2285)

08-06-2000 11:18 PM

This is something I like to do on my homepage. If a post has no replies it needs attention right? I agree so I threw this little hack together that will list your dead topics.

Demo:
http://www.extremeforums.com/include/deadtopics.inc.php

Code:

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

require("config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$query = "SELECT * FROM thread WHERE replycount < 1 ORDER BY dateline DESC LIMIT $maxthreads";
$resultlatest = mysql_query($query,$db);
while ($latest_array = mysql_fetch_array($resultlatest)) {
echo "<FONT SIZE=\"1\" 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>";
}
 
?>

Edit the echo statement and the $maxthreads variable as you see fit

~Chris

08-07-2000 12:50 AM

Most people dont want to display threads from private forums so you can do something like this:
Code:

$query = "SELECT * FROM thread WHERE replycount < 1 AND forumid != 34 ORDER BY dateline DESC LIMIT $maxthreads";
"34" would just be the forum id of your private forum

Once again Im not familar enough with the structure of vb right now so if anyone knows a better way please let me know

~Chris
P.S The != doesnt work on win32 systems (so ive been told) so you might want to use NOT= if your on win32

08-07-2000 01:12 AM

Instead of !=, just use <>

That will clear that issue up.

08-08-2000 04:55 PM

How did you make it so that it appears on your homepage? Did you use ssi? If so, what is the ssi code?

08-08-2000 08:18 PM

I put the above code in a file named "deadtopics.inc.php"

and then on my homepage (where I wanted the list to appear)i put:
include("/full/path/to/deadtopics.inc.php");

Hope this helps,
~Chris

08-16-2000 03:03 PM

Quote:

Originally posted by TechTalk
I put the above code in a file named "deadtopics.inc.php"

and then on my homepage (where I wanted the list to appear)i put:
include("/full/path/to/deadtopics.inc.php");

Hope this helps,
~Chris

Thanks for sharing the code! It's really nice. Do people respond to this list--I mean does it do what it intends to do?

08-16-2000 05:53 PM

Sure no problem ;)

And yes it has really helped my users get the answers they need because every visitor to my homepage sees this list and they want to be the one to answer a question first....

~Chris

08-22-2000 09:28 PM

How can I exclude more then one forum?

Just use:
$query = "SELECT * FROM thread WHERE replycount < 1 AND forumid <> 21 22 23 ORDER BY dateline DESC LIMIT $maxthreads";

Forum ID 21 22 23 or how do I do it?

Another Problem:
Got some old topics in the list! But they are allready deleted? Why do the y show up an d how kann I delete them?

http://std.krawall.de/vbb/dead.php

[Edited by The_Sisko on 08-22-2000 at 06:45 PM]

08-22-2000 11:20 PM

[QUOTE]Originally posted by The_Sisko
[B]How can I exclude more then one forum?

Just use:
$query = "SELECT * FROM thread WHERE replycount < 1 AND forumid <> 21 22 23 ORDER BY dateline DESC LIMIT $maxthreads";

Forum ID 21 22 23 or how do I do it?

Another Problem:
Got some old topics in the list! But they are allready deleted? Why do the y show up an d how kann I delete them?

http://std.krawall.de/vbb/dead.php

[Edited by TechTalk on 08-22-2000 at 08:22 PM]

08-22-2000 11:23 PM

Well I tried to edit the above thread 10 times but it never would change so here we go again:

Quote:

Originally posted by The_Sisko
How can I exclude more then one forum?

Just use:
$query = "SELECT * FROM thread WHERE replycount < 1 AND forumid <> 21 22 23 ORDER BY dateline DESC LIMIT $maxthreads";

Forum ID 21 22 23 or how do I do it?

Another Problem:
Got some old topics in the list! But they are allready deleted? Why do the y show up an d how kann I delete them?

http://std.krawall.de/vbb/dead.php

[Edited by The_Sisko on 08-22-2000 at 06:45 PM]


Code:

[B]$query = "SELECT * FROM thread WHERE replycount < 1 AND forumid <> 21 AND forumid <> 22 AND forumid <> 23 ORDER BY dateline DESC LIMIT $maxthreads";
Your other problem you are having is (im guessing) a problem with your database. It only selects records that exist in the database so if you deleted it then their would be no way that it would appear (because it querys the db each time and is always up to date)

Maybe someone else can shine some light on this problem?

~Chris


All times are GMT. The time now is 01:11 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.01077 seconds
  • Memory Usage 1,737KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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