SimplePortal

Support => International Support => Turkish (Türkçe) => Topic started by: Bumin on April 01, 2010, 04:41:20 PM

Title: İstediğimiz Başlığın Son Konularını Göstermek
Post by: Bumin on April 01, 2010, 04:41:20 PM
İstediğiniz Kategorinin Konularını Göstermek İçin,

./SSI.php
Code: (Bul) [Select]
?>

Code: (Üstüne Ekle) [Select]
function ssi_recentTopics_Include($num_recent = 8, $include_boards = null, $output_method = 'echo')
{
global $context, $settings, $scripturl, $txt, $db_prefix, $ID_MEMBER;
global $user_info, $modSettings, $func;

$include_boards = empty($include_boards) ? array() : $include_boards;

$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// Find all the posts in distinct topics.  Newer ones will have higher IDs.
$request = db_query("
SELECT
m.posterTime, ms.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, b.ID_BOARD, b.name AS bName,
IFNULL(mem.realName, m.posterName) AS posterName, " . ($user_info['is_guest'] ? '1 AS isRead, 0 AS new_from' : '
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) >= m.ID_MSG_MODIFIED AS isRead,
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from') . ", LEFT(m.body, 384) AS body, m.smileysEnabled, m.icon
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)" : '') . "
WHERE t.ID_LAST_MSG = m.ID_MSG
AND b.ID_BOARD = t.ID_BOARD" . (empty($include_boards) ? '' : "
AND b.ID_BOARD IN (" . implode(', ', $include_boards) . ")") . "
AND $user_info[query_see_board]
AND ms.ID_MSG = t.ID_FIRST_MSG
ORDER BY t.ID_LAST_MSG DESC
LIMIT $num_recent", __FILE__, __LINE__);
$posts = array();
while ($row = mysql_fetch_assoc($request))
{
$row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']), array('<br />' => '&#10;')));
if ($func['strlen']($row['body']) > 128)
$row['body'] = $func['substr']($row['body'], 0, 128) . '...';

// Censor the subject.
censorText($row['subject']);
censorText($row['body']);

if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

// Build the array.
$posts[] = array(
'board' => array(
'id' => $row['ID_BOARD'],
'name' => $row['bName'],
'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0">' . $row['bName'] . '</a>'
),
'topic' => $row['ID_TOPIC'],
'poster' => array(
'id' => $row['ID_MEMBER'],
'name' => $row['posterName'],
'href' => empty($row['ID_MEMBER']) ? '' : $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => empty($row['ID_MEMBER']) ? $row['posterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'
),
'subject' => $row['subject'],
'short_subject' => shorten_subject($row['subject'], 25),
'preview' => $row['body'],
'time' => timeformat($row['posterTime']),
'timestamp' => forum_time(true, $row['posterTime']),
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . '#new">' . $row['subject'] . '</a>',
'new' => !empty($row['isRead']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
);
}
mysql_free_result($request);

// Just return it.
if ($output_method != 'echo' || empty($posts))
return $posts;

echo '
<table border="0" class="ssi_table">';
foreach ($posts as $post)
echo '
<tr>
<td align="right" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>
<td valign="top">
<a href="', $post['href'], '">', $post['subject'], '</a>
', $txt[525], ' ', $post['poster']['link'], '
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>', '
</td>
<td align="right" nowrap="nowrap">
', $post['time'], '
</td>
</tr>';
echo '
</table>';
}


Yukarıda işlemden sonra,

Aşağıdaki kodu Php Kod, Phpbox olarak bloğunuzu oluşturunuz.

Code: [Select]
global $context, $scripturl, $settings, $txt;
$bullet = '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';

$result=ssi_recentTopics_Include(10,array(1),'return');

foreach($result as $my){
  echo "$bullet";
  echo '<span class="smalltext">'.$my['link'];

  // is this topic new? (assume they are logged in)
if (!$my['new'] && $context['user']['is_logged'])
        echo ' <a href="', $scripturl, '?topic=', $my['topic'], '.from', $my['new_from'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '<br />';
echo ' Yazar ', $my['poster']['link'];
echo '<br />';
echo ' posted ', $my['time'];
echo '<br />';
echo '<hr />';
}
echo '</span>';

Bu bölümü "array(1)" göstermek istediğiniz kategorinin/kategorilerin [id]'lerine göre düzenleyiniz.
Ör: "array(1,2,3)"
Title: Re: İstediğimiz Başlığın Son Konularını Göstermek
Post by: Bumin on April 01, 2010, 04:43:42 PM
Yukarda eklediğim fonksiyonla ilgili bir sorum var
yukardaki uygulamayı yaptıktan sonra
Code: [Select]
global $context, $scripturl, $settings, $txt;
$bullet = '<img src="'.$settings['images_url'].'/8top10.gif" alt="" border="0" style="margin:0 2px 0 0;" />';

$result=ssi_recentTopics_Include(10,array(46),'return');

foreach($result as $my){
  echo "$bullet";
  echo '<span class="2px">'.$my['link'];

  // is this topic new? (assume they are logged in)
if (!$my['new'] && $context['user']['is_logged'])
        echo ' <a href="', $scripturl, '?topic=', $my['topic'], '.from', $my['new_from'], '#new"></a>';
echo '<br />';

}
echo '</span>';

kodları kullanarak blok oluşturuyorum
görüntülemede sorun yok
ben üç farklı konuyu aynı blokta göstermemiz mümkünmü
örenğin alt bloğa yada üst bloğa eklenecek şekilde
forumda eklenen son şiirler , fıkralar , yazılar bunları ayrı ayrı blok şeklinde ama tek blokta
Şimdiden teşekkürler
Title: Re: İstediğimiz Başlığın Son Konularını Göstermek
Post by: Bumin on May 28, 2011, 08:16:49 AM
Bu Başlığı daha önce açtığım için aynı yerden devam edeyim istedim
bu uygulamayı smf rc 2 0 5 de uygulamak mümkünmüdür .
ben aynı şekilde blok eklediğim zaman hata veriyor yardımcı olurmusunuz teşekkür ederim .
Title: Re: İstediğimiz Başlığın Son Konularını Göstermek
Post by: Bumin on May 29, 2011, 11:03:58 AM
ustalar konu güncel tekrar yaptığım için özür dilerim
Title: Re: İstediğimiz Başlığın Son Konularını Göstermek
Post by: fthkynr on September 02, 2012, 01:24:52 PM
Yukarda eklediğim fonksiyonla ilgili bir sorum var
yukardaki uygulamayı yaptıktan sonra
Code: [Select]
global $context, $scripturl, $settings, $txt;
$bullet = '<img src="'.$settings['images_url'].'/8top10.gif" alt="" border="0" style="margin:0 2px 0 0;" />';

$result=ssi_recentTopics_Include(10,array(46),'return');

foreach($result as $my){
  echo "$bullet";
  echo '<span class="2px">'.$my['link'];

  // is this topic new? (assume they are logged in)
if (!$my['new'] && $context['user']['is_logged'])
        echo ' <a href="', $scripturl, '?topic=', $my['topic'], '.from', $my['new_from'], '#new"></a>';
echo '<br />';

}
echo '</span>';

kodları kullanarak blok oluşturuyorum
görüntülemede sorun yok
ben üç farklı konuyu aynı blokta göstermemiz mümkünmü
örenğin alt bloğa yada üst bloğa eklenecek şekilde
forumda eklenen son şiirler , fıkralar , yazılar bunları ayrı ayrı blok şeklinde ama tek blokta
Şimdiden teşekkürler

dediğiniz şeyi yaptınız mı? son şiirler fıkralar yazılar gibi ayrı ayrı son konular bloklarını bu şekilde gösterebilirmiyiz?
SimplePortal 2.3.8 © 2008-2024, SimplePortal