The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Profile Pic used on other vBulletin pages
Does anyone know how to display the profile picture in other places on your forums? I've added the code from the modifyprofilepic template to my usercp_shell template, but it only works when you load the Edit Profile Pic page.
I'd like it to load in usercp_shell. I'm guessing that it is calling for some variable(s) that usercp.php doesn't load but profile.php does. I've looked through profile.php for the code to load these variables but have come up short. I'd be grateful to anyone who knows how I might go about doing this. |
#2
|
||||
|
||||
Perhaps I should put the code in here for people to look at.
I added this code to usercp_shell: Code:
<tr class="alt2"> <if condition="!$show['profilepic']"> <td class="alt1" style="border:1px inset; padding:$stylevar[cellpadding]px"> <span class="smallfont">$vbphrase[no_profile_picture]</span> </td> <else /> <td class="smallfont"> <img src="$bbuserinfo[profileurl]" alt="$vbphrase[your_profile_picture]" border="0" /> </td> </if> </tr> Problem #2: I temporarily removed the surrounding IF statement from the code that calls the profile picture to see if it the IF statement was the only problem, but sadly it is not. The variable provides no ouput even without being wrapped in the IF statement. Anyone have any suggestions? --------------- Added [DATE]1228186250[/DATE] at [TIME]1228186250[/TIME] --------------- Nevermind, I got it. For anyone who's interested in doing this... Create a new plug in called Profile Pic in User CP and set it to the usercp_start hook with the following code: Code:
// ########################## EDIT PROFILE PICTURE ############################ // ############################################################################ { ($hook = vBulletinHook::fetch_hook('profile_editprofilepic')) ? eval($hook) : false; if ($vbulletin->options['profilepicenabled'] AND ($permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canprofilepic'])) { if ($profilepic = $db->query_first(" SELECT userid, dateline, height, width FROM " . TABLE_PREFIX . "customprofilepic WHERE userid = " . $vbulletin->userinfo['userid'] )) { if ($vbulletin->options['usefileavatar']) { $vbulletin->userinfo['profileurl'] = $vbulletin->options['profilepicurl'] . '/profilepic' . $vbulletin->userinfo['userid'] . '_' . $vbulletin->userinfo['profilepicrevision'] . '.gif'; } else { $vbulletin->userinfo['profileurl'] = 'image.php?' . $vbulletin->session->vars['sessionurl'] . 'u=' . $vbulletin->userinfo['userid'] . "&dateline=$profilepic[dateline]&type=profile"; } if ($profilepic['width'] AND $profilepic['height']) { $vbulletin->userinfo['profileurl'] .= "\" width=\"$profilepic[width]\" height=\"$profilepic[height]"; } $show['profilepic'] = true; } $permissions['profilepicmaxsize'] = vb_number_format($permissions['profilepicmaxsize'], 1, true); $maxnote = ''; if ($permissions['profilepicmaxsize'] AND ($permissions['profilepicmaxwidth'] OR $permissions['profilepicmaxheight'])) { $maxnote = construct_phrase($vbphrase['note_maximum_size_x_y_or_z'], $permissions['profilepicmaxwidth'], $permissions['profilepicmaxheight'], $permissions['profilepicmaxsize']); } else if ($permissions['profilepicmaxsize']) { $maxnote = construct_phrase($vbphrase['note_maximum_size_x'], $permissions['profilepicmaxsize']); } else if ($permissions['profilepicmaxwidth'] OR $permissions['profilepicmaxheight']) { $maxnote = construct_phrase($vbphrase['note_maximum_size_x_y_pixels'], $permissions['profilepicmaxwidth'], $permissions['profilepicmaxheight']); } $show['maxnote'] = (!empty($maxnote)) ? true : false; $show['profilepic_url'] = (ini_get('allow_url_fopen') != 0 OR function_exists('curl_init')); // draw cp nav bar construct_usercp_nav('profilepic'); $navbits[''] = $vbphrase['edit_profile_picture']; $templatename = 'modifyprofilepic'; } else { print_no_permission(); } } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|