Exemple #1
0
function mc_add_user_trend($user_id)
{
    $trend = mc_user_trend_count($user_id);
    if ($user_id != NULL) {
        M('action')->where("page_id='{$user_id}' AND user_id='{$user_id}' AND action_key='trend'")->delete();
        $action['page_id'] = $user_id;
        $action['user_id'] = $user_id;
        $action['action_key'] = 'trend';
        $action['action_value'] = $trend + 1;
        $action['date'] = strtotime("now");
        $result = M('action')->data($action)->add();
    }
}
Exemple #2
0
						</a>
					</li>
					<?php 
if (mc_user_id()) {
    ?>
					<li>
						<a href="<?php 
    echo U('user/index/index?id=' . mc_user_id());
    ?>
">
							<i class="icon-user"></i>
							<?php 
    if (mc_user_trend_count()) {
        ?>
<span class="count"><?php 
        echo mc_user_trend_count();
        ?>
</span><?php 
    }
    ?>
						</a>
					</li>
					<!--li>
						<a href="<?php 
    //echo U('user/reffer/index?id='.mc_user_id());
    ?>
">
							<i class="icon-trophy"></i>
						</a>
					</li-->
					<?php