vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   $post[avatarurl] and avatar problem (https://vborg.vbsupport.ru/showthread.php?t=232433)

indotekken 01-07-2010 08:51 AM

$post[avatarurl] and avatar problem
 
Hi,

I'm trying to make plugin to show custom avatar.

i cut from template postbit:

Code:

<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
then make plugin to call .php files
Code:

if($show['avatar']){
                echo "<td class=\"alt2\"><a href=\"member.php?".$session[sessionurl]."u=".$post[userid]."\"><img src=\"".$post[avatarurl]."\" ".$post[avwidth]." ".$post[avheight]." alt=\"Avatar ".$post[username]."\" border=\"0\" /></a></td>";               
        }


The problem is $post[avatarurl] not showing right.
i manual echo $post[avatarurl] and the result it empty.

But it have result when i try echo $show['avatar'] or echo $post[userid]


Does anyone here know how to do the right way to have $post[avatarurl] with right value?


Thanks

Lynne 01-07-2010 02:19 PM

What hook location are you using for your plugin?

Also, please use the code tags, not the quote tags, when posting code.

indotekken 01-07-2010 03:41 PM

Quote:

Originally Posted by Lynne (Post 1949617)
What hook location are you using for your plugin?

Also, please use the code tags, not the quote tags, when posting code.

the hook is postbit_display_start

Lynne 01-07-2010 06:02 PM

Try postbit_display_complete

indotekken 01-08-2010 12:37 AM

Quote:

Originally Posted by Lynne (Post 1949800)
Try postbit_display_complete

Thanks for the tips.

Anyway, i've change the hook to postbit_display_complte, it still can't echo the value of $post[avatarurl]

Lynne 01-08-2010 01:33 AM

It works just fine for me. However, you do realize that using echo will just spit it out when the plugin is evaled, right? So you just end up with a bunch of avatars on the top of the page (did you look there? Or did you look in your source code for it?)


All times are GMT. The time now is 12:11 AM.

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.00987 seconds
  • Memory Usage 1,720KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete