The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Avatar display in RPG Sheet

3 posters

Go down

Solved Avatar display in RPG Sheet

Post by Melanore July 1st 2015, 12:53 pm

I am trying to add avatar image to edit rpg_sheet template (/u1rpgsheet).
Ive tried {AVATAR_IMG}, {POSTER_AVATAR}, {AVATAR} and {postrow.displayed.POSTER_AVATAR} so far  but they didn't work. 

My rpg_sheet template:

Code:
    <h1>{L_ROLEPLAY_MANAGE_TITLE}</h1>
    {SOUS_MENU}
    <br />
    <br />
    <table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
        <tr>
            <th class="thHead" colspan="2" nowrap="nowrap" height="25">{L_VIEWING_PROFILE}</th>
        </tr>
        <!--<tr>
        <td class="catLeft" align="center" width="40%" height="28"><b><span class="gen">{L_AVATAR}</span></b></td>
        <td class="catRight" width="60%" align="center"><b><span class="gen">{L_ABOUT_USER}</span></b></td>
        </tr>-->
        <tr>
            <td class="row1" align="center" valign="top" height="6" width="30%">
          
            <span class="postdetails">
            {POSTER_AVATAR}<br />
            {POSTER_RANK}</span><br />
            {RPG_IMAGE}<br />
            <br />
            <table width="100%" border="0" cellspacing="1" cellpadding="0">
                <!-- BEGIN rpg_fields_left -->
                <tr>
                    <td align="right" valign="middle" nowrap="nowrap"><span class="gen">{rpg_fields_left.F_NAME} : </span></td>
                    <td width="100%" valign="middle" nowrap="nowrap"><span class="gen"><b>{rpg_fields_left.F_VALUE}</b></span></td>
                </tr>
                <!-- END rpg_fields_left -->
            </table>
            </td>
            <td class="row1" valign="top"><br />
            <table width="100%" border="0" cellspacing="1" cellpadding="0">
                <!-- BEGIN rpg_fields -->
                <tr>
                    <td align="right" valign="top" nowrap="nowrap"><span class="gen">{rpg_fields.F_NAME} :</span></td>
                    <td width="100%" valign="baseline"><span class="gen">{rpg_fields.F_VALUE}</span></td>
                </tr>
                <!-- END rpg_fields -->
            </table>
            </td>
        </tr>
    </table>

What code should I add?
Melanore
Melanore
New Member

Posts : 21
Reputation : 7
Language : EN
Location : TR

Back to top Go down

Solved Re: Avatar display in RPG Sheet

Post by Melanore July 2nd 2015, 5:38 pm

bump
Melanore
Melanore
New Member

Posts : 21
Reputation : 7
Language : EN
Location : TR

Back to top Go down

Solved Re: Avatar display in RPG Sheet

Post by Ange Tuteur July 3rd 2015, 3:08 am

Hi @3uphemia,

You can find a list of variables for the rpg_sheet template here. Note however, the explanations are in French.

{L_AVATAR} should be the variable you're looking for.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Avatar display in RPG Sheet

Post by Melanore July 3rd 2015, 3:30 am

Sorry, didn't work. "Character's picture" text appeared.
I also tried all of the list, only "about user" and "poster rank" work fine. :/


Last edited by 3uphemia on July 3rd 2015, 4:56 pm; edited 1 time in total
Melanore
Melanore
New Member

Posts : 21
Reputation : 7
Language : EN
Location : TR

Back to top Go down

Solved Re: Avatar display in RPG Sheet

Post by Ange Tuteur July 3rd 2015, 11:58 am

If none of those work, try using this to get the user avatar via JavaScript.
Code:
<div id="membreAva"></div>
<script type="text/javascript">//<![CDATA[
jQuery.get(window.location.pathname.replace(/(\/u\d+).*/, '$1'), function(d) {
  document.getElementById('membreAva').appendChild(jQuery('td.row1.gensmall img', d)[0]);
});
//]]></script>

Just paste that where you want the avatar appear. Note that it should not be pasted more than once. ( If you want one that can be used multiple times let me know )
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Avatar display in RPG Sheet

Post by Melanore July 3rd 2015, 12:25 pm

Thank you @Ange Tuteur! It works. ^^

I wish to add signature img too, if it is possible.   

I dont know javascript language but as far as I understand you call the avatar image from td.row1.gensmall in  /u# page . Then I tried to get gender icon and I did it! It is a success for me. Razz But I couldnt find a signature img in any pages belongs to u#, so I asked to you. :/
Melanore
Melanore
New Member

Posts : 21
Reputation : 7
Language : EN
Location : TR

Back to top Go down

Solved Re: Avatar display in RPG Sheet

Post by Ange Tuteur July 3rd 2015, 12:44 pm

Ooh yes, JavaScript AJAX is very useful for getting data from other pages. ^^

Try this for the signature :
Code:
<div id="membreSig"></div>
<script type="text/javascript">//<![CDATA[
jQuery.get('/profile?mode=editprofile&page_profil=signature', function(d) {
  var sigImg = jQuery('.signature_div img', d)[0];
  sigImg && document.getElementById('membreSig').appendChild(sigImg);
});
//]]></script>

This should only return the first image in the signature. Smile If there's no image, it will leave the containing element ( div#membreSig ) empty.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Avatar display in RPG Sheet

Post by Melanore July 3rd 2015, 1:25 pm

Oh, I had tried that one but here is a problem: 
It puts "my signature" to every rpgsheet profils. Even in u2, u3, u4.. rpg pages, I see u1 signature because I am u1.
Because editprofile link refers to my account's profile, right? Crying or Very sad
Melanore
Melanore
New Member

Posts : 21
Reputation : 7
Language : EN
Location : TR

Back to top Go down

Solved Re: Avatar display in RPG Sheet

Post by Ange Tuteur July 3rd 2015, 4:51 pm

Oh yeah.. I totally forgot about that. blackeye

Hmm.. as far as I know, the only other way to get a user's signature would be via a topic. I currently can't think of a another way. grrr!!!!!
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Avatar display in RPG Sheet

Post by Melanore July 3rd 2015, 4:55 pm

Oh okay then. I understand to working system of this javascript, I guess.  Thank you very much for your interest. ^^
#Solved  cheers
Melanore
Melanore
New Member

Posts : 21
Reputation : 7
Language : EN
Location : TR

Back to top Go down

Solved Re: Avatar display in RPG Sheet

Post by SLGray July 3rd 2015, 9:15 pm

Topic solved and archived


Avatar display in RPG Sheet Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51410
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum