예제 #1
0
 function cp_modules_mypoints_admin()
 {
     echo '<div class="wrap">';
     echo '<h2>CubePoints - ' . __('My Points', 'cp') . '</h2>';
     echo __('Manage and view information about your points.', 'cp');
     echo '<br /><br />';
     echo '<div style="background:#EFEFEF;display:inline-block;margin-right:25px;"><div style="float:left;font-size:17px;font-weight:bold;background:#E0E0E0;padding:18px;color:#565656;">' . __('My Points', 'cp') . ':</div><div style="float:left;padding:18px;font-size:20px;">' . cp_getPoints(cp_currentUser()) . '</div></div>';
     if (cp_module_activated('ranks')) {
         echo '<div style="background:#EFEFEF;display:inline-block;"><div style="float:left;font-size:17px;font-weight:bold;background:#E0E0E0;padding:18px;color:#565656;">' . __('My Rank', 'cp') . ':</div><div style="float:left;padding:18px;font-size:20px;">' . cp_module_ranks_getRank(cp_currentUser()) . '</div></div>';
     }
     echo '<div style="clear:both;"></div><br />';
     echo '<p style="font-weight:bold;">' . __('Your recent point transactions:', 'cp') . '</p>';
     cp_show_logs(cp_currentUser(), 15, false);
     echo '</div>';
 }
