예제 #1
0
 public function render($data)
 {
     $db = new WidgetModel();
     $rs = $db->where("name='douban'")->find();
     if ($rs['switch'] != 1) {
         return false;
         exit;
     }
     $db = new ConfigModel();
     $rs = $db->where("k='douban_fm'")->find();
     if ($rs === null || $rs === false) {
         return false;
         exit;
     }
     $douban_fm = $rs['v'];
     $rs = $db->where("k='douban_show'")->find();
     if ($rs === null || $rs === false) {
         return false;
         exit;
     }
     $douban_show = $rs['v'];
     echo "<h2>我的豆瓣</h2>";
     echo "<ul>";
     echo $douban_fm == '' ? '' : "<li>{$douban_fm}</li>";
     echo "</ul>";
 }
예제 #2
0
 public function render($data)
 {
     import("ORG.Util.Input");
     $db = new WidgetModel();
     $rs = $db->where("name='develop'")->find();
     if ($rs['switch'] != 1) {
         return false;
         exit;
     }
     $db = new WorldsModel();
     $rs = $db->field('id,text')->limit(5)->where("last_time<>''")->order('last_time desc')->select();
     //dump($rs);
     if ($rs === null || $rs === false) {
         return false;
         exit;
     }
     echo "<h2>最新动态</h2>";
     echo "<ul>";
     foreach ($rs as $rs) {
         $content = Input::truncate($rs['text'], 20);
         $link .= "[微博]:“";
         $link .= "<a href='";
         $link .= __APP__;
         $link .= "/Worlds/view/id/";
         $link .= $rs['id'];
         $link .= "'>";
         $link .= $content;
         $link .= "</a>";
         echo "<li>" . $link . "”有新回复</li>";
         unset($link);
     }
     echo "</ul>";
 }
예제 #3
0
 function render($data)
 {
     $db = new WidgetModel();
     $rs = $db->where("name='link'")->find();
     if ($rs['switch'] != 1) {
         return false;
     }
     $db = new LinksModel();
     $rs = $db->where("pass_flag=1")->limit(5)->select();
     //dump($rs);
     if ($rs === null || $rs === false) {
         return false;
         exit;
     }
     echo "<h2>友情链接</h2>";
     echo "<ul>";
     foreach ($rs as $rs) {
         echo "<li><a href='" . $rs['www_url'] . "'>" . $rs['worlds'] . "</a></li>";
     }
     echo "</ul>";
 }