Exemplo n.º 1
0
 public function vxZen2($options)
 {
     $_u = $options['target'];
     $z2 = new Zen_API($this->db, $_u, $this->Validator, false);
     echo '<script type="text/javascript" src="' . CDN_UI . 'js/jquery.js"> </script>';
     echo '<script type="text/javascript" src="/js/babel_zen2.js"> </script>';
     echo '<div id="main">';
     /* S: You're here */
     echo '<div class="blank">';
     _v_ico_map();
     echo ' <a href="/">' . Vocabulary::site_name . '</a> &gt; <a href="/u/' . urlencode($_u->usr_nick) . '">' . make_plaintext($_u->usr_nick) . '</a> &gt; ZEN <span class="tip_i"><small>2.0 alpha</small></span>';
     echo '</div>';
     /* E: You're here */
     echo '<div class="blank">';
     echo '<div id="zen2_top"><div id="zen2_top_left"><img src="/img/icons/silk/clock.png" align="absmiddle" /> ZEN / ' . $_u->usr_nick . ' &nbsp;<span class="zen2_date">' . date('M j', time()) . '</span></div>';
     echo '<div id="zen2_top_right"><span class="zen2_cur">概览</span>&nbsp;|&nbsp;<a href="">项目管理</a>&nbsp;|&nbsp;<a href="">随机展示</a>&nbsp;|&nbsp;<a href="">帮助与指南</a></div></div>';
     _v_hr();
     echo '<div class="zen2_projects"><div class="zen2_menu">进行中的项目</div>';
     echo '<div class="zen2_blank" id="zen2_projects_active">';
     echo $z2->vxLoadProjectsActive();
     echo '</div>';
     echo '</div>';
     _v_hr();
     echo '<div class="zen2_projects"><div class="zen2_menu">完成了的项目</div>';
     echo '<div class="zen2_blank" id="zen2_projects_done">';
     echo $z2->vxLoadProjectsDone();
     echo '</div>';
     echo '</div>';
     _v_hr();
     echo '<img src="/img/icons/silk/information.png" align="absmiddle" /> ' . Zen::vxTip($this->cl);
     echo '</div>';
     echo '</div>';
 }
Exemplo n.º 2
0
 public function vxLoadProjectsDone()
 {
     $user_id = 0;
     if (isset($_GET['user_id'])) {
         $user_id = intval($_GET['user_id']);
         if (!$this->Validator->vxExistUser($user_id)) {
             $user_id = 0;
         }
     } else {
         if ($this->User->usr_id != 0) {
             $user_id = $this->User->usr_id;
         }
     }
     if ($user_id == 0) {
         echo $this->r_failed;
     } else {
         $sql = "SELECT zpr_id, zpr_uid, zpr_title, zpr_private, zpr_type, zpr_tasks, zpr_notes, zpr_dbs, zpr_created FROM babel_zen_project WHERE zpr_progress = 1 AND zpr_uid = {$user_id} ORDER BY zpr_completed DESC";
         $rs = mysql_query($sql);
         $i = 0;
         $tasks = 0;
         $notes = 0;
         $dbs = 0;
         $o = '';
         while ($_p = mysql_fetch_array($rs)) {
             $i++;
             $tasks += $_p['zpr_tasks'];
             $notes += $_p['zpr_notes'];
             $dbs += $_p['zpr_dbs'];
             $_p['zpr_type_grid'] = 'zen2_grid_' . $_p['zpr_type'] . '_s';
             $o .= '<div class="zen2_project"><div class="' . $_p['zpr_type_grid'] . '"></div><div class="zen2_project_toolbar"><span class="tip_i"><small>' . Zen::vxIconTask($_p['zpr_tasks']) . ' / ' . Zen::vxIconNote($_p['zpr_notes']) . ' / ' . Zen::vxIconDB($_p['zpr_dbs']) . ' &nbsp;</small></span>';
             if ($_p['zpr_uid'] == $this->User->usr_id) {
                 $o .= Zen::vxUndoneButton($_p['zpr_id']);
                 $o .= Zen::vxDeleteButton($_p['zpr_id'], 'done');
             }
             $o .= '</div><div class="zen2_project_main">&nbsp; <a href="/project/view/' . $_p['zpr_id'] . '.html">' . make_plaintext($_p['zpr_title']) . '</a><span class="tip_i">&nbsp;...&nbsp;<small>created ' . make_desc_time($_p['zpr_created']) . ' ago</small></span></div></div>';
             unset($_p);
         }
         mysql_free_result($rs);
         $o .= '<div class="conclude">' . $i . ' 个完成了的项目 - ' . $tasks . ' 项任务 - ' . $notes . ' 则笔记 - ' . $dbs . ' 个数据库</div>';
         return $o;
     }
 }