vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Forum-Subforum Post Count (https://vborg.vbsupport.ru/showthread.php?t=26988)

Admin 09-01-2001 11:09 AM

PHP Code:

$invposts=$DB_site->query_first("SELECT replycount FROM forum WHERE forumid=1");
$invthreads=$DB_site->query_first("SELECT COUNT(*) AS threadcount FROM thread WHERE forumid=1"); 

Now use $invposts[replycount] and $invthreads[threadcount].
The thread count doesn't show up. Grr...

Admin 09-01-2001 11:23 AM

Oh wait, they do show up. I had the wrong forumid set for me. :p

webhost 09-01-2001 11:25 AM

I am working now, I changed the id the replycount/post show up correctly and the threadcount shows zero, should have a number of 107 according to forum and database. This what I havw in forumhome template.

PHP Code:



<tr>
<
td bgcolor="#FFFFFF" colspan="6"><normalfont color="{categoryfontcolor}"><p align="left"Look under here for all information pretaining to WNG listed hereIncludes News ReleasesCourt ProceedingsRaytheon and other.<br>$invposts[replycount] <br>$invthreads[threadcount]<br><br>

Information Here:<b><a href="http://forums.realwebhost.net/forumdisplay.php?forumid=29">Latest News Items</a></b></p></normalfont></td>
</
tr


Admin 09-01-2001 11:31 AM

Oh right, you have subforums IN the subforums... hold on.

Admin 09-01-2001 11:39 AM

Sorry, here it is: :)
PHP Code:

$invposts=$DB_site->query_first("SELECT replycount FROM forum WHERE forumid=29");
$invthreads=$DB_site->query_first("SELECT count(*) AS threadcount FROM thread WHERE forumid=66 OR forumid=23 OR forumid=36 OR forumid=27 OR forumid=25 OR forumid=21 OR forumid=24 OR forumid=87"); 


webhost 09-01-2001 11:54 AM

Thanks that did it I'm sure you probably have something better to do with your time.

Question later on if I wanted to do this again on another forum. Would I just put the same lines again in index.php but change
$invposts and $invthreads to something like $inv1posts and $inv1threads ?

Thanks again
Joey

Admin 09-01-2001 12:07 PM

Yeah, and don't forget the new IDs. :)

[QUOTE]Originally posted by webhost
Thanks that did it I'm sure you probably have something better to do with your time.

webhost 09-05-2001 08:30 PM

Firefly
Questions

First the thread count works great but for some reason when I update my counters it wipes out 70% of the threads in this forum.

Second where I installed this post and thread count on my forum, Is there away also I could add some code in the forumhome template along with what I have made already to show the last post not in each sub forum but only the last post in that group of sub forums?
Joey

Admin 09-06-2001 10:50 AM

PHP Code:

// dates for subs
$hiddenforum=$DB_site->query_first("SELECT lastpost FROM forum WHERE forumid=1 OR forumid=2 ORDER BY lastpost DESC LIMIT 1");
if (
$hiddenforum['lastpost']>0) {
 
$hiddenforum['lastpostdate']=vbdate($dateformat,$hiddenforum['lastpost']);
 
$hiddenforum['lastposttime']=vbdate($timeformat,$hiddenforum['lastpost']);
} else {
 
$hiddenforum['lastpostdate']='Never';
 
$hiddenforum['lastposttime']='';


I think that should work. (replace the forumids of course)
Use $hiddenforum[lastpostdate] and $hiddenforum[lastposttime].

webhost 09-06-2001 12:51 PM

Database error in vBulletin: Invalid SQL: SELECT lastpost FROM forum WHERE forumid=87 OR forumid=24 OR forumid=23 OR forumid=36 OR forumid=27 OR forumid=21 forumid=25 ORDER BY lastpost DESC LIMIT 1
mysql error:
mysql error number:
Date: Thursday 06th of September 2001 07:46:28 AM
Script: /
Referer:
This is where I placed in index.php
PHP Code:

$boardviews $DB_site->query_first(
SELECT SUM(views) AS threadviews FROM thread"
); 
$totalviews number_format($boardviews[threadviews]);

$invposts=$DB_site->query_first("SELECT replycount FROM forum WHERE forumid=29");
$invthreads=$DB_site->query_first("SELECT count(*) AS threadcount FROM thread WHERE forumid=66 OR forumid=23 OR forumid=36 OR forumid=27 OR forumid=25 OR forumid=21 OR forumid=24 OR forumid=87");

 
// dates for subs
$hiddenforum=$DB_site->query_first("SELECT lastpost FROM forum WHERE forumid=87 OR forumid=24 OR forumid=23 OR forumid=36 OR forumid=27 OR forumid=21 forumid=25 ORDER BY lastpost DESC LIMIT 1");
if (
$hiddenforum['lastpost']>0) {
 
$hiddenforum['lastpostdate']=vbdate($dateformat,$hiddenforum['lastpost']);
 
$hiddenforum['lastposttime']=vbdate($timeformat,$hiddenforum['lastpost']);
} else {
 
$hiddenforum['lastpostdate']='Never';
 
$hiddenforum['lastposttime']='';
}

// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbersmembers[max]");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid']; 



All times are GMT. The time now is 01:45 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.01197 seconds
  • Memory Usage 1,762KB
  • 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_php_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