示例#1
0
 function defaultAction()
 {
     $html = '';
     $page = new PageCommon(s('News'));
     $html .= $page->start();
     $html .= '<div class="row" style="margin-bottom:200px"><div class="col-md-offset-1 col-md-7"><h1>' . s('News') . '</h1><ul class="news-list">';
     foreach (Core::$sql->get('*', DB . 'news order by datetime_stamp desc') as $row) {
         translateFields(array('title', 'description'), $row);
         $html .= '<li><div class="item-date">' . time_format_date($row['datetime_stamp']) . '</div>' . '<h3><a name="' . $row['id'] . '"></a>' . $row['title'] . '</h3>' . '<p>' . $row['description'] . '</p>' . '</li>';
     }
     $html .= '</ul></div></div>';
     $html .= $page->stop();
     return $html;
 }
示例#2
0
文件: index.php 项目: bianle/www2
function display_nodes($link, $pc, $nodes, $tablewidth = "100%", $tablestyle = 0, $totalnodes, $pno)
{
    global $pcconfig;
    for ($i = 0; $i < min($pc["INDEX"]["nodeNum"], count($nodes)); $i++) {
        $contentcss = $nodes[$i]["htmltag"] ? "indexcontentwithhtml" : "indexcontent";
        if ($tablestyle == 1) {
            $tableclass = "f1";
            if ($i % 2 == 1) {
                $cellclass = array("t14", "t14", "t14");
            } else {
                $cellclass = array("t16", "t16", "t16");
            }
        } else {
            $tableclass = "t15";
            if ($i % 2 == 1) {
                $cellclass = array("t14", "t11", "t8");
            } else {
                $cellclass = array("t16", "t13", "t5");
            }
        }
        echo "<center><table cellspacing=0 cellpadding=10 width=\"" . $tablewidth . "\" class=" . $tableclass . ">\n" . "<tr><td class=\"" . $cellclass[0] . "\">" . time_format_date($nodes[$i]["created"]) . "</td>" . "<td class=\"" . $cellclass[1] . "\" align=right>[<a href=\"pccom.php?act=pst&nid=" . $nodes[$i]["nid"] . "\">评论</a>]\n" . "[<a href=\"";
        if ($pc["EMAIL"]) {
            echo "mailto:" . $pc["EMAIL"];
        } else {
            echo "/bbspstmail.php?userid=" . $pc["USER"] . "&title=问候";
        }
        echo "\">写信问候</a>]</td></tr>\n" . "<tr><td class=\"" . $cellclass[0] . "\"><img src=\"icon/" . $nodes[$i]["emote"] . ".gif\" border=0 align=absmiddle>\n" . "<a href=\"pccon.php?id=" . $pc["UID"] . "&nid=" . $nodes[$i]["nid"] . "&s=all\" class=f2>" . html_format($nodes[$i]["subject"]) . "</a></td>" . "<td align=right class=\"" . $cellclass[1] . "\">&nbsp;</td>" . "</tr>";
        if ($pc["INDEX"]["nodeChars"] == 0) {
            echo "<tr><td colspan=2 class=\"" . $cellclass[1] . "\"><font class='" . $contentcss . "'>" . html_format($nodes[$i]["body"], TRUE, $nodes[$i]["htmltag"]) . "</font></td></tr>\n";
        } else {
            echo "<tr><td colspan=2 class=\"" . $cellclass[1] . "\"><font class='" . $contentcss . "'>" . html_format(substr($nodes[$i]["body"], 0, $pc["INDEX"]["nodeChars"]) . " ", TRUE, $nodes[$i]["htmltag"]);
            if (strlen($nodes[$i]["body"]) > $pc["INDEX"]["nodeChars"]) {
                echo " <br class=\"\" /> ......<br class=\"\" /><br class=\"\" />" . "<strong><A href=\"pccon.php?id=" . $pc["UID"] . "&nid=" . $nodes[$i]["nid"] . "&s=all\">>> 阅读全文</A></strong>" . "</font></td></tr>\n";
            }
        }
        if (pc_is_groupwork($pc) && $nodes[$i]["publisher"]) {
            $publisher = $nodes[$i]["publisher"];
        } else {
            $publisher = $pc["USER"];
        }
        echo "<tr><td colspan=2 class=\"" . $cellclass[2] . "\"><font class=\"f7\">\n&nbsp; <a href=\"/bbsqry.php?userid=" . $publisher . "\">" . $publisher . "</a> 发布于 " . time_format($nodes[$i]["created"]) . "\n|\n浏览[" . $nodes[$i]["visitcount"] . "]" . "\n|\n<a href=\"pccon.php?id=" . $pc["UID"] . "&nid=" . $nodes[$i]["nid"] . "&s=all\">评论[" . $nodes[$i]["commentcount"] . "]</a>";
        if ($nodes[$i]["trackback"]) {
            echo "\n|\n<a href=\"javascript:openScript('pctb.php?nid=" . $nodes[$i]["nid"] . "&uid=" . $pc["UID"] . "&subject=" . base64_encode($nodes[$i]["subject"]) . "' , 460, 480)\">引用[" . $nodes[$i]["trackbackcount"] . "]</a>";
            echo "&nbsp;<a href=\"#\" onClick=\"javascript: holdtext.innerText = 'http://" . $pcconfig["SITE"] . "/pc/tb.php?id=" . $nodes[$i]["nid"] . "'; Copied = holdtext.createTextRange(); Copied.execCommand('Copy'); alert('该引用地址已经复制到剪贴板'); return false; \">Trackback Ping URL</a>";
        }
        echo "</font></td></tr>\n</table></center>\n";
    }
    echo "<center><table cellspacing=0 cellpadding=10 width=\"" . $tablewidth . "\" class=" . $tableclass . ">\n" . "<tr><td class=\"" . $cellclass[2] . "\" align=\"center\">";
    display_blog_page_tool($pc, $totalnodes, $pno);
    echo "</td></tr></table></center>";
}