$pku_img_tmp
|;
} else {
$fre_pku_image = qq|
|;
}
} else {
$fre_pku_image = qq|
|;
}
} else {
$fre_pku_image = qq|
|;
}
if($news_item_data_db{$t_pku_link} ne "" && ($news_item_data_db{"pku_text_pos"} eq "left" || $news_item_data_db{"pku_text_pos"} eq "right")) {
$fre_pku_image = qq|
${fre_pku_image}|;
}
$fre_pku_item_html .= $fre_pku_image;
}
if ($pku_link_flg == 1) {
$fre_pku_item_html .= qq||;
}
my $fre_pku_comment = "";
if ($news_item_data_db{$t_pku_text} ne "") {
if ($news_item_data_db{"pku_text_pos"} eq "up" && $fre_pku_image ne "") {
if ($news_item_data_db{disp_mode} == 1) {
$fre_pku_comment = qq||;
} else {
$fre_pku_comment = qq||;
}
} else {
$fre_pku_comment = qq||;
}
$fre_pku_item_html .= $fre_pku_comment;
}
} elsif ($news_item_data_db{"pku_text_pos"} eq "left" || $news_item_data_db{"pku_text_pos"} eq "right") {
if ($news_item_data_db{$t_pku_item_title} ne "") {
if ($news_item_data_db{disp_mode} == 1) {
$fre_pku_item_html .= qq|
$news_item_data_db{$t_pku_item_title}
\n|;
} else {
$fre_pku_item_html .= qq|
$news_item_data_db{$t_pku_item_title}
\n|;
}
}
my $fre_pku_image = "";
if ($pku_img_tmp ne "") {
#$pku_img_tmp = qq|
$pku_img_tmp
|;
if ($news_item_data_db{$t_pku_item_title} eq "") {
if ($news_item_data_db{disp_mode} == 1) {
#$fre_pku_image = qq|
$pku_img_tmp
|;
$fre_pku_image = qq|
|;
} else {
#$fre_pku_image = qq|
$pku_img_tmp
|;
$fre_pku_image = qq|
|;
}
} else {
$fre_pku_image = qq|
|;
}
if($news_item_data_db{$t_pku_link} ne "") {
$fre_pku_image = qq|
${fre_pku_image}|;
}
$fre_pku_item_html .= $fre_pku_image;
}
my $fre_pku_comment = "";
if ($news_item_data_db{$t_pku_text} ne "") {
$fre_pku_comment = qq||;
$fre_pku_item_html .= $fre_pku_comment;
}
}
$pku_tmp = <<_HTML_;
$fre_pku_item_html
_HTML_
if ($pku_tmp ne "") {
my $phone_class_str = "";
my $tab_class_str = "";
my $pc_class_str = "";
if ($fre_pku_cnt % $news_item_data_db{pku_phone_horizontal_num} == 0) {
$phone_class_str = " fre-pku-sm-rtn ";
}
if ($fre_pku_cnt % $news_item_data_db{pku_tablet_horizontal_num} == 0) {
$tab_class_str = " fre-pku-mm-rtn ";
}
if ($fre_pku_cnt % $news_item_data_db{pku_horizontal_num} == 0) {
$pc_class_str = " fre-pku-wm-rtn ";
}
$fre_pku_html .= qq|
$pku_tmp|;
$fre_pku_cnt++;
}
}
my $fre_pku_head = "";
if ($news_item_data_db{cuscom_title} ne "") {
if ($news_item_data_db{disp_mode} != 0) {
$fre_pku_head = qq|
$news_item_data_db{cuscom_title}
|;
} else {
$fre_pku_head = qq|
$news_item_data_db{cuscom_title}
|;
}
}
my $fre_pku_contents = "";
$news_item_data_db{pku_contents_text} = &normal_tag_data($news_item_data_db{pku_contents_text});
if ($news_item_data_db{pku_contents_text} ne "") {
$fre_pku_contents = qq||;
}
my $scroll_anime_val = int($news_item_data_db{$pku_scroll_anime_name});
my $scroll_anime_class_name = "";
if ($scroll_anime_val == 1) {
$scroll_anime_class_name = " pku_anime01 ";
} elsif ($scroll_anime_val == 2) {
$scroll_anime_class_name = " pku_anime01_ex ";
} elsif ($scroll_anime_val == 3) {
$scroll_anime_class_name = " pku_anime02 ";
} elsif ($scroll_anime_val == 4) {
$scroll_anime_class_name = " pku_anime02_ex ";
} elsif ($scroll_anime_val == 5) {
$scroll_anime_class_name = " pku_anime03 ";
} elsif ($scroll_anime_val == 6) {
$scroll_anime_class_name = " pku_anime03_ex ";
}
if ($fre_pku_html ne "") {
$sub_contents_data = <<_HTML_;
$fre_pku_head
$fre_pku_contents
_HTML_
if ($db01{"plan"} == 24) {
$sub_contents_data = qq|
|;
}
}
} else {
$sub_contents_data = &sub_contents_disp_ex($db01{plan},$contents_num,$icon_upload_check,$news_item_data_db{cuscom_layout},$news_item_data_db{cuscom_title},$news_cuscom_cmt,$add_img_tag,1,"","","","",$ccaption_sub_css_ex);
if ($news_item_data_db{disp_mode} != 0) {
$sub_contents_data =~ s/
.*<\/span>/$news_item_data_db{cuscom_title}<\/h3>/;
if ($ccaption_sub_min_css_ex == 1) {
$sub_contents_data =~ s/class="ccaption_sub([^"]*)"/class="master_ccaption_sub_min ccaption_sub_min$1"/;
$sub_contents_data =~ s/class="master_ccaption_sub ccaption_sub([^"]*)"/class="master_ccaption_sub_min ccaption_sub_min$1"/;
} else {
$sub_contents_data =~ s/class="ccaption_sub([^"]*)"/class="ccaption_sub_min$1"/;
}
} else {
$sub_contents_data =~ s/.*<\/span>/$news_item_data_db{cuscom_title}<\/h2>/;
}
}
$add_html .= $sub_contents_data;
$contents_num++;
}
}
$paste_str{"BODY"} = <<_HTML_;
$rss_link
$social_str
$time_title
_HTML_
#2010_06_03ニュースバーのカスタマイズ画像を可能とする修正ここまで↑
$meta_desc = "ニュース|".$db01{meta_desc};
$meta_kwd = "ニュース,".$db01{meta_kwd};
if ($db10{news_meta_desc} ne "") {
$meta_desc = $db10{news_meta_desc};
}
if ($db10{news_meta_kwd} ne "") {
$meta_kwd = $db10{news_meta_kwd};
}
$meta_desc = &normal_metadesc($meta_desc);
$meta_kwd = &normal_metakey($meta_kwd);
$paste_str{"meta_desc_tmp"} = $meta_desc;
$paste_str{'meta'} = <<_HTML_;
_HTML_
$pge_title = $db01{"title"}. '|ニュース';
if ($db10{news_pge_title} ne "") {
$pge_title = $db10{news_pge_title};
} elsif ($db10{news_title} ne "") {
$pge_title = $db10{news_title};
}
$qrexfile = "../../townguide/userimage/${area}/$in{userid}\_1\_0\.png";
if( (int($db01{"basehtmlfile"}) > 0) && (-f $qrexfile) ) {
$paste_str{"qrcode_image"} = <<_HTML_;
_HTML_
}
if ($subdomain == 1) {
$link_url = "";
}
else {
if (&check_top_user($db01{username})) {
$link_url = "";
} else {
$link_url = "../../$db01{username}";
}
}
if ($db01{plan} == 24) {
if (int($db10{"news_master_layout"}) == 0) {
$paste_str{"BODY"} = qq|
$paste_str{"BODY"}
|;
}
$paste_str{"BODY"} = qq||;
}
$paste_str{"h1_disp_title_comment"} = "___h1_title_none___";
$paste_str{"h1_disp_title"} = "";
print "Content-type: text/html\n\n";
&write_cmn00( conn=>$conn,id=>$in{userid},table=>$table_area{db01},param=>"paste_str",link_url=>$link_url,sp_type=>$sp_type,type=>'cgi:'.$out,title=>$pge_title,type_css=>$css_file);
exit;
}
sub all { # 記事全体の表示
my @sortdata,$time_title,$news_title;
local ($id) = $in{userid};
my $out = "news";
my $css_file = "/cgi-local/news/news_css.cgi?uid=$in{userid}&act=list";
$total_width = 690;
$total_width = &get_document_width($db01{"plan"}, $db01{"do_top_free_rmenuarea_all"}, $db01{"do_top_free_menuarea_dist"});
if ($db01{plan} == 20) {
$total_width = &get_custom_plan_document_width($db01{custom_plan_document},$db01{custom_plan_document_width},$db01{custom_plan_menu_width},$db01{custom_plan_document_margin_size},$db01{custom_plan_document_side_margin_size},$db01{custom_plan_menu_position},$db01{custom_plan_menu_disp_mode});
}
($omit_num,$omit_num2,$omit_num3,$total_width_tmp) = &omit_check($total_width,int($db01{"plan"}),int($db01{news_disp_type}));
if (int($db02{news_title_length}) != 0) {
$omit_num = int($db02{news_title_length}) +1;
}
if (int($db02{news_comment_length}) != 0) {
$omit_num2 = int($db02{news_comment_length}) +1;
$omit_num3 = int($db02{news_comment_length}) +1;
}
# ulの余白分をマイナスする。
$total_width -= 35;
my ($n_year) = (localtime(time))[5];
$n_year += 1900;
my ($pasttime) = 0;
my $filename = "../../contents/$area/$db01{username}/.htaccess";
my $lastmodified = (stat $filename)[9];
my $update_time = int(timelocal(0,15,17,3,1,115));
my $title_sub = "";
if ($in{year} != 0) {
$title_sub = "|$in{year}年";
if ($in{year} < (1900) || $in{year} >= ($n_year+1)) {
&error2("該当する記事はありません。");
}
}
my ($n_min,$n_hour,$n_mday, $n_mon, $n_year) = (localtime(time))[1,2,3,4,5];
my $now_time = int(timelocal(59,$n_min,$n_hour,$n_mday,$n_mon,$n_year));
my($sql10) = "";
$and_ssl = "";
if (int($in{category}) != 0) {
$and_ssl = " and news_category_select = $in{category} ";
}
if (int($in{year}) > 1900 && int($in{year}) < 2037) {
$search_year = int($in{year}) - 1900;
$search_min_time = int(timelocal(0,0,0,1,0,$search_year));
$next_year = $search_year + 1;
$search_max_time = int(timelocal(0,0,0,1,0,$next_year));
#$sql10 ="select * from $table_area{db10} where userid=$id and fr_id = 0 and time >= $search_min_time and time < $search_max_time and time <= $now_time " . $and_ssl . " order by time DESC limit $newsregistmax;";
$sql10 ="select * from $table_area{db10} where userid=$id and time >= $search_min_time and time < $search_max_time and time <= $now_time " . $and_ssl . " order by time DESC limit $newsregistmax;";
} else {
#SQLの実行
#$sql10 ="select * from $table_area{db10} where userid=$id and fr_id = 0 and time <= $now_time " . $and_ssl ." order by time DESC limit $newsregistmax;";
$sql10 ="select * from $table_area{db10} where userid=$id and time <= $now_time " . $and_ssl ." order by time DESC limit $newsregistmax;";
}
#SQLの実行
eval { $result10 = &pg_exec($conn,$sql10); };
if($@) { &error("SQL文エラー($sql10)".$@); }
$n = $result10->ntuples;
$sel_cnt = 0;
for ($i = 1; $i <= 10; $i++) {
$name_tmp = "news_category${i}_name";
if ($db02{$name_tmp} ne "") {
$sel_cnt++;
}
}
if ($sel_cnt == 0) {
$year_category_html = qq|";
} else {
$year_category_html = qq|";
}
if ($lastmodified < $update_time) {
# htaccessが最新版になっていない場合、年代別絞込は無し。
$year_category_html = "";
}
#2010_06_02ニュースバーのカスタマイズ画像を可能とする修正ここから↓
my ($whats_custom,$extfile_bar);
$news_rss_imgname = "/image/rss/rss-0.gif";
$news_img_width = 36;
$news_img_height = 14;
if($db02{news_rss_imgname} ne "" && int($db02{news_rss_imgnum}) != 0) {
$news_rss_imgname = "/image/rss/$db02{news_rss_imgname}";
$news_img_width = 18;
$news_img_height = 18;
}
$rss_link = qq||;
if (int($db02{"news_rss_flg"}) == 1) {
$rss_link = "";
$rss_link_onbar = qq||;
}
$whats_custom = "/image/whats/$db02{cover_news_select}";
$extfile_bar = "$userimage$db02{cover_news_select_custom}";
$newsbar1_img_height = 21;
if ($db02{'cover_news_is_custom'} eq '1' && -f $extfile_bar) {
$whats_custom = "/userimage/$db02{cover_news_select_custom}";
&getsize("$extfile_bar");
$newsbar1_img_height = $PICINFO{'height'};
}
$extfile_list_bar = "$userimage$db02{cover_news_list_select_custom}";
if ($db02{'cover_news_list_is_custom'} eq '1' && -f $extfile_list_bar) {
$whats_custom = "/userimage/$db02{cover_news_list_select_custom}";
&getsize("$extfile_list_bar");
$newsbar1_img_height = $PICINFO{'height'};
}
$paste_str{"BODY"} = <<_HTML_;
$rss_link
一覧表示
${year_category_html}
_HTML_
#2010_06_03ニュースバーのカスタマイズ画像を可能とする修正ここまで↑
my $newsprog_html = "";
for($i=0;$i<$n;$i++){
%ss = &result_to_array($result10,$i);
$coment_parts_tmp =$ss{news_comment};
$time_title = "";
if (int($db02{news_time_type}) == 0) {
$time_title = &getdate($ss{time},4);
} elsif (int($db02{news_time_type}) == 1) {
$time_title = &getdate($ss{time},5);
} elsif (int($db02{news_time_type}) == 2) {
$time_title = &getdate($ss{time},8);
} else {
$time_title = &getdate($ss{time},7);
}
if ($ss{news_category_select} != 0) {
my $cate_disp_day_tmp = "news_category$ss{news_category_select}_disp_day";
my $disp_after_day = int($db02{$cate_disp_day_tmp});
if (&getNewsDispCheck($ss{time},$disp_after_day) == 0) {
$cate_name_tmp = "news_category$ss{news_category_select}_name";
$news_category_select = "$db02{$cate_name_tmp}";
$time_title .= " " . $news_category_select;
}
}
#$news_title = &auto_cut($ss{news_title},$omit_num);
$news_title = $ss{news_title};
$news_title =~ s/\\,/,/g;
$news_title =~ s/\\\\/\\/g;
$coment_parts=&normal_tag_data($coment_parts_tmp);
$coment_parts=~ s/\\\,/,/g;
$coment_parts=~ s/<br>//g;
$coment_parts=~ s/\n//g;
$coment_parts =~ s///g;
$coment_parts =~ s/<.*?>//g;
if(($ss{news_view_thumb} ne "") && ($ss{news_layout} ne "noimg")){
$coment_parts2 = &auto_cut($coment_parts,$omit_num2);
} else {
$coment_parts2 = &auto_cut($coment_parts,$omit_num3);
}
if ($coment_parts2 eq "") { $coment_parts2 = " "; }
# ニュースリンク作成
#$newsprog_html = "/news/news_i$ss{id}_u$ss{userid}.html";#### サムネイルファイル指定
$newsprog_html = "/news/news-i$ss{id}-u$ss{userid}.html";#### サムネイルファイル指定
if ($ss{news_filename} ne "") {
$newsprog_html = "/news/$ss{news_filename}";
}
my $icon_type_class = "";
if ($db02{news_icon_disp_type} == 0) {
if ($db01{master_icon_custom_type} == 0) {
$icon_type_class = " class='at-icon-disc' ";
} elsif ($db01{master_icon_custom_type} == 1) {
$icon_type_class = " class='at-icon-arrow' ";
} elsif ($db01{master_icon_custom_type} == 2) {
$icon_type_class = " class='at-icon-arrow2' ";
}
} elsif ($db02{news_icon_disp_type} == 2) {
if ($db02{news_icon_custom_type} == 0) {
$icon_type_class = " class='at-icon-disc' ";
} elsif ($db02{news_icon_custom_type} == 1) {
$icon_type_class = " class='at-icon-arrow' ";
} elsif ($db02{news_icon_custom_type} == 2) {
$icon_type_class = " class='at-icon-arrow2' ";
}
} else {
$icon_type_class = " class='at-icon-none' ";
}
#### サムネイルファイル指定
#if (int($db01{news_disp_type}) ==1){
if (int($db01{news_disp_type}) >= 1 && int($db01{news_disp_type}) != 7 && int($db01{news_disp_type}) != 8 && int($db01{news_disp_type}) != 9 && int($db01{news_disp_type}) != 10){
$coment_parts3 = <<_HTML_;
_HTML_
if(($ss{news_view_thumb} ne "") && ($ss{news_layout} ne "noimg")){
$alt_text = "";
if ($ss{news_alt_text} ne "") {
$alt_text = " alt=\"$ss{news_alt_text}\" ";
}
$paste_str{"BODY"} .= <<_HTML_;
-
_HTML_
}else{
$paste_str{"BODY"} .= <<_HTML_;
-
_HTML_
}
}else{
if (int($db01{news_disp_type} == 7) || int($db01{news_disp_type} == 8) || int($db01{news_disp_type} == 9) || int($db01{news_disp_type} == 10)) {
$coment_parts3 = "";
if (int($db01{news_disp_type}) == 9 || int($db01{news_disp_type}) == 10) {
$coment_parts3 = <<_HTML_;
_HTML_
}
if(($ss{news_view_thumb} ne "") && ($ss{news_layout} ne "noimg")){
$alt_text = "";
if ($ss{news_alt_text} ne "") {
$alt_text = " alt=\"$ss{news_alt_text}\" ";
}
$paste_str{"BODY"} .= <<_HTML_;
-
$time_title
_HTML_
}else{
$paste_str{"BODY"} .= <<_HTML_;
-
$time_title
_HTML_
_HTML_
}
} else {
#旧タイプ
$paste_str{"BODY"} .= "\n";
}
}
}
if ($subdomain == 1) {
$toplink = "/index.html";
}
else {
# 一つのユーザをドキュメントルートとして使用している場合
if (&check_top_user($db01{username})) {
$toplink = "../../index.html";
} else {
$toplink = "../../$db01{username}/index.html";
}
}
if ($n == 0) {
$paste_str{"BODY"} .= "記事はありません。";
}
$paste_str{"BODY"} .= <<_HTML_;
_HTML_
#$width_css = "";
#if ((int($db01{"plan"}) >= 7)) {
# $width_css = "width:${total_width}px;";
#}
$meta_desc = "ニュース一覧|".$db01{meta_desc};
$meta_kwd = "ニュース一覧,".$db01{meta_kwd};
$meta_desc = &normal_metadesc($meta_desc);
$meta_kwd = &normal_metakey($meta_kwd);
$paste_str{'meta'} = <<_HTML_;
_HTML_
$qrexfile = "../../townguide/userimage/${area}/$in{userid}\_1\_0\.png";
if( (int($db01{"basehtmlfile"}) > 0) && (-f $qrexfile) ) {
$paste_str{"qrcode_image"} = <<_HTML_;
_HTML_
}
if ($subdomain == 1) {
$link_url = "";
}
else {
# 一つのユーザをドキュメントルートとして使用している場合
if (&check_top_user($db01{username})) {
$link_url = "";
} else {
$link_url = "../../$db01{username}";
}
}
if ($db01{plan} == 24) {
if (int($db02{"news_area_layout"}) == 0 && int($db02{"news_area_max_width"}) != 0) {
$paste_str{"BODY"} = qq||;
} else {
$paste_str{"BODY"} = qq||;
}
}
$paste_str{"h1_disp_title_comment"} = "___h1_title_none___";
$paste_str{"h1_disp_title"} = "";
print "Content-type: text/html\n\n";
&write_cmn00( conn=>$conn,id=>$id,table=>$table_area{db01},param=>"paste_str",link_url=>$link_url,type=>'cgi:'.$out,title=>$db01{"title"}. $title_sub. '|ニュース一覧',type_css=>$css_file);
exit;
}
sub error {
$error = $_[0];
my $printstr = <<"_HTML_";
エラー
エラー
$error
ブラウザの戻るボタンで前の画面に戻ってください。
_HTML_
my $myEnStr = encode_utf8($printstr);
print "Status: 404 Not Found\n";
print "Content-type: text/html\n\n";
print $myEnStr;
exit;
}
sub error2 {
$error = $_[0];
if ($subdomain == 1) {
$toplink = "/index.html";
}
else {
# 一つのユーザをドキュメントルートとして使用している場合
if (&check_top_user($db01{username})) {
$toplink = "../../index.html";
} else {
$toplink = "../../$db01{username}/index.html";
}
}
$paste_str{"BODY"} = <<_HTML_;
_HTML_
$paste_str{'meta'}="";
$paste_str{"style_sheet"} = <<_HTML_;
ul.news { line-height:1.5em; padding:2px 5px; margin:2px 5px 2px 20px; list-style-image:URL(/image/icon/$db01{menu_icon}) }
div.cvlay { text-align:center; padding-top:1em; padding-bottom:1em; }
_HTML_
$qrexfile = "../../townguide/userimage/${area}/$in{userid}\_1\_0\.png";
if( (int($db01{"basehtmlfile"}) > 0) && (-f $qrexfile) ) {
$paste_str{"qrcode_image"} = <<_HTML_;
_HTML_
}
if ($subdomain == 1) {
$link_url = "";
}
else {
# 一つのユーザをドキュメントルートとして使用している場合
if (&check_top_user($db01{username})) {
$link_url = "";
} else {
$link_url = "../../$db01{username}";
}
}
if ($db01{plan} == 24) {
$paste_str{"BODY"} = qq||;
}
print "Content-type: text/html\n\n";
&write_cmn00( conn=>$conn,id=>$in{userid},table=>$table_area{db01},param=>"paste_str",link_url=>$link_url,type=>'print',title=>$db01{"title"}. '|ニュース');
exit;
}