示例#1
0
文件: news.php 项目: nqv/eposys
 if ($epsclass->db->num_rows($result)) {
     $news = array();
     while ($cur_news = $epsclass->db->fetch_assoc($result)) {
         // Truncate
         if (eps_strlen($cur_news['content']) > $max_length && $nid < 1) {
             $cur_news['content'] = eps_truncate($cur_news['content'], $max_length);
             $cur_news['title'] = auto_gen_link('index.php?nid=' . $cur_news['id'], html_clean($cur_news['title']));
         } else {
             $cur_news['title'] = html_clean($cur_news['title']);
         }
         // BBCode
         $cur_news['content'] = $epsclass->bbcode->format($cur_news['content'], $cur_news['no_smiley']);
         // Author Or MODADMIN
         if (!empty($eps_user['id']) && ($cur_news['poster_id'] == $eps_user['id'] || IS_MODADMIN)) {
             // Edit, Delete Link
             $cur_news['action'] = gen_editlink('index.php?eps=post&amp;nid=' . $cur_news['id']);
             // Last edit by
             if (!empty($cur_news['edit_by'])) {
                 $cur_news['content'] .= '<p class="postedit">' . $eps_lang['Last_edit_by'] . ': ' . html_clean($cur_news['editor']) . ' &raquo; ' . format_time($cur_news['edit_time']) . '</p>';
             }
         }
         $cur_news['desc'] = auto_gen_link('index.php?eps=list&amp;list=user&amp;uid=' . $cur_news['poster_id'], html_clean($cur_news['poster']), '', true) . ' &raquo; ' . format_time($cur_news['post_time']);
         $news[] = $cur_news;
     }
     $smarty->assign('news_shows', $news);
     $smarty->assign('nid', $nid);
     $smarty->assign('pagination', $epsclass->paginate->gen_page_link());
     $smarty->display('module/news.tpl');
 } else {
     $smarty->display('empty.tpl');
 }
示例#2
0
文件: share.php 项目: nqv/eposys
                $epsclass->db->vinsert(TBL_SHARE, $inserts);
                redirect('index.php?eps=share', $eps_lang['Redirect_share_post']);
                return;
            } else {
                $errors = $epsclass->upload->errors;
            }
        } else {
            $errors = $epsclass->validate->errors;
        }
    }
    // Paginate
    $epsclass->load_class('class_paginate');
    $sqls = array("SELECT COUNT(id) FROM " . TBL_SHARE, "SELECT u.username,s.* FROM " . TBL_SHARE . " s LEFT JOIN " . TBL_USER . " u ON s.poster_id=u.id ORDER BY s.post_time DESC");
    $result = $epsclass->paginate->get_result($sqls, 'index.php?eps=share', $p);
    $shares = array();
    if ($epsclass->paginate->num_result()) {
        while ($cur_share = $epsclass->db->fetch_assoc($result)) {
            $tmp = array('link' => gen_link('download.php?down=share&amp;id=' . $cur_share['id'], html_clean($cur_share['url']), '', true), 'comment' => html_clean($cur_share['comment']), 'poster' => auto_gen_link('index.php?eps=list&amp;list=user&amp;uid=' . $cur_share['poster_id'], html_clean($cur_share['username']), '', true), 'post_time' => format_time($cur_share['post_time']));
            if ($cur_share['poster_id'] == $eps_user['id'] || IS_MODADMIN) {
                $tmp['editlink'] = gen_editlink('index.php?eps=share&amp;shid=' . $cur_share['id']);
            }
            $shares[] = $tmp;
        }
        $smarty->assign('pagination', $epsclass->paginate->gen_page_link());
    }
    $smarty->assign('error_show', !empty($errors) ? gen_alert($errors) : '');
    $smarty->assign('shares', $shares);
    $smarty->assign('comment', isset($comment) ? html_clean($comment) : '');
    $smarty->display('module/share.tpl');
}
unset($p, $shid, $action, $errors, $req_fields, $this_share, $comment, $updates, $inserts, $sqls, $shares);