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.

Avatars in the last topic #2

View previous topic View next topic Go down

Solved Avatars in the last topic #2

Post by Luffy on November 25th 2013, 9:19 pm

All the story:

When i have this in my templates it works fine:
Index_Box Template:
Code:
<!-- BEGIN catrow -->
   <!-- BEGIN tablehead -->
      <div class="main-head">
         <div class="page-title">{catrow.tablehead.L_FORUM}</div>
      </div>
      <div class="main-content">
         <table cellspacing="0" class="table">
            <thead>
               <tr>
                  <th class="tcl"></th>
                                          <th class="tc2"><div class="sthlh"><b>Στατιστικά</b></div></th>
                  
                                          <th class="tcr"><center><b>Tελευταία Απάντηση</b></center></th>
               </tr>
            </thead>
            <tbody class="statused">
   <!-- END tablehead -->

   <!-- BEGIN forumrow -->
               <tr>
                  <td class="tcl" width="450px" style="padding-right: {catrow.forumrow.INC_LEVEL_RIGHT}; padding-left: {catrow.forumrow.INC_LEVEL_LEFT};">
                     <span class="status" style="margin-right: -{catrow.forumrow.INC_WIDTH_ICON}; margin-left: -{catrow.forumrow.INC_WIDTH_ICON};">
                        <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
                     </span>
                     <h{catrow.forumrow.LEVEL} class="hierarchy"><a href="{catrow.forumrow.U_VIEWFORUM}" class="forumtitle">{catrow.forumrow.FORUM_NAME}</a></h{catrow.forumrow.LEVEL}>
                     <br />
                     <div class="descript"><span class="genmed">{catrow.forumrow.FORUM_DESC}</span></div>
        <div class="subforums"><span class="gensmall">
            <!-- BEGIN switch_moderators_links -->
            {catrow.forumrow.switch_moderators_links.L_MODERATOR}{catrow.forumrow.switch_moderators_links.MODERATORS}
            <!-- END switch_moderators_links -->
            {catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}
        </span></div>
                     <strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}
                  </td>
                  <td class="tc2" align="center" valign="middle" height="50" width="200">
                                                  <span class="gensmall"><b>Θέματα :</b> {catrow.forumrow.TOPICS}<div class="apantiseisthemata">Απαντήσεις :</div> {catrow.forumrow.POSTS}</span>
    </td>
                  <td class="tcr" align="right" valign="right">
                     <span><center>
                     <!-- 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}
                                                          </center></span>
                  </td>
               </tr>
   <!-- END forumrow -->

   <!-- BEGIN tablefoot -->
            </tbody>
         </table>
      </div>
   <!-- END tablefoot -->
<!-- END catrow -->

Javascript:
Code:
$(document).on('ready', function() {
            $('.statused td.tcr').prepend('<div class="avatar-index"><div>');
            $('.statused td.tcr .avatar-index').each(function () {
                var profileUser = $(this).parent().children('span').children('center').children('strong').children('a').attr('href');
                $(this).html('<a href="' + profileUser + '" class="avatar-index-enlace"><img src="http://cdn1.iconfinder.com/data/icons/basicset/user_64.png" alt="No Avatar" /></a>');
                $(this).children('a').load(profileUser + '#profile-advanced-right .main-content.clearfix.center img:eq(0)');
            });
        });

CSS:
Code:
.avatar-index {
  float: left;
}
.avatar-index img {
  width: 42px;
  height: 42px;
  padding: 1px;
  border: 2px solid #e8e8e8;
box-shadow:inset 0 0 7px #001C7A;
  margin: 0 5px;

}


