vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Last post avatar (https://vborg.vbsupport.ru/showthread.php?t=266326)

sadiq6210 07-05-2011 06:31 PM

Last post avatar
 
We have this mod.
https://vborg.vbsupport.ru/showthread.php?t=240021

Can you help us to display the avatar of last post in forumhome ?
something like IPB
http://community.invisionpower.com/

TheLastSuperman 07-05-2011 08:10 PM

Quote:

Originally Posted by sadiq6210 (Post 2217128)
We have this mod.
https://vborg.vbsupport.ru/showthread.php?t=240021

Can you help us to display the avatar of last post in forumhome ?
something like IPB
http://community.invisionpower.com/

You don't need a mod for this ;)

Edit Template: forumhome_lastpostby

Find this code (it's the very first snippet of code at the top of the template fyi):
Code:

<vb:if condition="$show['lastpostinfo']">
Add below:
Code:

<img src="{vb:raw vboptions.bburl}/image.php?{vb:raw session.sessionurl}u={vb:raw lastpostinfo.lastposterid}&amp;type=thumb&amp;quality=100" alt="Avatar" class="post_avatar" style="float:left;margin-right:10px;"/>
And save, refresh to view the users Avatar to the left of the lastpostinfo on forumhome :D.

Feel free to adjust the style= part or create your own custom CSS definition to replace the class etc ;).

If you want to add the users avatar to your CMS you can use a similar code so show the users Avatars on the CMS main for the article previews and then in the actual articles themselves too and that does not require a plugin either, I have seen these plugins but if you reference the correct variables you can do it w/o :cool:.

Edit: For RTL Language Users please use:

Code:

<img src="{vb:raw vboptions.bburl}/image.php?{vb:raw session.sessionurl}u={vb:raw lastpostinfo.lastposterid}&amp;type=thumb&amp;quality=100" alt="Avatar" class="post_avatar" style="float:<vb:if condition="$stylevar['textdirection'] == 'rtl'">right<vb:else />left</vb:if>;margin-<vb:if condition="$stylevar['textdirection'] == 'rtl'">left<vb:else />right</vb:if>:10px;"/>

sadiq6210 07-07-2011 08:19 AM

Thanks brother ^_^ you are the best

I modified the template but nothing appear? :(

This is my template:

Code:

<vb:if condition="$show['lastpostinfo']">

<img src="{vb:raw vboptions.bburl}/image.php?{vb:raw session.sessionurl}u={vb:raw lastpostinfo.lastposterid}&amp;type=thumb&amp;quality=100" alt="Avatar" class="post_avatar" style="float:left;margin-right:10px;"/>



        <p class="lastposttitle">
        <vb:if condition="$show['icon']"><img src="{vb:raw icon.iconpath}" alt="{vb:raw icon.title}" border="0" /></vb:if>
        <vb:if condition="$lastpostinfo['prefix']">{vb:raw lastpostinfo.prefix}</vb:if>
        <a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_newpost}}" class="threadtitle" title="{vb:rawphrase go_first_unread_in_thread_x, {vb:raw lastpostinfo.lastthread}}">{vb:raw lastpostinfo.trimthread}</a>
        <a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_lastpost}}#post{vb:raw lastpostinfo.lastpostid}"><img src="{vb:stylevar imgdir_button}/lastpost-{vb:stylevar right}.png" alt="{vb:rawphrase go_to_last_post}" /></a>
        </p>
        <div class="lastpostby">
        <vb:if condition="$lastpostinfo['lastposterid']">
                {vb:rawphrase by_x_memberaction, {vb:raw memberaction_dropdown}}
        <vb:else />
                {vb:rawphrase by_x_guest, {vb:raw lastpostinfo.lastposter}}
        </vb:if>
        </div>
        <p class="lastpostdate">{vb:raw lastpostinfo.lastpostdate}<vb:if condition="!$show['detailedtime']">, <span class="time">{vb:raw lastpostinfo.lastposttime}</span></vb:if></p>
<vb:else />
        <span class="lastpostdate">{vb:raw lastpostinfo.lastpostdate} <vb:if condition="!$show['detailedtime']"><span class="time">{vb:raw lastpostinfo.lastposttime}</span></vb:if></span>
        <a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_lastpost}}#post{vb:raw lastpostinfo.lastpostid}"><img src="{vb:stylevar imgdir_button}/lastpost-{vb:stylevar right}.png" alt="{vb:rawphrase go_to_last_post}" /></a>
</vb:if>


Nothing changed after refresh the page !
Appreciate your support

TheLastSuperman 07-07-2011 03:20 PM

Quote:

Originally Posted by sadiq6210 (Post 2217705)
Thanks brother ^_^ you are the best

