View Single Post
  #1  
Old 02-14-2015, 12:34 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default look over my code please avatars not displaying correctly

so i managed to get the userids so now im converting them to their avatar.
this code is partially working and i have been toying with it for hours with no success. this is the closest i've come in making this work.

*side note* im not too good with php*

heres the code i came up with after hours of digging (i know... hours, yeah pathetic)
oh and this is on forumbit_display
Code:
$lastpname = $lastpostinfo[lastposter];
$getlastpname = $vbulletin->db->query_first("SELECT userid FROM ". TABLE_PREFIX ."user WHERE username = \"$lastpname\"");   
$lastpid = $getlastpname['userid'];

require_once('./includes/functions_user.php');
$lastpavurl = fetch_avatar_url($vbulletin->userinfo['userid']);
if (!($lastpav)){
	$lastpav = "<img src='http://3.bp.blogspot.com/-mg71OkrgNhY/Uv9zeCV4IsI/AAAAAAAABbc/zqOph-wGgpc/s1600/Batman_avatar-e1263852269689.jpg' />";
}
else{
	$lastpav = "<a href='member.php?u=$lastpid'><img src='image.php?u=$lastpid' alt='$lastpname Profile'></a>";
}
and heres what the results are looking like


so the batman (default image) is posted where 1. there are no threads and 2. when a user doesn't have an avatar as you can see in the SS (or live on my site, in my sig) the image is not appearing in the user with no avatar, nor the last forum with no post.


viewing the source i see
Code:
<img src="http://dirtrif.com/avatars/drbot.gif" alt="DrBot" s="" profile="" title="DrBot">
which.. i mean makes since, but it should be the default image, then for that last one i see:
Code:
<img src="http://dirtrif.com/" alt="" s="" profile="">
which makes no since to me, and should be grabbing the default (batman) image

so im lost and thought id ask for help =)

and happy valentines day everyone
Attached Images
File Type: png Capture.PNG (110.2 KB, 0 views)
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03195 seconds
  • Memory Usage 1,786KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_attachment
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete