Avatar display in RPG Sheet
3 posters
Page 1 of 1
Avatar display in RPG Sheet
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:
What code should I add?
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- New Member
- Posts : 21
Reputation : 7
Language : EN
Location : TR
Melanore- New Member
- Posts : 21
Reputation : 7
Language : EN
Location : TR
Re: Avatar display in RPG Sheet
Sorry, didn't work. "Character's picture" text appeared.
I also tried all of the list, only "about user" and "poster rank" work fine.
I also tried all of the list, only "about user" and "poster rank" work fine.
Last edited by 3uphemia on Fri 3 Jul - 14:56; edited 1 time in total
Melanore- New Member
- Posts : 21
Reputation : 7
Language : EN
Location : TR
Re: Avatar display in RPG Sheet
If none of those work, try using this to get the user avatar via JavaScript.
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 )
- 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 )
Re: Avatar display in RPG Sheet
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. But I couldnt find a signature img in any pages belongs to u#, so I asked to you.
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. But I couldnt find a signature img in any pages belongs to u#, so I asked to you.
Melanore- New Member
- Posts : 21
Reputation : 7
Language : EN
Location : TR
Re: Avatar display in RPG Sheet
Ooh yes, JavaScript AJAX is very useful for getting data from other pages. ^^
Try this for the signature :
This should only return the first image in the signature. If there's no image, it will leave the containing element ( div#membreSig ) empty.
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. If there's no image, it will leave the containing element ( div#membreSig ) empty.
Re: Avatar display in RPG Sheet
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?
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?
Melanore- New Member
- Posts : 21
Reputation : 7
Language : EN
Location : TR
Re: Avatar display in RPG Sheet
Oh yeah.. I totally forgot about that.
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.
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.
Re: Avatar display in RPG Sheet
Oh okay then. I understand to working system of this javascript, I guess. Thank you very much for your interest. ^^
#Solved
#Solved
Melanore- New Member
- Posts : 21
Reputation : 7
Language : EN
Location : TR
Re: Avatar display in RPG Sheet
Topic solved and archived
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» Avatar display
» CSS Sheet is empty
» Display the avatar of a member on the toolbar
» Do I Need This In My CSS Style Sheet
» How to make user avatar display in portal page topics?
» CSS Sheet is empty
» Display the avatar of a member on the toolbar
» Do I Need This In My CSS Style Sheet
» How to make user avatar display in portal page topics?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum