[ALPHA] - Random Avatars Mod 1.1.0

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.

[ALPHA] - Random Avatars Mod 1.1.0

Postby mosheen » Thu May 19, 2005 7:19 pm

MOD Title: Random Avatars Mod
MOD Description: This MOD will allow your users to have multiple avatars. A random avatar from the poster's profile is chosen for each post. Supports all avatar types (upload, link, gallery). Admin controls exist for individual users, avatars, and forum-wide enable / disable.

MOD Version: 1.1.0 (07/01/2007)

MOD Download: http://test.medinaline.net/Random_Avatars_MOD_1.1.0.mod
Last Stable version: 1.0.19

NOTES:

Current status:

07/01/2007 - I have removed the test board. It's just a spam magnet sitting out there. When this mod is finally validated, I will post some screen shots or something.

1.1.0
This is a fairly major change from the previous version. For those of you that have version 1.0.19 installed, there is a link to an update doc posted on page 10 of this thread. The update is ONLY for 1.0.19 to 1.1.0; any other installed version will break things.

Added features:
ACP board config control: "Random Avatars Mod: Enable/Disable"
Changed edit profile (user / admin) "Random Avatar Gallery" layout to look better with more styles

Bug fixes:
- Security risk: SQL injection possible when user / admin deletes an avatar (major rewrite of this process)
- Ignores "Can display avatar" admin setting, breaking the edit profile (user / admin) layout


1.0.19
Changes were made to templates to allow compatibility with more skins. If you have installed a prior version of RAM, and have problems with certain skins, see page 10 of this post for two sets of changes to make.

1.0.17
[edit 1/19/2007]a very small change was made which was apparently breaking some FireFox capabilities in selected templates. this change didn't really seem worthy of a new version number. only two reports of the problem. anyway, if you have experienced the problem, the super easy fix is listed on page 10 of this post[/edit] two significant lines of code changed in the update to 2.0.20. The random av mod document needed two [FIND] lines changed. Back up and running at my live board. The test board has not been updated yet.

1.0.15
fixed a minor bug in the new user register page, which was showing the avatar control panel to new users. Thanks, Narc0sis for finding it! The update code is listed above, and also in a post over on page 5 of this thread.
Last edited by mosheen on Sun Jul 01, 2007 7:18 pm, edited 26 times in total.
User avatar
mosheen
Registered User
 
Posts: 259
Joined: Wed Apr 06, 2005 12:16 am
Location: Asheville, NC

Postby mosheen » Sat May 21, 2005 3:35 am

I have taken this mod live on my site now and users have begun... using it.

It's working great.

No interest?

at all?

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

Postby bonelifer » Sat May 21, 2005 4:32 am

Definately an interest, but remember it takes a little while before people notice a new mod. More than 24 hours especially if it's almost the weekend.
Knowledge Base | phpBB Board Rules | Search All Mods

Image bonelifer - phpBBModders Moderator Team Leader - http://www.phpbbmodders.net

Please refrain from making PM's to me unless you are genuinely asking for help or I have asked you to do so.
User avatar
bonelifer
Registered User
 
Posts: 1912
Joined: Wed Oct 27, 2004 11:35 pm

Postby mosheen » Mon May 23, 2005 8:33 pm

Well, I am up to 0.1.5 now (skipping even numbers, as my understanding of the version numbering system goes)

Some fixes of ugly things I didn't like and new stuff added.

I submitted to the mod database a few days ago.

view the test forum at:
http://test.medinaline.net

or the most recent mod sheet at:
http://test.medinaline.net/random_avatars_mod.mod
User avatar
mosheen
Registered User
 
Posts: 259
Joined: Wed Apr 06, 2005 12:16 am
Location: Asheville, NC

Postby Smokeydogg » Tue May 24, 2005 2:05 am

download link aint working make a zip file with txt file in it please
User avatar
Smokeydogg
Registered User
 
Posts: 239
Joined: Sat Dec 06, 2003 8:02 am

Postby Kalipo » Tue May 24, 2005 2:10 am

It's working fine for me.

Thanks for making it mosheen, I'll be installing it after I catch up with other MOD updates :x
User avatar
Kalipo
Registered User
 
Posts: 521
Joined: Mon Dec 08, 2003 1:47 pm

Postby bonelifer » Tue May 24, 2005 7:25 am

Remember to update the first post when you make an update. It makes it easier as eventually this could turn into multiple pages.
Knowledge Base | phpBB Board Rules | Search All Mods

Image bonelifer - phpBBModders Moderator Team Leader - http://www.phpbbmodders.net

