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

bobbydavro 01-07-2002 02:26 PM

just installed this and it works but not sure if this is because of another hack firefly helped me install before,

but I have a moderator validation on the forum I have added this to and the users hack count increases even before the moderator has validated the post.

eg i have a hints and tips forum, so I have added a hints (instead of hacks) count. When a user submits a hint it gos for moderator validation but the count is going up before validation. If the moderator then deletes the post the value does return to the correct value.

SgtSling 01-09-2002 04:08 AM

is this intensive on the server?

Admin 01-09-2002 08:32 AM

Not at all, that's the beauty of it. :) Only one more query per thread, not a query per post like the other hacks. :)

humble 01-10-2002 05:33 PM

fyi- this doesn't appear to be compatible with vb v2.2.1 and vbPortal v3.x

Admin 01-11-2002 11:59 AM

It works on v2.2.1, because that's what we have running here.
As for vbPortal... I can't tell.

MApI 01-11-2002 09:11 PM

Really great ! Easy to install. 5 stars :p Thx.

cya

fonzerelli_79 01-15-2002 12:27 PM

i get an error when i run the query (i replaced the x with the room id no.)

i use vbportal but i dont think that this matters as its only effecting vb files

Admin 01-15-2002 12:38 PM

What is the error? :)

fonzerelli_79 01-15-2002 12:42 PM

Quote:

Originally posted by FireFly
What is the error? :)
obviously that would have helped - doh!! the error is this


Code:

Invalid SQL: $hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN (10) AND postuserid IN $hackuserids GROUP BY postuserid");
mysql error: You have an error in your SQL syntax near '$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM threa' at line 1

mysql error number: 1064


Admin 01-15-2002 01:06 PM

Err...why are you running that whole line as a query?

fonzerelli_79 01-15-2002 01:10 PM

because im an idiot

aaarrrggggggg - doh!doh!doh!doh!doh!doh!doh!doh!doh!doh!doh!doh!do h!

ive fixed it now

maybe from now on firefly, you should put me on your ignore list so you dont have to listen to my stupid questions - this isnt my day - lol

fonzerelli_79 01-15-2002 01:26 PM

(i hope im not on fireflys ignore list yet)

i added $post[hacks] to my post bit template but it isnt displaying anything

what could be wrong? :D

fonzerelli_79 01-19-2002 11:13 AM

heres an example

fonzerelli_79 01-19-2002 11:48 AM

i have my board set up so that only moderators may submit news in my news room

is it possible to only add this hack to the moderators postbit or would this require further hacking

Ice Man_00 01-25-2002 01:26 PM

Hi.

Just a question......

Is there a way to add a the same hack like this, but so it counts in two diffrents.

Like this:

Just like your board, you have "Hacks" but is there anyway to add one more to it, so it`s counting from diffrents thread.

So it will be, just a ex.

Hacks: 0
Requested Hacks: 0

Hope it goes, becase i like this idea of this hack really good.

Thx a lot !!!!

cyrus 01-26-2002 04:23 PM

Quote:

Originally posted by FireFly
Err...why are you running that whole line as a query?
what should be run in phpmyadmin then ? :rolleyes:

Admin 01-26-2002 04:26 PM

Quote:

Originally posted by cyrus
what should be run in phpmyadmin then ? :rolleyes:
Nothing.

cyrus 01-26-2002 04:33 PM

omg

sorry, stupid question .... bangs head against monitor

good thing it aint liquid crystal ;)

wolfe 01-26-2002 04:38 PM

thanx m8

nitro 02-13-2002 01:38 PM

ye it works gr8 vbb 222 and vbp 3pr7 with pr8 update

nice 1 firefly great hack

just an idea id like to see the hack incorporated into member.php get user info as another table aswell as visible in the posts.

please ne chance of furthering the addon to this ultimate level i think it wud be really good

TWTCommish 02-13-2002 01:40 PM

I've already got an expanded hack in the works...breaks down a user's posts/threads per forum along with some other details. I'll try to release it soon.

Great hack, BTW. :)

M.Smith 02-13-2002 08:04 PM

Quote:

Originally posted by fonzerelli_79
(i hope im not on fireflys ignore list yet)

i added $post[hacks] to my post bit template but it isnt displaying anything

what could be wrong? :D

Mine does exactly the same as yours!
whats wrong with it firefly?
BTW: im running version 2.2.2

and sorry fonzerelli_79 but i despise man utd!
NEWCASTLE UTD RULES ALL!

SaintDog 02-17-2002 06:08 PM

Thanks for this great hack FireFly, this hack is recording posts from about 10-12 forums, but it is working from what I can see :). Just the hack I needed to track submissions in the forums.

Sn2,

Code:

$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN (x) AND postuserid IN $hackuserids GROUP BY postuserid");
Did you make sure you changed the (x) to the id of the forum(s) you wished it to count threads in? You have to change that or nothing will appear. Place your cursor over the link of the forum you wish this hack to record threads from and look at the ID at the end of the URL, place that ID in place of the x in the above coding (in showthread.php).

SaintDog

Snake~eyes 03-10-2002 11:55 AM

1. How do you lit all the hacks in the user profile like it is done here?
2. and how about top 10 hackers?
3. Is there some type of way to get the install button like done here?
4. POssibly a way to get omthing like the hacks database here?

lotta questions.. i hope there's answers :D

Ice Man_00 03-13-2002 10:51 PM

Great hack..

But i have one question.

Is there any way to add a little extra to this ??

The count in memberlist as well
&
more counts.

in postbit can it be done under posts and hacks a little extra ??

name
avatar
location
registered
posts
hacks
hacks II (from diffrent forums)

Is this possible ?!?

Thx in advanced

Ice Man_00 03-16-2002 09:34 AM

bump

Snake~eyes 03-16-2002 11:26 AM

hrm... i thought tihs was kinda ovious in the read me

Then use $post[hacks] in the postbit template to show the number of threads the user started in that forum. It will link to the user profile if he has more than 0 threads.

Also, Firefly can ya answer my questions?

Ice Man_00 03-17-2002 06:58 AM

Quote:

Originally posted by dhogan444
hrm... i thought tihs was kinda ovious in the read me


Then use $post[hacks] in the postbit template to show the number of threads the user started in that forum. It will link to the user profile if he has more than 0 threads.



My post you answered about ??
If it was, you see what i mean ??? I already have this installed in the postbit template with the hacks count on how many threads a user have done. But what i asking about is another to it could count from one hacks, two funs. Do you see now ?!?

Hacks: 0
Funs: 0

:) Ice Man

Snake~eyes 03-17-2002 01:33 PM

oh i see what your saying.. lol.. mybad

uh.. hrm.. wish firefly would reply already :p

Snake~eyes 03-21-2002 10:07 PM

*bump*


All times are GMT. The time now is 04:43 PM.

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.01537 seconds
  • Memory Usage 1,835KB
  • 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_php_printable
  • (5)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
  • (40)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