-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnews.php
151 lines (138 loc) · 4.09 KB
/
news.php
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?
/*
+--------------------------------------------------------------------------
| MkPortal
| ========================================
| by Meo aka Luponero <Amedeo de longis>
|
| (c) 2004 mkportal.it
| http://www.mkportal.it
| Email: [email protected]
|
+---------------------------------------------------------------------------
|
| > MKPortal
| > Written By Amedeo de longis
| > Date started: 9.2.2004
|
+--------------------------------------------------------------------------
*/
$limit = $this->config['news_block'];
if (!$limit) {
$limit = 5;
}
$cont = "";
$content = "";
$link_user = $mklib_board->forum_link("profile");
$query = $DB->query( "SELECT id, titolo, icona FROM mkp_news_sections ORDER BY `id` DESC");
while( $row = $DB->fetch_row($query) ) {
$icona = $row['icona'];
$idcat = $row['id'];
$categoria[$idcat]['titolo'] = $row['titolo'];
switch($icona) {
case '1':
$image = "$this->images/icona_news.gif";
break;
case '2':
$image = "$this->images/icona_help.gif";
break;
case '3':
$image = "$this->images/icona_star.gif";
break;
case '4':
$image = "$this->images/icona_pc.gif";
break;
case '5':
$image = "$this->images/icona_world.gif";
break;
default:
$image = $icona;
break;
}
$categoria[$idcat]['icona'] = $image;
}
$query1 = $DB->query( "SELECT id, idcategoria, idautore, titolo, autore, testo, data FROM mkp_news WHERE validate = '1' ORDER BY `id` DESC LIMIT $limit");
while( $row = $DB->fetch_row($query1) ) {
$idnt = $row['id'];
$query2 = $DB->query( "SELECT id FROM mkp_news_comments where identry = '$idnt'");
$totcomments = $DB->get_num_rows($query2);
$id_orig_name = $row['idautore'];
$idcategoria = $row['idcategoria'];
$titolo = stripslashes($row['titolo']);
$name = $row['autore'];
$testo = stripslashes($row['testo']);
if ($this->mkeditor == "BBCODE") {
$testo = $this->decode_bb($testo);
$testo = $mklib_board->decode_smilies($testo);
}
$sezione = $categoria[$idcategoria]['titolo'];
$icona = $categoria[$idcategoria]['icona'];
$cdata = $this->create_date($row['data']);
$news_words= $this->config['news_words'];
if ($this->config['news_html']) {
$testo = str_replace ("<br />", " ", $testo);
$testo = strip_tags ($testo);
}
if ($news_words) {
$testo = substr ($testo, 0, $news_words);
$testo .= " ...";
}
$cont .= "
<table class=\"tabnews\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">
<tbody>
<tr>
<td class=\"tdblock\" align=\"center\" width=\"5%\">
<img hspace=\"0\" src=\"$icona\" align=\"bottom\" border=\"0\" alt=\"\" />
</td>
<td class=\"tdblock\" valign=\"top\" width=\"95%\">
<b>$sezione<br /><a href=\"index.php?ind=news&op=news_show_single&ide={$row['id']}\">$titolo</a></b>
</td>
</tr>
<tr>
<td colspan=\"2\"><br />
$testo
</td>
</tr>
<tr>
<td align=\"right\" colspan=\"2\">
<br /><i>{$this->lang['from']}<b> <a href=\"$link_user=$id_orig_name\">$name</a></b>, $cdata <a href=\"index.php?ind=news&op=submit_comment&idnews={$row['id']}\">{$this->lang['comments']}</a>($totcomments), <a href=\"index.php?ind=news&op=news_show_single&ide={$row['id']}\">{$this->lang['readall']}</a></i>
</td>
</tr>
</tbody>
</table>
";
}
$content = "
<tr>
<td class=\"contents\">
<div class=\"taburlo\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
<tr>
<td class=\"taburlo\" valign=\"top\">
{$cont}
</td>
</tr>
</table>
</div>
</td>
</tr>
";
unset($cont);
unset($row);
unset($icona);
unset($idcat);
unset($categoria);
unset($idnt);
unset($query);
unset($query2);
unset($totcomments);
unset($id_orig_name);
unset($idcategoria);
unset($titolo);
unset($name);
unset($testo);
unset($sezione);
unset($icona);
unset($cdata);
unset($news_words);
?>