First of all I'm going to sort out previous post related questions and issues.
1. I did everything according to tutorial - no luck, all I can see only Edit link.
Oops. I forgot to mention that original icon set doesn't have Edit.gif in it. I had to create it myself. Please download it right from vldCrowd: http://www.vldcrowd.com/media/moods/Edit.gif and put to your moods folder.
2. I don't have mod_rewrite on my server and that's why seo-friendly url "Click to edit" leads me to nowhere.
I'm sorry, I thought every hosting has mod rewrite these days. My bad.
Please instead of {virtual_path}account/profile/mood/ use {virtual_path}index.php?m=account_profile&group=mood
3. I don't want to display Moods group at profile groups tabs because I already have it displayed as graphic icon.
We have to do same thing as with General group, if you noticed it it's not displayed at account_home in field group tabs.
Open your account_home.tpl and replace both occurrences of <!-- IF group_label != "general" --> with <!-- IF group_label != "general" AND group_label != "mood" -->
4. I installed your mod and can't see anything when I visit member's profile page
Oh yes, vldP v.2.5.5 doesn't use member_sections_card.tpl at member_profile page, hence you have to edit member_profile.tpl too. Add this anywhere at the file but outside of profile groups, fields loop:
<div style="background: url('{top.virtual_tpl_path}{session.template}/media/moods/<!-- IF profile_field_mymood_value -->{profile_field_mymood_value}<!-- ELSE -->Question<!-- ENDIF -->.gif') no-repeat; width:93px; height:30px;"> </div>
Here comes main part of tutorial.
How to dynamically display moods on selection
1. Open your account_profile.tpl and find <!-- ELSEIF field_type = "combo" -->
Add right after it:
<!-- IF field_label == "mymood" -->
<select class="select" onchange="display_mood('{top.virtual_tpl_path}{session.template}/media/moods/');" id="field_{field_label}" name="{field_label}">
<option value="">{lang:"core","user_field_none"}</option> {dropdownlist:field_items,field_value} </select><div id="mood_div"> </div>
<!-- ELSE -->
<!-- ENDIF -->
2. Scroll your account_profile.tpl to bottom and add right before
<!-- ENDIF -->
<!-- INCLUDE ...
this code:
<script type="text/javascript" >
$(document).ready(function(){
display_mood('{virtual_tpl_path}{session.template}/media/moods/');
});
// display mood icon
function display_mood(url)
{
var mood = $('select#field_mymood option:selected').text();
$('#mood_div').attr('style', 'background: url(' + url + mood + '.gif) no-repeat; width:93px; height:30px;');
}
</script>
3. Go and try to change your mood.






Comments
DDNY
jackal
definitive
melindaspenpals
radioact
After that add some check at account_home.tpl and member_profile.tpl like:
<!-- IF field_label == "mymood" -->
do something here
<!-- ELSE -->
{field_value}
<!-- ENDIF -->
This is logic, not exact code to use.
greg
Thank you very much for the mod, but how to make it appear in the "general" and not in a separate section
radioact
gugu
Pages
1 2 3Log in to leave a comment