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)
-   -   How many posts did a user make in which forum (https://vborg.vbsupport.ru/showthread.php?t=44790)

the_sisko 10-19-2002 10:00 PM

How many posts did a user make in which forum
 
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 :D
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") { 


the_sisko 10-20-2002 05:03 PM

Screenshot

JohnWoo 10-20-2002 05:04 PM

Some screenshots plz ?!

Matt87 10-20-2002 05:04 PM

Very Nice job!

JohnWoo 10-20-2002 05:05 PM

Ohh.. sorry... I`ll post before you attach it .. :) :lol:

the_sisko 10-20-2002 05:11 PM

Tested on 2.2.5 only but should work on any version above and below.

Floris 10-20-2002 05:24 PM

My members might have an interest in this being a public page. Is that possible? Or does that include some security issue? like showing forums they shouldn't see?

I'd love such an overview (public)

Matt87 10-20-2002 05:26 PM

Yes I agree... :D

Schorsch 10-20-2002 05:58 PM

public would be great !!!! :p

N9ne 10-20-2002 06:34 PM

Yeah public would be great :)

the_sisko 10-20-2002 07:13 PM

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.

Erwin 10-20-2002 07:26 PM

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.

Floris 10-20-2002 10:44 PM

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.

Floris 10-20-2002 10:45 PM

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.

Erwin 10-20-2002 10:49 PM

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.

Vile 10-20-2002 11:44 PM

Cool hack. Thanks :)

Velocd 10-21-2002 01:15 PM

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

/me installs

the_sisko 10-21-2002 03:40 PM

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.

Sc0rp 10-21-2002 05:29 PM

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 :p

the_sisko 10-22-2002 02:37 PM

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 :p

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.

Me2Be 11-07-2002 03:52 PM

Great idea :)

Is there anyway to that you can put a time frame in there? Like XYZ's posts in the past 30 days?

-=dm=- 11-07-2002 09:45 PM

Hi nice hack:)
Im getting page NOT found :(
what Im doing wrong? I have vB2.2.4

thanx

EDIT:

PHP Code:

<li>".makelinkcode("Show in which forum $user[usernameposted","countpost.php?s=$session[sessionhash]&userid=$userid&username=$user[username]")."</li

fixed :)
countpost.php =countposts.php (missing "s")

Odysseus 11-10-2002 08:29 PM

Thx Christian for this hack ... I use it now as well.
cu on scifi-forum.de ;)

Jethro 11-26-2002 09:42 PM

Cool hack sisko, we are going to install it.

Thanks for sharing.

rjlohan 11-29-2002 09:32 PM

'We' Jethro... :lol:

;)

Will have to check it out first, see what we can do about the SQL - if alot of queries are involved, could be a problem.

over 12-19-2002 12:09 PM

nice hack. might install.

ladyfyre 12-22-2002 07:26 PM

great hack :)

One question though....

Does anyone know how i could change this so that the script would only return forums in which a user has posted?? My site is set up by geographical area, with over 300 forums all told...and scrolling down trying to see where they have posted is a BIG TIME pain when many are blank.

subu1 02-08-2003 09:18 PM

Quote:

Originally posted by -=dm=-
Hi nice hack:)
Im getting page NOT found :(
what Im doing wrong? I have vB2.2.4

thanx

EDIT:

PHP Code:

<li>".makelinkcode("Show in which forum $user[usernameposted","countpost.php?s=$session[sessionhash]&userid=$userid&username=$user[username]")."</li

fixed :)
countpost.php =countposts.php (missing "s")

good morning *g*

i have the same problem, but i don't no what you tell me, oh my english *g*

*.php can not find

whats going on , please help me

thxx subu1

Rynthar 04-17-2003 04:59 AM

This is ++++ing me off, every hack I have installed wont work. I am on 2.3.0 and when I upload countposts.php and click on the link to view the posts, I get a page cannot be found. When I go to /admin/countposts.php I get that damn mysql error 1064. Help! I cant install any hacks since I get the same damn thing

legendarysk8er 05-28-2003 02:56 AM

I got the same thing, and I changed the countpost to countposts.php and it still didn't work.


All times are GMT. The time now is 04:49 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.01916 seconds
  • Memory Usage 1,798KB
  • 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
  • (6)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (30)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete