function votesys_gen_vote()
{
    if (is_user_logged_in()) {
        $userdata = get_userdata(get_current_user_id());
        echo "<center>Sveikas " . $userdata->display_name . "<br><br>";
        $vote_user = get_user_stats(get_current_user_id());
        $settings = get_option('votesys_options');
        echo "Jūs turite: " . $vote_user->points . " balsavimo taškus.<br><br>";
        echo "Visa informacija kodėl verta balsuoti, ką gausite balsuodami ir kaip tai padaryti nurodita <a href = '" . $settings['help_href'] . "'> čia.</a> <br><br>";
        echo "<i>Pastaba: paslaugų uždėjimo sistemą kolkas yra tobulinama todėl jas kolkas galite atsiimti tik parašius administracijai skype arba pm (Ideo)</i><br><br>";
        echo "<b>Svetainės kuriose galite balsuoti</b><br><br>";
        echo "<table class ='vote-table-top' width = '100%'>";
        echo "<tr class ='vote-table-top'><th>Topo pavadinimas</th><th>Taškų kuriuos gausite skaičius</th><th>Galite balsuoti vieną karta per</th><th>Ar galite balsuoti?</th><th>Baneris</th></tr>";
        global $wpdb;
        $table_name = $wpdb->prefix . 'votesys_topsite';
        $results = $wpdb->get_results("SELECT * FROM  `" . $table_name . "`");
        foreach ($results as $site) {
            echo "<tr class = 'vote-table-middle'><th class = 'vote-table-middle1'>" . $site->site_name . "</th>";
            echo "<th class = 'vote-table-middle1'>" . $settings['add_point_sk'] . "</th>";
            echo "<th class = 'vote-table-middle1'>" . $site->vote_interval_text . "</th>";
            if (can_vote($vote_user, $site->vote_site_id)) {
                echo "<th style='color:green;'>TAIP</th>";
            } else {
                echo "<th style='color:red;'>NE</th>";
            }
            echo "<th class = 'vote-table-middle1'><a href=wp-content/plugins/Vote-system/vote.php?userid=" . $vote_user->id . "&siteid=" . $site->vote_site_id . "><img src =" . $site->site_banner_url . "></img></th></tr>";
        }
        echo "</table></center>";
    } else {
        echo "<center> Sveiki! <br><br> <div class = 'vote-warning' >Jus nesate prisijunge prie tinklapio todėl už atiduotus balsus negausite taškų !</div> <br>";
        echo "Visa informacija kodėl verta balsuoti, ką gausite balsuodami ir kaip tai padaryti nurodita <b>SICIA REIKIA HREFO PADORAUS NEZINAU KA RASYTTTTTTTTT</b><a href = ''> čia.</a> <br><br>";
        echo "<b>Svetainės kuriose galite balsuoti</b><br><br>";
        echo "<table class ='vote-table-top' width = '100%'>";
        echo "<tr class ='vote-table-top'><th>Topo pavadinimas</th><th>Taškų kuriuos gutumete balsuojant prisijungus skaičius</th><th>Baneris</th></tr>";
        global $wpdb;
        $table_name = $wpdb->prefix . 'votesys_topsite';
        $results = $wpdb->get_results("SELECT * FROM  `" . $table_name . "`");
        $settings = get_option('votesys_options');
        foreach ($results as $site) {
            echo "<tr class = 'vote-table-middle'><th class = 'vote-table-middle1'>" . $site->site_name . "</th>";
            echo "<th class = 'vote-table-middle1'>" . $settings['add_point_sk'] . "</th>";
            echo "<th class = 'vote-table-middle1'>" . $site->site_web . "</th></tr>";
        }
        echo "</table></center>";
    }
}
Beispiel #2
0
foreach ($_pfields as $field_id => $field) {
    //	if ($field->config['visible']) {
    $query .= ',' . $field->query_select();
    //	}
}
$query .= " FROM `{$dbtable_prefix}user_profiles` WHERE `fk_user_id`={$uid}";
if (!($res = @mysql_query($query))) {
    trigger_error(mysql_error(), E_USER_ERROR);
}
if (mysql_num_rows($res)) {
    $output = array_merge($output, mysql_fetch_assoc($res));
    $output['date_added'] = strftime($config['datetime_format'], $output['date_added'] + $config['time_offset']);
    if (empty($output['del'])) {
        unset($output['del']);
    }
    $output = array_merge($output, get_user_stats($output['fk_user_id'], array('profile_comments', 'blog_posts', 'total_photos')));
    if (empty($output['profile_comments'])) {
        unset($output['profile_comments']);
    }
    if (empty($output['blog_posts'])) {
        unset($output['blog_posts']);
    }
    if (empty($output['total_photos'])) {
        unset($output['total_photos']);
    }
    // set all the fields to their real (readable) values
    foreach ($_pfields as $field_id => $field) {
        //		if ($field->config['visible']) {
        $_pfields[$field_id]->set_value($output, false);
        //		}
    }
Beispiel #3
0
$query = "SELECT b.`m_name`,UNIX_TIMESTAMP(a.`paid_until`) as `paid_until` FROM `{$dbtable_prefix}payments` a,`{$dbtable_prefix}memberships` b WHERE a.`m_value_to`=b.`m_value` AND a.`fk_user_id`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "' AND a.`paid_until`>'" . gmdate('Ymd') . "' AND a.`refunded`=0 AND a.`is_active`=1 ORDER BY a.`paid_until` DESC LIMIT 1";
if (!($res = @mysql_query($query))) {
    trigger_error(mysql_error(), E_USER_ERROR);
}
if (mysql_num_rows($res)) {
    $output = array_merge($output, mysql_fetch_assoc($res));
    $output['paid_until'] = strftime($_SESSION[_LICENSE_KEY_]['user']['prefs']['date_format'], $output['paid_until'] + $_SESSION[_LICENSE_KEY_]['user']['prefs']['time_offset']);
} else {
    $query = "SELECT b.`m_name` FROM `" . USER_ACCOUNTS_TABLE . "` a,`{$dbtable_prefix}memberships` b WHERE a.`membership`=b.`m_value` AND a.`" . USER_ACCOUNT_ID . "`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "'";
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    $output['m_name'] = mysql_result($res, 0, 0);
    $output['paid_until'] = $GLOBALS['_lang'][123];
}
$my_stats = get_user_stats($_SESSION[_LICENSE_KEY_]['user']['user_id'], array('total_photos', 'pviews', 'num_friends'));
$query = "SELECT count(*) FROM `{$dbtable_prefix}user_inbox` WHERE `fk_user_id`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "' AND `del`=0";
if (!($res = @mysql_query($query))) {
    trigger_error(mysql_error(), E_USER_ERROR);
}
$my_stats['total_messages'] = mysql_result($res, 0, 0);
$query = "SELECT count(*) FROM `{$dbtable_prefix}user_inbox` WHERE `is_read`=0 AND `fk_user_id`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "' AND `del`=0";
if (!($res = @mysql_query($query))) {
    trigger_error(mysql_error(), E_USER_ERROR);
}
$my_stats['new_messages'] = mysql_result($res, 0, 0);
$tpl->set_file('content', 'home.html');
$tpl->set_var('output', $output);
$tpl->set_var('my_stats', $my_stats);
$tpl->process('content', 'content');
$tplvars['title'] = $GLOBALS['_lang'][124];
Beispiel #4
0
	<tr>
		<th rowspan="2" align="center">Przyznane</th>
		<th colspan="2" align="center">Skontaktowane?</th>
		<th rowspan="2" align="center">Telefony</th>
		<th rowspan="2" align="center">Spotkania</th>
		<th rowspan="2" align="center">W sumie</th>
	</tr>
	<tr>
		<th align="center">TAK</th>
		<th align="center">NIE</th>
	</tr>
<?php 
$involved = array_keys(get_project_involved($_GET['project_id']));
$suma = array('all' => 0, 'contacted' => 0, 'telefon' => 0, 'spotkanie' => 0);
foreach ($involved as $inv_id) {
    $stats = get_user_stats($inv_id, $_GET['project_id']);
    foreach ($stats as $key => $value) {
        $suma[$key] += $value;
    }
    echo '<tr><td align="center" nowrap>';
    display_link_to_user($inv_id);
    if (is_ocp($inv_id, $_GET['project_id'])) {
        echo ' (OCP)';
    }
    echo '</td><td align="center">' . join('</td><td align="center">', array($stats['all'], $stats['contacted'], $stats['all'] - $stats['contacted'], $stats['telefon'], $stats['spotkanie'], $stats['telefon'] + $stats['spotkanie'])) . "</td></tr>\n";
}
echo '<tr><td align="center"><b>W SUMIE</b></td><td align="center"><b>' . join('</b></td><td align="center"><b>', array($suma['all'], $suma['contacted'], $suma['all'] - $suma['contacted'], $suma['telefon'], $suma['spotkanie'], $suma['telefon'] + $suma['spotkanie'])) . "</td></tr>\n";
?>
</table>
<br><br></td></tr>
<?php 
Beispiel #5
0
     }
     $smarty->display('static/downloads.tpl');
     break;
 case 'top100':
     $smarty->assign('stats', get_top100_info($_GET['what'], $_GET['type']));
     $smarty->display('top100.tpl');
     break;
 case 'stats':
     $uid = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : 0;
     $weekly = isset($_GET['weekly']);
     $smarty->assign('active_page', 'stats');
     $smarty->setCaching(Smarty::CACHING_LIFETIME_SAVED);
     $smarty->setCacheLifetime(300);
     $cache_key = $uid . '@' . (int) $weekly . (isset($_GET['team']) ? (int) $_GET['team'] : 0);
     if (!is_cached('stats.tpl', $cache_key)) {
         $smarty->assign('user_stats', get_user_stats($weekly, isset($_GET['team']) ? $_GET['team'] : 0));
         $smarty->assign('ma_count', count_all_answers());
     }
     $smarty->display('stats.tpl', $cache_key);
     break;
 case 'tag_stats':
     $smarty->assign('active_page', 'stats');
     $smarty->assign('stats', get_tag_stats());
     $smarty->display('tag_stats.tpl');
     break;
 case 'genre_stats':
     $smarty->assign('active_page', 'stats');
     $smarty->assign('stats', get_common_stats());
     $smarty->display('genre_stats.tpl');
     break;
 case 'charts':
Beispiel #6
0
function get_users_stats($usernames = [], $wiki = null)
{
    global $settings;
    $wiki = isset($wiki) ? $wiki : $settings['main_page_wiki'];
    $ret = [];
    $cnt = 0;
    while ($cnt * 50 < count($usernames)) {
        $temp_usernames = array_slice($usernames, $cnt * 50, 50);
        $cnt++;
        $cache = get_user_stats_cache($temp_usernames, $wiki);
        $cache_usernames = [];
        for ($i = 0; $i < count($cache); $i++) {
            $ret[$cache[$i]['username']] = array('all' => $cache[$i]['art_count'], 'pending' => $cache[$i]['pending_art'], 'yes' => $cache[$i]['valid_art'], 'no' => $cache[$i]['invalid_art']);
            array_push($cache_usernames, $cache[$i]['username']);
        }
        $temp_usernames = array_diff($temp_usernames, $cache_usernames);
        foreach ($temp_usernames as $username) {
            $ret[$username] = get_user_stats($username, $wiki);
        }
    }
    return $ret;
}
<?php

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(-1);
include 'Functions.php';
$user_id = $_GET['userid'];
$site_id = $_GET['siteid'];
$site = get_votesite_by_id($site_id);
$settings = get_option('votesys_options');
$vote_user = get_user_stats($user_id);
echo lookup_points($site_id);
/*
if($settings['advance_tracking'])
{
    if(can_vote($vote_user,$site_id) && !lookup_pending($site_id,$vote_user))
    {
	$lookup_time = time();
	
	add_lookup($site_id,$lookup_time,$vote_user);
	header('Location: '.$site->site_vote_url);
	
	flush();
	sleep(45);
	
	$lookup = get_lookup_data($lookup_time);
	$points = lookup_points($site_id);
		
	if($points > $lookup-> points_on_lookup)
	{
            vote($vote_user,$site_id);