$userdata->save(); unset($userdata); } if ($vbulletin->GPC['resize']) { if ($userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canprofilepic']) { $upload->maxwidth = $userinfo['permissions']['profilepicmaxwidth']; $upload->maxheight = $userinfo['permissions']['profilepicmaxheight']; #$upload->maxuploadsize = $userinfo['permissions']['profilepicmaxsize']; #$upload->allowanimation = ($userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cananimateprofilepic']) ? true : false; } } if (!$upload->process_upload($vbulletin->GPC['profilepicurl'])) { print_stop_message2(array('there_were_errors_encountered_with_your_upload_x', $upload->fetch_error())); } } else { $userpic = new vB_Datamanager_Userpic_Profilepic($vbulletin, vB_DataManager_Constants::ERRTYPE_CP, 'userpic'); $userpic->condition = array(array('field' => 'userid', 'value' => $userinfo['userid'], 'operator' => vB_dB_Query::OPERATOR_EQ)); $userpic->delete(); } print_stop_message2('saved_profile_picture_successfully', 'user', array('do' => 'edit', 'u' => $userinfo['userid'])); } // ###################### Start modify Signature Pic ########### if ($_REQUEST['do'] == 'sigpic') { $userinfo = vB_User::fetchUserinfo($vbulletin->GPC['userid'], array(vB_Api_User::USERINFO_SIGNPIC)); if (!$userinfo) { print_stop_message2('invalid_user_specified'); } if ($userinfo['sigpicwidth'] and $userinfo['sigpicheight']) { $size = " width=\"{$userinfo['sigpicwidth']}\" height=\"{$userinfo['sigpicheight']}\" "; } print_form_header('usertools', 'updatesigpic', 1);
$thumbpath = $vbulletin->options['avatarpath'] . "/thumbs/{$image['afilename']}"; chdir(DIR); $filedata = @file_get_contents($path); if ($filedata) { $userpic = new vB_Datamanager_Userpic_Avatar($vbulletin, vB_DataManager_Constants::ERRTYPE_CP, 'userpic'); $userpic->set_existing($image); $userpic->setr('filedata', $filedata); $userpic->save(); unset($userpic); } } if (!empty($image['pfilename'])) { $path = $vbulletin->options['profilepicpath'] . "/profilepic{$image['userid']}_{$image['profilepicrevision']}.gif"; $filedata = @file_get_contents($path); if ($filedata) { $userpic = new vB_Datamanager_Userpic_Profilepic($vbulletin, vB_DataManager_Constants::ERRTYPE_CP, 'userpic'); $userpic->set_existing($image); $userpic->setr('filedata', $filedata); $userpic->save(); unset($userpic); } } if (!empty($image['sfilename'])) { $path = $vbulletin->options['sigpicpath'] . "/sigpic{$image['userid']}_{$image['sigpicrevision']}.gif"; $filedata = @file_get_contents($path); if ($filedata) { $userpic = new vB_Datamanager_Userpic_Sigpic($vbulletin, vB_DataManager_Constants::ERRTYPE_CP, 'userpic'); $userpic->set_existing($image); $userpic->setr('filedata', $filedata); $userpic->save(); unset($userpic);