Пример #1
0
 print_cp_header("Forums Point Policy Manager");
 print_table_start();
 print_table_header('Forums Point Policy', 4);
 $heading = array('Forum', 'Per Thread', 'Per Reply', 'Per Char');
 print_cells_row($heading, 1);
 //Global Policy
 $cell = array();
 $cell[] = '<strong>GLOBAL</strong>';
 $cell[] = vb_number_format($vbulletin->kbank['perthread_default'], $vbulletin->kbank['roundup']);
 $cell[] = vb_number_format($vbulletin->kbank['perreply_default'], $vbulletin->kbank['roundup']);
 $cell[] = vb_number_format($vbulletin->kbank['perchar_default'], $vbulletin->kbank['roundup']);
 print_cells_row($cell);
 //Forums Policy
 foreach ($vbulletin->forumcache as $forumid => $forum) {
     $forumtitle = construct_depth_mark($forum['depth'], '--', $startdepth) . ' ' . $forum['title'] . ' ' . iif(!($forum['options'] & $vbulletin->bf_misc_forumoptions['allowposting']), " ({$vbphrase['forum_is_closed_for_posting']})");
     $policy = getPointPolicy($forum);
     $cell = array();
     $cell[] = $forumtitle;
     $cell[] = $policy['kbank_perthread_str'];
     $cell[] = $policy['kbank_perreply_str'];
     $cell[] = $policy['kbank_perchar_str'];
     print_cells_row($cell);
 }
 print_table_footer(4);
 print_form_header('kbankadmin', 'do_resetpolicy');
 print_table_header('Reset Forums Point Policy');
 print_forum_chooser('Please select forum to reset', 'forum[]', -1, null, false, true);
 print_input_row('[New] Per Thread Value', 'perthread', -1);
 print_input_row('[New] Per Reply Value', 'perreply', -1);
 print_input_row('[New] Per Char Value', 'perchar', -1);
 print_submit_row("Reset Policy", 0);
Пример #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') and $vbulletin->kbank['enabled']) {
    include_once DIR . '/kbank/functions.php';
    global $kbank;
    $kbank_forumpolicy = getPointPolicy($foruminfo);
    if ($kbank_forumpolicy['kbank_perthread'] + $kbank_forumpolicy['kbank_perreply'] + $kbank_forumpolicy['kbank_perchar'] > 0) {
        //1 of them is activated
        //eval('$forumrules = "' . fetch_template('kbank_forum_policy') . '";');
        $vbulletin->templatecache['forumrules'] = str_replace('$forumrules', $vbulletin->templatecache['forumrules'], $vbulletin->templatecache['kbank_forum_policy']);
        //echo 'here';exit;
    }
}
Пример #3
0
function kbank_points($post, $forumid, $type = '')
{
    global $vbulletin;
    $foruminfo = $vbulletin->forumcache["{$forumid}"];
    $policy = getPointPolicy($foruminfo);
    $points = 0;
    if ($type == 'thread') {
        if ($policy['kbank_perthread'] > 0) {
            $points += $policy['kbank_perthread'];
        }
    } else {
        if ($policy['kbank_perreply'] > 0) {
            $points += $policy['kbank_perreply'];
        }
    }
    if ($policy['kbank_perchar'] > 0) {
        $message = $post['message'];
        $message = preg_replace('/\\s\\s+/', ' ', $message);
        require_once DIR . '/includes/class_bbcode.php';
        $bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
        $message = $bbcode_parser->parse($message, $forumid, true);
        $message = strip_tags($message);
        $points += $policy['kbank_perchar'] * strlen($message);
    }
    if ($vbulletin->kbank['PointAdjust']) {
        eval('$points = $points ' . $vbulletin->kbank['PointAdjust'] . ';');
    }
    if ($vbulletin->kbank['RegPoint'] > 0 and $vbulletin->userinfo['joindate'] + 30 * 24 * 60 * 60 > TIMENOW) {
        $points += $vbulletin->kbank['RegPoint'];
    }
    return $points;
}