Remove cutenews/yui, use twitter bootstrap css
[contractdashboard.git] / preview.mdu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<HTML>
<TITLE>Preview</TITLE>
<BODY>
<center>
<?PHP
require("./data/Default.tpl");

$cat_lines = @file("./data/category.db.php");
foreach($cat_lines as $single_line){
	$cat_arr = explode("|", $single_line);
    $cat[$cat_arr[0]] = $cat_arr[1];
    $cat_icon[$cat_arr[0]]=$cat_arr[2];
}

    if($manual_avatar != ""){ $avatar = $manual_avatar; }
    elseif( $select_avatar != "" and $select_avatar != "none" ){ $avatar = $select_avatar; }
    else{ $avatar = ""; }

	if($if_convert_new_lines	== "yes"){ $n_to_br		= TRUE; }
    if($if_use_html				== "yes"){ $use_html	= TRUE; }

	$full_story  = replace_news("add", $full_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);

	if($member_db[4] != ""){
		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{
		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]"; }
	}

    $output = $template_active;
    $output = str_replace("{title}", $title, $output);
    $output = str_replace("{date}", date($config_timestamp_active, time()), $output);
    $output = str_replace("{author}", $author, $output);
    if($avatar != ""){$output = str_replace("{avatar}", "<img src=\"$avatar\" border=0>", $output); }
    else{ $output = str_replace("{avatar}", "", $output); }
    $output = str_replace("[link]","<a href=#>", $output);
    $output = str_replace("[/link]","</a>", $output);
    $output = str_replace("{comments-num}", countComments($id), $output);
    $output = str_replace("{short-story}", $short_story, $output);
    $output = str_replace("{full-story}", $full_story, $output);
    if($full_story){
    	$output = str_replace("[full-link]", "<a href=#>", $output); }
	else{
  		$output = preg_replace("'\[full-link\].*?\[/full-link\]'","", $output);
	}
    $output = str_replace("[/full-link]", "</a>", $output);
    $output = str_replace("[com-link]", "<a href=#>", $output);
    $output = str_replace("[/com-link]", "</a>", $output);

	$output = str_replace("{category}", $cat[$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); }
	else{ $output = str_replace("{category-icon}", "", $output); }


				$output = str_replace("{author-name}", $member_db[2], $output);

                if($member_db[5] != ""){
	                $output = str_replace("[mail]","<a href=\"mailto:". $member_db[5] ."\">", $output);
	                $output = str_replace("[/mail]","</a>", $output);
				}else{
	                $output = str_replace("[mail]","", $output);
	                $output = str_replace("[/mail]","", $output);
                }
				$output = str_replace("{news-id}", "ID Unknown", $output);
				$output = str_replace("{archive-id}", $archive, $output);
				$output = str_replace("{php-self}", $PHP_SELF, $output);
				$output = str_replace("{cute-http-path}", $config_http_script_dir, $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>");


if($full_story){

    $output = $template_full;
    $output = str_replace("{title}", $title, $output);
    $output = str_replace("{date}", date($config_timestamp_active, time()), $output);
    $output = str_replace("{author}", $author, $output);
    if($avatar != ""){$output = str_replace("{avatar}", "<img src=\"$avatar\" border=0>", $output); }
    else{ $output = str_replace("{avatar}", "", $output); }
    $output = str_replace("[link]","<a href=#>", $output);
    $output = str_replace("[/link]","</a>", $output);
    $output = str_replace("{comments-num}", countComments($id), $output);
    $output = str_replace("{short-story}", $short_story, $output);
    $output = str_replace("{full-story}", $full_story, $output);
    if($full_story){
    	$output = str_replace("[full-link]", "<a href=#>", $output); }
	else{
  		$output = preg_replace("'\[full-link\].*?\[/full-link\]'","", $output);
	}
    $output = str_replace("[/full-link]", "</a>", $output);
    $output = str_replace("[com-link]", "<a href=#>", $output);
    $output = str_replace("[/com-link]", "</a>", $output);
	$output = str_replace("{category}", $cat[$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); }
	else{ $output = str_replace("{category-icon}", "", $output); }


				$output = str_replace("{author-name}", $member_db[2], $output);

                if($member_db[5] != ""){
	                $output = str_replace("[mail]","<a href=\"mailto:". $member_db[5] ."\">", $output);
	                $output = str_replace("[/mail]","</a>", $output);
				}else{
	                $output = str_replace("[mail]","", $output);
	                $output = str_replace("[/mail]","", $output);
                }
				$output = str_replace("{news-id}", "ID Unknown", $output);
				$output = str_replace("{archive-id}", $archive, $output);
				$output = str_replace("{php-self}", $PHP_SELF, $output);
				$output = str_replace("{cute-http-path}", $config_http_script_dir, $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>");
}

?>
</center>
</BODY>
</HTML>