Arkadaşlar daha önce 2-3 blok yayınlandı. Bende bir sitede buldum kurulumu biraz değişik olduğu için paylaşayım dedim.
İlk önce Linkleri Görebilmek İçin
Kayıt Olun veya
Giriş Yapın bu adrese girip bloğu indiriyorsunuz. içerisinde 3 dosya çıkacak. last_forum_topic.php bunun içindekilerini silip yerine aşağıdaki kodu ekliyorsunuz.
<?php
/*
+--------------------------------------------------------------------------
| 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
|
+--------------------------------------------------------------------------
*/
if (!defined("IN_MKP")) {
die ("Sorry !! You cannot access this file directly.");
}
require("forum/SSI.php");
$content = "";
$content = $mklib_board->get_last_topics();
?>
Değiştirdiğimiz bu dosyayı ve zipten çıkan istruzioni.txt dosyasını ftp den bloklara atıyoruz.
mkportal/include/SMF/ içerisinden smf_board_functions.php dosyasını indirip, aşağıdaki kodu arayoruz.
function get_last_posts($by, $sdate)
kodunun üzerine
function get_last_topics()
{
global $DB, $mklib, $mkportals, $db_prefix, $user_info, $modSettings;
$limit = 10;
$taglio = 80;
$db_prefix = DBPREFIX;
ob_start();
$sql = "Select count(*) As anzahl FROM {$db_prefix}topics";
$row = mysql_fetch_array($DB->query($sql));
if ($row['anzahl'] < $limit)
$limit = $row['anzahl'];
$content = '
<tr>
<td height="14" style="background-color : #354D7F; color:#FFFFFF" width="25"> </td>
<td height="14" style="background-color : #354D7F; color:#FFFFFF"><b>Topic</b></td>
<td height="14" style="background-color : #354D7F; color:#FFFFFF" width="130" align="center"><b>Ultimo Post</b></td>
<td height="14" style="background-color : #354D7F; color:#FFFFFF" width="70" align="center"><b>Risposte</b></td>
<td height="14" style="background-color : #354D7F; color:#FFFFFF" width="35" align="center"><b>Visto</b></td>
<td height="14" style="background-color : #354D7F; color:#FFFFFF" width="100"><b>Board</b></td>
</tr>';
$Output = ssi_recentTopics(10, null, 'array');
if( count($Output) < $limit ) $limit = count($Output);
For ($i = 0; $i<$limit; $i=$i+1){
$ID_TOPIC = $Output[$i]['topic'];
$ID_BOARD = $Output[$i]['board']['id'];
$ID_MEMBER_UPDATED = $Output[$i]['poster']['id'];
$boardName = $Output[$i]['board']['name'];
$boardLink = $Output[$i]['board']['link'];
$MEMBER_UPDATED = $Output[$i]['poster']['name'];
$MEMBER_UPDATED_LINK = $Output[$i]['poster']['link'];
$subject = $Output[$i]['subject'];
$body = $Output[$i]['preview'];
$icon = $Output[$i]['icon'];
$posterTime = $Output[$i]['timestamp'];
$sql = "Select ID_FIRST_MSG, ID_LAST_MSG, ID_MEMBER_STARTED, numViews, numReplies FROM {$db_prefix}topics Where ID_TOPIC = $ID_TOPIC";
$qry = $DB->query($sql);
$row = mysql_fetch_array($qry);
$ID_FIRST_MSG = $row['ID_FIRST_MSG'];
$ID_LAST_MSG = $row['ID_LAST_MSG'];
$ID_MEMBER_STARTED = $row['ID_MEMBER_STARTED'];
$numViews = $row['numViews'];
$numReplies = $row['numReplies'];
$sql = "Select memberName From {$db_prefix}members Where ID_MEMBER = $ID_MEMBER_STARTED";
$qry = $DB->query($sql);
$row = mysql_fetch_array($qry);
$MEMBER_STARTED = $row[''];
$sql2 = "Select icon From {$db_prefix}messages Where ID_MSG = $ID_FIRST_MSG";
$qry = $DB->query($sql2);
$row2 = mysql_fetch_array($qry);
$icon = $row2['icon'];
$subject = strip_tags($subject);
$subject = str_replace( "!" , "!" ,$subject );
$subject = str_replace( """, "\"", $subject );
if (strlen($subject) > $taglio) {
$subject = substr( $subject,0,($taglio - 3) ) . "...";
$subject = preg_replace( '/&(#(\d+;?)?)?(\.\.\.)?$/', '...',$subject );
}
$body = str_replace( "<br>" , "[br]" ,$body );
$body = str_replace( "<br />" , "[br]" ,$body );
$body = strip_tags($body);
$body = str_replace( "!" , "!" ,$body );
$body = str_replace( "<", "<", $body );
$body = str_replace( ">", ">", $body );
$body = str_replace( "[br]" ,"\n" ,$body );
if (strlen($body) > 800){
$body = substr($body, 1, 800)." ...";
}
$datum = strftime("%d.%m.%Y",$posterTime);
if ($datum == strftime("%d.%m.%Y",Time()))
$datum = "Oggi";
elseif ($datum == strftime("%d.%m.%Y",Time()-86400))
$datum = "Ieri";
else
$datum = "Il: ".$datum;
$zeit = strftime("%H:%M",$posterTime);
$content .= '
<tr>
<td class="windowbg" align="center"><img src="'.$mkportals->forum_url.'/Themes/default/images/post/'.$icon.'.gif" alt="" border="" /></td>
<td class="windowbg2" id="" title="'.$body.'">
<strong><a href="'.$mkportals->forum_url.'/index.php?topic='.$ID_TOPIC.'" id="">'.$subject.'</a></strong><br>
<span class="smalltext">
<a href="'.$mkportals->forum_url.'/index.php?action=profile;u='.$ID_MEMBER_STARTED.'" rel="nofollow">'.$MEMBER_STARTED.'</a>
</span>
</td>
<td class="windowbg" align="right">
<div class="smalltext">
'.$datum.' <span class="color:#COCOCO">'.$zeit.'</span><br />
da <a href="'.$mkportals->forum_url.'/index.php?action=profile;u='.$ID_MEMBER_UPDATED.'" rel="nofollow">'.$MEMBER_UPDATED.'</a>
<a href="'.$mkportals->forum_url.'/index.php?topic='.$ID_TOPIC.".msg".$ID_LAST_MSG.'#msg'.$ID_LAST_MSG.'">
<img src="'.$mkportals->forum_url.'/Themes/default/images/icons/last_post.gif" alt="" border="0" /></a>
</div>
</td>
<td class="windowbg2" align="center">'.$numReplies.'</td>
<td class="windowbg" align="center">'.$numViews.'</td>
<td class="windowbg2">'.$boardLink.'</td>
</tr>';
}
return $content;
}
Bu kodu ekliyoruz. Görünümü

Teşekkür listesi şu anda boş.