PDA

View Full Version : Special post counter system


Dpcows
16 Feb 2003, 11:13
Version: 0.3
Title: Special post counter system
Requested: [Here] (http://www.vbulletin.org/forum/showthread.php?s=&threadid=48230)
Explanation: You can maintain a special post counter for certain forums, like your offtopic forum.

Features:


Special counter in postbit template
Add special counter to your profile overview
Special counter can be controled from admin panel


Screenshots

Special post counter in postbit template (http://www.vbulletin.org/forum/attachment.php?s=&postid=354573)
Admin settings (http://www.vbulletin.org/forum/attachment.php?s=&postid=354622)
Special posts counter in users profile (http://www.vbulletin.org/forum/attachment.php?s=&postid=354623)


Version 0.3 should be working fine.
i'm not able to test it very well. but it worked for me one 1 board.
my conenction make it almost impossible to upload a file to my server :/

but it should work, and there is no restrinction of the amount of forums..

by the way, i put all this in a nice install file :)
upload that file to your admin dir and run it..

Dpcows
16 Feb 2003, 11:38
a example of the special post counter:

BaBa2002
16 Feb 2003, 11:42
wow nice dude

Dpcows
16 Feb 2003, 11:45
it works ? or you just clicked install for fun ?

Floris
16 Feb 2003, 13:45
I have made some additions:
You can now turn it on/off in the admin control panel
You can now set the forumid through the admin control panel
And where it says 'Special Posts' - You can now name this whatever you want through the admin control panel too.

All three options are available through acp > vbulletin options > thread options.

I gave you the file, and can't wait for you to implement it in the new version, together with the support for multiple forums and how to delete stuff and update counters, etc.

Nice hack, I might not have a use for it, but if it is complete later on, it starts to look really interesting and fun to play with :)

I have another little feature request.
Would it be possible to extend this to use for threads too?
Special Posts: x
Special Threads: y

Also, maybe extend my add-on to also have option to set the number to count up for the special count, like 1, or 5
And the same for threads,
so we can set posts count each time up with 1
and threads with 2
or 5 and 10 or 100 and 1000 :)

Dpcows
16 Feb 2003, 14:29
Originally posted by xiphoid
I have another little feature request.
Would it be possible to extend this to use for threads too?
Special Posts: x
Special Threads: y


I guess that is possible..

Originally posted by xiphoid
Also, maybe extend my add-on to also have option to set the number to count up for the special count, like 1, or 5
And the same for threads,
so we can set posts count each time up with 1
and threads with 2
or 5 and 10 or 100 and 1000 :)

what use will that be ? could be done, but i don't see the use :)


btw: implented multiple forums and you addon.
now working on the delete problem.

thx for the help

Xyphen
16 Feb 2003, 14:51
Nice hack, I might use it sometime but not now..

Dpcows
16 Feb 2003, 15:24
i've finished the delete part.

check the first post in this thread for a updated version.
i hope the install file is complete.

Dpcows
16 Feb 2003, 15:58
admin section screenshot

Dpcows
16 Feb 2003, 16:03
screenshot of specialposts in user profile

Chris M
16 Feb 2003, 16:22
Interesting Idea:)

Satan

Mike Gaidin
16 Feb 2003, 17:57
Thanks for doing this Dpcows! :)

It's not working for me though. Now, the new post count is the only one that goes up no matter what forum I post in.

Dpcows
16 Feb 2003, 18:05
Originally posted by J-OST
Thanks for doing this Dpcows! :)

It's not working for me though. Now, the new post count is the only one that goes up no matter what forum I post in.

did you set the 'Special Post Count' optino to yes ?
and did you sepecify a specific forumid in the admin control ?

you have an url to your board ?

Mike Gaidin
16 Feb 2003, 18:10
Yes

Yes

http://www.winespringinn.com/forums/index.php

I go by Mike Gaidin there.

