Ejemplo n.º 1
0
<?php

/*======================================================================*\
|| #################################################################### ||
|| # kBank 2.4
|| # Coded by mrpaint
|| # Contact: mrpaint@gmail.com
|| # I'm a Vietnamese! Thank you for using this script
|| # Last Updated: 03:26 29-03-2009
|| #################################################################### ||
\*======================================================================*/
if (defined('VB_AREA') && $vbulletin->kbank['enabled']) {
    include_once DIR . '/kbank/functions.php';
    customize_userinfo_replaceUsername($userinfo['username']);
}
Ejemplo n.º 2
0
<?php

/*======================================================================*\
|| #################################################################### ||
|| # kBank 2.4
|| # Coded by mrpaint
|| # Contact: mrpaint@gmail.com
|| # I'm a Vietnamese! Thank you for using this script
|| # Last Updated: 03:26 29-03-2009
|| #################################################################### ||
\*======================================================================*/
if (defined('VB_AREA') && $vbulletin->kbank['enabled']) {
    include_once DIR . '/kbank/functions.php';
    global $KBANK_HOOK_NAME;
    $KBANK_HOOK_NAME = KBANK_THREADBIT_DISPLAY;
    findItemToWork($thread['postuserid']);
    customize_userinfo_replaceUsername($thread['postusername']);
    customize_userinfo_replaceUsername($thread['lastposter']);
}
<?php

/*======================================================================*\
|| #################################################################### ||
|| # kBank 2.4
|| # Coded by mrpaint
|| # Contact: mrpaint@gmail.com
|| # I'm a Vietnamese! Thank you for using this script
|| # Last Updated: 03:27 29-03-2009
|| #################################################################### ||
\*======================================================================*/
if (defined('VB_AREA') && $vbulletin->kbank['enabled'] && $vbulletin->GPC['folderid'] != -1) {
    include_once DIR . '/kbank/functions.php';
    if (customize_userinfo_replaceUsername($username)) {
        //rebuild userbit with username replaced
        eval('$userbit = "' . fetch_template('pm_messagelistbit_user') . '";');
    }
}
Ejemplo n.º 4
0
function getUsername($id, $url = false, $url_element = 'userid')
{
    global $vbulletin, $vbphrase, $kbank_active_items, $cached_username, $need2cached_username;
    //Cache
    $need2query = false;
    if (is_array($id)) {
        if (!$id['userid']) {
            return $id['username'];
        }
        customize_userinfo_replaceUsername($id['username']);
        $cached_username[$id['userid']] = $id;
        $id = $id['userid'];
    } else {
        if (is_numeric($id) and $id > 0) {
            if (!isset($cached_username[$id])) {
                $need2cached_username[] = $id;
                $need2query = true;
            }
        }
    }
    if ($need2query and count($need2cached_username)) {
        $userids = array();
        foreach ($need2cached_username as $userid) {
            if (!isset($cached_username[$userid])) {
                //Look for username from active items cached
                $username_found = false;
                if (isset($kbank_active_items[$userid]) and $kbank_active_items[$userid][0] and $kbank_active_items[$userid][0]->data['username']) {
                    //Yeah, we found it!
                    $username_found = $kbank_active_items[$userid][0]->data['username'];
                }
                if ($username_found) {
                    $cached_username[$userid] = array('userid' => $userid, 'username' => $username_found);
                } else {
                    //No luck, we will get it from database
                    $userids[] = $userid;
                }
            }
        }
        if (count($userids)) {
            //for safe reason only
            $userids_str = '';
            foreach ($userids as $userid) {
                if (is_numeric($userid) and $userid > 0) {
                    $userids_str .= ",{$userid}";
                }
            }
            $users = $vbulletin->db->query_read("\n\t\t\t\tSELECT \n\t\t\t\t\tuserid\n\t\t\t\t\t,username\n\t\t\t\tFROM `" . TABLE_PREFIX . "user`\n\t\t\t\tWHERE userid IN (0{$userids_str})\n\t\t\t");
            DEVDEBUG('[kBank] getUsername query the database');
            while ($user = $vbulletin->db->fetch_array($users)) {
                customize_userinfo_replaceUsername($user['username']);
                $cached_username[$user['userid']] = $user;
            }
        }
        foreach ($need2cached_username as $userid) {
            if (!isset($cached_username[$userid])) {
                $cached_username[$userid] = array('userid' => $userid, 'username' => "#{$userid}");
            }
        }
    }
    //Output
    if (is_numeric($id)) {
        if ($id == 0) {
            return $vbphrase['kbank'];
        }
        if (!$url) {
            $url = $vbulletin->options['bburl'] . '/member.php?u=' . $cached_username[$id]['userid'];
        } else {
            $url = $url . $cached_username[$id][$url_element];
        }
        return "<a href=\"{$url}\">" . $cached_username[$id]['username'] . '</a>';
    } else {
        return $id;
    }
}
Ejemplo n.º 5
0
<?php

