function update_news_pos($pos) { $db = get_db(); $category = new category_class('news'); if ($pos == 1) { $category_id = $category->find_by_name('富豪报道'); $category_id = $category_id->id; $type = 'richindex_news_'; } else { $category_id = $category->find_by_name('创富者说'); $category_id = $category_id->id; $type = 'richindex_news1_'; } $table = new table_class('fb_page_pos'); $db->echo_sql = true; $items = $db->query("select id,title,created_at,description,author from fb_news where category_id={$category_id} order by created_at desc limit 6"); $exist_items = $table->find('all', array('conditions' => "name like '{$type}%' and (end_time <= now() or end_time is null)", 'order' => "name")); $db->echo_sql = false; $len = empty($exist_items) ? 0 : count($exist_items); for ($i = 0; $i < $len; $i++) { $exist_items[$i]->display = $items[$i]->title; $exist_items[$i]->description = $items[$i]->description; $exist_items[$i]->href = dynamic_news_url($items[$i]); $exist_items[$i]->statci_href = static_news_url($items[$i]); $exist_items[$i]->title = $items[$i]->title; $exist_items[$i]->alias = $items[$i]->author; $exist_items[$i]->end_time = dt_increase(1, 'h', $exist_itmes->end_time); $exist_items[$i]->save(); } }
function update_news_column($category_name, $limit, $type, $position_name) { if ($type == 'author') { $author_type = 2; } else { if ($type == 'journalist') { $author_type = 1; } } $db = get_db(); $category = new category_class(); $category_id = $category->find_by_name($category_name)->id; if (!$category_id) { return false; } $ids = $category->children_map($category_id); $ids = implode(",", $ids); $sql = "select t1.id,t1.title,t1.short_title,t1.created_at,t1.description,t1.video_photo_src,t2.nick_name,t2.image_src,t2.column_name from fb_news t1 join fb_user t2 on t1.author_id=t2.id where 1=1 and t1.is_adopt=1 and t1.author_type={$author_type} and t1.category_id in ({$ids}) and t2.role_name='{$type}' order by t1.created_at desc"; $news = $db->query($sql); $news_count = $db->record_count; for ($i = 0; $i < $news_count; $i++) { for ($j = 0; $j < $limit; $j++) { $pos_name = $position_name . $j; $record = $db->query("select id,end_time from fb_page_pos where name='{$pos_name}'"); if ($db->record_count == 1) { if ($record[0]->end_time > now()) { } else { $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]->short_title; $pos->title = $news[$i]->title; $pos->image1 = $news[$i]->video_photo_src; $pos->image2 = $news[$i]->image_src; if (!$news[$i]->column_name) { $pos->alias = $news[$i]->nick_name . '专栏'; } else { $pos->alias = $news[$i]->column_name . '专栏'; } $pos->description = $news[$i]->description; $pos->href = dynamic_news_url($news[$i]); $pos->static_href = static_news_url($news[$i]); $pos->save(); break; } } 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]->short_title; $pos->title = $news[$i]->title; $pos->image1 = $news[$i]->video_photo_src; $pos->image2 = $news[$i]->image_src; if (!$news[$i]->column_name) { $pos->alias = $news[$i]->nick_name . '专栏'; } else { $pos->alias = $news[$i]->column_name . '专栏'; } $pos->description = $news[$i]->description; $pos->href = dynamic_news_url($news[$i]); $pos->static_href = static_news_url($news[$i]); $pos->comment = $category_name . $i; $pos->save(); break; } } } }
style="display:none;"<?php } ?> id="nav<?php echo $countnav[$i]->id; ?> "> <?php if ($navigation2) { ?> <div class="top_menu2_left"></div> <div class="top_menu2_content"> <?php $except = array("picindex", "piclist", "picbillionaires", "piclife", "piccolumn", "life"); for ($j = 0; $j < count($navigation2); $j++) { $url = !in_array($countnav[$i]->id_name, $except) ? get_newslist_url($category->find_by_name($navigation2[$j]->name)->id) : $navigation2[$j]->href; ?> <div class="t_content"> <div></div> <a target="<?php echo $navigation2[$i]->target; ?> " href="<?php echo $navigation2[$j]->href; ?> "><?php echo $navigation2[$j]->name; ?> </a> </div> <?php
<div class='menu' <?php if ($age && $age != -2) { ?> style="display:none;"<?php } ?> >准备怀孕</div> <div class="box" <?php if ($age && $age != -2) { ?> style="display:none;"<?php } ?> > <?php $cate = $category->find_by_name('积极备孕'); $childrens = $category->find_sub_category($cate->id); !$childrens && ($childrens = array()); ?> <div class="first_title"><a href="list.php?category_id=<?php echo $cate->id; ?> &age=-2"><?php echo $cate->name; ?> </a></div> <?php foreach ($childrens as $child) { ?> <div class="second_title"><a href="list.php?category_id=<?php echo $child->id;
?> class=lifelist><?php show_page_href(); ?> </div> <?php } ?> </div> </div> <div class=forbes_r> <div id=dictionary> <div id="dictionary_t"><a href="<?php echo get_newslist_url($category->find_by_name('财经词典')->id); ?> " target="_blank">财经词典</a></div> <div id=dictionary_r> <div id=content2 <?php $pos_name = "dictionary_r_content1"; show_page_pos($pos_name, 'dictionary'); ?> ><?php show_page_href(); ?> </div> <div id=content3 <?php #$pos_name ="dictionary_r_content2"; #show_page_pos($pos_name,'dictionary'); ?> ><?php
</div> <div id=life_bottom_flash> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="660" height="210"> <param name="movie" value="life3.swf"> <param name="quality" value="high"> <param name="wmode" value="transparent" /> <embed src="life3.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="660" height="210"></embed> </object> </div> <div class=life_box> <div class=life_caption> <div class=captions>服饰钟表</div> <div class=line>|</div> <?php $url = get_newslist_url($category->find_by_name("服饰钟表")->id); ?> <a href="<?php echo $url; ?> " class=more target="_blank"></a> </div> <?php $pos_name = "liftindex_news_1"; ?> <div id=picture <?php show_page_pos($pos_name, 'life_index'); ?> > <?php