I modified the template but nothing appear? :(

This is my template:

Code:

<vb:if condition="$show['lastpostinfo']">

<img src="{vb:raw vboptions.bburl}/image.php?{vb:raw session.sessionurl}u={vb:raw lastpostinfo.lastposterid}&amp;type=thumb&amp;quality=100" alt="Avatar" class="post_avatar" style="float:left;margin-right:10px;"/>



        <p class="lastposttitle">
        <vb:if condition="$show['icon']"><img src="{vb:raw icon.iconpath}" alt="{vb:raw icon.title}" border="0" /></vb:if>
        <vb:if condition="$lastpostinfo['prefix']">{vb:raw lastpostinfo.prefix}</vb:if>
        <a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_newpost}}" class="threadtitle" title="{vb:rawphrase go_first_unread_in_thread_x, {vb:raw lastpostinfo.lastthread}}">{vb:raw lastpostinfo.trimthread}</a>
        <a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_lastpost}}#post{vb:raw lastpostinfo.lastpostid}"><img src="{vb:stylevar imgdir_button}/lastpost-{vb:stylevar right}.png" alt="{vb:rawphrase go_to_last_post}" /></a>
        </p>
        <div class="lastpostby">
        <vb:if condition="$lastpostinfo['lastposterid']">
                {vb:rawphrase by_x_memberaction, {vb:raw memberaction_dropdown}}
        <vb:else />
                {vb:rawphrase by_x_guest, {vb:raw lastpostinfo.lastposter}}
        </vb:if>
        </div>
        <p class="lastpostdate">{vb:raw lastpostinfo.lastpostdate}<vb:if condition="!$show['detailedtime']">, <span class="time">{vb:raw lastpostinfo.lastposttime}</span></vb:if></p>
<vb:else />
        <span class="lastpostdate">{vb:raw lastpostinfo.lastpostdate} <vb:if condition="!$show['detailedtime']"><span class="time">{vb:raw lastpostinfo.lastposttime}</span></vb:if></span>
        <a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_lastpost}}#post{vb:raw lastpostinfo.lastpostid}"><img src="{vb:stylevar imgdir_button}/lastpost-{vb:stylevar right}.png" alt="{vb:rawphrase go_to_last_post}" /></a>
</vb:if>


Nothing changed after refresh the page !
Appreciate your support

Hmm I see it in 4.1.4 Test site just fine upon refresh... RTL Language?

If so try:

Code:

<img src="{vb:raw vboptions.bburl}/image.php?{vb:raw session.sessionurl}u={vb:raw lastpostinfo.lastposterid}&amp;type=thumb&amp;quality=100" alt="Avatar" class="post_avatar" style="float:<vb:if condition="$stylevar['textdirection'] == 'rtl'">right<vb:else />left</vb:if>;margin-<vb:if condition="$stylevar['textdirection'] == 'rtl'">left<vb:else />right</vb:if>:10px;"/>
Lemme know :D

sadiq6210 07-07-2011 05:28 PM

Strange, yes brother I am using RTL and nothing appeared in both CODES
Also, I tried to use EN-LTR and nothing appeared for both codes

Hmmm

I opened the page source in Firefox5, have a look

Code:

<div class="forumlastpost td">
                        <h4 class="lastpostlabel">Last Post:</h4>

                        <div>
                               

<img src="http://www.domain.com/forum/image.php?u=9379&amp;type=thumb&amp;quality=100" alt="Avatar" class="post_avatar" style="float:left;margin-right:10px;"/>



        <p class="lastposttitle">

where domain.com = my domain

Even I copy the direct link for avatar:
http://www.domain.com/forum/image.ph...mp;quality=100
OR
http://www.domain.com/forum/image.php?u=9379

It is not working !

Maybe because I am using files system to save the avatars in a folder not in database?
for example, this is a link for an exist avatar
http://www.domain.com/forum/avatar/c...avatar9115.gif

Thank you very very much =)

sadiq6210 07-09-2011 10:58 AM

Any idea? =)

TheLastSuperman 07-10-2011 02:15 AM

Quote:

Originally Posted by sadiq6210 (Post 2217856)
Maybe because I am using files system to save the avatars in a folder not in database?
for example, this is a link for an exist avatar
http://www.domain.com/forum/avatar/c...avatar9115.gif

That's exactly it I'm afraid, therefor you'll need to create a plugin using the parse_templates hook location to accomplish this.

K!nG 06-21-2013 03:30 AM

Hey @TheLastSuperman

Can you help me in fixing ths size of the avatars ?? They all in different sizes. I would like to have them in one single size.

Please see the image & thanks in advance for ur help.

http://img15.imageshack.us/img15/638/bpn1.png

yestyle 08-24-2013 05:37 AM

Quote:

<img src="{vb:raw vboptions.bburl}/image.php?{vb:raw session.sessionurl}u={vb:raw lastpostinfo.lastposterid}&amp;type=thumb&amp;qual ity=100" alt="Avatar" class="post_avatar" style="float:left;margin-right:10px;"/>
It showed avatar perfectly but in case members did not upload their avatar then It showed blank space. This very annoyed.
How to change blank space to default avatar. I really need this. Please share code

peugeot405 08-24-2013 10:42 AM

there is a mod for vb4 that does that:

Last Poster Avatar


All times are GMT. The time now is 08:44 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01223 seconds
  • Memory Usage 1,765KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete