SimplePortal

Support => International Support => Turkish (Türkçe) => Topic started by: saruhan on December 12, 2012, 12:37:05 PM

Title: Forumdan son konular bloğu editleme
Post by: saruhan on December 12, 2012, 12:37:05 PM
Öncelikle herkese merhabalar...

Değerli arkadaşlar www.avkolik.net sitemizi artık 2 sürümüne geçirmek zamanı geldi diyerekten bir çalışmaya başladık. Hali hazırda kullandığımız sürüm mkportal ile gidiyordu fakat sürüm 2 olunca simple portala geçiş yapacağız. Ön çalışmaları yaparken takıldığımız bir nokta oldu. Simple portalda forumdan son konuları php bir blok ile çekiyoruz..

Şu anki ekran görüntüsü


(http://i47.tinypic.com/f4314j.png)

Arkadaşlar bu bloğun kodları

Code: [Select]
$topics = ssi_recentTopics(30, null, null, 'array');
   echo '

<table width="100%" style="border-collapse: collapse" id="table1">
    <tr>
        <center><td class="cat_bar"><div class="cat_bar"> <h3 class="catbg">
        &nbsp; <b>Son Yanıtlanan Konular</b></h3></div></td></center>
        <center><td class="cat_bar" align="center"><div class="cat_bar"><h3 class="catbg">
        <b>Cevap</b></h3></div></td></center>
       <center><td class="cat_bar" align="center"><div class="cat_bar"><h3 class="catbg">
        <b>Son Gönderen/Tarih</b></h3></div></td></center>
    </tr>
    ';

foreach ($topics as $topic)
   echo '
      <tr class="windowbg">
     <td style="border-bottom: 1px solid #AAA;">', $topic['link'], '</td>
     <td style="border-bottom: 1px solid #AAA;">', $topic['replies'], '</td>
     <td style="border-bottom: 1px solid #AAA;">', $topic['poster']['link'], '<br />', $topic['time'], '</td>
      </tr>';

echo '
   </table>
</div>';

Şimdi sizlerden ricam eğer mümkünse kırmızı ok ile gösterdiğim bölümde yine mümkünse iki adet bağlantı birimi olacak şekilde adsense reklamı yayınlamak istiyorum.  iki mümkün değilse tek kırmızı okun olduğu yerdede bir tanede olabilir. Kırmızı okların oldukları yerler mümkün değilse mavi okun olduğu yer için yukarıdaki kodlamaya nasıl  bir ekleme yapacağız..

Son olarak bu kodlar ile oluşan son konular bloğunu www.avkolik.net sitesi ana sayfasında mkportalda kullandığımız forumdan son konular şekline nasıl getirebiliriz. mkportalda kullandığımız blokta konunun üzerine mause ile geldiğimizde knuyu kim hangi tarihte açmış bilgisi ve son meaj yazısına tıklayınca son mesaja gitme konunun üzerine tıklayınca konuya farklı bir pencerede gitme gibi özellikler vardı...Mkportalda kullandığım bloğun kodlarınıda ekliyorum :


Code: [Select]
<?php
/*-------------------------------------------------------------------------
|  MKPortal SMF Last Posts Table 1.0 (for center block) 16.05.2006 
|  for MKP M1.x x SMF 1.x
|  by visiblesoul <visiblesoul.net>
|  Support: http://www.visiblesoul.net/resources/forum/viewforum.php?id=52
+--------------------------------------------------------------------------

Want to show your appreciation for this block?
Link to me on your website using the link code below:
 
Get free <a href="http://www.visiblesoul.net/" target="_blank">MKPortal modules, blocks, hacks, and skins</a> at <a href="http://www.visiblesoul.net/" target="_blank">Visible Soul Web Design - Corpus Christi, Texas</a>!

---------------------------------------------------------------------------
Config:
--------------------------------------------------------------------------*/
$limit 60 // Number of forum posts to show in block 
$cuttitle 52 // Number of characters to display in title
$startformat "" // Formats the topic start date. 
// Options are 'short', 'time', 'small', 'normal', or leave blank for default.
$lastformat "" // Formats the last post date. 
// Options are 'short', 'time', 'small', 'normal', or leave blank for default. 
$showprev 0; // Show post preview? Yes=1 No=0
$cutpost "199"; // Number of characters to display in post preview
/*------------------------------------------------------------------------*/

global $mklib$mkportals$db_prefix$user_info$modSettings;

$content "
<td><em><center>aVKoLiK.NeT | Dostkolik - Avcılık, Av Köpekleri, Av Fotoları,Av Videoları, Av Tüfekleri</center></em></td>
<tr>
  <td>

    <table class=\"moduleborder\" cellspacing=\"1\" width=\"100%\">
      <tr>
<th class=\"modulex\" width=\"35%\" style=\"padding-left: 10px; text-align: center;\">Konu Başlığı</th>
<th class=\"modulex\" width=\"30%\" style=\"padding-left: 10px; text-align: center;\">Son Gönderen</th>
<th class=\"modulex\" width=\"25%\" style=\"padding-left: 10px; text-align: center;\">Tarih</th>
<th class=\"modulex\" width=\"5%\" style=\"text-align: center;\">Okuma</th>
<th class=\"modulex\" width=\"5%\" style=\"text-align: center;\">Cevap</th>
      </tr>
  
  
  
"
;

$db_prefix DBPREFIX;

        
$sql "
SELECT
m.posterTime AS lastPosterTime, m.ID_TOPIC, m.ID_MSG, m.ID_MEMBER, m.smileysEnabled, 
m2.ID_MEMBER AS ID_FIRST_MEMBER, m2.subject, m2.posterTime, m2.body, 
t.ID_BOARD, t.ID_LAST_MSG, t.numReplies, t.numViews, b.name AS bName,
IFNULL(mem2.realName, m2.posterName) AS posterName, t.ID_FIRST_MSG,
IFNULL(mem.realName, m.posterName) AS lastPosterName, t.ID_LAST_MSG
FROM (
{$db_prefix}messages AS m, {$db_prefix}messages AS m2, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
LEFT JOIN 
{$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
LEFT JOIN 
{$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = m2.ID_MEMBER)
WHERE m2.ID_MSG = t.ID_FIRST_MSG
AND m.ID_MSG = t.ID_LAST_MSG
AND t.ID_TOPIC = m.ID_TOPIC
AND m.ID_MSG >= " 
max(0$modSettings['maxMsgID'] - 20 $limit) . "
AND b.ID_BOARD = t.ID_BOARD" 
. (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > "
AND b.ID_BOARD != 
$modSettings[recycle_board]'') . "
AND 
$user_info[query_see_board]
GROUP BY m.ID_TOPIC
ORDER BY t.ID_LAST_MSG DESC
LIMIT 
$limit";

        
$DB->query($sql);

        while ( 
$post $DB->fetch_row() ) {
          
$title strip_tags($post['subject']);
        
$title str_replace"&#38;#33;" "!" ,$title );
        
$title str_replace"&quot;""\""$title );
            
if (strlen($title) > $cuttitle) {
                
$title substr$title,0,($cuttitle 3) ) . "...";
                
$title preg_replace'/&(#(\d+;?)?)?(\.\.\.)?$/''...',$title );
}