Please refrain from making PM's to me unless you are genuinely asking for help or I have asked you to do so.
User avatar
bonelifer
Registered User
 
Posts: 1912
Joined: Wed Oct 27, 2004 11:35 pm

Postby mosheen » Tue May 24, 2005 12:27 pm

I will get that updated. Thanks for checking it out!

Since, to my knowledge, no one (besides myself) has installed this yet, be sure to back all of your files up before going through it. There are some instructions in there that may be a little confusing. I documented it as best I could.

Please let me know either here or through e-mail if you have any problems with it, or if there is anything I need to change.

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

Postby mosheen » Thu May 26, 2005 12:03 pm

I am anxious to get some feedback on this mod. If anyone has tried it already, let me know how it's working.

I submitted to the mod db, but would like to know any problems or suggestions there might be, so I can fix them.

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

Postby Kalipo » Thu May 26, 2005 2:24 pm

This is without adding the optional profile pieces of code.

First a suggestion...

Code: Select all
CREATE TABLE `(table prefix)_avatars` (
and
ALTER TABLE `(table prefix)_users`


change to

Code: Select all
CREATE TABLE `phpbb_avatars` (
and
ALTER TABLE `phpbb_users`


...or at least make a note that the table prefix needs to be adjusted.

Next,

../profile.php?mode=editprofile

Code: Select all
Parse error: parse error, unexpected '=' in ../includes/usercp_register.php on line 54


snippet of those lines...

Code: Select all
if ( $userdata['user_randomavatars'] == 1 )
{
        $user_id = $userdata['user_id'];
        $avatar_path = $board_config['avatar_path'];
        $sql = "SELECT user_avatar, av_id FROM " . AVATARS_TABLE . " WHERE user_id = '$user_id' ORDER BY av_id";
        $result = $db->sql_query($sql);
        WHILE ($row = $db->sql_fetchrow($result))
        {
                $avatar_row = $row['user_avatar'];
                if ( substr( $avatar_row, 0, 4 ) = "http" )
                {
                $image_path = "<img src=\"" . $avatar_row . "\" border=0>";
                }
                else
                {
                $image_path = "<img src=\"" . $avatar_path . "/" . $avatar_row . "\" border=0>";
                }
                $avatar_name = $image_path . "<input type=\"checkbox\" name=\"rand_av_del[]\" value='$avatar_row'><span class=\"gensmall\">Delete</span>&nbsp;";
                $random_avatar_gallery = $random_avatar_gallery . $avatar_name;
        }
        $db->sql_freeresult($result);


Line 54 was this...

Code: Select all
               if ( substr( $avatar_row, 0, 4 ) = "http" )


which I changed to...

Code: Select all
               if ( substr( $avatar_row, 0, 4 ) == "http" )



Works fine :D
User avatar
Kalipo
Registered User
 
Posts: 521
Joined: Mon Dec 08, 2003 1:47 pm

Postby mosheen » Thu May 26, 2005 6:17 pm

Good catch!

I will get those things updated in the mod file.

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

Postby PizzaHuge » Mon May 30, 2005 3:02 am

does it limit uploading (avatars), or you can upload it as much as you can, and it will go through all?
PizzaHuge
Registered User
 
Posts: 360
Joined: Sun Apr 10, 2005 3:36 am

Postby Kalipo » Mon May 30, 2005 6:17 am

I use 3 avs (not sure about any of my members using more than), but on his site here you'll see one of James' test accounts has 12 (same 3 images, but different file names for each).

I haven't had it not display an av.
User avatar
Kalipo
Registered User
 
Posts: 521
Joined: Mon Dec 08, 2003 1:47 pm

Postby mosheen » Mon May 30, 2005 1:08 pm

There is no limit to the number it will currently allow you to upload. On my site (http://medinaline.net) there are three of us currently using random avatars and there are between 10 and 25 in use. Works like a charm!

Admin defined avatar_Max numbers might be something to add in a later release. I'm sure it can be done.

Also another feature that is coming soon (this will probably be written up as an add-on to the random avatars mod as it currently sits, and also as its own separate thing) is to allow users to choose on the site's avatar gallery whether to cycle through those randomly instead of choosing just one.

Sound interesting to anyone?
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

Postby Kalipo » Mon May 30, 2005 1:19 pm

^definately.

Hopefully compatible with this MOD?
User avatar
Kalipo
Registered User
 
Posts: 521
Joined: Mon Dec 08, 2003 1:47 pm

Next

Return to [2.0.x] MODs in Development

Who is online

Users browsing this forum: No registered users and 7 guests