tweak year/agency modifer for queries
[contractdashboard.git] / cutenews / inc / preview.mdu
blob:a/cutenews/inc/preview.mdu -> blob:b/cutenews/inc/preview.mdu
<HTML> <HTML>
<TITLE>Preview</TITLE> <TITLE>Preview</TITLE>
<BODY> <BODY>
<center> <center>
<?PHP <?PHP
require("./data/Default.tpl"); require("./data/Default.tpl");
$cat_lines = @file("./data/category.db.php"); $cat_lines = @file("./data/category.db.php");
foreach($cat_lines as $single_line){ foreach($cat_lines as $single_line){
$cat_arr = explode("|", $single_line); $cat_arr = explode("|", $single_line);
$cat[$cat_arr[0]] = $cat_arr[1]; $cat[$cat_arr[0]] = $cat_arr[1];
$cat_icon[$cat_arr[0]]=$cat_arr[2]; $cat_icon[$cat_arr[0]]=$cat_arr[2];
} }
if($manual_avatar != ""){ $avatar = $manual_avatar; } if($manual_avatar != ""){ $avatar = $manual_avatar; }
elseif( $select_avatar != "" and $select_avatar != "none" ){ $avatar = $select_avatar; } elseif( $select_avatar != "" and $select_avatar != "none" ){ $avatar = $select_avatar; }
else{ $avatar = ""; } else{ $avatar = ""; }
if($if_convert_new_lines == "yes"){ $n_to_br = TRUE; } if($if_convert_new_lines == "yes"){ $n_to_br = TRUE; }
if($if_use_html == "yes"){ $use_html = TRUE; } if($if_use_html == "yes"){ $use_html = TRUE; }
$full_story = replace_news("add", $full_story, $n_to_br, $use_html); $full_story = replace_news("add", $full_story, $n_to_br, $use_html);
$short_story = replace_news("add", $short_story, $n_to_br, $use_html); $short_story = replace_news("add", $short_story, $n_to_br, $use_html);
$title = replace_news("add", $title, TRUE, $use_html); $title = replace_news("add", $title, TRUE, $use_html);
if($member_db[4] != ""){ if($member_db[4] != ""){
if($member_db[7] != 1 and $member_db[5] != ""){ $author = "<a href=mailto:$member_db[5]>$member_db[4]</a>"; } if($member_db[7] != 1 and $member_db[5] != ""){ $author = "<a href=mailto:$member_db[5]>$member_db[4]</a>"; }
else{ $author = "$member_db[4]"; } else{ $author = "$member_db[4]"; }
}else{ }else{
if($member_db[7] != 1 and $member_db[5] != ""){ $author = "<a href=mailto:$member_db[5]>$member_db[2]</a>"; } if($member_db[7] != 1 and $member_db[5] != ""){ $author = "<a href=mailto:$member_db[5]>$member_db[2]</a>"; }
else{ $author = "$member_db[2]"; } else{ $author = "$member_db[2]"; }
} }
$output = $template_active; $output = $template_active;
$output = str_replace("{title}", $title, $output); $output = str_replace("{title}", $title, $output);
$output = str_replace("{date}", date($config_timestamp_active, time()), $output); $output = str_replace("{date}", date($config_timestamp_active, time()), $output);
$output = str_replace("{author}", $author, $output); $output = str_replace("{author}", $author, $output);
if($avatar != ""){$output = str_replace("{avatar}", "<img src=\"$avatar\" border=0>", $output); } if($avatar != ""){$output = str_replace("{avatar}", "<img src=\"$avatar\" border=0>", $output); }
else{ $output = str_replace("{avatar}", "", $output); } else{ $output = str_replace("{avatar}", "", $output); }
$output = str_replace("[link]","<a href=#>", $output); $output = str_replace("[link]","<a href=#>", $output);
$output = str_replace("[/link]","</a>", $output); $output = str_replace("[/link]","</a>", $output);
$output = str_replace("{comments-num}", countComments($id), $output); $output = str_replace("{comments-num}", countComments($id), $output);
$output = str_replace("{short-story}", $short_story, $output); $output = str_replace("{short-story}", $short_story, $output);
$output = str_replace("{full-story}", $full_story, $output); $output = str_replace("{full-story}", $full_story, $output);
if($full_story){ if($full_story){
$output = str_replace("[full-link]", "<a href=#>", $output); } $output = str_replace("[full-link]", "<a href=#>", $output); }
else{ else{
$output = preg_replace("'\[full-link\].*?\[/full-link\]'","", $output); $output = preg_replace("'\[full-link\].*?\[/full-link\]'","", $output);
} }
$output = str_replace("[/full-link]", "</a>", $output); $output = str_replace("[/full-link]", "</a>", $output);
$output = str_replace("[com-link]", "<a href=#>", $output); $output = str_replace("[com-link]", "<a href=#>", $output);
$output = str_replace("[/com-link]", "</a>", $output); $output = str_replace("[/com-link]", "</a>", $output);
$output = str_replace("{category}", $cat[$category], $output); $output = str_replace("{category}", $cat[$category], $output);
$output = str_replace("{category-id}", $category, $output); $output = str_replace("{category-id}", $category, $output);
if($cat_icon[$category] != ""){ $output = str_replace("{category-icon}", "<img border=0 src=\"".$cat_icon[$category]."\">", $output); } if($cat_icon[$category] != ""){ $output = str_replace("{category-icon}", "<img border=0 src=\"".$cat_icon[$category]."\">", $output); }
else{ $output = str_replace("{category-icon}", "", $output); } else{ $output = str_replace("{category-icon}", "", $output); }
$output = str_replace("{author-name}", $member_db[2], $output); $output = str_replace("{author-name}", $member_db[2], $output);
if($member_db[5] != ""){ if($member_db[5] != ""){
$output = str_replace("[mail]","<a href=\"mailto:". $member_db[5] ."\">", $output); $output = str_replace("[mail]","<a href=\"mailto:". $member_db[5] ."\">", $output);
$output = str_replace("[/mail]","</a>", $output); $output = str_replace("[/mail]","</a>", $output);
}else{ }else{
$output = str_replace("[mail]","", $output); $output = str_replace("[mail]","", $output);
$output = str_replace("[/mail]","", $output); $output = str_replace("[/mail]","", $output);
} }
$output = str_replace("{news-id}", "ID Unknown", $output); $output = str_replace("{news-id}", "ID Unknown", $output);
$output = str_replace("{archive-id}", $archive, $output); $output = str_replace("{archive-id}", $archive, $output);
$output = str_replace("{php-self}", $PHP_SELF, $output); $output = str_replace("{php-self}", $PHP_SELF, $output);
$output = str_replace("{cute-http-path}", $config_http_script_dir, $output); $output = str_replace("{cute-http-path}", $config_http_script_dir, $output);
$output = replace_news("show", $output); $output = replace_news("show", $output);
echo("<fieldset style=\"border-style:solid; border-width:1; border-color:black;\"><legend> <span style=\"font-size: 13px;\">Active News:</span> </legend>".$output."</fieldset>"); echo("<fieldset style=\"border-style:solid; border-width:1; border-color:black;\"><legend> <span style=\"font-size: 13px;\">Active News:</span> </legend>".$output."</fieldset>");
if($full_story){ if($full_story){
$output = $template_full; $output = $template_full;
$output = str_replace("{title}", $title, $output); $output = str_replace("{title}", $title, $output);
$output = str_replace("{date}", date($config_timestamp_active, time()), $output); $output = str_replace("{date}", date($config_timestamp_active, time()), $output);
$output = str_replace("{author}", $author, $output); $output = str_replace("{author}", $author, $output);
if($avatar != ""){$output = str_replace("{avatar}", "<img src=\"$avatar\" border=0>", $output); } if($avatar != ""){$output = str_replace("{avatar}", "<img src=\"$avatar\" border=0>", $output); }
else{ $output = str_replace("{avatar}", "", $output); } else{ $output = str_replace("{avatar}", "", $output); }
$output = str_replace("[link]","<a href=#>", $output); $output = str_replace("[link]","<a href=#>", $output);
$output = str_replace("[/link]","</a>", $output); $output = str_replace("[/link]","</a>", $output);
$output = str_replace("{comments-num}", countComments($id), $output); $output = str_replace("{comments-num}", countComments($id), $output);
$output = str_replace("{short-story}", $short_story, $output); $output = str_replace("{short-story}", $short_story, $output);
$output = str_replace("{full-story}", $full_story, $output); $output = str_replace("{full-story}", $full_story, $output);
if($full_story){ if($full_story){
$output = str_replace("[full-link]", "<a href=#>", $output); } $output = str_replace("[full-link]", "<a href=#>", $output); }
else{ else{
$output = preg_replace("'\[full-link\].*?\[/full-link\]'","", $output); $output = preg_replace("'\[full-link\].*?\[/full-link\]'","", $output);
} }
$output = str_replace("[/full-link]", "</a>", $output); $output = str_replace("[/full-link]", "</a>", $output);
$output = str_replace("[com-link]", "<a href=#>", $output); $output = str_replace("[com-link]", "<a href=#>", $output);
$output = str_replace("[/com-link]", "</a>", $output); $output = str_replace("[/com-link]", "</a>", $output);
$output = str_replace("{category}", $cat[$category], $output); $output = str_replace("{category}", $cat[$category], $output);
$output = str_replace("{category-id}", $category, $output); $output = str_replace("{category-id}", $category, $output);
if($cat_icon[$category] != ""){ $output = str_replace("{category-icon}", "<img border=0 src=\"".$cat_icon[$category]."\">", $output); } if($cat_icon[$category] != ""){ $output = str_replace("{category-icon}", "<img border=0 src=\"".$cat_icon[$category]."\">", $output); }
else{ $output = str_replace("{category-icon}", "", $output); } else{ $output = str_replace("{category-icon}", "", $output); }
$output = str_replace("{author-name}", $member_db[2], $output); $output = str_replace("{author-name}", $member_db[2], $output);
if($member_db[5] != ""){ if($member_db[5] != ""){
$output = str_replace("[mail]","<a href=\"mailto:". $member_db[5] ."\">", $output); $output = str_replace("[mail]","<a href=\"mailto:". $member_db[5] ."\">", $output);
$output = str_replace("[/mail]","</a>", $output); $output = str_replace("[/mail]","</a>", $output);
}else{ }else{
$output = str_replace("[mail]","", $output); $output = str_replace("[mail]","", $output);
$output = str_replace("[/mail]","", $output); $output = str_replace("[/mail]","", $output);
} }
$output = str_replace("{news-id}", "ID Unknown", $output); $output = str_replace("{news-id}", "ID Unknown", $output);
$output = str_replace("{archive-id}", $archive, $output); $output = str_replace("{archive-id}", $archive, $output);
$output = str_replace("{php-self}", $PHP_SELF, $output); $output = str_replace("{php-self}", $PHP_SELF, $output);
$output = str_replace("{cute-http-path}", $config_http_script_dir, $output); $output = str_replace("{cute-http-path}", $config_http_script_dir, $output);
$output = replace_news("show", $output); $output = replace_news("show", $output);
echo("<br /><fieldset style=\"border-style:solid; border-width:1; border-color:black;\"><legend> <span style=\"font-size: 13px;\">Full Story:</span> </legend>".$output."</fieldset>"); echo("<br /><fieldset style=\"border-style:solid; border-width:1; border-color:black;\"><legend> <span style=\"font-size: 13px;\">Full Story:</span> </legend>".$output."</fieldset>");
} }
?> ?>
</center> </center>
</BODY> </BODY>
</HTML> </HTML>