예제 #2
0
global $wpdb;
$where = 'WHERE comment_approved = 1 AND user_id = ' . $public_user_ID;
$num_com = $wpdb->get_var("SELECT COUNT( * ) AS total\n\t    FROM {$wpdb->comments}\n\t    {$where}");
//first steps to implement karma
//$karma = $num_com * 3 + $num_art * 50;
#if (function_exists('cp_getPoints'))
#$karma = cp_getPoints( $public_user_ID ); //$num_com * 3 + $num_art * 50;
$subscriptions = $wp_subscribe_reloaded->get_subscriptions('email', 'equals', $email, 'dt', 'DESC');
#echo 'Username: '******'<br />';
#echo 'User email: ' . $current_user->user_email . '<br />';
#echo 'User first name: ' . $current_user->user_firstname . '<br />';
#echo 'User last name: ' . $current_user->user_lastname . '<br />';
$rank_level = lhg_get_rank_level($public_user_ID);
$karma_rank_total = lhg_get_karma_threshold($rank_level);
if (function_exists('cp_module_ranks_getRank')) {
    $rank_txt = cp_module_ranks_getRank($public_user_ID);
}
//if ($karma < 1000){ $karma_rank_total = 1000;  $rank_level = 2; }
//if ($karma < 100) { $karma_rank_total = 100 ; $rank_level = 1; }
$max_rank_levels = 7;
$squares_full = '<div class="square_full"></div>';
$squares_empty = '<div class="square_empty"></div>';
$squares = '<br><div class="squarebar">';
$i = 0;
while ($i < $rank_level) {
    $squares .= $squares_full;
    $i++;
}
while ($i < $max_rank_levels) {
    $squares .= $squares_empty;
    $i++;
예제 #3
0
function lhg_comment_percent_bar($uid)
{
    global $lang;
    if ($lang == "de") {
        return;
    }
    #$karma = cp_getPoints( $uid );
    $karma = lhg_get_karma($uid);
    $level = lhg_get_rank_level($uid);
    $rank_txt = cp_module_ranks_getRank($public_user_ID);
    $max_rank = 3;
    $tooltip = lhg_user_tooltip($uid);
    $output = '<div class="comment_percent_bar">';
    $output .= '<div class="rateline" style="border: 0px solid #000;" title="' . $tooltip . '">
                       <div style="float: left;"></div>

                       <div class="outerbox" style="background-color: #fff; width: 54px; float: left; margin: 4px 0px; border: 1px solid #eee;">
                         <div class="box" style="border: 0px solid #088; background-color: #2b8fc3; height: 6px; width: ' . 100 * $level / $max_rank . '%;" >
                         </div>
                       </div>
                     </div>';
    //$output .= ''.$rank_txt.'';
    $output .= '</div>';
    return $output;
}
예제 #4
0
function gold_admin_bar_init()
{
    global $wpdb;
    global $wp_admin_bar;
    $current_user = wp_get_current_user();
    $user_id = $current_user->ID;
    $userlogin = $current_user->user_login;
    $testing = $wpdb->get_var('select option_value from wp_options where option_name = "cp_module_ranks_data"');
    $new = unserialize($testing);
    ksort($new);
    $new_array = array(current($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new));
    reset($new);
    $rank = cp_module_ranks_getRank(cp_currentUser());
    $rank_points = array_search($rank, $new_array);
    $current_rank_points = array_search($rank, $new);
    // Get the sum of the gold, silver, and copper.
    $prev_lvl = $new_array[$rank_points];
    $xp = cp_getPoints($user_id);
    $current_lvl = array_search($next_lvl, $new);
    $next_ranks_points = $new_array[$rank_points + 1];
    $xp_level = array_search($next_ranks_points, $new);
    $xp_left = $xp;
    $percentage_num = $xp - array_search($prev_lvl, $new);
    $percentage_dom = $xp_level - $current_rank_points;
    $percentage = $percentage_num / $percentage_dom * 100;
    reset($new);
    $new = unserialize($testing);
    ksort($new);
    $first_value = next($new);
    $second_value = next($new);
    $third_value = next($new);
    $forth_value = next($new);
    $fifth_value = next($new);
    $sixth_value = next($new);
    $seventh_value = next($new);
    $eaighth_value = next($new);
    $nineth_value = next($new);
    $tenth_value = next($new);
    $eleventh_value = next($new);
    $twelveth_value = next($new);
    $thirteenth_value = next($new);
    $forteenth_value = next($new);
    reset($new);
    if ($percentage == 0) {
        $percentage = 1;
    }
    if ($percentage > 100) {
        $percentage = 100;
    }
    // Is the user sufficiently leveled, or has the bar been disabled?
    if (!is_admin_bar_showing() || !is_user_logged_in()) {
        return;
    }
    $wp_admin_bar->add_menu(array('title' => 'Add', 'href' => false, 'id' => 'gold_links'));
    if (!is_admin_bar_showing() || !is_user_logged_in()) {
        return;
    }
    $wp_admin_bar->add_menu(array('title' => "<div id='prog_bar_admin_box' style='width:120px; padding-top: 7px !important;'><div id=\"progress-bar-2\" class=\"all-rounded\" style=\"\tborder: 2px solid #777777 !important;\n\n\n\n\n\n\n\n\tborder-radius: 8px 8px 8px 8px;\n\n\n\n\n\n\n\n\tclear: none !important;\n\n\n\n\n\n\n\n\tmargin-bottom: 0 !important;\n\n\n\n\n\n\n\n\tpadding: 0 !important;\">\n\n\n\n\n\n\n\n\n\t<div id\n\n\n\n\n\n\n\n\t=\"progress-bar-percentage\" class=\"all-rounded\" style=\"\n\n\n\n\n\n\n\n\t-webkit-border-radius: 5px;\n\n\n\n\n\n\n\n    -moz-border-radius: 5px;\n\n\n\n\n\n\n\n    border-radius: 5px;\n\n\n\n\n\n\n\n\tborder-bottom-width:100%; \n\n\n\n\n\n\n\n\tpadding: 5px 0px;\n\n\n\n\n\n\n\n \tcolor: #FFF;\n\n\n\n\n\n\n\n \tfont-weight: bold;\n\n\n\n\n\n\n\n\tbackground-color:#ff6600;\n\n\n\n\n\n\n\n \ttext-align: center; width: " . $percentage . "%\">\n\n\n\n\n\n\n\n\t</div></div></div>", 'href' => false, 'id' => 'prog_bar_links'));
    /**
     * Add the submenu links.
     */
    $wp_admin_bar->add_menu(array('title' => '







<form action = "" method="post">







<div style="background: url(/wp-content/plugins/cube-gold/images/clock.png); width: 34px; height: 34px; float:left; margin-right:2px;"></div><input type="text" name = "minutes_admin" style="margin-top:8px; margin-left: 6px; width: 25px;" />  







for:<input type="text" name = "minutes_reason_admin" style="width: 145px; margin-left: 6px;"  />















<br />















<div style="background: url(/wp-content/plugins/cube-gold/images/xp.png); width: 32px; height: 23px; float:left; margin-top: 10px;"></div> <input type="text" name = "xp_admin"  style="width:25px; margin-top: 11px; margin-left: 7px; margin-right: 2px;" />  







 for:<input type="text" name = "xp_reason_admin" style="width: 145px; margin-left: 6px;"  />







 







<br />















<div style="background: url(/wp-content/plugins/cube-gold/images/gold-icon.png); width: 33px; height: 37px; float:left;"></div> <input type="text" name = "gold_admin"  style="width:25px; margin-top: 11px; margin-left: 7px; margin-right: 2px;" />  







 for:<input type="text" name = "gold_reason_admin" style="width: 145px; margin-left: 6px;"  />







 







<br />















<form action="" method="post"><input style="width: 145px; margin-left: 6px;" type="submit" value="Add" /></form>







          ', 'href' => false, 'parent' => 'gold_links'));
    $gold_sum = (int) $wpdb->get_var("select sum(gold) from wp_class_cur where login = '******'");
    $minutes_sum = (int) $wpdb->get_var("select sum(minutes) from wp_class_cur where login = '******'");
    $period_count_check_three = (int) $wpdb->get_var("select count(*) from wp_total_cur where id = {$user_id} and period_one != 0 and period_two != 0 and period_three != 0");
    if ($period_count_check_three != 0) {
        $period_count = 3;
    } else {
        $period_count_check_two = (int) $wpdb->get_var("select count(*) from wp_total_cur where id = {$user_id} and period_one != 0 and period_two != 0");
        if ($period_count_check_two != 0) {
            $period_count = 2;
        } else {
            $period_count = 1;
        }
    }
    $minutes_required = 10800 * $period_count;
    $minutes_percentage_admin = $minutes_sum / $minutes_required * 100;
    $wp_admin_bar->add_menu(array('title' => $rank, 'href' => false, 'parent' => 'prog_bar_links'));
    $wp_admin_bar->add_menu(array('title' => $xp_left . "/" . $xp_level . " (" . floor($percentage) . "%)", 'href' => false, 'parent' => 'prog_bar_links'));
    $wp_admin_bar->add_menu(array('title' => $minutes_sum . '/' . $minutes_required . ' (' . floor($minutes_percentage_admin) . '%)', 'href' => false, 'parent' => 'prog_bar_links'));
    $wp_admin_bar->add_menu(array('title' => $gold_sum . ' Gold', 'href' => false, 'parent' => 'prog_bar_links'));
    $minute_admin = $_POST['minutes_admin'];
    $gold_admin = $_POST['gold_admin'];
    $gold_admin_reason = $_POST['gold_reason_admin'];
    $minutes_admin_reason = $_POST['minutes_reason_admin'];
    $xp_admin_reason = $_POST['xp_reason_admin'];
    $xp_admin = $_POST['xp_admin'];
    if (isset($gold_admin) && isset($gold_admin_reason)) {
        if ($gold_admin != 0) {
            global $wpdb;
            $current_user = wp_get_current_user();
            $userlogin = $current_user->user_login;
            $table_name = $wpdb->prefix . "class_cur";
            $wpdb->insert($table_name, array('gold' => $gold_admin, 'gold_reason' => $gold_admin_reason, 'login' => $userlogin, 'timestamp' => date('m/d@H:i', current_time('timestamp', 0))), array('%s', '%s'));
            echo '<embed src ="/wp-content/plugins/cube-gold/CashRegister.mp3" hidden="true" autostart="true"></embed>';
        }
    }
    if (isset($xp_admin) && isset($xp_admin_reason)) {
        if ($xp_admin != 0) {
            global $wpdb;
            $current_user = wp_get_current_user();
            $user_id = $current_user->ID;
            $table_name = $wpdb->prefix . "cp";
            $points = cp_getPoints($user_id);
            $wpdb->insert($table_name, array('points' => $xp_admin, 'data' => $xp_admin_reason, 'uid' => $user_id, 'timestamp' => time(), 'type' => 'addpoints'), array('%s', '%s'));
            update_user_meta($user_id, 'cpoints', $points + $xp_admin);
            echo '<div class="noticetime"><div class="notice-wrap"><div class="notice-item-wrapper"><div style="" class="notice-item notice"><div class="notice-item-close">×</div><p>+' . $xp_admin . '</p></div></div></div></div>';
        }
    }
    if (isset($minute_admin)) {
        if ($minute_admin != 0) {
            global $wpdb;
            $current_user = wp_get_current_user();
            $userlogin = $current_user->user_login;
            $time = date('m/d@H:i', current_time('timestamp', 0));
            $table_name = $wpdb->prefix . "class_cur";
            $wpdb->insert($table_name, array('minutes' => $minute_admin, 'minutes_reason' => $minutes_admin_reason, 'login' => $userlogin, 'timestamp' => $time), array('%s'));
        }
    }
}
예제 #5
0
    function cp_module_ranks_widget()
    {
        if (is_user_logged_in()) {
            ?>
				<li><?php 
            _e('Rank', 'cp');
            ?>
: <?php 
            echo cp_module_ranks_getRank(cp_currentUser());
            ?>
</li>
			<?php 
        }
    }
/**
 * cubepoints_bp_profile() 
 *
 * Adds CubePoints to Profile Page
 * 
 *  @version 1.9.8.2
 *  @since 1.0
 */
function cubepoints_bp_profile()
{
    global $bp;
    if (function_exists('cp_displayPoints')) {
        ?>
		<span class="cubepoints_buddypress"><?php 
        echo cp_displayPoints($bp->displayed_user->id);
        ?>
</span>
	<?php 
    }
    if (cp_module_activated('donate')) {
        if (is_user_logged_in()) {
            ?>
			<span class="cupepoints_buddypress_donate"><a href="#" title="<?php 
            _e('Donate', 'cp_buddypress');
            ?>
" onclick="Javascript:cp_module_donate();" class="thickbox cp_donateLink"><?php 
            _e('Donate Points', 'cp_buddypress');
            ?>
</a></span>
	<?php 
        }
    }
    if (cp_module_activated('ranks')) {
        ?>
		<span class="cupepoints_buddypress_rank"><?php 
        _e('Rank', 'cp_buddypress');
        ?>
 - <?php 
        echo cp_module_ranks_getRank($bp->displayed_user->id);
        ?>
</span>
	<?php 
    }
}
예제 #7
0
    /**
     * Section template.
     */
    function section_template()
    {
        global $wpdb;
        $current_user = wp_get_current_user();
        if (isset($_GET['id'])) {
            $user_id = $_GET['id'];
            $user_info = get_userdata($user_id);
            $userlogin = $user_info->user_login;
            $gamertag = $user_info->display_name;
            $user_website = $user_info->user_url;
        } else {
            $user_id = $current_user->ID;
            $userlogin = $current_user->user_login;
            $gamertag = $current_user->display_name;
            $user_website = $current_user->user_url;
        }
        $quest_posts_ids = $wpdb->get_results("select post_id from wp_postmeta where meta_value = 'page.quest.php' and meta_key ='_wp_page_template'");
        $quest_posts_count = (int) $wpdb->get_var("select count(*) from wp_postmeta where meta_value = 'page.quest.php' and meta_key ='_wp_page_template'");
        $quests_e = (int) $wpdb->get_var("select count(data) from wp_cp where uid = {$user_id} and status = 1");
        $quests_a = (int) $wpdb->get_var("select count(data) from wp_cp where uid = {$user_id} and status = 2");
        $quests_c = (int) $wpdb->get_var("select count(data) from wp_cp where uid = {$user_id} and status = 3");
        $quests_m = (int) $wpdb->get_var("select count(data) from wp_cp where uid = {$user_id} and status = 4");
        $quests_ne = $quest_posts_count - $quests_e - $quests_a - $quests_c - $quests_m;
        //Progres Bar!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        $testing = $wpdb->get_var('select option_value from wp_options where option_name = "cp_module_ranks_data"');
        $new = unserialize($testing);
        ksort($new);
        $new_array = array(current($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new), next($new));
        reset($new);
        $rank = cp_module_ranks_getRank($user_id);
        $rank_points = array_search($rank, $new_array);
        $current_rank_points = array_search($rank, $new);
        // Get the sum of the gold, silver, and copper.
        $prev_lvl = $new_array[$rank_points];
        $xp = cp_getPoints($user_id);
        $current_lvl = array_search($next_lvl, $new);
        $next_ranks_points = $new_array[$rank_points + 1];
        $xp_level = array_search($next_ranks_points, $new);
        ?>
<input type="text" style="display:none;"  name="re_xp_in" value="<?php 
        echo 8000;
        ?>
" /></form>  <?php 
        if (isset($_POST['re_xp_in'])) {
            $xp_left = $_POST['re_xp_in'];
        } else {
            $xp_left = $xp;
        }
        $percentage_num = $xp_left - array_search($prev_lvl, $new);
        $percentage_dom = $xp_level - $current_rank_points;
        $percentage = $percentage_num / $percentage_dom * 100;
        if ($percentage <= 1) {
            $percentage = 1;
        }
        reset($new);
        $new = unserialize($testing);
        ksort($new);
        $first_value = next($new);
        $second_value = next($new);
        $third_value = next($new);
        $forth_value = next($new);
        $fifth_value = next($new);
        $sixth_value = next($new);
        $seventh_value = next($new);
        $eaighth_value = next($new);
        $nineth_value = next($new);
        $tenth_value = next($new);
        $eleventh_value = next($new);
        $twelveth_value = next($new);
        $thirteenth_value = next($new);
        $forteenth_value = next($new);
        //Gold!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        $period_count_check_three = (int) $wpdb->get_var("select count(*) from wp_total_cur where id = {$user_id} and period_one != 0 and period_two != 0 and period_three != 0");
        if ($period_count_check_three != 0) {
            $period_count = 3;
        } else {
            $period_count_check_two = (int) $wpdb->get_var("select count(*) from wp_total_cur where id = {$user_id} and period_one != 0 and period_two != 0");
            if ($period_count_check_two != 0) {
                $period_count = 2;
            } else {
                $period_count = 1;
            }
        }
        $minutes_required = 10800 * $period_count;
        $querygold = "SELECT SUM(gold) FROM wp_class_cur where login = '******'";
        $resultgold = mysql_query($querygold) or die(mysql_error());
        $rowgold = mysql_fetch_array($resultgold);
        $gold_rnd = $rowgold['SUM(gold)'];
        $queryminutes = "SELECT SUM(minutes) FROM wp_class_cur where login = '******'";
        $resultminutes = mysql_query($queryminutes) or die(mysql_error());
        $rowminutes = mysql_fetch_array($resultminutes);
        $minutes_rnd = $rowminutes['SUM(minutes)'];
        $wpdb->update($table_name_c, array('totalgold' => $gold_rnd), array(login => $userlogin), array('%d', '%d'), array('%s'));
        $qry_m = "select minutes, minutes_reason, timestamp from wp_class_cur where login = '******' and minutes IS NOT NULL order by id desc ";
        $qry_g = "select gold, gold_reason, timestamp from wp_class_cur where login = '******' and gold IS NOT NULL order by id desc";
        $qry_xp = "select type, data, points from wp_cp where uid = '{$user_id}' order by id desc";
        $qry_per = "select period_one, period_two, period_three, computer_one, computer_two, computer_three from wp_total_cur where login = '******'";
        $rt_m = mysql_query($qry_m);
        $rt_g = mysql_query($qry_g);
        $rt_xp = mysql_query($qry_xp);
        $rt_per = mysql_query($qry_per);
        $minutes_percentage = $minutes_rnd / $minutes_required * 100;
        ?>
 
 <head>
<link rel="stylesheet" href="/wp-content/themes/<?php 
        echo get_stylesheet();
        ?>
/sections/statspage/myown_js/ui-lightness/jquery-ui-1.8.21.custom.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="/wp-content/themes/<?php 
        echo get_stylesheet();
        ?>
/sections/statspage/myown_js/myown_style.css" /> 

</head>
<body>
<div id="topinfo">
<h2 id="gt"><?php 
        echo $gamertag;
        ?>
</h2>
<div id="gravatarstat">
<?php 
        echo '<div id="re_xp_p"></div>';
        echo get_avatar($user_id, '96', $default = '<path_to_url>');
        ?>
</div>
<div id="profileinfo">
<table cellpadding="0px" id="profiletable">
<tr><td width="150px"><a href="<?php 
        echo $user_website;
        ?>
" >Website</a></td><td width="150px">Ecountered: <?php 
        echo $quests_e + $quests_a + $quests_c + $quests_m;
        ?>
</td><tr>
<tr><td><?php 
        echo $rank;
        ?>
 </td><td> Accepted: <?php 
        echo $quests_a + $quests_c + $quests_m;
        ?>
</td></tr>
<tr><td> <?php 
        print $xp_left . '/' . $xp_level;
        ?>
</td><td> Completed: <?php 
        echo $quests_c + $quests_m;
        ?>
</td></tr>
<tr><td> <?php 
        print $gold_rnd;
        ?>
 Gold </td><td> Mastered: <?php 
        echo $quests_m;
        ?>
</td></tr>
<tr><td> <?php 
        echo $minutes_rnd;
        ?>
/<?php 
        echo $minutes_required;
        ?>
 Minutes</td><td>Not Encountered: <?php 
        echo $quests_ne;
        ?>
</td><tr>
</table>
</div>
<div id="progressbar">
	<?php 
        print "<div id=\"progress-bar-2\" class=\"all-rounded\">\n";
        print "<div id\n\t=\"progress-bar-percentage-stats-2\" class=\"all-rounded\" style=\"\n\t-webkit-border-radius: 5px;\n    -moz-border-radius: 5px;\n    border-radius: 5px;\n\tborder-bottom-width:100%px; \n\theight:20px;\n\tpadding: 5px 0px;\n \tcolor: #FFF;\n \tfont-weight: bold;\n\tbackground-color:#ff6600;\n\t\nbackground: -webkit-gradient(linear, left top, left bottom, \ncolor-stop(0%, #ff6600), color-stop(20%, #ff6600), color-stop(150%, rgba(255,255,255,.9))); \n\nbackground: -webkit-linear-gradient(top, #ff6600, rgba(255,255,255,.9)); \nbackground: -moz-linear-gradient(top, #ff6600 0%, #ff6600 20%, rgba(255,255,255,.9) 150%);\n \ttext-align: center; width: " . $percentage . "%\">";
        print "</div></div>";
        print $xp_left . '/' . $xp_level;
        ?>
     </div>
     <div id="progressbar2">
	<?php 
        print "<div id=\"progress-bar-3\" class=\"all-rounded\">\n";
        ?>
     
     <div id="time-indicator">
     <div id="ti"> | | | | | 
     </div>
     </div>
     <?php 
        print "<div id\n\t=\"progress-bar-percentage-stats-3\" class=\"all-rounded\" style=\"\n\t-webkit-border-radius: 5px;\n    -moz-border-radius: 5px;\n    border-radius: 5px;\n\tborder-bottom-width:100%px; \n\theight:20px;\n\tpadding: 5px 0px;\n \tcolor: #FFF;\n \tfont-weight: bold;\n\tbackground-color:#486fb3;\n\t\nbackground: -webkit-gradient(linear, left top, left bottom, \ncolor-stop(0%, #486fb3), color-stop(20%, #486fb3), color-stop(150%, rgba(255,255,255,.9))); \nbackground: -webkit-linear-gradient(top, #486fb3, rgba(255,255,255,.9)); \nbackground: -moz-linear-gradient(top, #486fb3 0%, #486fb3 20%, rgba(255,255,255,.9) 150%);\n \ttext-align: center; width: " . $minutes_percentage . "%\">";
        print "</div></div>";
        print $minutes_rnd . '/' . $minutes_required;
        ?>
  
 </div>
    </div>

<div id ="tabs">
<ul>
<li><a href="#quests">Quests</a></li>
<li><a href="#xp">XP</a></li>
<li><a href="#minutes">Minutes</a></li>
<li><a href="#gold">Gold</a></li>
<li><a href="#log">Log-ins</a></li>
</ul>
<div id="log">
<?php 
        $log_list = $wpdb->get_results("select i_datetime from wp_3wp_activity_monitor_index where user_id = {$user_id} and activity_id = 'wp_login' order by i_id desc");
        foreach ($log_list as $lg_list) {
            foreach ($lg_list as $log_lst) {
                echo $log_lst . '<br />';
            }
        }
        ?>
</div>
<div id="xp">
<table id="xp_table" rules="rows">
<tr><th>Type</th><th>Reason</th><th>XP</th></tr>
<?php 
        $j = 1;
        while ($nt = mysql_fetch_array($rt_xp)) {
            $xp_div_id = $j & 1 ? "odd" : "even";
            $data = $nt['data'];
            $type = $nt['type'];
            $xp_p = $nt['points'];
            $xp_quest_check = (int) $wpdb->get_var("select count(*) from wp_cp where data ='{$data}' and uid = {$user_id} and type = 'Quest'");
            if ($xp_quest_check != 0) {
                $xp_post_id = $wpdb->get_var("select post_parent from wp_posts where post_title = '{$data}' order by id desc limit 1");
                $xp_post_id_link = get_permalink($xp_post_id);
                echo '<tr id="' . $xp_div_id . '"><th>' . $type . '</th><th><a href="' . $xp_post_id_link . '">' . $data . '</a></th><th>' . $xp_p . '</th></tr>';
            } else {
                echo '<tr id="' . $xp_div_id . '"><th>' . $type . '</th><th>' . $data . '</th><th>' . $xp_p . '</th></tr>';
            }
            $j = $j + 1;
        }
        ?>
</table>
</div>
<div id="minutes">
<?php 
        $v = 1;
        while ($nt = mysql_fetch_array($rt_m)) {
            $minutes_div_id = $v & 1 ? "odd" : "even";
            $minutes = $nt['minutes'];
            $minutes_reason = $nt['minutes_reason'];
            echo '<div id="' . $minutes_div_id . '">' . $minutes . '-' . $minutes_reason . ' - ' . $nt['timestamp'] . '</div>';
            $v = $v + 1;
        }
        ?>
</div>
<div id="gold"
><?php 
        $g = 1;
        while ($nt = mysql_fetch_array($rt_g)) {
            $gold_div_id = $g & 1 ? "odd" : "even";
            $gold_d = $nt['gold'];
            $gold_reason_d = $nt['gold_reason'];
            $gold_check_master = (int) $wpdb->get_var("select count(*) from wp_cp where data ='{$gold_reason_d}' and uid = {$user_id} and status in(4,5)");
            $gold_check_pc = (int) $wpdb->get_var("select count(*) from wp_class_cur where gold_reason ='{$gold_reason_d}' and login = '******' and status = 5");
            if ($gold_check_master != 0) {
                $gold_post_id = $wpdb->get_var("select post_parent from wp_posts where post_title = '{$gold_reason_d}' order by id desc limit 1");
                $gold_post_id_link = get_permalink($gold_post_id);
                echo '<div id= "' . $gold_div_id . '">' . $gold_d . ' - <a href="' . $gold_post_id_link . '" >' . $gold_reason_d . '</a> - ' . $nt['timestamp'] . '</div>';
            } else {
                if ($gold_check_pc != 0) {
                    $gold_post_id = $wpdb->get_var("select post_parent from wp_posts where post_title = '{$gold_reason_d}' order by id desc limit 1");
                    $gold_post_id_link = get_permalink($gold_post_id);
                    echo '<div id= "' . $gold_div_id . '">' . $gold_d . ' - <a href="' . $gold_post_id_link . '" >' . $gold_reason_d . '</a> - ' . $nt['timestamp'] . '</div>';
                } else {
                    echo '<div id= "' . $gold_div_id . '">' . $gold_d . ' - ' . $gold_reason_d . ' - ' . $nt['timestamp'] . '</div>';
                }
            }
            $g = $g + 1;
        }
        ?>
</div>
<div id="quests">
<?php 
        $quests = $wpdb->get_results("SELECT id FROM wp_cp WHERE  status != 0 and uid = {$user_id} order by id desc");
        ?>
    <table> <tr align="left"><th> Encountered</th><th> Accepted</th><th> Completed</th><th> Mastered</th></tr><?php 
        $s = 1;
        foreach ($quests as $qst) {
            foreach ($qst as $qsts) {
                $encountered = $wpdb->get_var("SELECT data FROM wp_cp WHERE  status = 1 and uid = {$user_id} and id = {$qsts}");
                $accepted = $wpdb->get_var("SELECT data FROM wp_cp WHERE  status = 2 and uid = {$user_id} and id = {$qsts}");
                $completed = $wpdb->get_var("SELECT data FROM wp_cp WHERE  status = 3 and uid = {$user_id} and id = {$qsts}");
                $mastered = $wpdb->get_var("SELECT data FROM wp_cp WHERE  status = 4 and uid = {$user_id} and id = {$qsts}");
                $encountered_t = $wpdb->get_var("SELECT data FROM wp_cp WHERE  (status = 1 or status = 2 or status = 3 or status = 4) and uid = {$user_id} and id = {$qsts}");
                $accepted_t = $wpdb->get_var("SELECT data FROM wp_cp WHERE  ( status = 2 or status = 3 or status = 4) and uid = {$user_id} and id = {$qsts}");
                $completed_t = $wpdb->get_var("SELECT data FROM wp_cp WHERE  ( status = 3 or status = 4) and uid = {$user_id} and id = {$qsts}");
                $mastered_t = $wpdb->get_var("SELECT data FROM wp_cp WHERE  status = 4 and uid = {$user_id} and id = {$qsts}");
                $encountered_time = $wpdb->get_var("SELECT enc FROM wp_class_cur_log WHERE uid = {$user_id} and (quest ='{$encountered}' or quest = '{$accepted}' or quest = '{$completed}' or quest = '{$mastered}')");
                $accepted_time = $wpdb->get_var("SELECT acc FROM wp_class_cur_log WHERE  uid = {$user_id} and (quest ='{$encountered}' or quest = '{$accepted}' or quest = '{$completed}' or quest = '{$mastered}')");
                $completed_time = $wpdb->get_var("SELECT com FROM wp_class_cur_log WHERE  uid = {$user_id} and (quest ='{$encountered}' or quest = '{$accepted}' or quest = '{$completed}' or quest = '{$mastered}')");
                $mastered_time = $wpdb->get_var("SELECT mas FROM wp_class_cur_log WHERE  uid = {$user_id} and (quest ='{$encountered}' or quest = '{$accepted}' or quest = '{$completed}' or quest = '{$mastered}')");
                $title = $wpdb->get_var("SELECT data FROM wp_cp where id = {$qsts}");
                $ids = (int) $wpdb->get_var("SELECT post_parent FROM wp_posts WHERE  post_title = '{$title}'  order by id desc limit 1");
                $permalink = get_permalink($ids);
                ?>
                        
                       <tr id= "<?php 
                echo $s & 1 ? "odd" : "even";
                ?>
"> <td align="left" title="<?php 
                echo $encountered_time;
                ?>
"><a href="<?php 
                echo $permalink;
                ?>
"><?php 
                echo $encountered_t;
                ?>
 </a> </td> 
					<td align="left" title="<?php 
                echo $accepted_time;
                ?>
"> <a href="<?php 
                echo $permalink;
                ?>
"><?php 
                echo $accepted_t;
                ?>
</a> </td>
                     <td  align="left" title="<?php 
                echo $completed_time;
                ?>
"> <a href="<?php 
                echo $permalink;
                ?>
"><?php 
                echo $completed_t;
                ?>
 </a> </td>
                 <td align="left" title=" <?php 
                echo $mastered_time;
                ?>
"> <a href="<?php 
                echo $permalink;
                ?>
"><?php 
                echo $mastered_t;
                ?>
 </a> </td> </tr> <?php 
                $s = $s + 1;
            }
        }
        ?>
                         
                         </table>
                         
</div>

 </div>
 
 <script src="/wp-content/themes/<?php 
        echo get_stylesheet();
        ?>
/sections/statspage/myown_jquery.js"></script>
<script src="/wp-content/themes/<?php 
        echo get_stylesheet();
        ?>
/sections/statspage/myown_js/jquery-ui.js"></script>
<script src="/wp-content/themes/<?php 
        echo get_stylesheet();
        ?>
/sections/statspage/myown_js/development-bundle/external/jquery.cookie.js"></script>
<script src="/wp-content/themes/<?php 
        echo get_stylesheet();
        ?>
/sections/statspage/myown_js/ui.js"></script>



 </body>
		
	


		<?php 
        do_action('bp_after_blog_page');
        ?>

		</div><!-- .padder -->
	</div><!-- #content -->


	<?php 
    }