The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Custom page showing profile pic, need "wildcard" reference for pic changes
I currently have a custom page showing user profile pics.
The code below is currently calling up the images without issue from the file system. PHP Code:
I'm just not experienced enough with php to know how to place a wildcard in that statement. Any help would be appreciated, thanks. |
#2
|
|||
|
|||
I think you want profilepicrevision from the user info. So something like:
Code:
$url = sprintf('customprofilepics/profilepic%d_%d.gif', $registration['Registration']['user_id'], $userinfo['profilepicrevision']); but I don't know if there's any $userinfo available so I'd be surprised if that worked as is. |
#3
|
||||
|
||||
I got this to pick up the correct revision #:
PHP Code:
|
#4
|
|||
|
|||
Yeah, $vbulletin->userinfo will always be you (or whoever's logged in). You need to get the profilepicrevision for each user in that $registration array. You could just do a query of the user table for each user, but if there's already a query being done to get that other info you might be able to add on to that (or maybe you've already got it in memory somewhere).
|
#5
|
||||
|
||||
Here is the query above it:
PHP Code:
|
#6
|
|||
|
|||
Maybe try this change (replaces the similar block of code from what you posted above):
Code:
if (($ppic = $GLOBALS['vbulletin']->db->query_first(sprintf('SELECT dateline, profilepicrevision FROM %1$scustomprofilepic AS customprofilepic LEFT JOIN %1$suser USING(userid) WHERE customprofilepic.userid = %2$d', TABLE_PREFIX, RollCalls::$vB_User_Id))) != null && $registration['Registration']['profile_picture'] && $registration['Registration']['user_id']) { $url = sprintf('customprofilepics/profilepic%d_%d.gif', $registration['Registration']['user_id'], $ppic['profilepicrevision']); } else { $url = 'images/misc/unknown.gif'; } |
#7
|
||||
|
||||
Thanks, but that didn't do it, still trying...
|
#8
|
|||
|
|||
What did happen? Did you get an error, or can you see what filename it was trying to load?
|
#9
|
||||
|
||||
It was returning a "0" for all pic revisions.
Examples: /customprofilepics/profilepic1_0.gif /customprofilepics/profilepic48_0.gif |
#10
|
|||
|
|||
Oh right - I had a close paren in the wrong place. I fixed the above code so I think it should work now.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|