The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

how to make avatar in topic list?

View previous topic View next topic Go down

Solved how to make avatar in topic list?

Post by akbarmaulana on April 2nd 2013, 1:24 pm

how to make avatar in topic list?
like this

thanks before Very Happy

akbarmaulana
Forumember

Posts : 140
Reputation : 1
Language : Indonesian

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by Jophy on April 2nd 2013, 1:43 pm


Jophy
ForumGuru

Male Posts : 17924
Reputation : 835
Language : English
Location : Somewhere

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by akbarmaulana on April 2nd 2013, 2:09 pm

yes, but it's not work

akbarmaulana
Forumember

Posts : 140
Reputation : 1
Language : Indonesian

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by Jophy on April 2nd 2013, 2:28 pm

What's your forum version?

Jophy
ForumGuru

Male Posts : 17924
Reputation : 835
Language : English
Location : Somewhere

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by E-Mark on April 2nd 2013, 2:40 pm

Go to JS Management then check 'In Homepage', then put this:
Code:
/* Avatar in index by giObanii punbb*/
$(document).ready(function () {
$('.statused .tcr').each(function(e) {
var l = this.getElementsByTagName('strong')[0].firstChild.href;
$(this).prepend('<span class="avatar-index" id="avatar-index'+e+'"></span>');
$('#avatar-index'+e).load(l+' .module .main-content.clearfix.center:eq(0) img:eq(0)');
});
});;

