function update_column2($type, $limit, $position_name, $news_limit, $news_position, $flag = true) { $db = get_db(); for ($k = 0; $k < $limit; $k++) { $pos_name = $position_name . $k; $column = $db->query("select t2.id,t2.name from fb_page_pos t1 join fb_user t2 on t1.alias=t2.name where t1.name='{$pos_name}' "); if ($db->record_count == 1) { $sql = "select title,id,short_title,created_at,description,video_photo_src from fb_news where publisher={$column[0]->id} and is_adopt=1 group by title order by created_at desc limit {$news_limit}"; $news = $db->query($sql); $news_count = $db->record_count; } else { $news_count = 0; } for ($i = 0; $i < 4; $i++) { $pos_name = $position_name . $k . $news_position . $i; $record = $db->query("select id,end_time from fb_page_pos where name='{$pos_name}'"); if ($db->record_count == 1) { $pos = new table_class('fb_page_pos'); $pos->find($record[0]->id); $end_time = date('Y-m-d H:00:00', strtotime("+1hours", time())); $pos->end_time = $end_time; $pos->display = $news[$i]->title; $pos->title = $news[$i]->title; $pos->image1 = $news[$i]->video_photo_src; $pos->description = $news[$i]->description; $pos->href = dynamic_news_url($news[$i]); $pos->static_href = column_article_url($column[0]->name, $news[$i]->id, 'static'); $pos->save(); } else { $pos = new table_class('fb_page_pos'); $pos->name = $pos_name; $end_time = date('Y-m-d H:00:00', strtotime("+1hours", time())); $pos->end_time = $end_time; $pos->display = $news[$i]->title; $pos->title = $news[$i]->title; $pos->image1 = $news[$i]->video_photo_src; $pos->description = $news[$i]->description; $pos->href = dynamic_news_url($news[$i]); $pos->static_href = column_article_url($column[0]->name, $news[$i]->id, 'static'); $pos->save(); } } } }
?> </div> </div> <div class=newarticle> <div class=wz>最新专栏文章</div> <div class=wx> <div class="enterzl"></div> </div> <?php $news = $db->query('select * from fb_news where publisher=' . $user[$i]->id . ' order by priority asc, created_at desc limit 2'); $ncount = $db->record_count; for ($j = 0; $j < $ncount; $j++) { ?> <div class=content> <div class=context><a href="<?php echo column_article_url($user[$i]->name, $news[$j], 'static'); ?> "><?php echo $news[$j]->title; ?> </a></div> </div> <?php if ($j == 0) { ?> <div class=content_dash></div> <?php } } ?> </div>
$table->name = $pos; $table->display = $news[0]->title; $table->description = $news[0]->description; $table->image1 = $items[$i]->image_src; $table->alias = $items[$i]->column_name ? $items[$i]->column_name : $items[$i]->nick_name; $table->reserve = "/column/{$items[$i]->name}"; $table->href = dynamic_news_url($news[0]); $table->static_href = column_article_url($news[0]->name, $news[0], 'static'); $table->save(); $selected_news[] = $news[0]->id; for ($j = 1; $j < 3; $j++) { $pos = 'column_recommend_top_r_t2_' . $i . '_' . $j; $table->find('first', array("conditions" => "name = '{$pos}'")); #if(strtotime($table->end_time) && strtotime($table->end_time) >= time()){ # continue; #} $table->name = $pos; $table->display = $news[$j]->title; $table->href = dynamic_news_url($news[$j]); $table->static_href = column_article_url($news[$j]->name, $news[$j], 'static'); $table->save(); if ($news[$j]->id) { $selected_news[] = $news[$j]->id; } } } update_pos("城市", 3, "index_city", true, true); #update_pos("早餐资讯",3,"index_zczx_",true,true); #update_pos("基金经理看市",1,"index_jjjl",true,true); #update_pos("股票之选",1,"index_gpzx",true,true); update_pos("阳光财富观察", 2, "index_dyn_list", true, true);
echo $news[0]->title; ?> </a></div> <div id=content title="<?php echo strip_tags($news[0]->description); ?> "><?php echo $news[0]->description; ?> </div> </div> <?php for ($i = 1; $i < 5; $i++) { ?> <div class="title" ><a href="<?php echo column_article_url($news[$i]->name, $news[$i]->id, 'static'); ?> " title="<?php echo $news[$i]->title; ?> "><?php echo $news[$i]->title; ?> </a></div> <?php } ?> </div> <div class=column_edit> <div class=captions>专栏文章推荐</div> <div class=line>|</div>
$news = new table_class('fb_news'); $news->find($id); ?> <div id=comment_caption> <div id=comment_title>读者评论</div> <div id=comment_count>(共<?php echo $count; ?> 条)</div> <button id=comment_btn></button> <div id="comment_more"> <?php if ($news->is_adopt == 0) { $db->query("select name from fb_user where id={$news->publisher}"); $name = $db->field_by_name('name'); $url = column_article_url($name, $news, 'static'); } else { $url = static_news_url($news); } ?> <a href="<?php echo $url; ?> ">返回<?php echo $news->title; ?> </a> </div> </div> <div class=publish_comment id='show_comment'>
if ($date != "") { if (strtotime($date) === false) { die_error(); } $sql = ' and left(created_at,7)="' . $date . '"'; } else { $sql = ''; } if ($type == "news") { $news = $db->paginate('select a.*,b.name from fb_news a left join fb_user b on a.publisher = b.id where publisher=' . $id . $sql . ' and is_adopt=1 group by a.title order by priority asc, created_at desc', 4); for ($i = 0; $i < count($news); $i++) { ?> <div class=r_content> <div class=r_title> <div class=wz>·<a target="_blank" href="<?php echo column_article_url($news[$i]->name, $news[$i]); ?> "><?php echo get_fck_content($news[$i]->title); ?> </a></div> <div class=subtime>发表于:<?php echo substr($news[$i]->created_at, 0, 10); ?> </div> </div> <?php $comment = $db->query('select count(*) as num from fb_comment where resource_id=' . $news[$i]->id); ?> <div class=r_read>阅读数 (<?php echo $news[$i]->click_count;
$item = $db->query("select t1.*,t2.name,t2.image_src from fb_news t1 join fb_user t2 on t1.publisher=t2.id where t1.publisher not in {$nid} and t2.role_name='column_editor' order by t1.created_at desc;"); $ids[] = $item[0]->publisher; ?> <div class="guide_hr_val2"> <a target="_blank" style="color:#057FE4" href="<?php echo "/column/" . $item[0]->name; ?> "><?php echo $item[0]->author; ?> </a> <a target="_blank" style="margin:0;" title="<?php echo strip_tags($item[0]->title); ?> " href="<?php echo column_article_url($item[0]->name, $item[0], 'static'); ?> "><?php echo $item[0]->title; ?> </a> </div> <?php } ?> </div> <div class="center_box"> <div class="normal_title"><div>读者高见</div></div> <?php $comments = $db->query("select * from fb_comment where resource_type='news' and is_approve=1 order by priority asc,created_at desc limit 4"); $news = new table_class('fb_news');