![]() |
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. |
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. |
I got this to pick up the correct revision #:
PHP Code:
|
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).
|
Here is the query above it:
PHP Code:
|
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']) { |
Thanks, but that didn't do it, still trying...
|
What did happen? Did you get an error, or can you see what filename it was trying to load?
|
It was returning a "0" for all pic revisions.
Examples: /customprofilepics/profilepic1_0.gif /customprofilepics/profilepic48_0.gif |
Oh right - I had a close paren in the wrong place. I fixed the above code so I think it should work now.
|
All times are GMT. The time now is 07:21 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|