Version: 1.00, by the_sisko
Developer Last Online: Oct 2023
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[username] posted","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.
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.
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.
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.
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.
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.