Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
How many posts did a user make in which forum Details »»
How many posts did a user make in which forum
Version: 1.00, by the_sisko the_sisko is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 10-19-2002 Last Update: Never Installs: 33
Supported
 

What does it do?
OK, this is one off my many hack I made a long time ago, it was very bad as my sql was very bad. Today I improved it a little bit as I learned some more sql
Some time ago I needed to get some new mods and wanted a fast way to find out where a specific user posted most. So I created this little stats script which shows up the number of posts in very forum. I took the function from forum.php and modified it a little bit.
For better understanding see screenshot in next post.
https://vborg.vbsupport.ru/attachment.php?postid=311900

Installation

Edit /admin/user.php
Find:
PHP Code:
  <li>".makelinkcode("View the profile for $user[username]","../member.php?s=$session[sessionhash]&action=getinfo&userid=$userid",1)."</li
under it put:
PHP Code:
  <li>".makelinkcode("Show in which forum $user[usernameposted","countpost.php?s=$session[sessionhash]&userid=$userid&username=$user[username]")."</li
Upload countposts.php
Put countposts.php in your admin folder.


You will find a new link on the CP under edit user called:
[Show in which forum USERNAME posted]

When you click on it, you will see a page which shows a statistic in which forum the user posts how many posts.



EDIT
Protection
I limited this function to the admins added under the config.php file. If you want this hack to be used be any admin just do this:
Find:
PHP Code:
if (($action=="modify") && checklogperms($canviewadminlog,1,"<p>Page viewing restricted.</p>")) { 
and replace it with
PHP Code:
if ($action=="modify") { 

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 10-20-2002, 07:13 PM
the_sisko's Avatar
the_sisko the_sisko is offline
 
Join Date: Oct 2001
Location: Hamburg,Germany
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Public shouldn't be a prob, as we can use the forum permission function. My only thought about this is, on my forum which have ~55 active forums, I have ~100 queries for this page. OK its half the query size as when I go to edit forums in CP but its the CP and I don'T do this often.

So I could make this a public one as well, but remember this could make a lot load on you db.
Reply With Quote
  #13  
Old 10-20-2002, 07:26 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by the_sisko
Public shouldn't be a prob, as we can use the forum permission function. My only thought about this is, on my forum which have ~55 active forums, I have ~100 queries for this page.
That is a big problem. If you make that public, anyone can bring your server to its knees by setting that page to auto-refresh using a cron job. So better optimize it first.
Reply With Quote
  #14  
Old 10-20-2002, 10:44 PM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by the_sisko
Public shouldn't be a prob, as we can use the forum permission function. My only thought about this is, on my forum which have ~55 active forums, I have ~100 queries for this page. OK its half the query size as when I go to edit forums in CP but its the CP and I don'T do this often.

So I could make this a public one as well, but remember this could make a lot load on you db.
Since I am just a little people person with little people members and little forums .. i think it wont be a problem, not many will use it, not even on a daily base!

In my personal case i would like to have it:
admins - through back-end {everything} and public like the (super)mods.
(super)mods - can view everybody (like the admin, but only public (my (super)mods don't have back-end access
registered - can only view their own information - not others. (maybe through userCP option?)
everybody else - no access to this feature at all

And ofcourse, if a registered member can't view the moderators forum - then they shouldn't - like normal protection. but thaz all.

Just to give an impression of what I have in my head about this.
Reply With Quote
  #15  
Old 10-20-2002, 10:45 PM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Erwin


That is a big problem. If you make that public, anyone can bring your server to its knees by setting that page to auto-refresh using a cron job. So better optimize it first.
A little extra code can prevent that with ease.
Reply With Quote
  #16  
Old 10-20-2002, 10:49 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by xiphoid

A little extra code can prevent that with ease.
That's true. But having 2 queries for each forum is still too server-intensive.
Reply With Quote
  #17  
Old 10-20-2002, 11:44 PM
Vile's Avatar
Vile Vile is offline
 
Join Date: Apr 2002
Location: Arizona, USA
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool hack. Thanks
Reply With Quote
  #18  
Old 10-21-2002, 01:15 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice idea, I'll surely install it whether or not you plan a public release.

/me installs
Reply With Quote
  #19  
Old 10-21-2002, 03:40 PM
the_sisko's Avatar
the_sisko the_sisko is offline
 
Join Date: Oct 2001
Location: Hamburg,Germany
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Erwin


That's true. But having 2 queries for each forum is still too server-intensive.
IF you will look at the code its one query for the numbers and one for every forum. I used the function from /admin/forum.php to show a sortet list of all forums.
Don't know if there is a better and fast way to create a list of all forums and its subforums? IF so, I would like to know, to make this code better.
Reply With Quote
  #20  
Old 10-21-2002, 05:29 PM
Sc0rp Sc0rp is offline
 
Join Date: Jul 2002
Location: Netherlands
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanx mate.. awesome hack

just one thing.. u named it countposts.php but the link goes to countpost.php... just thought I'd tell ya
Reply With Quote
  #21  
Old 10-22-2002, 02:37 PM
the_sisko's Avatar
the_sisko the_sisko is offline
 
Join Date: Oct 2001
Location: Hamburg,Germany
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Sc0rp
thanx mate.. awesome hack

just one thing.. u named it countposts.php but the link goes to countpost.php... just thought I'd tell ya
Thx m8, didn't realised that, cause my server looks for same file names and took the closest result he gets

Will fix this in next update.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04599 seconds
  • Memory Usage 2,324KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete