<?
/*
+--------------------------------------------------------------------------
| MkPortal
| ========================================
| by Meo aka Luponero <Amedeo de longis>
|
| (c) 2004 mkportal.it
| http://www.mkportal.it
| Email: luponero@mclink.it
|
+---------------------------------------------------------------------------
|
| > 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 n.id, n.idcategoria, n.idautore, n.titolo, n.autore, n.testo, n.data, n.totalcomm, s.id AS idcat, s.titolo AS titcat, s.icona
FROM mkp_news AS n
LEFT JOIN mkp_news_sections AS s ON(s.id = n.idcategoria)
WHERE validate = '1' ORDER BY `id` DESC LIMIT $limit");
while( $row = $DB->fetch_row($query) ) {
$idnt = $row['id'];
$totcomments = $row['totalcomm'];
$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 = $row['titcat'];
$icona = $row['icona'];
switch($icona) {
case '1':
$image = "$this->images/entry.gif";
break;
case '2':
$image = "$this->images/entry.gif";
break;
case '3':
$image = "$this->images/entry.gif";
break;
case '4':
$image = "$this->images/entry.gif";
break;
case '5':
$image = "$this->images/entry.gif";
break;
default:
$image = $icona;
break;
}
$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 .= "
<img hspace=\"0\" src=\"http://www.egitimciyim.net/mkportal/templates/default/images/atb_home.gif\" align=\"bottom\" border=\"0\" alt=\"\" />
<a href=\"index.php?ind=news&op=news_show_single&ide={$row['id']}\">$titolo</a><br>
";
}
$query = $DB->query( "SELECT n.id, n.idcategoria, n.idautore, n.titolo, n.autore, n.testo, n.data, n.totalcomm, s.id AS idcat, s.titolo AS titcat, s.icona
FROM mkp_news AS n
LEFT JOIN mkp_news_sections AS s ON(s.id = n.idcategoria)
WHERE validate = '1' ORDER BY `id` DESC LIMIT 1");
while( $row = $DB->fetch_row($query) ) {
$idnt = $row['id'];
$totcomments = $row['totalcomm'];
$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 = $row['titcat'];
$icona = $row['icona'];
switch($icona) {
case '1':
$image = "$this->images/entry.gif";
break;
case '2':
$image = "$this->images/entry.gif";
break;
case '3':
$image = "$this->images/entry.gif";
break;
case '4':
$image = "$this->images/entry.gif";
break;
case '5':
$image = "$this->images/entry.gif";
break;
default:
$image = $icona;
break;
}
$cdata = $this->create_date($row['data']);
if ($news_words) {
$testo = substr ($testo, 0, $news_words);
$testo .= " ...";
}
$cont2 = "
<table class=\"tabnews\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">
<tbody>
<tr>
<td>
<img hspace=\"0\" align=\"left\" src=\"$image\" align=\"bottom\" border=\"0\" alt=\"\" />
<b><a href=\"index.php?ind=news&op=news_show_single&ide={$row['id']}\">$titolo</a></b>
<br />
$testo
</td>
</tr>
</tbody>
</table>
";
}
$query = $DB->query( "SELECT n.id, n.idcategoria, n.idautore, n.titolo, n.autore, n.testo, n.data, n.totalcomm, s.id AS idcat, s.titolo AS titcat, s.icona
FROM mkp_news AS n
LEFT JOIN mkp_news_sections AS s ON(s.id = n.idcategoria)
WHERE validate = '1' ORDER BY `id` DESC LIMIT 3");
while( $row = $DB->fetch_row($query) ) {
$idnt = $row['id'];
$totcomments = $row['totalcomm'];
$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 = $row['titcat'];
$icona = $row['icona'];
switch($icona) {
case '1':
$image = "$this->images/entry.gif";
break;
case '2':
$image = "$this->images/entry.gif";
break;
case '3':
$image = "$this->images/entry.gif";
break;
case '4':
$image = "$this->images/entry.gif";
break;
case '5':
$image = "$this->images/entry.gif";
break;
default:
$image = $icona;
break;
}
$cdata = $this->create_date($row['data']);
if ($news_words) {
$testo = substr ($testo, 0, $news_words);
$testo .= " ...";
}
$cont3 = "
<table class=\"tabnews\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">
<tbody>
<tr>
<td>
<img align=\"left\" hspace=\"0\" src=\"$image\" align=\"bottom\" border=\"0\" alt=\"\" />
<b><a href=\"index.php?ind=news&op=news_show_single&ide={$row['id']}\">$titolo</a></b>
<br />
$testo
</td>
</tr>
</tbody>
</table>
";
}
$query = $DB->query( "SELECT n.id, n.idcategoria, n.idautore, n.titolo, n.autore, n.testo, n.data, n.totalcomm, s.id AS idcat, s.titolo AS titcat, s.icona
FROM mkp_news AS n
LEFT JOIN mkp_news_sections AS s ON(s.id = n.idcategoria)
WHERE validate = '1' ORDER BY `id` DESC LIMIT 2");
while( $row = $DB->fetch_row($query) ) {
$idnt = $row['id'];
$totcomments = $row['totalcomm'];
$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 = $row['titcat'];
$icona = $row['icona'];
switch($icona) {
case '1':
$image = "$this->images/entry.gif";
break;
case '2':
$image = "$this->images/entry.gif";
break;
case '3':
$image = "$this->images/entry.gif";
break;
case '4':
$image = "$this->images/entry.gif";
break;
case '5':
$image = "$this->images/entry.gif";
break;
default:
$image = $icona;
break;
}
$cdata = $this->create_date($row['data']);
if ($news_words) {
$testo = substr ($testo, 0, $news_words);
$testo .= " ...";
}
$cont4 = "
<table class=\"tabnews\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">
<tbody>
<tr>
<td>
<img align=\"left\" hspace=\"0\" src=\"$image\" align=\"bottom\" border=\"0\" alt=\"\" />
<b><a href=\"index.php?ind=news&op=news_show_single&ide={$row['id']}\">$titolo</a></b>
<br />
$testo
</td>
</tr>
</tbody>
</table>
";
}
$query = $DB->query( "SELECT n.id, n.idcategoria, n.idautore, n.titolo, n.autore, n.testo, n.data, n.totalcomm, s.id AS idcat, s.titolo AS titcat, s.icona
FROM mkp_news AS n
LEFT JOIN mkp_news_sections AS s ON(s.id = n.idcategoria)
WHERE validate = '1' ORDER BY `id` DESC LIMIT 4");
while( $row = $DB->fetch_row($query) ) {
$idnt = $row['id'];
$totcomments = $row['totalcomm'];
$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 = $row['titcat'];
$icona = $row['icona'];
switch($icona) {
case '1':
$image = "$this->images/entry.gif";
break;
case '2':
$image = "$this->images/entry.gif";
break;
case '3':
$image = "$this->images/entry.gif";
break;
case '4':
$image = "$this->images/entry.gif";
break;
case '5':
$image = "$this->images/entry.gif";
break;
default:
$image = $icona;
break;
}
$cdata = $this->create_date($row['data']);
if ($news_words) {
$testo = substr ($testo, 0, $news_words);
$testo .= " ...";
}
$cont5 = "
<table class=\"tabnews\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">
<tbody>
<tr>
<td>
<img align=\"left\" hspace=\"0\" src=\"$image\" align=\"bottom\" border=\"0\" alt=\"\" />
<b><a href=\"index.php?ind=news&op=news_show_single&ide={$row['id']}\">$titolo</a></b>
<br />
$testo
</td>
</tr>
</tbody>
</table>
";
}
$query = $DB->query( "SELECT n.id, n.idcategoria, n.idautore, n.titolo, n.autore, n.testo, n.data, n.totalcomm, s.id AS idcat, s.titolo AS titcat, s.icona
FROM mkp_news AS n
LEFT JOIN mkp_news_sections AS s ON(s.id = n.idcategoria)
WHERE validate = '1' ORDER BY `id` DESC LIMIT 5");
while( $row = $DB->fetch_row($query) ) {
$idnt = $row['id'];
$totcomments = $row['totalcomm'];
$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 = $row['titcat'];
$icona = $row['icona'];
switch($icona) {
case '1':
$image = "$this->images/entry.gif";
break;
case '2':
$image = "$this->images/entry.gif";
break;
case '3':
$image = "$this->images/entry.gif";
break;
case '4':
$image = "$this->images/entry.gif";
break;
case '5':
$image = "$this->images/entry.gif";
break;
default:
$image = $icona;
break;
}
$cdata = $this->create_date($row['data']);
if ($news_words) {
$testo = substr ($testo, 0, $news_words);
$testo .= " ...";
}
$cont6 = "
<table class=\"tabnews\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">
<tbody>
<tr>
<td>
<img align=\"left\" hspace=\"0\" src=\"$image\" align=\"bottom\" border=\"0\" alt=\"\" />
<b><a href=\"index.php?ind=news&op=news_show_single&ide={$row['id']}\">$titolo</a></b>
<br />
$testo
</td>
</tr>
</tbody>
</table>
";
}
$query = $DB->query( "SELECT n.id, n.idcategoria, n.idautore, n.titolo, n.autore, n.testo, n.data, n.totalcomm, s.id AS idcat, s.titolo AS titcat, s.icona
FROM mkp_news AS n
LEFT JOIN mkp_news_sections AS s ON(s.id = n.idcategoria)
WHERE validate = '1' ORDER BY `id` DESC LIMIT 6");
while( $row = $DB->fetch_row($query) ) {
$idnt = $row['id'];
$totcomments = $row['totalcomm'];
$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 = $row['titcat'];
$icona = $row['icona'];
switch($icona) {
case '1':
$image = "$this->images/entry.gif";
break;
case '2':
$image = "$this->images/entry.gif";
break;
case '3':
$image = "$this->images/entry.gif";
break;
case '4':
$image = "$this->images/entry.gif";
break;
case '5':
$image = "$this->images/entry.gif";
break;
default:
$image = $icona;
break;
}
$cdata = $this->create_date($row['data']);
if ($news_words) {
$testo = substr ($testo, 0, $news_words);
$testo .= " ...";
}
$cont7 = "
<table class=\"tabnews\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">
<tbody>
<tr>
<td>
<img align=\"left\" hspace=\"0\" src=\"$image\" align=\"bottom\" border=\"0\" alt=\"\" />
<b><a href=\"index.php?ind=news&op=news_show_single&ide={$row['id']}\">$titolo</a></b>
<br />
$testo
</td>
</tr>
</tbody>
</table>
";
}
$content = "
<tr>
<td class=\"contents\">
<div class=\"taburlo\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
<tr><td align=\"center\" colspan=\"2\" rowspan=\"1\"><script type=\"text/javascript\"><!--
google_ad_client = \"pub-3129119178344888\";
/* 468x60, oluþturulma 04.12.2007 */
google_ad_slot = \"5780237003\";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type=\"text/javascript\"
src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script>
</td></tr>
<tr>
<td width=\"33%\" class=\"taburlo\" valign=\"top\">
{$cont2}
{$cont4}
</td>
</tr>
<tr>
<td width=\"33%\" class=\"taburlo\" valign=\"top\">
{$cont3}
{$cont5}
</td>
</tr>
<tr><td align=\"center\" colspan=\"2\" rowspan=\"1\"><script type=\"text/javascript\"><!--
google_ad_client = \"pub-3129119178344888\";
/* 468x60, oluþturulma 04.12.2007 */
google_ad_slot = \"5780237003\";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type=\"text/javascript\"
src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script>
</td></tr>
<tr>
<td width=\"33%\" class=\"taburlo\" valign=\"top\">
{$cont6}
{$cont7}
</td> </tr>
</table>
</div>
</td>
</tr>
";
unset($cont);
unset($row);
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);
?>