$term order by no desc limit 0,1"; // print $sql; $result = @mysql_query($sql); while(list($no, $xml_url) = @mysql_fetch_array($result)) { if ($xml_url) { put_query("update t3_".$dbid."_rss set regdate = ".time()." where no = '$no'"); $rss_no = $no; } } } ob_start(); ?>
s_s; $d1 = str_replace("[##_s_t3_##]", $pre_d1.$skin->s_t3."[##_shortcut_script_##]".$post_d1, $d0); $image = $s_attach_path."image/".$p_imagefile; if (!$p_imagefile) $image = "images/spacer.gif"; $d1 = str_replace("[##_url_##]", "", $d1); $d1 = str_replace("[##_title_##]", "$p_title", $d1); $d1 = str_replace("[##_image_##]", $image, $d1); $d1 = str_replace("[##_onclick_image_##]", "window.open('image_pop.php?imagefile=$s_attach_path"."image/"."$p_imagefile&width=$p_width&height=$p_height','s_im','width=$p_width,height=$p_height,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0')", $d1); $d1 = str_replace("[##_desc_##]", $p_description, $d1); $d1 = str_replace("[##_search_text_##]", $stext, $d1); $d1 = str_replace("[##_search_name_##]", "search", $d1); $d1 = str_replace("[##_search_onclick_submit_##]", "window.location.href='index.php?stext='+document.weblog.search.value; return false;", $d1); if (strpos($d1, "[##_count_total_##]")) { $sql = "select sum(count) from t3_".$dbid."_count"; list ($sum) = mysql_fetch_array(mysql_query($sql)); $d1 = str_replace("[##_count_total_##]", $sum+$p_icount, $d1); } if (strpos($d1, "[##_count_today_##]") || strpos($d1, "[##_count_yesterday_##]")) { $day_count1 = 0; $day_count2 = 0; $sql = "select set_date, count from t3_".$dbid."_count where set_date between '".date("Ymd", mktime(0, 0, 0, date(m), date(d)-1, date(Y)))."' and '".date("Ymd")."' order by set_date asc"; $result = @mysql_query($sql); while(list($date, $count) = @mysql_fetch_array($result)) { if (date("Ymd") == $date) $day_count1 = $count; else $day_count2 = $count; } $d1 = str_replace("[##_count_today_##]", $day_count1, $d1); $d1 = str_replace("[##_count_yesterday_##]", $day_count2, $d1); } if ($pl) { $sql = "select regdate from t3_".$dbid." where no = '$pl'"; list ($rd) = mysql_fetch_array(mysql_query($sql)); $sql = "select count(*) from t3_".$dbid." where $is_public $add_query and regdate > '$rd'"; list ($r_cnt) = mysql_fetch_array(mysql_query($sql)); $start = $r_cnt; $end = 1; $page = $start+1; $pagelog = 1; $md = "pl"; } unset($p, $p2, $add_str); while(1) { if ($md == "rss" || $md == "guest" || ($ct1 && ($p_select_cat_view == 2)) || (($setdate || $setday) && ($p_select_arc_view == 2)) || ($stext && $pl) || $page != 1 || $pl || !($setdate || $setday || $stext || $ct1 || $ct2)) break; $p = $skin->s_list; $sql = "select no, category1, category2, title, user_id, image_file_path1, image_file_path2, regdate, rp_cnt from t3_".$dbid." where $is_public $add_query order by regdate desc"; // print $sql; $result = @mysql_query($sql); $list_count = mysql_num_rows($result); while(list($no, $category1, $category2, $title, $user_id, $image_file_path1, $image_file_path2, $regdate, $rp_cnt) = @mysql_fetch_array($result)) { if ($rp_cnt) $rp_cnt = "($rp_cnt)"; else $rp_cnt = ""; $p2_rp = $skin->s_list_rep; $p2_rp = str_replace("[##_list_rep_title_##]", $title, $p2_rp); $p2_rp = str_replace("[##_list_rep_link_##]", "index.php?pl=$no".$add_val, $p2_rp); $p2_rp = str_replace("[##_list_rep_regdate_##]", get_timevalue1($regdate), $p2_rp); $p2_rp = str_replace("[##_list_rep_rp_cnt_##]", $rp_cnt, $p2_rp); $p2 .= $p2_rp; } if ($ct2) $add_str = " - '".get_category2_label($ct2)."'"; if ($ct1) $p = str_replace("[##_list_conform_##]", "分類 '".get_category1_label($ct1)."' $add_str", $p); unset($add_str); if ($setday) $add_str = " ".$setday."日 "; if ($setdate) $p = str_replace("[##_list_conform_##]", substr($setdate,0,4)."年 ".intval(substr($setdate,4))."月".$add_str, $p); if ($stext) $p = str_replace("[##_list_conform_##]", "搜索 '$stext'", $p); $p = str_replace("[##_list_count_##]", $list_count, $p); $p = str_replace("[##_s_list_rep_##]", $p2, $p); break; } if (strpos($d1, "[##_s_list_##]")) $d1 = str_replace("[##_s_list_##]", $p, $d1); unset($p, $p2); if (!$pl && $stext) { $p = $skin->s_rplist; $sql = "select no, pno, name, body, regdate from t3_".$dbid."_reply where ".(return_authority()?(""):("is_secret = '0' and"))." (name like ('%$stext%') or body like ('%$stext%')) order by no desc"; // print $sql; $result = @mysql_query($sql); $rp_cnt = mysql_num_rows($result); while(list($no, $pno, $name, $body, $regdate) = @mysql_fetch_array($result)) { $p2_rp = $skin->s_rplist_rep; $p2_rp = str_replace("[##_rplist_rep_link_##]", $PHP_SELF."?pl=$pno#r$no", $p2_rp); $p2_rp = str_replace("[##_rplist_rep_regdate_##]", get_timevalue1($regdate), $p2_rp); $p2_rp = str_replace("[##_rplist_rep_name_##]", $name, $p2_rp); $p2_rp = str_replace("[##_rplist_rep_body_##]", str_cut($body, 50, 0), $p2_rp); $p2 .= $p2_rp; } if ($stext) $p = str_replace("[##_rplist_conform_##]", "搜索 '$stext'", $p); $p = str_replace("[##_rplist_count_##]", $rp_cnt, $p); } $p = str_replace("[##_s_rplist_rep_##]", $p2, $p); $d1 = str_replace("[##_s_rplist_##]", $p, $d1); while(1) { if ($md == "rss" || $md == "guest" || ($ct1 && $p_select_cat_view == 1 && !$pl) || (($setdate || $setday) && $p_select_arc_view == 1 && !$pl) || ($stext && !$pl)) break; $sql = "select count(*) from t3_".$dbid." where $is_public $add_query"; list ($t_cnt) = mysql_fetch_array(mysql_query($sql)); $sql = " select no, category1, category2, title, body , user_id, image_file_path1, image_file_path2, regdate , rp_cnt, tb_cnt, is_sync, is_public , perm_rp, perm_tb from t3_".$dbid." where $is_public $add_query order by regdate desc limit $start, $end "; // print $sql; $result = @mysql_query($sql); while(list( $no, $category1, $category2, $title, $body , $user_id, $image_file_path1, $image_file_path2, $regdate , $rp_cnt, $tb_cnt, $is_sync, $is_public_set , $perm_rp, $perm_tb ) = @mysql_fetch_array($result)) { unset($plbuffer); $set_tb = 0; $set_rp = 0; if (return_authority()) { $perm_tb = 1; $perm_rp = 1; } if ($pl || $p_show_preview) { if ($perm_tb && ($pl || $p_show_preview != 1)) { $plbuffer = get_tb_content($skin, $no); $set_tb = 1; } if ($perm_rp && ($pl || $p_show_preview != 2)) { $plbuffer .= get_rp_content($skin, $no); $set_rp = 1; } } unset ($perm_rp_link, $perm_tb_link); $category = get_category1_label($category1); if ($category2) $category .= " - ".get_category2_label($category2); if ($rp_cnt) $rp_cnt = "($rp_cnt)"; else $rp_cnt = ""; if ($tb_cnt) $tb_cnt = "($tb_cnt)"; else $tb_cnt = ""; $d2_rp = $skin->s_article_rep; $d2_rp = str_replace("[##_s_tb_##]", "", $d2_rp); $d2_rp = str_replace("[##_s_rp_##]", "", $d2_rp); $d2_rp = str_replace("[##_article_rep_title_##]", $title, $d2_rp); $d2_rp = str_replace("[##_article_rep_desc_##]", set_moreless( nl2brc( set_keyword( attach_image( 1, $body, $s_root_path, $r_root_path, $attach_path.$image_file_path1.$image_file_path2 ), $is_sync ) ), $no ), $d2_rp ); if ($perm_rp) $perm_rp_link = "onclick_addexe('$no', 'post_$no', weblog.post_$no"."_div_rp, weblog.post_$no"."_div_tb, 'rp'); return false;"; else $perm_rp_link = "alert('對不起,此文章日誌不允許訪客回覆.\\t'); return false;"; if ($perm_tb) $perm_tb_link = "onclick_addexe('$no', 'post_$no', weblog.post_$no"."_div_tb, weblog.post_$no"."_div_rp, 'tb'); return false;"; else $perm_tb_link = "alert('對不起,此文章日誌不接受文章引用傳送.\\t'); return false;"; $d2_rp = str_replace("[##_article_rep_name_##]", $user_id, $d2_rp); $d2_rp = str_replace("[##_article_rep_date_##]", get_timevalue1($regdate)." ".get_timevalue3($regdate), $d2_rp); $d2_rp = str_replace("[##_article_rep_link_##]", $PHP_SELF."?pl=$no".$add_val, $d2_rp); $d2_rp = str_replace("[##_article_rep_category_##]", $category, $d2_rp); $d2_rp = str_replace("[##_article_rep_category_link_##]", "index.php?ct1=$category1&ct2=$category2", $d2_rp); $d2_rp = str_replace("[##_article_div_area_##]", "
$plbuffer
", $d2_rp); $d2_rp = str_replace("[##_article_rep_rp_link_##]", $perm_rp_link, $d2_rp); $d2_rp = str_replace("[##_article_rep_tb_link_##]", $perm_tb_link, $d2_rp); $d2_rp = str_replace("[##_article_rep_rp_cnt_##]", $rp_cnt, $d2_rp); $d2_rp = str_replace("[##_article_rep_tb_cnt_##]", $tb_cnt, $d2_rp); if (strpos($d2_rp, "[##_s_ad_div_##]") && return_authority()) { $d3 = $skin->s_ad_div; if ($is_public_set) { $label1 = "公開"; $label2 = "不公開"; } else { $label1 = "不公開"; $label2 = "公開"; } $d3 = str_replace("[##_s_ad_m_link_##]", "admin/article_edit.php?num=$no&am=1", $d3); $d3 = str_replace("[##_s_ad_s1_label_##]", $label1, $d3); $d3 = str_replace("[##_s_ad_s2_label_##]", $label2, $d3); $d3 = str_replace("[##_s_ad_s2_link_##]", "admin/article.php?mode=set_public&exenum=".$no."_".$is_public_set."_".$is_sync."&am=1", $d3); $d3 = str_replace("[##_s_ad_t_onclick_##]", "window.open('admin/article_trackback_pop.php?no=$no','tb','width=550,height=200,location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0'); return false;", $d3); $d3 = str_replace("[##_s_ad_d_onclick_##]", "window.location.href='admin/article.php?mode=set_delete&exenum=".$no."_".$is_public_set."&am=1'; return false;", $d3); } $d2_rp = str_replace("[##_s_ad_div_##]", $d3, $d2_rp); $d2 .= $d2_rp; } break; } if (strpos($d1, "[##_s_guest_##]")) $d1 = str_replace("[##_s_guest_##]", get_guest(), $d1); unset($buf, $prev_page, $next_page); $i = $page - 5; $cnt = 0; $final = sprintf("%d", ($t_cnt+$pagelog-1) / $pagelog); if ($md) $add_val = "&md=$md".$add_val; if ($sort) $add_val = "&sort=$sort".$add_val; if ($i > 0 && $i > ($final - 9)) { $i = $final - 9; if ($i < 1) $i = 1; } if ($page > 5) { $buf .= set_paging_link(1); $buf .= " ... "; } while(1) { $i++; if ($i < 1) continue; $buf .= set_paging_link($i); $cnt++; if ($cnt == 9 || $i == $final || !$final) break; } if ($final > $i) { $buf .= " ... "; $buf .= set_paging_link($final); } $prev = $page; $next = $final; if ($page > 1) { $prev = $page-1; $prev_page = "href=\"index.php?page=".($page-1)."$add_val\""; } if ($page != $final && $final) { $next = $page+1; $next_page = "href=\"index.php?page=".($page+1)."$add_val\""; } $d1 = str_replace("[##_s_paging_rep_##]", $buf, $d1); $d1 = str_replace("[##_prev_page_##]", $prev_page, $d1); $d1 = str_replace("[##_next_page_##]", $next_page, $d1); ob_start(); ?> ".get_rctps_rep(), $d1); if (strpos($d1, "[##_s_rctrp_rep_##]")) $d1 = str_replace("[##_s_rctrp_rep_##]", "".get_rctrp_rep(), $d1); if (strpos($d1, "[##_s_rcttb_rep_##]")) $d1 = str_replace("[##_s_rcttb_rep_##]", "".get_rcttb_rep(), $d1); if (strpos($d1, "[##_s_link_rep_##]")) $d1 = str_replace("[##_s_link_rep_##]", get_link_rep(), $d1); $d1 = str_replace("[##_s_article_rep_##]", $d2, $d1); $time_total = chk_time($time_total); print $d1; print " "; ?>