What i did is to change the template into this:
NEW Index_Box Template:
Code:
<!-- BEGIN catrow -->
   <!-- BEGIN tablehead -->
      <div class="main-head">
         <div class="page-title">{catrow.tablehead.L_FORUM}</div>
      </div>
      <div class="main-content">
         <table cellspacing="0" class="table">
            <thead>
               <tr>
                                          <th class="tcl"></th>
                                         
                                       
                  
                                     
               </tr>
            </thead>
            <tbody class="statused">
   <!-- END tablehead -->

   <!-- BEGIN forumrow -->
               <tr>
                  <td class="tcl" width="450px" style="padding-right: {catrow.forumrow.INC_LEVEL_RIGHT}; padding-left: {catrow.forumrow.INC_LEVEL_LEFT};">
                     <span class="status" style="margin-right: -{catrow.forumrow.INC_WIDTH_ICON}; margin-left: -{catrow.forumrow.INC_WIDTH_ICON};">
                        <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
                     </span>
                     <h{catrow.forumrow.LEVEL} class="hierarchy"><a href="{catrow.forumrow.U_VIEWFORUM}" class="forumtitle">{catrow.forumrow.FORUM_NAME}</a></h{catrow.forumrow.LEVEL}>
                     <br />
                     <div class="descript"><span class="genmed">{catrow.forumrow.FORUM_DESC}</span></div>
        <div class="subforums"><span class="gensmall">
            <!-- BEGIN switch_moderators_links -->
            {catrow.forumrow.switch_moderators_links.L_MODERATOR}{catrow.forumrow.switch_moderators_links.MODERATORS}
            <!-- END switch_moderators_links -->
            {catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}
        </span></div>
                                                 
                                                  <div class="thematakouti"><center><b>Θέμ. :</b> {catrow.forumrow.TOPICS}</center></div><div class="apantiseiskouti"><center>Απ. : {catrow.forumrow.POSTS}</center></div>
                                                <center>
                     <!-- BEGIN switch_topic_title -->
                                                  <div class="themataforum"><a href="{catrow.forumrow.U_LATEST_TOPIC}" title="{catrow.forumrow.LATEST_TOPIC_TITLE}">{catrow.forumrow.LATEST_TOPIC_NAME}</a><br />
                                                  {catrow.forumrow.USER_LAST_POST}</div>
                                                 
                     <!-- END switch_topic_title -->
                     
                                                          </center>
                     <strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}
                  


   
                  
               </tr>
   <!-- END forumrow -->

   <!-- BEGIN tablefoot -->
            </tbody>
         </table>
      </div>
   <!-- END tablefoot -->
<!-- END catrow -->

And i added to the CSS this:
CSS:
Code:
.themataforum {
    border: 1px solid #cccacc;
padding: 3px 7px;
background: #FAFAFA;
color: #616161;
box-shadow: inset 0 0 5px #1f537b;
border-radius: 4px;
position:absolute;
  margin:-37px 0px 0px 700px;
font-size:12px;
  width:230px;
  height:50px;
}

So it would look like this:


And now i want to add the avatar of the last topic in the box next to the info of the last topic.. How can i do this?

Version: PunBB

Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Avatars in the last topic #2

Post by Ange Tuteur on November 25th 2013, 9:29 pm

If you make changes to the template in that area you will have to expect it to not work.

Please try this and see if it works:
Code:
    $(document).on('ready', function() {
                $('.themataforum').prepend('<div class="avatar-index"><div>');
                $('.themataforum .avatar-index').each(function () {
                    var profileUser = $(this).parent().children('strong').children('a').attr('href');
                    $(this).html('<a href="' + profileUser + '" class="avatar-index-enlace"><img src="http://cdn1.iconfinder.com/data/icons/basicset/user_64.png" alt="No Avatar" /></a>');
                    $(this).children('a').load(profileUser + '#profile-advanced-right .main-content.clearfix.center img:eq(0)');
                });
            });

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Avatars in the last topic #2

Post by Luffy on November 25th 2013, 9:35 pm

I knew it wouldn't show it but i thought it was the column the problem!!

Anyway!! Seth u r the best!!! I love you I love you 

All the thanks of the world i give you!!!

SOOOOLVED!!! Very Happy






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Avatars in the last topic #2

Post by Ange Tuteur on November 25th 2013, 9:48 pm

You're welcome I love you

Topic Solved and Archived

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

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