Dpcows
16 Feb 2003, 18:16
hmmmm,

i'll try my hack on a freash install.

might be easy if you get on irc. i'm there

Mike Gaidin
16 Feb 2003, 18:22
Sorry, I actually don't have any IM programs installed on my pc. I know, it's kind of retarded in this day and age not to, but I just haven't gotten around to it.

Question though. I don't know anything about php, but I was just wondering if there are supposed to be . in front of an = mark?

i.e.,


$forumcheck .= "|| ($foruminfo[forumid] == $specialforums[$i]) ";

Dpcows
16 Feb 2003, 18:33
yeah it is :)

goto vB chat: [HERE] (http://www.vbulletin.org/chat/index.php?s=)

i'm having problems too, getting it to work on a fresh install :)
all posts i make, are added to the special counter

btw: you shouldn't add this hack to a live board yett.

Dpcows
16 Feb 2003, 19:04
THIS VERSION IS BUGGED !!

do not use, working on a working on

Mike Gaidin
16 Feb 2003, 19:20
Ok. :)

*waits patiently for this cool hack*

Dpcows
16 Feb 2003, 19:37
i located the problem, but don't know how to fix it.

it is so stupid. i don't get why it goes wrong.
my logic sais it should be no problem. but it's not working :/

i'll work later tonight or tomorrow on it :/

Mike Gaidin
16 Feb 2003, 19:49
Ok, that's cool. I'll wait. Thanks for your effort. :)

How do I remove the parts of my database that were added in the instructions?

*NOTE*
Nevermind, I figured out how to do it. :)

Dpcows
16 Feb 2003, 22:52
ok, i fixed it.
new release will be out tomorrow.
/me needs his bed now :)

it only supports up to 5 forums now.
but you can add more if you like, you need to add some code to your files for that.

Mike Gaidin
16 Feb 2003, 23:28
That's fine. I only need it for 2 forums. :)

/me thanks Dpcows.

Dpcows
17 Feb 2003, 15:25
remade hack,

check first post for install file.

it isn't tested very well, but i believe it should work fine.

Mike Gaidin
17 Feb 2003, 22:06
Great! Will check it out. :)

Mike Gaidin
17 Feb 2003, 22:09
When I double click on the attachment all it does is bring up the old text file, not download a php file.

Dpcows
17 Feb 2003, 22:13
try this one, it works for me.. but here it is again..

Mike Gaidin
17 Feb 2003, 22:23
That download worked. Thanks!

Mike Gaidin
18 Feb 2003, 05:21
tested and it works great!

marcel-ea
22 Feb 2003, 04:57
the new version does not work by me

OffTopic Posts: 0
by all users

offtopic had id 21
german 22
english 23

option is on
ids insert with comma

but by all users also by the users who post in OT
allways OffTopic Posts: 0

Any Ideas?
VB229

Thx

Dpcows
22 Feb 2003, 22:45
You used the php file or the "old" text file ?

and when you post, does the normal post couter gets higher or not ?

marcel-ea
22 Feb 2003, 23:55
I used the php install, make all step to step
But only 0 :( and no the post goes not higher
when i post on a forum that i insert in the acp

Dpcows
23 Feb 2003, 09:17
your normal post count goes up on normal forums ?

have you tried unstalling and installing again ?

you have more hacks on your forum ?

i could apply the hack my self if you would like

marcel-ea
23 Feb 2003, 17:17
yes other post work normaly

Other hacks
Quick Post, faqbot

EDIT:
ok now work. I delete your installphp from admindir.

Other problem:
Any Idea how i get the posts from the past in the counter?

the hack count only new posts

Update Counters does not work for this hack

Dpcows
23 Feb 2003, 18:54
cool,

i'll see if i can work something out.
you have an url from your forums ?

marcel-ea
23 Feb 2003, 19:15
Its the forum of emule.de
or better jump to www.emuleforum.net
no reg
but only in the german template (standard)

jeo
24 Feb 2003, 06:14
Originally posted by marcel-ea


Other problem:
Any Idea how i get the posts from the past in the counter?

the hack count only new posts

Update Counters does not work for this hack

Have anyone figured out how to do this yet?

Thanks.

Dpcows
24 Feb 2003, 09:09
i said i'll look into it..

cna't work always on stuff

jeo
24 Feb 2003, 09:31
Originally posted by Dpcows
i said i'll look into it..


Thanks!

lynda
03 Mar 2003, 23:08
I installed it. Seems to work very well. Easily integratable with the store hack as well. My forum needs something like this. They post about 500 off-topic posts a day just to get their post count up. :)

Dpcows
04 Mar 2003, 14:21
can i see your forum ?

lynda
04 Mar 2003, 14:34
It's in my profile (click the www button on the post)

Dpcows
05 Mar 2003, 09:18
yeah, but i don't see to many forums over there.

you called it Trolls & Gibberish ?

cool :)

lynda
05 Mar 2003, 15:45
Ohh. The forums are not visible to people who are not registered. It's a clan site for Asheron's Call and the members appreicate their privacy.

:)

FlyingDutchman
06 Mar 2003, 06:12
it's working great for me...
needed some customizations, but they were easily made :)
(like edit special post count in admin cp user edit ;))

FlyingDutchman
06 Mar 2003, 06:22
--(for screenshot, see attached file)--
if you want to be able to edit the special posts count of a specific member in the admin cp, do this:


open admin/user.php
-find:
makeinputcode("Number of Posts","posts",$user[posts]);

-just UNDER that, add:

makeinputcode("Number of Special Posts","specialposts",$user[specialposts]);





-find:
if ($posts=="") {
$posts=0;
}

-just UNDER that, add:
if ($specialposts=="") {
$specialposts=0;
}





-find:
$DB_site->query("UPDATE user SET birthday='$birthday',options='$options',usergroupid='$usergroupid',username='".addslashes(htmlspecialchars($ausername))."'$pwdinclude,email='".addslashes(htmlspecialchars($email))."',styleid='$userstyleid',parentemail='".addslashes(htmlspecialchars($parentemail))."',coppauser=$coppauser,homepage='".addslashes(htmlspecialchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialchars($yahoo))."',signature='".addslashes($signature)."',adminemail=$adminemail,showemail=$showemail,invisible=$invisible,usertitle='".addslashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cookieuser=$cookieuser,nosessionha sh=$nosessionhash,daysprune='$daysprune',lastvisit=$lastvisit,lastactivity=$last activity,lastpost=$lastpost,posts='$posts',timezoneoffset='$timezoneoffset',emai lnotification=$emailnotification,receivepm='$receivepm',emailonpm='$emailonpm',i paddress='".addslashes($aipaddress)."',pmpopup=IF(pmpopup=2 AND $pmpopup=1,pmpopup,'$pmpopup') WHERE userid=$userid");


-REPLACE that with:
$DB_site->query("UPDATE user SET birthday='$birthday',options='$options',usergroupid='$usergroupid',username='".addslashes(htmlspecialchars($ausername))."'$pwdinclude,email='".addslashes(htmlspecialchars($email))."',styleid='$userstyleid',parentemail='".addslashes(htmlspecialchars($parentemail))."',coppauser=$coppauser,homepage='".addslashes(htmlspecialchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialchars($yahoo))."',signature='".addslashes($signature)."',adminemail=$adminemail,showemail=$showemail,invisible=$invisible,usertitle='".addslashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cookieuser=$cookieuser,nosessionha sh=$nosessionhash,daysprune='$daysprune',lastvisit=$lastvisit,lastactivity=$last activity,lastpost=$lastpost,posts='$posts',specialposts='$specialposts',timezone offset='$timezoneoffset',emailnotification=$emailnotification,receivepm='$receiv epm',emailonpm='$emailonpm',ipaddress='".addslashes($aipaddress)."',pmpopup=IF(pmpopup=2 AND $pmpopup=1,pmpopup,'$pmpopup') WHERE userid=$userid");





now you can edit a user's special post count from the admin cp...

Mike Gaidin
08 Mar 2003, 05:00
Is there a way to add the special post count to have it's own option under the memberlist?

If that's unclear, what I mean is have a top special poster option next to the top 10 posters.

Does that make sense?

Dpcows
08 Mar 2003, 09:53
i think it is possible.

you have to tinker with memberlist.php

gopherhockey
08 Mar 2003, 21:38
I have a question about this hack, thinking it may help me out with a slightly different issue.

When a user is logged in they see the message:

Members: XX, Threads: YY, Posts: ZZ

I have a forum that is run off the NNTP gateway, so it gets TONS of new posts all the time. I was able to "ignore" the threads in that forum via another individual's code help here... I was also able to exclude the forum from the search and "view new posts" functions... however, I have yet to find a way to stop the post count from going up for this forum.

I'm curious - if I use this hack, turn on special post count and use that forumid, will the post count on the main page NOT show the posts that happen in the "special" forum?

If not, is there a way to do that?

Sorry if this is slightly off topic, but I know others are looking for this functionality as well... this is as close as I've seen to pulling it off.

Thanks..

My users are so tired of seeing the post count in the hundreds I have had to turn off the NNTP gateway, even though they also enjoyed having that forum open.

Dpcows
09 Mar 2003, 11:34
yes that would be possible.

but it might be easier to set the
"Count posts made in this forum towards user post counts?"
feature on at that specific forum.

tell me if the normal featur isn't good enough. then i'll give you the code to do it with this hack..

gopherhockey
09 Mar 2003, 15:22
Yea, setting not to count posts in that forum toward users post counts doesn't seem to have any affect on how they are reported to the users - they are still seeing tons of new posts each day... I'd love whatever you could do to help me out - thanks a ton!!

Dpcows
09 Mar 2003, 18:41
could you explain your problem a bit more specific,
i think i've misunderstood your problem in your first post.

gopherhockey
09 Mar 2003, 19:05
Sure thing - I'll try to explain this again. I confuse myself sometimes, so hopefully I can get this straight.

The way vb works, as we all know, is that posts in a forum will trigger various affects. A few of which are:

1. Users post count increases (there is a way around this in the admin cp)

2. Total posts on the entire board go up (as displayed on the top of most unedited vb systems as:

Members: XX, Threads: YY, Posts: ZZ

3. There are various scripts & hacks that will show this data on other pages as well, such as vbhome lite which shows it as:

X new articles released
Y new forum threads started
Z new forum posts

4. When looking at the list of all forums, you can see the total number of posts and threads for each forum just before the "Last Post" column.

5. When a user arrives and sees that there are new posts or threads, often times they click on "view new posts" to see a list of what has been posted lately.

All of those are just fine under most circumstances.

I have a specific reason to have a forum never increment those totals. (actually all but #4, but even if it affects #4 above thats ok too).

In my example, the forum is an NNTP gateway (newsgroup). The forum itself can get anywhere from 10-200+ posts/threads in a day. Users coming to my system do not wish to see these show up as new posts, new threads etc. I want to treat it as a resource (special) forum - but not let it act like the others by increasing post totals etc.

I have worked around *most* of this by editing search.php and putting in a statement such as:

wheresql.=" AND thread.open<>10 AND thread.forumid!=50";

(example excluding forum #50 from daily new threads stats)

What I can't fix is the new posts part. You can't just add the AND thread.forumid!=50 to the posts section (you get a SQL error).

What happens now is that people come to my system and in a low traffic day (but high for the newsgroup) they might see:

0 new articles released
0 new forum threads started
201 new forum posts

They click on "view new posts" and get a message that there are no posts since they last visited.

The reason is because that forum is still able to increase the forum post count and total vb system post count.

I have posted this elsewhere on this system (and have had others request the same) - have had many think they knew how to do this, but nobody has been able to do it.

When I ran accross your hack, I thought maybe it found a way to categorize posts in a certain forum differently. However, I think there is still some counter that is affected - some global total post count that many functions hit. I thought maybe if I installed this and set the forum, that the system would stop displaying the post count since last visit for this forum. I think the concept is close, or closer than anything I have seen... but there still must be something missing.

I'm not enough of a programmer to be able to figure out out. Conceptually I would guess if one could edit all places where the post total is increased and exclude a forum it would work. Thats why this hack seemed sooo very close.

I know there are others looking for this kind of functionality. I apologize if this is rather off-topic specifically for what this hack does. Perhaps I should re-post this in the hack requests area. I just feel with this hack, there is probably one simple line of code somewhere that I'm missing to pull this off.

Thanks for your time...

Dpcows
11 Mar 2003, 09:25
I'm afraid i don't have time to look into this, or even add more features.

gopherhockey: i don't see a fast solution for you problem with this hack. sorry..

gopherhockey
11 Mar 2003, 14:01
Thats ok, I found an alternate way of doing this that I'll post elsewhere. Thanks for your time though!

Dan
12 Mar 2003, 03:21
Hmm.... is there a way to update this post count in anyway?

And is there a way to make this work with post count off in a forum it suppose to count in?


Thanks in Advance

/me clicks install

Koopa
15 Mar 2003, 19:53
Good idea, could be useful....

Dpcows
16 Mar 2003, 15:28
03-12-03 at 04:21 AM Oricon said this in Post #56 (http://www.vbulletin.org/forum/showthread.php?postid=364554#post364554)
Hmm.... is there a way to update this post count in anyway?

And is there a way to make this work with post count off in a forum it suppose to count in?


Thanks in Advance

* Oricon clicks install

Not sure, didn't test that.
if you did, i'd like to know if it works

tinbin
27 Mar 2003, 16:37
Interesting hack m8!
Would it be hard to code it so that it counts the # of replies people made in the offtopic forum, but DOESN'T count if the users started the thread itself.

So it should count all offtopic replies, not all offtopic posts..

Dpcows or anyone else:
Would that be just a bit of extra code or hard to do ?

Dpcows
28 Mar 2003, 08:35
Would be pretty easy.
Just don't edit the newthread.php file i guess.

No garantee all still works..

SoBal
14 May 2003, 09:48
Dpcows, good work m8.
Few months has passed since the last post in this thread, and I've installed this great hack a few moments ago. But I have an urgent request, If I may...

I have to re-count old posts and threads, If any1 has any idea how this can be done - plz post it here, or let me know, it's very important to me. I have few users among 12.000 which always used to talk about off-topic thigns, and I have to "downgrade them" :)

SoBal
14 May 2003, 10:33
Small problem, which I hope be able to take care by myself. But I think it shall be reported. After hack installation on 2.3.0 several problems shows up. Avatars and post edit dates - doesn't show up, also all attached graphics are only visible as attachements - not displayed.

Dpcows
14 May 2003, 15:29
you would have to fix something up like, the update couter in the admin panel.

But, i'm not gonna tinker with it

Ryuujin
30 Apr 2004, 00:53
Hey, could you do one for vb3.0.1 ?

Requested here:
http://www.vbulletin.org/forum/showthread.php?t=64365&highlight=Special+Post+Count

Serph_kun
27 Jun 2004, 06:25
Thanks man!!
I love this hack :3~~

Dark Zero
08 Aug 2004, 09:23
Hey, could you do one for vb3.0.1 ?

Requested here:
http://www.vbulletin.org/forum/showthread.php?t=64365&highlight=Special+Post+Count http://www.vbulletin.org/forum/showthread.php?t=68041
:nervous: