vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Number of threads use started in a certain forum (https://vborg.vbsupport.ru/showthread.php?t=33811)

Admin 01-04-2002 10:00 PM

Just like we have the number of hacks the user released in postbit, you can have this too.

Let's say you have a reviews forum on your board, and you want to show next to each user's post how many reviews he has posted.
Use this hack, and replace X in this code:
Code:

$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN ([high]x[/high]) AND postuserid IN $hackuserids GROUP BY postuserid");
with the ID of that forum, or with a comma delimited list of forum ID's (for example: 2,5,3,7).

Have fun. :D

TheComputerGuy 01-05-2002 08:27 AM

firefly works wonders ;)

squawell 01-05-2002 08:27 AM

haha~~~it's me again!!

i know u will post the ss right?? :D :D

thankz FireFly i think it a great hack again~~

squawell 01-05-2002 08:39 AM

FireFly one question~~

if i have two or more forums need how should i change the x~~

squawell 01-05-2002 09:00 AM

FireFly the txt have someplace wrong??

PHP Code:

$getpostids=$DB_site->query("
    SELECT post.postid FROM post
    WHERE post.threadid='
$threadid' AND post.visible=1
    ORDER BY dateline 
$postorder LIMIT ".($limitlower-1).",$perpage
"
);

if (
$limitupper>$totalposts) {
  
$limitupper=$totalposts;
  if (
$limitlower>$totalposts) {
    
$limitlower=$totalposts-$perpage;
  }
}
if (
$limitlower<=0) {
  
$limitlower=1;
}
$postids="post.postid IN (0";
while (
$post=$DB_site->fetch_array($getpostids)) {
  
$postids.=",".$post['postid'];
}

$postids.=")";
$hackuserids.=")";

$hacks=array();
$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN (4,5) AND postuserid IN $hackuserids GROUP BY postuserid");
while (
$hackcount=$DB_site->fetch_array($hackcounts)) {
  if (!isset(
$hackcount[totalhacks]))
    
$hackcount[totalhacks]=0;
  
$hacks["$hackcount[postuserid]"]=$hackcount[totalhacks];
}
$hacks[0]=0

*********************************
with this:
*********************************
PHP Code:

$getpostids=$DB_site->query("
    SELECT post.postid,post.userid AS postuserid FROM post
    WHERE post.threadid='
$threadid' AND post.visible=1
    ORDER BY dateline 
$postorder LIMIT ".($limitlower-1).",$perpage
"
);

if (
$limitupper>$totalposts) {
  
$limitupper=$totalposts;
  if (
$limitlower>$totalposts) {
    
$limitlower=$totalposts-$perpage;
  }
}
if (
$limitlower<=0) {
  
$limitlower=1;
}
$postids="post.postid IN (0";
$hackuserids="(0";
while (
$post=$DB_site->fetch_array($getpostids)) {
  
$postids.=",".$post['postid'];
  
$hackuserids.=",".$post['postuserid'];
}
$postids.=")";
$hackuserids.=")";

$hacks=array();
$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN (x) AND postuserid IN $hackuserids GROUP BY postuserid");
while (
$hackcount=$DB_site->fetch_array($hackcounts)) {
  if (!isset(
$hackcount[totalhacks]))
    
$hackcount[totalhacks]=0;
  
$hacks["$hackcount[postuserid]"]=$hackcount[totalhacks];
}
$hacks[0]=0

it's the same code~ :confused: :confused:

fonzerelli_79 01-05-2002 11:41 AM

nice one firefly

keep em coming!!

Admin 01-05-2002 12:56 PM

Fixed the .txt file. :)

squawell, read my post again, I hate saying the same thing twice.

squawell 01-05-2002 01:14 PM

sorry~~

i just misunderstand about ur first post's example!! :(

now i understand~ thankz u tell me that~~~:D

TaP 01-05-2002 04:51 PM

Hey kickaz hack here :) It works perfectly...

Any way you can tell us how to make this a field in the profile? And be forum specific..?

Like

Contibutations In General: 10
Contibutations In Reviews: 15
ect..

Lesane 01-05-2002 07:45 PM

Great hack FireFly, as usual ;) Thx


All times are GMT. The time now is 08:22 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.01136 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
  • (1)bbcode_code_printable
  • (2)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