Remove cutenews/yui, use twitter bootstrap css
[contractdashboard.git] / preview.mdu
1 <HTML>
2 <TITLE>Preview</TITLE>
3 <BODY>
4 <center>
5 <?PHP
6 require("./data/Default.tpl");
7
8 $cat_lines = @file("./data/category.db.php");
9 foreach($cat_lines as $single_line){
10 $cat_arr = explode("|", $single_line);
11 $cat[$cat_arr[0]] = $cat_arr[1];
12 $cat_icon[$cat_arr[0]]=$cat_arr[2];
13 }
14
15 if($manual_avatar != ""){ $avatar = $manual_avatar; }
16 elseif( $select_avatar != "" and $select_avatar != "none" ){ $avatar = $select_avatar; }
17 else{ $avatar = ""; }
18
19 if($if_convert_new_lines == "yes"){ $n_to_br = TRUE; }
20 if($if_use_html == "yes"){ $use_html = TRUE; }
21
22 $full_story = replace_news("add", $full_story, $n_to_br, $use_html);
23 $short_story = replace_news("add", $short_story, $n_to_br, $use_html);
24 $title = replace_news("add", $title, TRUE, $use_html);
25
26 if($member_db[4] != ""){
27 if($member_db[7] != 1 and $member_db[5] != ""){ $author = "<a href=mailto:$member_db[5]>$member_db[4]</a>"; }
28 else{ $author = "$member_db[4]"; }
29 }else{
30 if($member_db[7] != 1 and $member_db[5] != ""){ $author = "<a href=mailto:$member_db[5]>$member_db[2]</a>"; }
31 else{ $author = "$member_db[2]"; }
32 }
33
34 $output = $template_active;
35 $output = str_replace("{title}", $title, $output);
36 $output = str_replace("{date}", date($config_timestamp_active, time()), $output);
37 $output = str_replace("{author}", $author, $output);
38 if($avatar != ""){$output = str_replace("{avatar}", "<img src=\"$avatar\" border=0>", $output); }
39 else{ $output = str_replace("{avatar}", "", $output); }
40 $output = str_replace("[link]","<a href=#>", $output);
41 $output = str_replace("[/link]","</a>", $output);
42 $output = str_replace("{comments-num}", countComments($id), $output);
43 $output = str_replace("{short-story}", $short_story, $output);
44 $output = str_replace("{full-story}", $full_story, $output);
45 if($full_story){
46 $output = str_replace("[full-link]", "<a href=#>", $output); }
47 else{
48 $output = preg_replace("'\[full-link\].*?\[/full-link\]'","", $output);
49 }
50 $output = str_replace("[/full-link]", "</a>", $output);
51 $output = str_replace("[com-link]", "<a href=#>", $output);
52 $output = str_replace("[/com-link]", "</a>", $output);
53
54 $output = str_replace("{category}", $cat[$category], $output);
55 $output = str_replace("{category-id}", $category, $output);
56 if($cat_icon[$category] != ""){ $output = str_replace("{category-icon}", "<img border=0 src=\"".$cat_icon[$category]."\">", $output); }
57 else{ $output = str_replace("{category-icon}", "", $output); }
58
59
60 $output = str_replace("{author-name}", $member_db[2], $output);
61
62 if($member_db[5] != ""){
63 $output = str_replace("[mail]","<a href=\"mailto:". $member_db[5] ."\">", $output);
64 $output = str_replace("[/mail]","</a>", $output);
65 }else{
66 $output = str_replace("[mail]","", $output);
67 $output = str_replace("[/mail]","", $output);
68 }
69 $output = str_replace("{news-id}", "ID Unknown", $output);
70 $output = str_replace("{archive-id}", $archive, $output);
71 $output = str_replace("{php-self}", $PHP_SELF, $output);
72 $output = str_replace("{cute-http-path}", $config_http_script_dir, $output);
73
74 $output = replace_news("show", $output);
75
76
77
78 echo("<fieldset style=\"border-style:solid; border-width:1; border-color:black;\"><legend> <span style=\"font-size: 13px;\">Active News:</span> </legend>".$output."</fieldset>");
79
80
81 if($full_story){
82
83 $output = $template_full;
84 $output = str_replace("{title}", $title, $output);
85 $output = str_replace("{date}", date($config_timestamp_active, time()), $output);
86 $output = str_replace("{author}", $author, $output);
87 if($avatar != ""){$output = str_replace("{avatar}", "<img src=\"$avatar\" border=0>", $output); }
88 else{ $output = str_replace("{avatar}", "", $output); }
89 $output = str_replace("[link]","<a href=#>", $output);
90 $output = str_replace("[/link]","</a>", $output);
91 $output = str_replace("{comments-num}", countComments($id), $output);
92 $output = str_replace("{short-story}", $short_story, $output);
93 $output = str_replace("{full-story}", $full_story, $output);
94 if($full_story){
95 $output = str_replace("[full-link]", "<a href=#>", $output); }
96 else{
97 $output = preg_replace("'\[full-link\].*?\[/full-link\]'","", $output);
98 }
99 $output = str_replace("[/full-link]", "</a>", $output);
100 $output = str_replace("[com-link]", "<a href=#>", $output);
101 $output = str_replace("[/com-link]", "</a>", $output);
102 $output = str_replace("{category}", $cat[$category], $output);
103 $output = str_replace("{category-id}", $category, $output);
104 if($cat_icon[$category] != ""){ $output = str_replace("{category-icon}", "<img border=0 src=\"".$cat_icon[$category]."\">", $output); }
105 else{ $output = str_replace("{category-icon}", "", $output); }
106
107
108 $output = str_replace("{author-name}", $member_db[2], $output);
109
110 if($member_db[5] != ""){
111 $output = str_replace("[mail]","<a href=\"mailto:". $member_db[5] ."\">", $output);
112 $output = str_replace("[/mail]","</a>", $output);
113 }else{
114 $output = str_replace("[mail]","", $output);
115 $output = str_replace("[/mail]","", $output);
116 }
117 $output = str_replace("{news-id}", "ID Unknown", $output);
118 $output = str_replace("{archive-id}", $archive, $output);
119 $output = str_replace("{php-self}", $PHP_SELF, $output);
120 $output = str_replace("{cute-http-path}", $config_http_script_dir, $output);
121
122 $output = replace_news("show", $output);
123
124 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>");
125 }
126
127 ?>
128 </center>
129 </BODY>
130 </HTML>