$starter $post['posterName'];
$lastname $post['lastPosterName'];
$lastid $post['ID_MEMBER'];
$last_postid $post['ID_LAST_MSG'];
$posts $post['numReplies'];
$views $post['numViews'];
$tid $post['ID_TOPIC'];
$title $post['subject'];
$prepost $post['body'];

$prepost strip_tags($post['body']);
        
$prepost str_replace"&#38;#33;" "!" $prepost );
        
$prepost str_replace"&quot;""\""$prepost );
            
if (strlen($prepost) > $cutpost) {
                
$prepost substr$prepost,0,($cutpost 3) ) . "...";
                
$prepost preg_replace'/&(#(\d+;?)?)?(\.\.\.)?$/''...',$prepost );
}

$startdate  $mklib->create_date($post['posterTime'],$startformat);
$lastdate  $mklib->create_date($post['lastPosterTime'], $lastformat);

if ($showprev == 1) {
$preview "<tr><td style=\"padding: 2px 8px\" class=\"modulecell\" colspan=\"5\">$prepost</td></tr>";
}
else
$preview "";

$content .= "
<!-- topic begin -->
      <tr>
<td class=\"modulecell\" style=\"padding-left: 8px; text-align: left;\">
  <a target=\"_blank\" style=\"text-decoration: none; font-weight: bold;\" href=\"
{$mkportals->forum_url}/index.php?topic={$tid}\"
title=\"
$startdate tarihinde konuyu $starter açmıştır... \">$title</a>
</td>
<td class=\"modulecell\" style=\"padding-left: 8px; text-align: center;\">
  <a href=\"
{$mkportals->forum_url}/index.php?topic={$tid}.msg{$last_postid}#msg{$last_postid}\" title=\"Son Mesaja Git...\">Son Mesaj</a>: <a href=\"{$mkportals->forum_url}/index.php?action=profile;u={$lastid}\" title=\"Son Gönderen: $lastname\"><b>$lastname</b></a>
</td>
<td class=\"modulecell\" style=\"padding-left: 8px; text-align: center;\">
$lastdate</td>
<td class=\"modulecell\" style=\"padding-right: 8px; text-align: center;\">
$views</td>
<td class=\"modulecell\" style=\"padding-right: 8px; text-align: center;\">
$posts</td>     
</td>

</tr>
$preview
<!-- topic end -->    
"
;
}

$content .= "
    </table>

  </td>
</tr>
"
;

        unset(
$limit);
unset($cuttitle);
unset($startformat);
unset($lastformat);
unset($showprev);
unset($cutpost);
        unset(
$post);
unset($tid);
        unset(
$title);
        unset(
$views);
unset($posts);
unset($startdate);
unset($starter);
unset($last_postid);
unset($sql);
unset($lastname);
unset($lastid);
unset($prepost);
unset($lastdate);
unset($preview);
unset($prepost);

?>


Yardımcı olabilcek arkadaşlara şimdeden teşekkür ediyorum...
SimplePortal 2.3.8 © 2008-2024, SimplePortal