That would be useful because many users don't know how to write their own code.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.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.
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.Oyabun1 wrote:That would be useful because many users don't know how to write their own code.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.
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[[email protected]]]></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>
Code: Select all
while ($row = $db->sql_fetchrow($result))
{
$layer_id = $row['dynamo_item_layer'];
$name = $row['dynamo_item_name'];
Code: Select all
$name_file = $row['dynamo_item_filename'];
Code: Select all
$layers[$layer_id]['items'][$item_id] = array(
Code: Select all
'url' => get_item_image_path('entire', $layer_id, $item_id),
Code: Select all
'url' => get_item_image_path('entire', $name_file),
Code: Select all
$filename = $layer_id . '-' . $item_id . '.png';
Code: Select all
$filename = $name_file . '.png';
Code: Select all
$desired_price = request_var('item_price', 0);
Code: Select all
//the filename
$desired_filename = utf8_normalize_nfc(request_var('dynamo_item_filename', '', true));
Code: Select all
$file->realname = get_item_image_path('filename', $desired_layer, $item_id);
Code: Select all
'dynamo_item_name' => $desired_name,
Code: Select all
'dynamo_item_filename' => $desired_filename,
Code: Select all
// First, rename the image file
Code: Select all
/*
Code: Select all
// Then, delete all traces of this item from the users table
Code: Select all
*/
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.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?
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 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!
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!
It's definitely too much for me to do myself as I only know basic HTML and CSS, but hopefully someone else will do thatgylippus 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.