[BETA] Dynamic Avatar

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!
Scam Warning
Locked
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: [BETA] Dynamic Avatar

Post by Oyabun1 »

mentioned offitype wrote:If that's too vague a description of the process I'll go into more detail for anyone who wants to know.
That would be useful because many users don't know how to write their own code.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

mentioned offitype
Registered User
Posts: 19
Joined: Thu Jun 02, 2011 7:42 pm

Re: [BETA] Dynamic Avatar

Post by mentioned offitype »

Oyabun1 wrote:
mentioned offitype wrote:If that's too vague a description of the process I'll go into more detail for anyone who wants to know.
That would be useful because many users don't know how to write their own code.
Hey, I'm not perfect either. I thought it might be rude of me how to modify someone else's mod, but if dellsystems is okay with it I could write up a small how-to.

User avatar
Sequor
Registered User
Posts: 68
Joined: Sat Nov 14, 2009 8:21 pm
Location: USA
Contact:

Re: [BETA] Dynamic Avatar

Post by Sequor »

In reference to my previous post, I'm attaching an updated install.xml file that works perfectly with AutoMod. Edit and replace your install.xml file with the following if AutoMod isn't copying your files over correctly (as in my case). Please note that this is for version 0.9.2.

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
<!--NOTICE: Please open this file in your web browser. If presented with a security warning, you may safely tell it to allow the blocked content.-->
<!--For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD.\nAlthough MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD.\nNo support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.phpbb.com/mods/xml/modx-1.2.6.xsd">
	<header>
		<meta name="generator" content="MODX file generated with PP MODX Creator by tumba25 (online version)"/>
		<license><![CDATA[http://opensource.org/licenses/gpl-license.php GNU General Public License v2]]></license>
		<title lang="en"><![CDATA[Dynamic Avatar Mod]]></title>
		<description lang="en"><![CDATA[This MOD provides the ability to edit your avatar, using bodily features and clothes that can be purchased or acquired. In the vein of 2.0x MODs like Live Avatar and Nulavatar, and the dynamic avatar capabilities of the 3.0x MOD Camorea Suite. Useful for RPG forums.]]></description>
		<author-notes lang="en"><![CDATA[Although not required, the Ultimate Points MOD by femu and Wuerzi is supported by this MOD. If you have it installed, you will be able to set prices for items. If not installed, all items are free. Additionally, although some sample images are provided for you to test out the MOD, a comprehensive set of avatar and clothing images is not included; you will need to acquire those images yourself.]]></author-notes>
		<github><![CDATA[https://github.com/dellsystem/phpBB-dynamic-avatar]]></github>
		<author-group>
			<author>
				<realname><![CDATA[Wendy Liu]]></realname>
				<username><![CDATA[dellsystem]]></username>
				<homepage><![CDATA[http://www.dellsystem.me/phpbb]]></homepage>
				<email><![CDATA[dellsystem@phpbb.com]]></email>
			</author>
		</author-group>
		<mod-version>0.9.2</mod-version>
		<installation>
			<level>easy</level>
			<time>120</time>
			<target-version>3.0.12</target-version>
		</installation>
		<history>
			<entry>
				<date>2011-08-23</date>
				<rev-version>0.0.1</rev-version>
				<changelog lang="en">
					<change><![CDATA[Initial release - very basic and unstable ALPHA version]]></change>
				</changelog>
			</entry>
			<entry>
				<date>2011-08-31</date>
				<rev-version>0.0.2</rev-version>
				<changelog lang="en">
					<change><![CDATA[Fixed bug in ACP dynamic avatar module]]></change>
					<change><![CDATA[Clicking on radio buttons in UCP module works now]]></change>
					<change><![CDATA[More language constants]]></change>
				</changelog>
			</entry>
			<entry>
				<date>2012-03-26</date>
				<rev-version>0.1.0</rev-version>
				<changelog lang="en">
					<change><![CDATA[Rewrote and redesigned UCP module (issues #35 and #42)]]></change>
					<change><![CDATA[Added logging to more ACP actions (issue #41)]]></change>
					<change><![CDATA[Made image directory paths ACP-configurable (issue #37)]]></change>
					<change><![CDATA[Turned basically all text into a language constant (issues #10, #16)]]></change>
					<change><![CDATA[Improved reordering of layers by adding a move up/down option and fixing bugs (issues #32, #33, #34)]]></change>
					<change><![CDATA[Dropped the `position` unique index in the layers table (see previous)]]></change>
					<change><![CDATA[Added functionality to the "reset" button, and added a new one (issue #36)]]></change>
					<change><![CDATA[Moved reusable functions into functions_dynamo.php (new file)]]></change>
					<change><![CDATA[Added ACP-configurable image dimensions (issue #5 - still a WIP and may not behave as expected)]]></change>
				</changelog>
			</entry>
			<entry>
				<date>2012-07-09</date>
				<rev-version>0.9.0</rev-version>
				<changelog lang="en">
					<change><![CDATA[Points MOD integration (issue #1)]]></change>
					<change><![CDATA[Fixed bugs with deleting layers/items (issue #48)]]></change>
					<change><![CDATA[Fixed bugs with itemless layers and layerless items in UCP (issues #49, #50)]]></change>
					<change><![CDATA[Updated to jQuery 1.7.2]]></change>
				</changelog>
			</entry>
			<entry>
				<date>2013-03-10</date>
				<rev-version>0.9.1</rev-version>
				<changelog lang="en">
					<change><![CDATA[Added support for unicode input for item/layer names and descriptions (issue #53)]]></change>
					<change><![CDATA[Updated page titles for adding and editing items]]></change>
					<change><![CDATA[Updated jQuery to 1.9.1]]></change>
				</changelog>
			</entry>
			<entry>
				<date>2013-10-03</date>
				<rev-version>0.9.2</rev-version>
				<changelog lang="en">
					<change><![CDATA[Improved caching prevention for avatar images (issue #54)]]></change>
				</changelog>
			</entry>
		</history>
	</header>
	<action-group>
		<copy>
			<file from="root/adm/style/acp_dynamo_items_edit.html" to="adm/style/acp_dynamo_items_edit.html"/>
			<file from="root/adm/style/acp_dynamo_items_edit.html" to="adm/style/acp_dynamo_items_edit.html"/>
			<file from="root/adm/style/acp_dynamo_layers_edit.html" to="adm/style/acp_dynamo_layers_edit.html"/>
			<file from="root/adm/style/acp_dynamo_layers.html" to="adm/style/acp_dynamo_layers.html"/>
			<file from="root/adm/style/acp_dynamo_overview.html" to="adm/style/acp_dynamo_overview.html"/>
			<file from="root/adm/style/acp_dynamo_settings.html" to="adm/style/acp_dynamo_settings.html"/>
			<file from="root/adm/style/acp_dynamo_users.html" to="adm/style/acp_dynamo_users.html"/>
			<file from="root/adm/style/dynamo.js" to="adm/style/dynamo.js"/>
			<file from="root/images/avatars/dynamo/emptyfile" to="images/avatars/dynamo/emptyfile"/>
			<file from="root/images/dynamo/1-11.png" to="images/dynamo/1-11.png"/>
			<file from="root/images/dynamo/10-10.png" to="images/dynamo/10-10.png"/>
			<file from="root/images/dynamo/10-19.png" to="images/dynamo/10-19.png"/>
			<file from="root/images/dynamo/10-7.png" to="images/dynamo/10-7.png"/>
			<file from="root/images/dynamo/10-8.png" to="images/dynamo/10-8.png"/>
			<file from="root/images/dynamo/10-9.png" to="images/dynamo/10-9.png"/>
			<file from="root/images/dynamo/11-20.png" to="images/dynamo/11-20.png"/>
			<file from="root/images/dynamo/12-21.png" to="images/dynamo/12-21.png"/>
			<file from="root/images/dynamo/12-22.png" to="images/dynamo/12-22.png"/>
			<file from="root/images/dynamo/12-23.png" to="images/dynamo/12-23.png"/>
			<file from="root/images/dynamo/12-24.png" to="images/dynamo/12-24.png"/>
			<file from="root/images/dynamo/4-16.png" to="images/dynamo/4-16.png"/>
			<file from="root/images/dynamo/4-17.png" to="images/dynamo/4-17.png"/>
			<file from="root/images/dynamo/4-18.png" to="images/dynamo/4-18.png"/>
			<file from="root/images/dynamo/5-2.png" to="images/dynamo/5-2.png"/>
			<file from="root/images/dynamo/6-13.png" to="images/dynamo/6-13.png"/>
			<file from="root/images/dynamo/6-14.png" to="images/dynamo/6-14.png"/>
			<file from="root/images/dynamo/6-15.png" to="images/dynamo/6-15.png"/>
			<file from="root/images/dynamo/7-12.png" to="images/dynamo/7-12.png"/>
			<file from="root/images/dynamo/9-3.png" to="images/dynamo/9-3.png"/>
			<file from="root/images/dynamo/9-4.png" to="images/dynamo/9-4.png"/>
			<file from="root/images/dynamo/9-5.png" to="images/dynamo/9-5.png"/>
			<file from="root/images/dynamo/9-6.png" to="images/dynamo/9-6.png"/>
			<file from="root/includes/acp/info/acp_dynamo.php" to="includes/acp/info/acp_dynamo.php"/>
			<file from="root/includes/acp/acp_dynamo.php" to="includes/acp/acp_dynamo.php"/>
			<file from="root/includes/ucp/info/ucp_dynamo.php" to="includes/ucp/info/ucp_dynamo.php"/>
			<file from="root/includes/ucp/ucp_dynamo.php" to="includes/ucp/ucp_dynamo.php"/>
			<file from="root/includes/functions_dynamo.php" to="includes/functions_dynamo.php"/>
			<file from="root/language/en/mods/dynamo/acp.php" to="language/en/mods/dynamo/acp.php"/>
			<file from="root/language/en/mods/dynamo/ucp.php" to="language/en/mods/dynamo/ucp.php"/>
			<file from="root/language/en/mods/info_acp_dynamo.php" to="language/en/mods/info_acp_dynamo.php"/>
			<file from="root/language/en/mods/info_ucp_dynamo.php" to="language/en/mods/info_ucp_dynamo.php"/>
			<file from="root/language/en/mods/permissions_dynamo.php" to="language/en/mods/permissions_dynamo.php"/>
			<file from="root/styles/prosilver/template/dynamo.js" to="styles/prosilver/template/dynamo.js"/>
			<file from="root/styles/prosilver/template/ucp_dynamo_edit.html" to="styles/prosilver/template/ucp_dynamo_edit.html"/>
			<file from="root/dynamo_mod_install.php" to="dynamo_mod_install.php"/>
			<file from="root/jquery-1.9.1.min.js" to="jquery-1.9.1.min.js"/>
		</copy>
		<open src="includes/constants.php">
			<edit>
				<find><![CDATA[// Additional tables]]></find>
				<action type="after-add"><![CDATA[// Dynamo (dynamic avatar) MOD
define('DYNAMO_LAYERS_TABLE',		$table_prefix . 'dynamo_layers');
define('DYNAMO_ITEMS_TABLE',		$table_prefix . 'dynamo_items');
define('DYNAMO_USERS_TABLE',		$table_prefix . 'dynamo_users');
define('DYNAMO_INVENTORY_TABLE',  $table_prefix . 'dynamo_inventory');]]></action>
			</edit>
		</open>
		<php-installer><![CDATA[dynamo_mod_install.php]]></php-installer>
		<diy-instructions lang="en"><![CDATA[Make sure to enable remote avatars (ACP, Avatar settings) and change the maximum avatar dimensions (the supplied demo images have a width of 100px and a height of 120px - this isn't a necessary step but it may become one eventually?). Make sure also to chmod/chown the /images/avatars/dynamo/ and /images/dynamo/ directories so that they are writable by whatever user your server's PHP process runs under (777 is always a safe bet).

You can configure this MOD in the ACP, under the .MODs tab.]]></diy-instructions>
	</action-group>
</mod>
@mentioned offitype - I agree with Oyabun1; Having that kind of control over the avatar items would be splendid, and I'd be really interested to see how you went about it.

mentioned offitype
Registered User
Posts: 19
Joined: Thu Jun 02, 2011 7:42 pm

Re: [BETA] Dynamic Avatar

Post by mentioned offitype »

Well, I'll try to remember everything I did...

First I edited the phpbb_dynamo_items table to include data on the filename by adding a new column and give it the name "dynamo_item_filename". Make sure the column is just like either "dynamo_item_name" or "dynamo_item_desc". I have mine set to varchar(255), but if the filename is going to be web-safe, it might be best to have varchar(100). Not sure which would be better suited myself.

The rest of these steps involve editing php files. Make sure you back up includes/functions_dynamo.php, includes/ucp/ucp_dynamo.php, and includes/acp/acp_dynamo.php in case you need to undo any changes. Keep the originals somewhere you can find them. I'm not responsible if you don't back up your original or modified files and they end up breaking.

Open includes/ucp/ucp_dynamo.php

Find this:

Code: Select all

while ($row = $db->sql_fetchrow($result))
				{
					$layer_id = $row['dynamo_item_layer'];
					$name = $row['dynamo_item_name'];
Add this after:

Code: Select all

$name_file = $row['dynamo_item_filename'];
Next, find this:

Code: Select all

$layers[$layer_id]['items'][$item_id] = array(
then find this:

Code: Select all

'url'		=> get_item_image_path('entire', $layer_id, $item_id),
and change it to this:

Code: Select all

'url'		=> get_item_image_path('entire', $name_file),

Open includes/functions_dynamo.php
Find this:

Code: Select all

$filename = $layer_id . '-' . $item_id . '.png';
Change it to this:

Code: Select all

$filename = $name_file . '.png';
If you're going to use the acp to upload files, then includes/acp/acp_dynamo.php also needs to be edited, otherwise it'll rename the items based on layer and image id, and they'll conflict with the changes in the other files. I haven't been able to make it so it takes the filename of the file being uploaded and inputs it in the database, so I just added a second name field in the acp where you can input it manually. It's a pain, but at best it's a temporary solution.

Open includes/acp/acp_dynamo.php
Find this:

Code: Select all

$desired_price = request_var('item_price', 0);
Add this after it:

Code: Select all

//the filename
	$desired_filename = utf8_normalize_nfc(request_var('dynamo_item_filename', '', true));
This will generate a second name field below the first one. You use this to input the filename in the database manually. Just make sure the name you enter matches the name of the file minus the file extension.

Find this:

Code: Select all

$file->realname = get_item_image_path('filename', $desired_layer, $item_id);
Either remove it, or add a "//" at the beginning to tell php not to use that line of code. I recommend using "//" in case you need this line of code again.

Find this:

Code: Select all

'dynamo_item_name' 		=> $desired_name,
Add after it this:

Code: Select all

'dynamo_item_filename' 	=> $desired_filename,
Find this:

Code: Select all

// First, rename the image file
Add this in front:

Code: Select all

/*
Find this:

Code: Select all

// Then, delete all traces of this item from the users table
Add before it:

Code: Select all

*/
Since the images are being loaded based on filename and not layer and item id, this code is not needed.

You don't have to use the same variables as I did, like '$name_file' and 'dynamo_item_filename', but they must be consistent. I haven't tried out the mod extensively after these changes were made, but there doesn't seem to be any problems so far. Now if only I could make a tabbed display like nulavatar had.

User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: [BETA] Dynamic Avatar

Post by dellsystem »

Updated to version 0.9.3 (ZIP)

Changes: AutoMOD compatibility, fixed jQuery linking issue in UCP. View release notes

@mentioned offitype, thanks for taking the time to write that up! I'll include that feature in the next release. What do you mean by tabbed display?

@Sequor, I wish I had seen your post earlier - I came across the AutoMOD issue myself earlier today when I was trying to install the MOD with AutoMOD, and ended up manually adding in the list of files to install.xml. It's fixed in the latest release (0.9.3). Thanks so much for looking into it!
Former moderator and website team member | My MODs, and more (GitHub)

User avatar
Sequor
Registered User
Posts: 68
Joined: Sat Nov 14, 2009 8:21 pm
Location: USA
Contact:

Re: [BETA] Dynamic Avatar

Post by Sequor »

@Dellsystem - You're welcome. I"m sorry you had to go through and add all that. :P It's a fantastic mod, though. I'm going to try mentioned offitype's edits and see how they work out. I know it's a bit early to be asking this, but do you have an ETA as to when you'll be releasing 0.9.4? Just so I know when to start looking for it, y'know.

mentioned offitype
Registered User
Posts: 19
Joined: Thu Jun 02, 2011 7:42 pm

Re: [BETA] Dynamic Avatar

Post by mentioned offitype »

dellsystem wrote: @mentioned offitype, thanks for taking the time to write that up! I'll include that feature in the next release. What do you mean by tabbed display?
Nulavatar had a third party mod that displayed one layer at a time. There was a row of icons or tabs at the top that, when clicked on, would switch to the layer it indicated. I got something like that to work, but all it does is hide every other layer besides the one selected. Ideally this would be for when you have a ton of items where loading all of them would be bandwidth or resource heavy, but if you only want to change one layer you'll only load the items on the layer you selected. The rest of the items would only load when you went into the layer tab they were part of.
Right now I'm trying to make certain items linked so when you equip one you equip the other as well.

Squet
Registered User
Posts: 4
Joined: Fri Aug 15, 2014 2:31 am

Re: [BETA] Dynamic Avatar

Post by Squet »

@Dellsystem - Thanks so much for making this mod! I'm having heaps of fun with it :)
Have a few issues/questions:

I'm a total noob with all this. I know some CSS and that's it really. Tried the filename tutorial above several times and couldn't get it working so I would love to see that feature implemented in a future release. Would also love a shop mod that's compatible with this and Ultimate Points! :D

I'm wondering if/how I can change the height of the links in the layer menu in UCP? I'd like to squeeze a few more layers in without having it become a scrolling box.

Would be possible in the future to have an option to set our own preview images instead of showing the whole item? Looks a bit creepy when all you have is a set of floating eyes or a creepy grinning mouth hanging there!

xuniap
Registered User
Posts: 1
Joined: Wed Aug 20, 2014 2:25 pm

Re: [BETA] Dynamic Avatar

Post by xuniap »

This is a great mod and is working perfectly up to now, thank you so much!

Is there a way to make it generate a .png and give you the url/img code of it instead of setting the created avatar as your actual avatar? That would make it even cooler. :D

gylippus
Registered User
Posts: 50
Joined: Mon Nov 12, 2007 1:53 am

Re: [BETA] Dynamic Avatar

Post by gylippus »

Squet wrote:@Dellsystem - Thanks so much for making this mod! I'm having heaps of fun with it :)
Have a few issues/questions:

I'm a total noob with all this. I know some CSS and that's it really. Tried the filename tutorial above several times and couldn't get it working so I would love to see that feature implemented in a future release. Would also love a shop mod that's compatible with this and Ultimate Points! :D

I'm wondering if/how I can change the height of the links in the layer menu in UCP? I'd like to squeeze a few more layers in without having it become a scrolling box.

Would be possible in the future to have an option to set our own preview images instead of showing the whole item? Looks a bit creepy when all you have is a set of floating eyes or a creepy grinning mouth hanging there!
I have easy shop and ultimate points on my forum so I am thinking it wouldn't be too much of a stretch to edit easy shop to make items that are wearable for sale. But that may be easier said than done.

Squet
Registered User
Posts: 4
Joined: Fri Aug 15, 2014 2:31 am

Re: [BETA] Dynamic Avatar

Post by Squet »

gylippus wrote: I have easy shop and ultimate points on my forum so I am thinking it wouldn't be too much of a stretch to edit easy shop to make items that are wearable for sale. But that may be easier said than done.
It's definitely too much for me to do myself as I only know basic HTML and CSS, but hopefully someone else will do that :)

@dellsystem
I've found a small error with layers. They're layered by database ID rather than layer position. Eg. socks might be layer 1 and shoes layer 2, but if socks have a database ID of 2 and shoes of 1, the socks will show up above the shoes. It's fine in preview mode but once you save the avatar the layers are reorganised by ID. Easy enough to rearrange things, but it would be great if you could override that somehow :)

or123111
Registered User
Posts: 17
Joined: Wed Mar 04, 2015 8:01 am

Re: [BETA] Dynamic Avatar

Post by or123111 »

Hello,

I installed the mod.
When I went to install appears to me the error:

Server is unavailable HTTP 503

Server overloading due to maintenance or failure to answer.Please contact the administrator of the server if the problem persists.

Click Here to test your Internet speed!

I tried to access a file dynamo_mod_install.php he setup file.

What can you do?

Thank helpers!

or123111
Registered User
Posts: 17
Joined: Wed Mar 04, 2015 8:01 am

Re: [BETA] Dynamic Avatar

Post by or123111 »

Question creator mod:

Is it possible to send items user? If not, can anyone do that?

Locked

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