[ALPHA] Enable Avatars By Post Count Mod - 1.0.7

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.
User avatar
mosheen
Registered User
Posts: 259
Joined: Wed Apr 06, 2005 12:16 am
Location: Asheville, NC
Contact:

[ALPHA] Enable Avatars By Post Count Mod - 1.0.7

Post by mosheen » Wed Jul 20, 2005 2:29 am

MOD Title: Enable Avatars By Post Count Mod
MOD Description: Enables the user_posts field to determine whether or not avatars should be enabled for a user.
MOD Version: 1.0.7 (01/24/2007)

MOD Download: http://test.medinaline.net/Enable_Avata ... _1.0.7.mod

Demo Board: http://test.medinaline.net

NOTES:

UPDATE 1.0.7
Made minor changes to the code as requested by the mod validation team. The issues with the ACP have been fixed, also templates code rewritten to allow for greater compatibility with more skins. Resubmitted for mod validation.
/UPDATE

For the demo, join the test board with bogus information. Check the profile, avatars are disabled by default. Make two test posts, view your posts. It's that simple, folks. You can log in as admin to see the new ACP (login as James / James, go to ACP, general administration)

After installing this mod, you would need to run the following SQL statement once to get the users table up to date:

Code: Select all

UPDATE phpbb_users SET user_allowavatar = 1 WHERE user_posts >= XXX
Of course, replace the XXX with your preferred minimum number of posts.

If you don't want to "grandfather" users in (meaning, if they are allowed to have avatars now, but after the mod you don't want them to) run the following SQL statement once:

Code: Select all

UPDATE phpbb_users SET user_allowavatar = 0 WHERE user_posts < XXX
Of course, replace the XXX with your preferred minimum number of posts.

This mod won't do anything for you if you don't disable avatars by default for new users.

Now, the thought process behind using the "viewtopic.php" page to do this function, is that all the information you need to check is already being pulled there... And, unless modded away, by default phpBB redirects you back to view your post after making a new post... So... Right then, the database is updated with your new avatar permissions.

The mod is simple enough, that it could easily be modified to update other fields of information in the users table (allowing other permission related things, like smilies, bbcode, etc.)
Last edited by mosheen on Thu Jan 25, 2007 1:14 pm, edited 5 times in total.
Interested in Random Avatars for your board? Click here
Need to Enable Avatars By Post Count? Click here
Want HTML in your polls? Click here

User avatar
mosheen
Registered User
Posts: 259
Joined: Wed Apr 06, 2005 12:16 am
Location: Asheville, NC
Contact:

Post by mosheen » Wed Jul 20, 2005 12:08 pm

This mod can be easily updated to change all sorts of user permissions... If you have other mods that you would like to use as incentive, Random Avatars, for example (wink wink) this same mod can be used for that purpose.

Just let me know what you would like it to do and I will post it up here.

User avatar
mosheen
Registered User
Posts: 259
Joined: Wed Apr 06, 2005 12:16 am
Location: Asheville, NC
Contact:

Post by mosheen » Wed Jul 20, 2005 3:19 pm

Just a little clarification on the following:

There are two steps to the mod, the first changes the default value of "user_allowavatar" in the users table, so when a new user registers, avatars will be disabled.

The second adds the line of code that actually checks the poster's information and updates the users table if necessary.

User avatar
mosheen
Registered User
Posts: 259
Joined: Wed Apr 06, 2005 12:16 am
Location: Asheville, NC
Contact:

Post by mosheen » Sat Aug 13, 2005 11:30 am

I had a user request that this mod be integrated with the Random Avatars Mod, to set, by post count, the number of avatars that a user can have.

I posted it HERE as an add-on to my Random Avatars mod.

I haven't gotten any feedback on it, yet. If interested, go try it out!

James
Last edited by mosheen on Sun May 21, 2006 10:41 am, edited 1 time in total.

User avatar
mosheen
Registered User
Posts: 259
Joined: Wed Apr 06, 2005 12:16 am
Location: Asheville, NC
Contact:

Post by mosheen » Fri Sep 09, 2005 12:32 pm

Version 1.0.1 update

View the initial post for details of the update.

Submitted for Mod Validation
Last edited by mosheen on Sun May 21, 2006 10:41 am, edited 1 time in total.

User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape » Sun Apr 09, 2006 11:53 am

Hi!

I'm running into a problem, but I suspect it's actually a conflict with this mod:
http://www.phpbb.com/phpBB/viewtopic.php?t=354718

Seems I can't enter a number that sticks in my ACP. I had hoped to get the two working together, but that may not be possible, so there's an idea for an add-on :wink: ...

Nice job, by the way!!
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :

User avatar
mosheen
Registered User
Posts: 259
Joined: Wed Apr 06, 2005 12:16 am
Location: Asheville, NC
Contact:

Post by mosheen » Tue Apr 11, 2006 11:25 pm

Good to know. I have been out of touch for a while, but when things in my life slow down I will be back and seeing what I can do with these "MODs in Development" of mine.

Thanks!
James
Last edited by mosheen on Sun May 21, 2006 10:42 am, edited 1 time in total.

User avatar
mosheen
Registered User
Posts: 259
Joined: Wed Apr 06, 2005 12:16 am
Location: Asheville, NC
Contact:

Post by mosheen » Sun May 21, 2006 10:40 am

Updated to v1.0.5 - submitted for validation.
Last edited by mosheen on Wed May 24, 2006 11:25 am, edited 1 time in total.

User avatar
Saeru
Registered User
Posts: 622
Joined: Sun Feb 19, 2006 5:44 am
Location: Under a pile of PHP code.
Contact:

Post by Saeru » Sun May 21, 2006 10:54 am

This is something I was looking for, Question, does it allow users to still pick an Avatar from the gallery?

I'd like to restrict users from putting up custom avatars until they have reached a sellect post count.
"Naku ga yousuru ichidanto tsuyosa kyaku ga icchuu wo yusuru."[/size]

User avatar
mosheen
Registered User
Posts: 259
Joined: Wed Apr 06, 2005 12:16 am
Location: Asheville, NC
Contact:

Post by mosheen » Wed May 24, 2006 11:25 am

As it sits, it does not restrict what type of avatar they can use, once they reach the defined number of posts.

The type of avatars that are allowed is something that is set for the whole board, not per user. The only user control is allow avatars yes or no. To change this mod to do what you are wanting would require adding three more fields to the users table, allow_gallery_avatars, allow_local_avatars, allow_remote_avatars. Then there would be three more fields to add to the config table, to set the minimum amount for each of the three types.

The code involved would end up making this mod more complex than my random avatars mod, which is pretty complex.

It can be done, but it's really beyond the scope of what this mod is for.

If there is significant interest in it, I can certainly do it, but it would be a lot of work. Take a look at the phpbb_users table, anything there can be easily changed with this mod as it stands, just one more line of code, really.

James
Interested in Random Avatars for your board? Click here
Need to Enable Avatars By Post Count? Click here
Want HTML in your polls? Click here

User avatar
Saeru
Registered User
Posts: 622
Joined: Sun Feb 19, 2006 5:44 am
Location: Under a pile of PHP code.
Contact:

Post by Saeru » Wed May 24, 2006 10:55 pm

I don't see a use for this mod then.. I mean restricting all users from having their own custom avatar until they made a few posts, and having to either go with out, or use a gallery avatar only until then yes..
But making them be unable to sellect an avatar at all until then.. well.. ehh...
"Naku ga yousuru ichidanto tsuyosa kyaku ga icchuu wo yusuru."[/size]

User avatar
mosheen
Registered User
Posts: 259
Joined: Wed Apr 06, 2005 12:16 am
Location: Asheville, NC
Contact:

Post by mosheen » Thu May 25, 2006 12:48 am

Feel welcome to not use it!

Do a search for related terms here and see how many times this has been requested. That's why I wrote it. Not for what you want to use it for. Between phpbb.com and phpbbhacks.com it has been downloaded a lot of times.

Thanks for stopping by, though.
James

User avatar
Ramon Fincken
Registered User
Posts: 4835
Joined: Thu Oct 14, 2004 1:04 am
Location: NL, The Netherlands Amsterdam area @GMT +1
Contact:

Post by Ramon Fincken » Thu May 25, 2006 4:45 pm

Saeru wrote: This is something I was looking for, Question, does it allow users to still pick an Avatar from the gallery?

I'd like to restrict users from putting up custom avatars until they have reached a sellect post count.
Saeru wrote: I don't see a use for this mod then.. I mean restricting all users from having their own custom avatar until they made a few posts, and having to either go with out, or use a gallery avatar only until then yes..
But making them be unable to sellect an avatar at all until then.. well.. ehh...


Then perhaps you will find my mod usefull?
http://www.phpbb.com/phpBB/viewtopic.php?t=394024
Dutch quality fully managed WordPress hosting - ManagedWPHosting.nl

Before changing a file, some code or installing a MOD >> Make a backup first!

Do you like my mods? paypal me $1 :) forumsoftware[AT}creativepulses[DOT}nl [/size]
PhpBBantispam.com || Instant find your mod here

User avatar
mosheen
Registered User
Posts: 259
Joined: Wed Apr 06, 2005 12:16 am
Location: Asheville, NC
Contact:

Post by mosheen » Thu May 25, 2006 7:21 pm

Yep, that sounds like the one!

I believe I got dinged on my first attempt at mod validation because there wasn't ACP controls for this mod. That's why I can't so easily hard-code the minimum post numbers in the page.

User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape » Wed Jun 28, 2006 4:31 pm

mosheen, by any chane does the updated version address the possible conflicts I've mentioned above? This mod is exactly what I was looking for, and I'd love to get the two working together! LOL
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :

Post Reply

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