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.
The forum of the forums
3 posters

    Avatar display in RPG Sheet

    Melanore
    Melanore
    New Member


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

    Solved Avatar display in RPG Sheet

    Post by Melanore 7/1/2015, 11:53

    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

    Solved Re: Avatar display in RPG Sheet

    Post by Melanore 7/2/2015, 16:38

    bump
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Avatar display in RPG Sheet

    Post by Ange Tuteur 7/3/2015, 02:08

    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.
    Melanore
    Melanore
    New Member


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

    Solved Re: Avatar display in RPG Sheet

    Post by Melanore 7/3/2015, 02:30

    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 7/3/2015, 15:56; edited 1 time in total
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Avatar display in RPG Sheet

    Post by Ange Tuteur 7/3/2015, 10:58

    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 )
    Melanore
    Melanore
    New Member


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

    Solved Re: Avatar display in RPG Sheet

    Post by Melanore 7/3/2015, 11:25

    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. :/
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Avatar display in RPG Sheet

    Post by Ange Tuteur 7/3/2015, 11:44

    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.
    Melanore
    Melanore
    New Member


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

    Solved Re: Avatar display in RPG Sheet

    Post by Melanore 7/3/2015, 12:25

    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
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Avatar display in RPG Sheet

    Post by Ange Tuteur 7/3/2015, 15:51

    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!!!!!
    Melanore
    Melanore
    New Member


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

    Solved Re: Avatar display in RPG Sheet

    Post by Melanore 7/3/2015, 15:55

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


    Male Posts : 51499
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Avatar display in RPG Sheet

    Post by SLGray 7/3/2015, 20:15

    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.

      Current date/time is 9/23/2024, 14:22