Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define("IN_MYBB", 1);
- define('THIS_SCRIPT', 'signature.php');
- $nosession['avatar'] = 1;
- $templatelist = "member_register,error_nousername,error_nopassword,error_passwordmismatch,error_invalidemail,error_usernametaken,error_emailmismatch,error_noemail,redirect_registered,member_register_hiddencaptcha";
- $templatelist .= ",redirect_loggedout,login,redirect_loggedin,error_invalidusername,error_invalidpassword,member_profile_email,member_profile_offline,member_profile_reputation,member_profile_warn,member_profile_warninglevel,member_profile_customfields_field,member_profile_customfields,member_profile_adminoptions,member_profile,member_login,member_profile_online,member_profile_modoptions,member_profile_signature,member_profile_groupimage,member_profile_referrals";
- require_once "./global.php";
- require_once MYBB_ROOT."inc/functions_post.php";
- require_once MYBB_ROOT."inc/functions_user.php";
- require_once MYBB_ROOT."inc/class_parser.php";
- $parser = new postParser;
- // Load global language phrases
- $lang->load("member");
- if($mybb->input['uid'] == "lastposter")
- {
- if($mybb->input['tid'])
- {
- $query = $db->simple_select("posts", "uid", "tid='".intval($mybb->input['tid'])."' AND visible = 1", array('order_by' => 'dateline', 'order_dir' => 'DESC', 'limit' => '1'));
- $post = $db->fetch_array($query);
- $uid = $post['uid'];
- }
- elseif($mybb->input['fid'])
- {
- $flist = '';
- switch($db->type)
- {
- case "pgsql":
- case "sqlite":
- $query = $db->simple_select("forums", "fid", "INSTR(','||parentlist||',',',".intval($mybb->input['fid']).",') > 0");
- break;
- default:
- $query = $db->simple_select("forums", "fid", "INSTR(CONCAT(',',parentlist,','),',".intval($mybb->input['fid']).",') > 0");
- }
- while($forum = $db->fetch_array($query))
- {
- if($forum['fid'] == $mybb->input['fid'])
- {
- $theforum = $forum;
- }
- $flist .= ",".$forum['fid'];
- }
- $query = $db->simple_select("threads", "tid", "fid IN (0$flist) AND visible = 1", array('order_by' => 'lastpost', 'order_dir' => 'DESC', 'limit' => '1'));
- $thread = $db->fetch_array($query);
- $tid = $thread['tid'];
- $query = $db->simple_select("posts", "uid", "tid='$tid' AND visible = 1", array('order_by' => 'dateline', 'order_dir' => 'DESC', 'limit' => '1'));
- $post = $db->fetch_array($query);
- $uid = $post['uid'];
- }
- }
- else
- {
- if($mybb->input['uid'])
- {
- $uid = intval($mybb->input['uid']);
- }
- else
- {
- $uid = $mybb->user['uid'];
- }
- }
- if($mybb->user['uid'] != $uid)
- {
- $memprofile = get_user($uid);
- }
- else
- {
- $memprofile = $mybb->user;
- }
- $lang->profile = $lang->sprintf($lang->profile, $memprofile['username']);
- $nemakorisnika = 'ID korisnika koji ste unijeli je neispravan ili ne postoji u našoj bazi.';
- if(!$memprofile['uid'])
- {
- error($nemakorisnika);
- }
- if(!$memprofile['displaygroup'])
- {
- $memprofile['displaygroup'] = $memprofile['usergroup'];
- }
- $displaygroup = usergroup_displaygroup($memprofile['displaygroup']);
- unset($usertitle);
- if(trim($memprofile['usertitle']) != '')
- {
- // User has custom user title
- $usertitle = $memprofile['usertitle'];
- }
- elseif(trim($displaygroup['usertitle']) != '')
- {
- // User has group title
- $usertitle = $displaygroup['usertitle'];
- }
- else
- {
- // No usergroup title so get a default one
- $usertitles = $cache->read('usertitles');
- if(is_array($usertitles))
- {
- foreach($usertitles as $title)
- {
- if($memprofile['postnum'] >= $title['posts'])
- {
- $usertitle = $title['title'];
- }
- }
- }
- }
- $name = $memprofile['username'];
- $postcount = $memprofile['postnum'];
- $timeonline = nice_time($memprofile['timeonline']);
- $reputation = $memprofile['reputation'];
- $memlastvisitdate = my_date($mybb->settings['dateformat'], $memprofile['lastactive']);
- $memlastvisittime = my_date($mybb->settings['timeformat'], $memprofile['lastactive']);
- $my_img = imagecreatefrompng('sigbg.png');
- $avatar = $memprofile['avatar'];
- $avput = imagecreatefrompng($avatar);
- $background = imagecolorallocate( $my_img, 0, 0, 0 );
- $text_colour = imagecolorallocate( $my_img, 255, 255, 255 );
- imagestring( $my_img, 2, 25, 25, $name,
- $text_colour );
- imagestring( $my_img, 2, 25, 38, $usertitle,
- $text_colour );
- imagestring( $my_img, 2, 25, 51, $postcount,
- $text_colour );
- imagestring( $my_img, 2, 25, 64, $reputation,
- $text_colour );
- imagestring( $my_img, 2, 25, 77, $timeonline,
- $text_colour );
- imagestring( $my_img, 2, 25, 90,"$memlastvisitdate, $memlastvisittime",
- $text_colour );
- imagecopy($my_img, $avput, 260, 35, 0, 0, 80, 80);
- header( "Content-type: image/png" );
- imagepng( $my_img );
- imagecolordeallocate( $line_color );
- imagecolordeallocate( $text_color );
- imagecolordeallocate( $background );
- imagedestroy( $my_img );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement