diff -r de56132c008d -r bdac73ed481e includes/namespaces/user.php --- a/includes/namespaces/user.php Sun Mar 28 21:49:26 2010 -0400 +++ b/includes/namespaces/user.php Sun Mar 28 23:10:46 2010 -0400 @@ -13,463 +13,463 @@ class Namespace_User extends Namespace_Default { - public function __construct($page_id, $namespace, $revision_id = 0) - { - global $db, $session, $paths, $template, $plugins; // Common objects - global $lang; - - parent::__construct($page_id, $namespace, $revision_id); - - if ( ( $this->title == str_replace('_', ' ', $this->page_id) || $this->title == $paths->nslist['User'] . str_replace('_', ' ', $this->page_id) ) || !$this->exists ) - { - $this->title = $lang->get('userpage_page_title', array('username' => str_replace('_', ' ', dirtify_page_id($this->page_id)))); - $this->cdata['name'] = $this->title; - } - - } - - public function send() - { - global $db, $session, $paths, $template, $plugins; // Common objects - global $email; - global $lang, $output; - - /** - * PLUGGING INTO USER PAGES - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * Userpages are highly programmable and extendable using a number of - * hooks. These hooks are: - * - * - userpage_sidebar_left - * - userpage_sidebar_right - * - userpage_tabs_links - * - userpage_tabs_body - * - * You can add a variety of sections to user pages, including new tabs - * and new sections on the tables. To add a tab, attach to - * userpage_tabs_links and echo out: - * - *
  • YOUR TAB TEXT
  • - * - * Then hook into userpage_tabs_body and echo out: - * - *
    YOUR TAB CONTENT
    - * - * The userpage javascript runtime will take care of everything else, - * meaning transitions, click events, etc. Currently it's not possible - * to add custom click events to tabs, but any DOM-related JS that needs - * to run in your tab can be run onload and the effects will be seen when - * your tab is clicked. YOURTABID should be lowercase alphanumeric and - * have a short prefix so as to assure that it remains specific to your - * plugin. - * - * To hook into the "profile" tab, use userpage_sidebar_{left,right}. Just - * echo out table cells as normal. The table on the left (the wide one) has - * four columns, and the one on the right has one column. - * - * See plugins.php for a guide on creating and attaching to hooks. - */ - - $page_urlname = dirtify_page_id($this->page_id); - - $target_username = strtr($page_urlname, - Array( - '_' => ' ', - '<' => '<', - '>' => '>' - )); - - $target_username = preg_replace('/^' . str_replace('/', '\\/', preg_quote($paths->nslist['User'])) . '/', '', $target_username); - list($target_username) = explode('/', $target_username); - - $ux_columns = $db->columns_in(table_prefix . 'users_extra'); - - $output->set_title($this->title); - $q = $db->sql_query('SELECT u.username, u.user_id AS authoritative_uid, u.real_name, u.email, u.reg_time, u.user_has_avatar, u.avatar_type, x.*, COUNT(c.comment_id) AS n_comments - FROM '.table_prefix.'users u - LEFT JOIN '.table_prefix.'users_extra AS x - ON ( u.user_id = x.user_id OR x.user_id IS NULL ) - LEFT JOIN '.table_prefix.'comments AS c - ON ( ( c.user_id=u.user_id AND c.name=u.username AND c.approved=1 ) OR ( c.comment_id IS NULL AND c.approved IS NULL ) ) - WHERE u.username=\'' . $db->escape($target_username) . '\' - GROUP BY u.username, u.user_id, u.real_name, u.email, u.reg_time, u.user_has_avatar, u.avatar_type, x.' . implode(', x.', $ux_columns) . ';'); - if ( !$q ) - $db->_die(); - - $user_exists = true; - - if ( $db->numrows() < 1 ) - { - $user_exists = false; - } - else - { - $userdata = $db->fetchrow(); - if ( $userdata['authoritative_uid'] == 1 ) - { - // Hide data for anonymous user - $user_exists = false; - unset($userdata); - } - } - - // get the user's rank - if ( $user_exists ) - { - $rank_data = $session->get_user_rank(intval($userdata['authoritative_uid'])); - } - else - { - // get the rank data for the anonymous user (placeholder basically) - $rank_data = $session->get_user_rank(1); - } - - // add the userpage script to the header - $template->add_header(''); - - $output->header(); - - // if ( $send_headers ) - // { - // display_page_headers(); - // } - - // - // BASIC INFORMATION - // Presentation of username/rank/avatar/basic info - // - - if ( $user_exists ) - { - - ?> -
    - - -
    - - - '; - - echo ' '; - - echo '
    - '; - - // heading - echo ' - - ' . ( - $session->user_level >= USER_LEVEL_ADMIN ? - '' - : '' - ) . ' - '; - - // avi/rank/username - echo ' - - '; - - // join date & total comments - echo ''; - echo ' - '; - echo ' - '; - echo ''; - - // real name - if ( !empty($userdata['real_name']) ) - { - echo ' - - - '; - } - - // latest comments - - echo ''; - $q = $db->sql_query('SELECT page_id, namespace, subject, time FROM '.table_prefix.'comments WHERE name=\'' . $db->escape($target_username) . '\' AND user_id=' . $userdata['authoritative_uid'] . ' AND approved=1 ORDER BY time DESC LIMIT 7;'); - if ( !$q ) - $db->_die(); - - $comments = Array(); - $no_comments = false; - - if ( $row = $db->fetchrow() ) - { - do - { - $row['time'] = enano_date(ED_DATE, $row['time']); - $comments[] = $row; - } - while ( $row = $db->fetchrow() ); - } - else - { - $no_comments = true; - } - - echo ''; - - $code = $plugins->setHook('userpage_sidebar_left'); - foreach ( $code as $cmd ) - { - eval($cmd); - } - - echo '
    - ' . $lang->get('userpage_heading_basics', array('username' => htmlspecialchars($target_username))) . ' - » ' . $lang->get('userpage_btn_administer_user') . '
    - ' . ( - $userdata['user_has_avatar'] == 1 ? - '
    - ' . $lang->get('usercp_avatar_image_alt', array('username' => $userdata['username'])) . ' -
    ' - : '' - ) . ' - ' . htmlspecialchars($userdata['username']) . ' - ' . ( !empty($rank_data['user_title']) ? '
    ' . htmlspecialchars($rank_data['user_title']) : '' ) . ' - ' . ( !empty($rank_data['rank_title']) ? '
    ' . htmlspecialchars($lang->get($rank_data['rank_title'])) : '' ) . ' -
    - ' . $lang->get('userpage_lbl_joined') . ' - - ' . enano_date(ED_DATE | ED_TIME, $userdata['reg_time']) . ' - - ' . $lang->get('userpage_lbl_num_comments') . ' - - ' . $userdata['n_comments'] . ' -
    - ' . $lang->get('userpage_lbl_real_name') . ' - - ' . htmlspecialchars($userdata['real_name']) . ' -
    ' . $lang->get('userpage_heading_comments', array('username' => htmlspecialchars($target_username))) . '
    '; - echo '
    '; - - echo ''; - $class = 'row1'; - - $tpl = ' '; - $parser = $template->makeParserText($tpl); - - if ( count($comments) > 0 ) - { - foreach ( $comments as $comment ) - { - $c_page_id = $paths->nslist[ $comment['namespace'] ] . sanitize_page_id($comment['page_id']); - if ( isPage($c_page_id) ) - { - $parser->assign_bool(array( - 'page_exists' => true - )); - $page_title = get_page_title($c_page_id); - } - else - { - $parser->assign_bool(array( - 'page_exists' => false - )); - $page_title = htmlspecialchars(dirtify_page_id($c_page_id)); - } - $parser->assign_vars(array( - 'CLASS' => $class, - 'PAGE_LINK' => makeUrlNS($comment['namespace'], sanitize_page_id($comment['page_id'])), - 'PAGE' => $page_title, - 'SUBJECT' => $comment['subject'], - 'DATE' => $comment['time'], - 'COMMENT_LINK' => makeUrlNS($comment['namespace'], sanitize_page_id($comment['page_id']), 'do=comments', true) - )); - $class = ( $class == 'row3' ) ? 'row1' : 'row3'; - echo $parser->run(); - } - } - else - { - echo ''; - } - echo '
    - class="wikilink-nonexistent">{PAGE}
    - {lang:userpage_comments_lbl_posted} {DATE}
    - {SUBJECT} -
    ' . $lang->get('userpage_msg_no_comments') . '
    '; - - echo '
    '; - echo '
    -
    '; - - echo ''; - - // - // CONTACT INFORMATION - // - - echo ' '; - - echo '
    - '; - - // - // Main part of sidebar - // - - // Contact information - - echo ''; - - $class = 'row3'; - - if ( $userdata['email_public'] == 1 ) - { - $class = ( $class == 'row1' ) ? 'row3' : 'row1'; - $email_link = $email->encryptEmail($userdata['email']); - echo ''; - } - - if ( !empty($userdata['user_homepage']) ) - { - $class = ( $class == 'row1' ) ? 'row3' : 'row1'; - echo ''; - } - - $class = ( $class == 'row1' ) ? 'row3' : 'row1'; - if ( $session->user_logged_in ) - { - echo ''; - } - else - { - echo ''; - } - - if ( !empty($userdata['user_aim']) ) - { - $class = ( $class == 'row1' ) ? 'row3' : 'row1'; - echo ''; - } - - if ( !empty($userdata['user_yahoo']) ) - { - $class = ( $class == 'row1' ) ? 'row3' : 'row1'; - echo ''; - } - - if ( !empty($userdata['user_msn']) ) - { - $class = ( $class == 'row1' ) ? 'row3' : 'row1'; - $email_link = $email->encryptEmail($userdata['user_msn']); - echo ''; - } - - if ( !empty($userdata['user_xmpp']) ) - { - $class = ( $class == 'row1' ) ? 'row3' : 'row1'; - $email_link = $email->encryptEmail($userdata['user_xmpp']); - echo ''; - } - - // Real life - - echo ''; - - if ( !empty($userdata['user_location']) ) - { - $class = ( $class == 'row1' ) ? 'row3' : 'row1'; - echo ''; - } - - if ( !empty($userdata['user_job']) ) - { - $class = ( $class == 'row1' ) ? 'row3' : 'row1'; - echo ''; - } - - if ( !empty($userdata['user_hobbies']) ) - { - $class = ( $class == 'row1' ) ? 'row3' : 'row1'; - echo ''; - } - - if ( empty($userdata['user_location']) && empty($userdata['user_job']) && empty($userdata['user_hobbies']) ) - { - $class = ( $class == 'row1' ) ? 'row3' : 'row1'; - echo ''; - } - - $code = $plugins->setHook('userpage_sidebar_right'); - foreach ( $code as $cmd ) - { - eval($cmd); - } - - echo '
    ' . $lang->get('userpage_heading_contact') . '
    ' . $lang->get('userpage_lbl_email') . ' ' . $email_link . '
    ' . $lang->get('userpage_lbl_homepage') . '
    ' . $userdata['user_homepage'] . '
    ' . $lang->get('userpage_btn_send_pm', array('username' => htmlspecialchars($target_username), 'pm_link' => makeUrlNS('Special', 'PrivateMessages/Compose/to/' . $this->page_id, false, true))) . '
    ' . $lang->get('userpage_btn_send_pm_guest', array('username' => htmlspecialchars($target_username), 'login_flags' => 'href="' . makeUrlNS('Special', 'Login/' . $paths->nslist[$this->namespace] . $this->page_id) . '" onclick="ajaxStartLogin(); return false;"')) . '
    ' . $lang->get('userpage_lbl_aim') . ' ' . $userdata['user_aim'] . '
    ' . $lang->get('userpage_lbl_yim') . ' ' . $userdata['user_yahoo'] . '
    ' . $lang->get('userpage_lbl_wlm') . ' ' . $email_link . '
    ' . $lang->get('userpage_lbl_xmpp') . ' ' . $email_link . '
    ' . $lang->get('userpage_heading_real_life', array('username' => htmlspecialchars($target_username))) . '
    ' . $lang->get('userpage_lbl_location') . ' ' . $userdata['user_location'] . '
    ' . $lang->get('userpage_lbl_job') . ' ' . $userdata['user_job'] . '
    ' . $lang->get('userpage_lbl_hobbies') . ' ' . $userdata['user_hobbies'] . '
    ' . $lang->get('userpage_msg_no_contact_info', array('username' => htmlspecialchars($target_username))) . '
    -
    '; - echo ''; - - // - // End of profile - // - - echo ''; - - echo '
    '; // tab:profile - - } - - // User's own content - - echo ''; - - echo '
    '; - - if ( $this->exists ) - { - $this->send_from_db(true, false); - } - else - { - $this->error_404(); - } - - echo '
    '; // tab:content - - $code = $plugins->setHook('userpage_tabs_body'); - foreach ( $code as $cmd ) - { - eval($cmd); - } - - if ( $user_exists ) - { - echo '
    '; // userpage_wrap - } - else - { - if ( !is_valid_ip($target_username) ) - { - echo '

    ' . $lang->get('userpage_msg_user_not_exist', array('username' => htmlspecialchars($target_username))) . '

    '; - } - } - - // if ( $send_headers ) - // { - // display_page_footers(); - // } - - $output->footer(); - } + public function __construct($page_id, $namespace, $revision_id = 0) + { + global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; + + parent::__construct($page_id, $namespace, $revision_id); + + if ( ( $this->title == str_replace('_', ' ', $this->page_id) || $this->title == $paths->nslist['User'] . str_replace('_', ' ', $this->page_id) ) || !$this->exists ) + { + $this->title = $lang->get('userpage_page_title', array('username' => str_replace('_', ' ', dirtify_page_id($this->page_id)))); + $this->cdata['name'] = $this->title; + } + + } + + public function send() + { + global $db, $session, $paths, $template, $plugins; // Common objects + global $email; + global $lang, $output; + + /** + * PLUGGING INTO USER PAGES + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Userpages are highly programmable and extendable using a number of + * hooks. These hooks are: + * + * - userpage_sidebar_left + * - userpage_sidebar_right + * - userpage_tabs_links + * - userpage_tabs_body + * + * You can add a variety of sections to user pages, including new tabs + * and new sections on the tables. To add a tab, attach to + * userpage_tabs_links and echo out: + * + *
  • YOUR TAB TEXT
  • + * + * Then hook into userpage_tabs_body and echo out: + * + *
    YOUR TAB CONTENT
    + * + * The userpage javascript runtime will take care of everything else, + * meaning transitions, click events, etc. Currently it's not possible + * to add custom click events to tabs, but any DOM-related JS that needs + * to run in your tab can be run onload and the effects will be seen when + * your tab is clicked. YOURTABID should be lowercase alphanumeric and + * have a short prefix so as to assure that it remains specific to your + * plugin. + * + * To hook into the "profile" tab, use userpage_sidebar_{left,right}. Just + * echo out table cells as normal. The table on the left (the wide one) has + * four columns, and the one on the right has one column. + * + * See plugins.php for a guide on creating and attaching to hooks. + */ + + $page_urlname = dirtify_page_id($this->page_id); + + $target_username = strtr($page_urlname, + Array( + '_' => ' ', + '<' => '<', + '>' => '>' + )); + + $target_username = preg_replace('/^' . str_replace('/', '\\/', preg_quote($paths->nslist['User'])) . '/', '', $target_username); + list($target_username) = explode('/', $target_username); + + $ux_columns = $db->columns_in(table_prefix . 'users_extra'); + + $output->set_title($this->title); + $q = $db->sql_query('SELECT u.username, u.user_id AS authoritative_uid, u.real_name, u.email, u.reg_time, u.user_has_avatar, u.avatar_type, x.*, COUNT(c.comment_id) AS n_comments + FROM '.table_prefix.'users u + LEFT JOIN '.table_prefix.'users_extra AS x + ON ( u.user_id = x.user_id OR x.user_id IS NULL ) + LEFT JOIN '.table_prefix.'comments AS c + ON ( ( c.user_id=u.user_id AND c.name=u.username AND c.approved=1 ) OR ( c.comment_id IS NULL AND c.approved IS NULL ) ) + WHERE u.username=\'' . $db->escape($target_username) . '\' + GROUP BY u.username, u.user_id, u.real_name, u.email, u.reg_time, u.user_has_avatar, u.avatar_type, x.' . implode(', x.', $ux_columns) . ';'); + if ( !$q ) + $db->_die(); + + $user_exists = true; + + if ( $db->numrows() < 1 ) + { + $user_exists = false; + } + else + { + $userdata = $db->fetchrow(); + if ( $userdata['authoritative_uid'] == 1 ) + { + // Hide data for anonymous user + $user_exists = false; + unset($userdata); + } + } + + // get the user's rank + if ( $user_exists ) + { + $rank_data = $session->get_user_rank(intval($userdata['authoritative_uid'])); + } + else + { + // get the rank data for the anonymous user (placeholder basically) + $rank_data = $session->get_user_rank(1); + } + + // add the userpage script to the header + $template->add_header(''); + + $output->header(); + + // if ( $send_headers ) + // { + // display_page_headers(); + // } + + // + // BASIC INFORMATION + // Presentation of username/rank/avatar/basic info + // + + if ( $user_exists ) + { + + ?> +
    + + +
    + + + '; + + echo ' '; + + echo '
    + '; + + // heading + echo ' + + ' . ( + $session->user_level >= USER_LEVEL_ADMIN ? + '' + : '' + ) . ' + '; + + // avi/rank/username + echo ' + + '; + + // join date & total comments + echo ''; + echo ' + '; + echo ' + '; + echo ''; + + // real name + if ( !empty($userdata['real_name']) ) + { + echo ' + + + '; + } + + // latest comments + + echo ''; + $q = $db->sql_query('SELECT page_id, namespace, subject, time FROM '.table_prefix.'comments WHERE name=\'' . $db->escape($target_username) . '\' AND user_id=' . $userdata['authoritative_uid'] . ' AND approved=1 ORDER BY time DESC LIMIT 7;'); + if ( !$q ) + $db->_die(); + + $comments = Array(); + $no_comments = false; + + if ( $row = $db->fetchrow() ) + { + do + { + $row['time'] = enano_date(ED_DATE, $row['time']); + $comments[] = $row; + } + while ( $row = $db->fetchrow() ); + } + else + { + $no_comments = true; + } + + echo ''; + + $code = $plugins->setHook('userpage_sidebar_left'); + foreach ( $code as $cmd ) + { + eval($cmd); + } + + echo '
    + ' . $lang->get('userpage_heading_basics', array('username' => htmlspecialchars($target_username))) . ' + » ' . $lang->get('userpage_btn_administer_user') . '
    + ' . ( + $userdata['user_has_avatar'] == 1 ? + '
    + ' . $lang->get('usercp_avatar_image_alt', array('username' => $userdata['username'])) . ' +
    ' + : '' + ) . ' + ' . htmlspecialchars($userdata['username']) . ' + ' . ( !empty($rank_data['user_title']) ? '
    ' . htmlspecialchars($rank_data['user_title']) : '' ) . ' + ' . ( !empty($rank_data['rank_title']) ? '
    ' . htmlspecialchars($lang->get($rank_data['rank_title'])) : '' ) . ' +
    + ' . $lang->get('userpage_lbl_joined') . ' + + ' . enano_date(ED_DATE | ED_TIME, $userdata['reg_time']) . ' + + ' . $lang->get('userpage_lbl_num_comments') . ' + + ' . $userdata['n_comments'] . ' +
    + ' . $lang->get('userpage_lbl_real_name') . ' + + ' . htmlspecialchars($userdata['real_name']) . ' +
    ' . $lang->get('userpage_heading_comments', array('username' => htmlspecialchars($target_username))) . '
    '; + echo '
    '; + + echo ''; + $class = 'row1'; + + $tpl = ' '; + $parser = $template->makeParserText($tpl); + + if ( count($comments) > 0 ) + { + foreach ( $comments as $comment ) + { + $c_page_id = $paths->nslist[ $comment['namespace'] ] . sanitize_page_id($comment['page_id']); + if ( isPage($c_page_id) ) + { + $parser->assign_bool(array( + 'page_exists' => true + )); + $page_title = get_page_title($c_page_id); + } + else + { + $parser->assign_bool(array( + 'page_exists' => false + )); + $page_title = htmlspecialchars(dirtify_page_id($c_page_id)); + } + $parser->assign_vars(array( + 'CLASS' => $class, + 'PAGE_LINK' => makeUrlNS($comment['namespace'], sanitize_page_id($comment['page_id'])), + 'PAGE' => $page_title, + 'SUBJECT' => $comment['subject'], + 'DATE' => $comment['time'], + 'COMMENT_LINK' => makeUrlNS($comment['namespace'], sanitize_page_id($comment['page_id']), 'do=comments', true) + )); + $class = ( $class == 'row3' ) ? 'row1' : 'row3'; + echo $parser->run(); + } + } + else + { + echo ''; + } + echo '
    + class="wikilink-nonexistent">{PAGE}
    + {lang:userpage_comments_lbl_posted} {DATE}
    + {SUBJECT} +
    ' . $lang->get('userpage_msg_no_comments') . '
    '; + + echo '
    '; + echo '
    +
    '; + + echo ''; + + // + // CONTACT INFORMATION + // + + echo ' '; + + echo '
    + '; + + // + // Main part of sidebar + // + + // Contact information + + echo ''; + + $class = 'row3'; + + if ( $userdata['email_public'] == 1 ) + { + $class = ( $class == 'row1' ) ? 'row3' : 'row1'; + $email_link = $email->encryptEmail($userdata['email']); + echo ''; + } + + if ( !empty($userdata['user_homepage']) ) + { + $class = ( $class == 'row1' ) ? 'row3' : 'row1'; + echo ''; + } + + $class = ( $class == 'row1' ) ? 'row3' : 'row1'; + if ( $session->user_logged_in ) + { + echo ''; + } + else + { + echo ''; + } + + if ( !empty($userdata['user_aim']) ) + { + $class = ( $class == 'row1' ) ? 'row3' : 'row1'; + echo ''; + } + + if ( !empty($userdata['user_yahoo']) ) + { + $class = ( $class == 'row1' ) ? 'row3' : 'row1'; + echo ''; + } + + if ( !empty($userdata['user_msn']) ) + { + $class = ( $class == 'row1' ) ? 'row3' : 'row1'; + $email_link = $email->encryptEmail($userdata['user_msn']); + echo ''; + } + + if ( !empty($userdata['user_xmpp']) ) + { + $class = ( $class == 'row1' ) ? 'row3' : 'row1'; + $email_link = $email->encryptEmail($userdata['user_xmpp']); + echo ''; + } + + // Real life + + echo ''; + + if ( !empty($userdata['user_location']) ) + { + $class = ( $class == 'row1' ) ? 'row3' : 'row1'; + echo ''; + } + + if ( !empty($userdata['user_job']) ) + { + $class = ( $class == 'row1' ) ? 'row3' : 'row1'; + echo ''; + } + + if ( !empty($userdata['user_hobbies']) ) + { + $class = ( $class == 'row1' ) ? 'row3' : 'row1'; + echo ''; + } + + if ( empty($userdata['user_location']) && empty($userdata['user_job']) && empty($userdata['user_hobbies']) ) + { + $class = ( $class == 'row1' ) ? 'row3' : 'row1'; + echo ''; + } + + $code = $plugins->setHook('userpage_sidebar_right'); + foreach ( $code as $cmd ) + { + eval($cmd); + } + + echo '
    ' . $lang->get('userpage_heading_contact') . '
    ' . $lang->get('userpage_lbl_email') . ' ' . $email_link . '
    ' . $lang->get('userpage_lbl_homepage') . '
    ' . $userdata['user_homepage'] . '
    ' . $lang->get('userpage_btn_send_pm', array('username' => htmlspecialchars($target_username), 'pm_link' => makeUrlNS('Special', 'PrivateMessages/Compose/to/' . $this->page_id, false, true))) . '
    ' . $lang->get('userpage_btn_send_pm_guest', array('username' => htmlspecialchars($target_username), 'login_flags' => 'href="' . makeUrlNS('Special', 'Login/' . $paths->nslist[$this->namespace] . $this->page_id) . '" onclick="ajaxStartLogin(); return false;"')) . '
    ' . $lang->get('userpage_lbl_aim') . ' ' . $userdata['user_aim'] . '
    ' . $lang->get('userpage_lbl_yim') . ' ' . $userdata['user_yahoo'] . '
    ' . $lang->get('userpage_lbl_wlm') . ' ' . $email_link . '
    ' . $lang->get('userpage_lbl_xmpp') . ' ' . $email_link . '
    ' . $lang->get('userpage_heading_real_life', array('username' => htmlspecialchars($target_username))) . '
    ' . $lang->get('userpage_lbl_location') . ' ' . $userdata['user_location'] . '
    ' . $lang->get('userpage_lbl_job') . ' ' . $userdata['user_job'] . '
    ' . $lang->get('userpage_lbl_hobbies') . ' ' . $userdata['user_hobbies'] . '
    ' . $lang->get('userpage_msg_no_contact_info', array('username' => htmlspecialchars($target_username))) . '
    +
    '; + echo ''; + + // + // End of profile + // + + echo ''; + + echo '
    '; // tab:profile + + } + + // User's own content + + echo ''; + + echo '
    '; + + if ( $this->exists ) + { + $this->send_from_db(true, false); + } + else + { + $this->error_404(); + } + + echo '
    '; // tab:content + + $code = $plugins->setHook('userpage_tabs_body'); + foreach ( $code as $cmd ) + { + eval($cmd); + } + + if ( $user_exists ) + { + echo '
    '; // userpage_wrap + } + else + { + if ( !is_valid_ip($target_username) ) + { + echo '

    ' . $lang->get('userpage_msg_user_not_exist', array('username' => htmlspecialchars($target_username))) . '

    '; + } + } + + // if ( $send_headers ) + // { + // display_page_footers(); + // } + + $output->footer(); + } }