Ejemplo n.º 1
0
 function can_i_comment()
 {
     return time() > strtotimelt($this->may_comment_after);
 }
Ejemplo n.º 2
0
 function show_userinfo()
 {
     global $user, $g_usr;
     isset($user) || redirect('/');
     $this->tpl->set_file('temp', 'users/tpl/userinfo.html');
     $info = $g_usr->get_user_info($user);
     if (!$info) {
         //var_dump($info); exit;
         redirect('http://art.scene.lt/process.php/page.simple;menuname.nouser');
     }
     $info['url'] = $this->completeUri($info['url']);
     if (time() < strtotimelt($info['may_comment_after'])) {
         $info['comment_after'] = 1;
     }
     if (time() < strtotimelt($info['may_send_work_after'])) {
         $info['send_work_after'] = 1;
     }
     if (!$info) {
         redirect('/process.php/page.simple;menuname.nouser');
     }
     $tmp = $this->db->get_array("SELECT COUNT(*) AS count FROM avcomments WHERE user_id='{$user}'");
     $info['comments'] = $tmp['count'];
     $tmp = $this->db->get_array("SELECT COUNT(*) AS count, sum(mark) AS sum_mark FROM avworkvotes WHERE user_id='{$user}'");
     $info['votes'] = $tmp['count'];
     $info['sum_mark'] = $tmp['sum_mark'] ? $tmp['sum_mark'] : 0;
     $this->tpl->set_var('user', $info);
     $this->tpl->set_var('nonactive', '');
     if (empty($info["active"])) {
         $this->tpl->set_var('nonactive', 'atjungtas');
     }
     return $this->tpl->process('out', 'temp', TPL_OPTIONAL);
 }