Then put this in the CSS:
Code:
.avatar-index { float: left; }
.avatar-index img { width: 40px; height: 40px; padding: 1px; border: 1px solid #DDD; margin: 0 5px; }

E-Mark
Active Poster

Male Posts : 1389
Reputation : 164
Language : English, Tagalog
Location : Republic of the Philippines

http://coding-spot.darkbb.com/

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by zenzo on April 2nd 2013, 5:18 pm

JS all pages

Code:
$(document).ready(function () {
$('.statused .tcr').each(function(e) {
var l = this.getElementsByTagName('strong')[0].firstChild.href;
$(this).prepend('<span class="avatar-index" id="avatar-index'+e+'"></span>');
$('#avatar-index'+e).load(l+' .module .main-content.clearfix.center:eq(0) img:eq(0)');
});
});;

CSS

Code:

.avatar-index {
  float: left;
}
.avatar-index img {
  width: 40px; height: 40px; padding: 1px;
  border: 1px solid #DDD;
  border-radius: 3px;
  margin: 0 5px;
  margin-top: 2px;
}
td.tcr span {
    display: inline-block !important;
}

zenzo
Forumember

Posts : 464
Reputation : 13
Language : english,tagalog
Location : philippines

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by akbarmaulana on April 3rd 2013, 1:38 am

my forum is PunBB
-
i have try the code, but it still not work

akbarmaulana
Forumember

Posts : 140
Reputation : 1
Language : Indonesian

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by Sanket on April 3rd 2013, 5:58 am


Sanket
ForumGuru

Male Posts : 48766
Reputation : 2819
Language : English
Location : Mumbai

http://webartzforum.com

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by Rhino.Freak on April 3rd 2013, 6:22 am

hmm I also need one for Invision, if anyone has..

Rhino.Freak
Active Poster

Male Posts : 1243
Reputation : 105
Language : English
Location : Mumbai, India

http://freetest.forumotion.net/

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by Sanket on April 3rd 2013, 6:25 am

@Rhino.Freak wrote:hmm I also need one for Invision, if anyone has..
Not possible for invision in my opinion.

Sanket
ForumGuru

Male Posts : 48766
Reputation : 2819
Language : English
Location : Mumbai

http://webartzforum.com

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by akbarmaulana on April 3rd 2013, 8:18 am

it still not work

akbarmaulana
Forumember

Posts : 140
Reputation : 1
Language : Indonesian

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by E-Mark on April 3rd 2013, 8:19 am

What's your Forum URL?

E-Mark
Active Poster

Male Posts : 1389
Reputation : 164
Language : English, Tagalog
Location : Republic of the Philippines

http://coding-spot.darkbb.com/

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by akbarmaulana on April 3rd 2013, 8:33 am


akbarmaulana
Forumember

Posts : 140
Reputation : 1
Language : Indonesian

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by E-Mark on April 3rd 2013, 9:37 am

Give this a try:

Add this to JS Management, create new JS then check "In Homepage"
Code:
$(document).on('ready', function() {
    $('.statused .tcr').prepend('<div class="avatar-index"><div>');
    $('.statused .tcr .avatar-index').each(function () {
        var profileUserURL = $(this).parent().children('span').children('strong').children('a').attr('href');
        $(this).html('<a href="' + profileUserURL + '" class="avatar-index-enlace"><img src="http://illiweb.com/fa/invision/pp-blank-thumb.png" alt="No Avatar" /></a>');
        $(this).children('a').load(profileUserURL + ' .module:eq(0) img:eq(0)')
    });
});

Add this to your CSS:
Code:
.avatar-index { float: left; }
.avatar-index img { width: 40px; height: 40px; padding: 1px; border: 1px solid #DDD; margin: 0 5px; }

E-Mark
Active Poster

Male Posts : 1389
Reputation : 164
Language : English, Tagalog
Location : Republic of the Philippines

http://coding-spot.darkbb.com/

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by akbarmaulana on April 3rd 2013, 11:31 am

it's work, but the avatar isn't showing

akbarmaulana
Forumember

Posts : 140
Reputation : 1
Language : Indonesian

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by Rhino.Freak on April 3rd 2013, 12:06 pm

@Sanket wrote:
@Rhino.Freak wrote:hmm I also need one for Invision, if anyone has..
Not possible for invision in my opinion.

i have started to hate invision now , meh.. anyways no problem

Rhino.Freak
Active Poster

Male Posts : 1243
Reputation : 105
Language : English
Location : Mumbai, India

http://freetest.forumotion.net/

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by E-Mark on April 3rd 2013, 7:21 pm

@akbarmaulana wrote:it's work, but the avatar isn't showing
What do you mean? It should work, can you please post a screenshot referring to your problem? Hello

@Rhino.Freak wrote:
@Sanket wrote:
@Rhino.Freak wrote:hmm I also need one for Invision, if anyone has..
Not possible for invision in my opinion.

i have started to hate invision now , meh.. anyways no problem
Use PunBB, simple, easy to use, can edit template, and almost all of the codes can be applied on it. Razz

E-Mark
Active Poster

Male Posts : 1389
Reputation : 164
Language : English, Tagalog
Location : Republic of the Philippines

http://coding-spot.darkbb.com/

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by akbarmaulana on April 4th 2013, 1:28 am

here is it

akbarmaulana
Forumember

Posts : 140
Reputation : 1
Language : Indonesian

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by SLGray on April 4th 2013, 3:28 am

I see avatars. Does the members who have posted have different avatars?


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


SLGray
Administrator
Administrator

Male Posts : 35661
Reputation : 2375
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by E-Mark on April 4th 2013, 7:14 am

This will be the default image for those who doesn't have avatars:

E-Mark
Active Poster

Male Posts : 1389
Reputation : 164
Language : English, Tagalog
Location : Republic of the Philippines

http://coding-spot.darkbb.com/

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by akbarmaulana on April 4th 2013, 8:06 am

@E-Mark wrote:This will be the default image for those who doesn't have avatars:

but the member have avatar

akbarmaulana
Forumember

Posts : 140
Reputation : 1
Language : Indonesian

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by E-Mark on April 4th 2013, 8:15 am

Ok wait. Can you enable the chatbox so we can talk.

E-Mark
Active Poster

Male Posts : 1389
Reputation : 164
Language : English, Tagalog
Location : Republic of the Philippines

http://coding-spot.darkbb.com/

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by akbarmaulana on April 4th 2013, 8:23 am

@E-Mark wrote:Ok wait. Can you enable the chatbox so we can talk.

ok, done

akbarmaulana
Forumember

Posts : 140
Reputation : 1
Language : Indonesian

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by E-Mark on April 4th 2013, 9:44 am

Hi,

Go to ACP > Display > Templates > General > index_box > (Find this part):
Code:
                  <td class="tcr">
                      <div class="avs"><span>
      <!-- BEGIN switch_topic_title -->
      <a href="{catrow.forumrow.U_LATEST_TOPIC}" title="{catrow.forumrow.LATEST_TOPIC_TITLE}">{catrow.forumrow.LATEST_TOPIC_NAME}</a><br />
      <!-- END switch_topic_title -->
      {catrow.forumrow.USER_LAST_POST}
      </span></div>
                  </td>

Replace it with this one:
Code:
                  <td class="tcr">
                      <span>
      <!-- BEGIN switch_topic_title -->
      <a href="{catrow.forumrow.U_LATEST_TOPIC}" title="{catrow.forumrow.LATEST_TOPIC_TITLE}">{catrow.forumrow.LATEST_TOPIC_NAME}</a><br />
      <!-- END switch_topic_title -->
      {catrow.forumrow.USER_LAST_POST}
      </span>
                  </td>

Removing the div tag will make the code work now Hello.

E-Mark
Active Poster

Male Posts : 1389
Reputation : 164
Language : English, Tagalog
Location : Republic of the Philippines

http://coding-spot.darkbb.com/

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by akbarmaulana on April 4th 2013, 9:50 am

@E-Mark wrote:Hi,

Go to ACP > Display > Templates > General > index_box > (Find this part):
Code:
                  <td class="tcr">
                      <div class="avs"><span>
      <!-- BEGIN switch_topic_title -->
      <a href="{catrow.forumrow.U_LATEST_TOPIC}" title="{catrow.forumrow.LATEST_TOPIC_TITLE}">{catrow.forumrow.LATEST_TOPIC_NAME}</a><br />
      <!-- END switch_topic_title -->
      {catrow.forumrow.USER_LAST_POST}
      </span></div>
                  </td>

Replace it with this one:
Code:
                  <td class="tcr">
                      <span>
      <!-- BEGIN switch_topic_title -->
      <a href="{catrow.forumrow.U_LATEST_TOPIC}" title="{catrow.forumrow.LATEST_TOPIC_TITLE}">{catrow.forumrow.LATEST_TOPIC_NAME}</a><br />
      <!-- END switch_topic_title -->
      {catrow.forumrow.USER_LAST_POST}
      </span>
                  </td>

Removing the div tag will make the code work now Hello.

thank you very much about your help,
it's now solved Very Happy

akbarmaulana
Forumember

Posts : 140
Reputation : 1
Language : Indonesian

Back to top Go down

Solved Re: how to make avatar in topic list?

Post by Jophy on April 4th 2013, 9:53 am

Topic Solved & Locked

Jophy
ForumGuru

Male Posts : 17924
Reputation : 835
Language : English
Location : Somewhere

Back to top Go down

View previous topic View next topic Back to top


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