/*======================================================================*\
|| #################################################################### ||
|| # kBank 2.4
|| # Coded by mrpaint
|| # Contact: mrpaint@gmail.com
|| # I'm a Vietnamese! Thank you for using this script
|| # Last Updated: 03:26 29-03-2009
|| #################################################################### ||
\*======================================================================*/
if (defined('VB_AREA') && $vbulletin->kbank['enabled']) {
    include_once DIR . '/kbank/functions.php';
    if (customize_userinfo_replaceUsername($lastpostinfo['lastposter'])) {
        //rebuild lastpostinfo if nescessary
        eval('$forum[\'lastpostinfo\'] = "' . fetch_template('forumhome_lastpostby') . '";');
    }
}
Ejemplo n.º 6
0
function showAwardBox($postid, $force = false)
{
    global $vbulletin, $vbphrase, $stylevar, $tmp_post, $postinfo;
    $records = fetchAwarded($postid, true, $force);
    if (!isset($tmp_post)) {
        $tmp_post = $postinfo;
    }
    if (!isset($tmp_post['musername'])) {
        $tmp_post['musername'] = $tmp_post['username'];
    }
    if (!count($records)) {
        return '';
    }
    $kbank_award_message = $kbank_award_message_member = array();
    foreach ($records as $data) {
        $message = '';
        $postid = $data['postid'];
        $canRemoveAwarded = $vbulletin->userinfo['canRemoveAwarded'];
        if ($data['points'] >= 0) {
            $color = $vbulletin->kbank['award']['showPlusColor'];
        } else {
            $color = $vbulletin->kbank['award']['showSubtractColor'];
        }
        $colorPre = "<span style=\"color:{$color}\">";
        $colorSuf = "</span>";
        //Parse smilies
        if ($vbulletin->kbank['award']['parseSmilies'] and isset($vbulletin->kbankBBCodeParser)) {
            $data['reason'] = $vbulletin->kbankBBCodeParser->parse_smilies($data['reason']);
        }
        $data['reason'] = $colorPre . $data[reason] . $colorSuf;
        if ($data['userid']) {
            if ($data['receiver'] == $tmp_post['userid']) {
                if (!$vbulletin->kbank['award']['showUsername']) {
                    $message = construct_phrase($vbphrase['kbank_award_the_message_thank'], $tmp_post['musername'], vb_number_format($data['points'], $vbulletin->kbank['roundup']), $data['reason'], $vbulletin->kbank['name']);
                } else {
                    if ($data['username']) {
                        customize_userinfo_replaceUsername($data['username']);
                        $username = "******"member.php?u={$data['userid']}\">{$data['username']}</a>";
                    } else {
                        $username = $vbphrase['kbank_award_unknown'];
                    }
                    $message = construct_phrase($vbphrase['kbank_award_the_message_thank_with_username'], $tmp_post['musername'], vb_number_format($data['points'], $vbulletin->kbank['roundup']), $data['reason'], $username, $vbulletin->kbank['name']);
                }
            }
        } else {
            if ($data['points'] != 0) {
                $data['points_str'] = $colorPre . iif($data['points'] > 0, '+') . vb_number_format($data['points'], $vbulletin->kbank['roundup']) . $colorSuf;
                if (count($data['multi'])) {
                    $list = array();
                    foreach ($data['multi'] as $rec) {
                        if ($rec['comment'] != AWARD_REMOVE) {
                            if ($vbulletin->kbank['award']['parseSmilies'] and isset($vbulletin->kbankBBCodeParser)) {
                                $rec['comment'] = $vbulletin->kbankBBCodeParser->parse_smilies($rec['comment']);
                            }
                            $list[] = iif($vbulletin->kbank['award']['showUsername'], construct_phrase($vbphrase['kbank_award_the_message_multi_bit_with_username'], $rec['comment'], getUsername($rec['adminid'])), construct_phrase($vbphrase['kbank_award_the_message_multi_bit'], $rec['comment']));
                        } else {
                            $list[] = iif($vbulletin->kbank['award']['showUsername'], construct_phrase($vbphrase['kbank_award_the_message_multi_bit_remove_with_username'], getUsername($rec['adminid'])), construct_phrase($vbphrase['kbank_award_the_message_multi_bit_remove']));
                        }
                    }
                    $list = implode('</li><li>', $list);
                    $message = construct_phrase($vbphrase['kbank_award_the_message_multi'], $tmp_post['musername'], $data['points_str'], $list, $vbulletin->kbank['name']);
                } else {
                    if (!$vbulletin->kbank['award']['showUsername']) {
                        $message = construct_phrase($vbphrase['kbank_award_the_message'], $tmp_post['musername'], $data['points_str'], $data['reason'], $vbulletin->kbank['name']);
                    } else {
                        $message = construct_phrase($vbphrase['kbank_award_the_message_with_username'], $tmp_post['musername'], $data['points_str'], $data['reason'], getUsername($data['adminid']), $vbulletin->kbank['name']);
                    }
                }
            }
        }
        if ($data['time']) {
            $message .= ' ' . construct_phrase($vbphrase['kbank_award_the_message_datetime'], vbdate($vbulletin->options['dateformat'] . ' ' . $vbulletin->options['timeformat'], $data['date']));
        }
        if ($message) {
            if ($data['userid'] == 0) {
                $kbank_award_message[] = $message;
            } else {
                if ($vbulletin->userinfo['canRemoveAwarded']) {
                    $message = '[<a href="' . $vbulletin->kbank['award']['phpfile'] . '?p=' . $postid . '&do=hide&id=' . $data['userid'] . '" id="kbank_award_hide_' . $postid . '_' . $data['userid'] . '" onclick="return kbank_award_link(' . $postid . ',\'kbank_award_hide_' . $postid . '_' . $data['userid'] . '\',this.href);">x</a>] ' . $message;
                }
                $kbank_award_message_member[] = $message;
            }
        }
    }
    $kbank_award_message = implode('<br/>', $kbank_award_message);
    $thankcount = count($kbank_award_message_member);
    $kbank_award_message_member = implode('<br/>', $kbank_award_message_member);
    if ($kbank_award_message or $kbank_award_message_member) {
        eval('$kbank_award_message = " ' . fetch_template('kbank_award_message') . '";');
        return $kbank_award_message;
    } else {
        return '';
    }
}
Ejemplo n.º 7
0
<?php

/*======================================================================*\
|| #################################################################### ||
|| # kBank 2.4
|| # Coded by mrpaint
|| # Contact: mrpaint@gmail.com
|| # I'm a Vietnamese! Thank you for using this script
|| # Last Updated: 03:26 29-03-2009
|| #################################################################### ||
\*======================================================================*/
if (defined('VB_AREA') && $vbulletin->kbank['enabled']) {
    include_once DIR . '/kbank/functions.php';
    customize_userinfo_replaceUsername($post['username']);
}