[RC] Admin Edit Post Count MOD (2 Versions)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
mr_mo
Registered User
Posts: 29
Joined: Thu May 23, 2002 7:20 pm

[RC] Admin Edit Post Count MOD (2 Versions)

Post by mr_mo »

Re-done to phpBB 2.04 and PHP Coding Standards (I hope).
- Submitted to MOD DB for validation.



Ok, there are 2 versions, one is a User management MOD that simply adds an extra field to the bottom of the user management page (when looking up a users profile).

The other one is a "full" module which adds an extra option in the Admin CP titled "Edit Post Counts"

When clicked, this opens a page with a user lookup field, simply enter the user into the field, submit, and enter their new post count on the next page.

Decide which version of the mod is easier for you, or use both!

Please give me some feedback on this MOD.

Thanks


DOWNLOAD 2.04 VERSION: http://myhost.users.btopenworld.com/edi ... nt_100.zip
Last edited by mr_mo on Sun Jun 08, 2003 12:43 pm, edited 6 times in total.
User avatar
bourmad
Registered User
Posts: 43
Joined: Sun Mar 10, 2002 6:28 pm

Post by bourmad »

I don't know why you want to change posts count !
Maybe you can recalculate it from all posted messages, but change it may add integrity errors. :evil:

I am working on another mod (Guest Management), managing posts count, and merging messages from some users (from guest to registered).
http://www.phpbb.com/phpBB/viewtopic.php?t=36159
~/.Hello
Registered User
Posts: 488
Joined: Mon Jul 22, 2002 3:50 pm
Location: Somewhere in the US...
Contact:

Post by ~/.Hello »

wow. The post count editor, works perfect. GREAT JOB! Now can you please make a mod where you can edit other stuff like board total posts? 8)
mr_mo
Registered User
Posts: 29
Joined: Thu May 23, 2002 7:20 pm

Post by mr_mo »

hehe, ill see what i can do :wink:

Im glad you like it, the problem now is trying to get it submitted to the MOD database :cry:

Doesnt seem to be working for me :cry:

Also:
I don't know why you want to change posts count !
Maybe you can recalculate it from all posted messages, but change it may add integrity errors.

I am working on another mod (Guest Management), managing posts count, and merging messages from some users (from guest to registered).
http://www.phpbb.com/phpBB/viewtopic.php?t=36159


1) Changing post counts does NOT cause errors.

2) Do you have to make a shameless plug and prove your point by posting a link to YOUR mod in my post?
AbelaJohnB
Former Team Member
Posts: 5674
Joined: Fri Jul 06, 2001 11:56 pm

Post by AbelaJohnB »

Please See:

http://www.phpbb.com/phpBB/viewtopic.ph ... highlight=



If it still does not work.... send a PM to the guy that posted the above announcement!



Thanks.
User avatar
bourmad
Registered User
Posts: 43
Joined: Sun Mar 10, 2002 6:28 pm

Post by bourmad »

mr_mo wrote: 1) Changing post counts does NOT cause errors.

I prefer a query like :
update phpbb_users set post_count = (select count(user_id) from phpbb_posts where user_id = %user_id%)
I think it's more coherent.
I don't say you may have ERRORS, but you may have differences between 2 values, first calculated (posts table), and second one static (users table).
mr_mo wrote: 2) Do you have to make a shameless plug and prove your point by posting a link to YOUR mod in my post?

I dont want to add a link to my "shameless plug" !
I only want to share my ideas with you, and discuss on how to improve phpBB forums together with good ideas.
But, never mind...

and goog continuation with your "useless" mod !
I love phpbb2
Registered User
Posts: 18
Joined: Tue Aug 13, 2002 6:12 am

Post by I love phpbb2 »

Uses:
decrease 'hyperactive' spammer post count
assign non-special ranking to users


-BTW
plus posting on a testing forum with test forum mod does not increase your post count and I get no error with that. On the other hand, I get no error in editing the post count in phpadmin
but
It may get an error if you recount all post count with some other mods
mr_mo
Registered User
Posts: 29
Joined: Thu May 23, 2002 7:20 pm

Post by mr_mo »

bourmad wrote: I prefer a query like :
update phpbb_users set post_count = (select count(user_id) from phpbb_posts where user_id = %user_id%)
I think it's more coherent.


Code: Select all

$sql = "UPDATE " . USERS_TABLE . "
					SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . "
					WHERE user_id = $user_id";
				if( $result = $db->sql_query($sql) )
Note that phpbb uses a single sql update statement to update all aspects of the users profile. When updating the users posts, I decided it would be easier to add it into that statement rather than creating a whole new update command, which would use more code and would be totally pointless.

I don't say you may have ERRORS, but you may have differences between 2 values, first calculated (posts table), and second one static (users table).


I dont think you quite understand, all this does is changes the users post count, this has NOTHING to do with the post table. The users post count is stored in ONE place. And that is the users table. There is nothing that related the the users post count in the posts table. To change a users post count, you simply update it in the field "user_posts" in the users table.
There is no chance of anything causing errors, becuase there is simply nothing to make it cause an error!

All this does is change ONE users post count.

Possible users maybe, as before mentioned, spammers, it is possible to set there post count to a "normal level."

Hope this has cleared things up.

I only want to share my ideas with you, and discuss on how to improve phpBB forums together with good ideas.
But, never mind...


I apreciate your ideas, and have nothing against them. All I was saying is that this is my thread, and all I wanted was for people to express their ideas on my MOD.

If you want people to look at your mod, make your own thread.

and goog continuation with your "useless" mod !


Was this entriely nessesary?

I apreciate your views on my MOD, but you could have put them in more suttle way.
User avatar
bourmad
Registered User
Posts: 43
Joined: Sun Mar 10, 2002 6:28 pm

Post by bourmad »

Never mind.
mr_mo
Registered User
Posts: 29
Joined: Thu May 23, 2002 7:20 pm

Post by mr_mo »

~/.Hello wrote: wow. The post count editor, works perfect. GREAT JOB! Now can you please make a mod where you can edit other stuff like board total posts? 8)


At least some ppl like it :lol:
eXplosive
Registered User
Posts: 368
Joined: Mon Mar 04, 2002 4:03 am
Contact:

Post by eXplosive »

I find it easier to do it on the user management page. Why add a whole new page just to edit post count?
mr_mo
Registered User
Posts: 29
Joined: Thu May 23, 2002 7:20 pm

Post by mr_mo »

Well thats why I created both, to allow people to choose which one they prefered.
User avatar
DivScript
Registered User
Posts: 62
Joined: Tue Oct 22, 2002 8:10 pm
Location: United Kingdom
Contact:

Post by DivScript »

I think you ought to change the "3-5 minutes" to about 1.
All it takes is uploading 2 files to the /admin/ directory.
How long will that take!?

Dave.

PS: Nice MOD - keep up the good work.
Linkooseven
Registered User
Posts: 70
Joined: Sun Dec 22, 2002 11:30 pm
Location: Michigan, USA
Contact:

Post by Linkooseven »

I'm going to try this on my phpBB 2.0.4 board. Hope it works.

Since I made everyone move over to phpBB from IB, they all want there old post counts. So, I'm gonna put them back.

Thanks for the mod. I hope it works.
Bradman
Registered User
Posts: 84
Joined: Mon Nov 11, 2002 6:39 am
Location: Ledyard, CT
Contact:

2.0.4?

Post by Bradman »

So, does this work with 2.0.4?
Post Reply

Return to “[2.0.x] MODs in Development”