The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
Quote:
Code:
Database error in vBulletin 3.8.8: Invalid SQL: SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline, customavatar.width, customavatar.height, customavatar.width_thumb, customavatar.height_thumb FROM user AS user LEFT JOIN avatar AS avatar ON avatar.avatarid = user.avatarid LEFT JOIN customavatar AS customavatar ON customavatar.userid = user.userid WHERE user.userid =; MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6 Error Number : 1064 Request Date : Saturday, February 14th 2015 @ 08:04:33 PM Error Date : Saturday, February 14th 2015 @ 08:04:34 PM Script : http://dirtrif.com/ Referrer : http://dirtrif.com/news-announcements/1-dirt-rif-resurrected.html IP Address : 68.61.******* Username : DrCustUmz Classname : vB_Database MySQL Version : 5.5.40-cll the thing that gets me most is why is it pulling the data (you can see in the dump on my site) for that last forum yet in the last forum box it wont display =/ also i will add an avatar to the test account just so you can see it working correctly (last poster avatar wise) still would like the if no avatar display default img to work though. ok so after adding the avatar to the test account, the avatar does appear correctly no matter what account / browser im on or even logged off, but i noticed in that echo dump dave had me add, it's not showing the test accounts avatar..... |
#12
|
|||
|
|||
OK, I think I might see what's happening. The reason you're seeing the test account avatar is because the html has ?u=$lastpid. But I think what you want to do is check $lastpid before calling fetch_avatar_path(), like maybe:
PHP Code:
|
#13
|
||||
|
||||
Quote:
that did it and i havent noticed any errors, you rock Kevin happy valentines day! btw i didnt just copy and paste that, i compared it to mine, took in my mistakes and learned from them (damn if statement lol) so thanks and i learned quite a bit tinkering with this what seemed to be simple addition =) side note* if user doesnt have avatar set, it doesnt display the default image, like i have said i can get around it with forced avatars, but would rather have this working fully.... if its possible lol. i have looked at some other avatar mods, but what i came up with was the best i could do |
#14
|
|||
|
|||
Hmm...I don't understand why that is, because it looks like fetch_avatar_url should return an empty string in that case. Maybe you can vardump() some things and see what's happening. What does the html look like if the user has no avatar set?
|
#15
|
||||
|
||||
ok so i've had some time to rest, and figure out whats actually going on in this script so heres what i found out (this is with the code from post #12)
if guest (obviously no avatar set) (my account) with avatar set Broken images pointing to: Code:
<img src="http://dirtrif.com/avatars/drbot.gif" alt="DrBot Profile" title="DrBot Profile"> *same as the first image* (test user and my account has an avatar) with test account avatar set without test account avatar set *same as the first image* (test user and my account has no avatar) with test account avatar set Broken images pointing to: Code:
<img src="http://dirtrif.com/avatars/drcustumz.gif" alt="DrCustUmz Profile" title="DrCustUmz Profile"> *same as the first image* so in summery, it looks like if the user is logged in, and has an avatar set it works 100%, but if logged in user doesnt set an avatar then they will see batman for everyone. and if logged in user has an avatar and another user doesnt have an avatar and happens to be the last poster. instead of being the default img, its just a broken img so even though i thought this was done... it looks like its still has some work to be done. still alot further then anywhere i was with it =) |
#16
|
||||
|
||||
i made that default img a smaller img (for easier testing) enabled the debug above the if condition and made a test account for anyone to see whats going on, oh and removed the big under construction overlay cause yall probally thought that was annoying lol (the point of it)
i have printed Code:
<td class="forum bordl"> <a class="forumh_cat" href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><b>$forum[title]</b></a> <br /> $lastpav -lastpav <br /> $lastpavurl - lastpavur <br /> $lastpid - lastpid <br /> $getlastpname - lastpname <br /> </td> and have made a test account for anyone wanting to tinker with this to get a hands on (ahh i see whats going on kinda feel) Code:
username: test password: 123 feel free to post give him an avatar or w/e to see what hapens. --------------- Added [DATE]1424001841[/DATE] at [TIME]1424001841[/TIME] --------------- sry for the trip posts, but i havent touched this code since yesterday, the code still stands as it did in post #12 and i cant believe i didnt notice it sooner but in forum categorie's it returns an error. and yes im sure its this plugin. --------------- Added [DATE]1424004452[/DATE] at [TIME]1424004452[/TIME] --------------- another bump* i was looking over the code used in postbit and looking over the tables in the DB heres one thing i noticed: if the user has set their avatar, it creates a row for them in the table customavatar. so what i need is an if condition saying if lastpid is in customavatar table then show avatar, else show default. i started messing around with this, with no luck no matter what variation i tried. looking at the function_user file and i came up with Code:
fetch_avatar_url($vbulletin->customavatar['lastpid']); --------------- Added [DATE]1424004661[/DATE] at [TIME]1424004661[/TIME] --------------- heres how my code (kind of working) stands to this point Code:
require_once('./includes/functions_user.php'); $lastpname = $lastpostinfo[lastposter]; $getlastpname = $vbulletin->db->query_first("SELECT userid FROM ". TABLE_PREFIX ."user WHERE username = \"$lastpname\""); $lastpid = $getlastpname['userid']; var_dump($getlastpname); echo '<br>'; if ($lastpid) { $lastpavurl = fetch_avatar_url($vbulletin->userinfo['userid']); } else { $lastpavurl = ''; } if ($lastpavurl==''){ $lastpav = "<img src='http://images.fanpop.com/images/image_uploads/Batman-avatar-batman-233977_100_100.jpg' />"; } else{ $lastpav = "<a href='member.php?u=$lastpid'><img src='image.php?u=$lastpid' alt='$lastpname Profile'></a>"; } Code:
var_dump($getlastpname); echo '<br>'; --------------- Added [DATE]1424006931[/DATE] at [TIME]1424006931[/TIME] --------------- another update i came up with this garbage (which doesnt work at all) but maybe just maybe it will help someone in helping me lol Code:
require_once('./includes/functions_user.php'); $lastpname = $lastpostinfo[lastposter]; $getlastpname = $vbulletin->db->query_first("SELECT userid FROM ". TABLE_PREFIX ."user WHERE username = \"$lastpname\""); $lastpid = $getlastpname['userid']; $avatarinfo = $vbulletin->db->query_first_slave("SELECT user.avatarid FROM " . TABLE_PREFIX . "user AS user LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON avatar.avatarid = user.avatarid LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON customavatar.userid = user.userid WHERE user.userid = \"$lastpid\""); var_dump($avatarinfo); echo '<br>'; if (!empty($avatarinfo)) { $lastpavurl = fetch_avatar_url($vbulletin->userinfo['userid']); } else { $lastpavurl = ''; } if ($lastpavurl==''){ $lastpav = "<img src='http://images.fanpop.com/images/image_uploads/Batman-avatar-batman-233977_100_100.jpg' />"; } else{ $lastpav = "<a href='member.php?u=$lastpid'><img src='image.php?u=$lastpid' alt='$lastpname Profile'></a>"; } am i thinking about this the right way? is that a good start? wasnt there a plugin that already did this lmao. --------------- Added [DATE]1424007806[/DATE] at [TIME]1424007806[/TIME] --------------- well shit -_- https://vborg.vbsupport.ru/showthread.php?t=269031 and html/css is what im pro with, so adapting it would be no issue BUT BUT BUT! i would still like to get this functional (its end result would be the same) but the method completly different, and this is more of a learning curve for me, so it is something i would like to finish since i (we) started just to be able to say it was completed. |
#17
|
||||
|
||||
Don't use that mod you posted above until you figure out yours first - else you won't have learned anything imho .
+1 to kh99 and +1 to Dave for helping! |
3 благодарности(ей) от: | ||
blind-eddie, Dr.CustUmz, Max Taxable |
#18
|
||||
|
||||
kind of past that point lol, but its not on my live site =)
I would LOVE to get this working (even took a look at the guts of the mod i mentioned) but I'm still lost =/ |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|