SimplePortal

Support => International Support => Turkish (Türkçe) => Topic started by: sayfam on September 18, 2008, 05:30:40 PM

Title: son konular blogu ve devamını oku ile ilgili sorun
Post by: sayfam on September 18, 2008, 05:30:40 PM
1- Son konular blogunu sadece konu isimleri olacak şekilde ayarlayabilir miyiz? Yani gönderen, gönderim tarihi ve ait olduğu bölüm olmasın..

2- Makaleleri istediğimiz bir yerden bölüp devamını oku linkini ekleyebilir miyiz?


Edit: Son Konular bloğu bende son mesaj atılan konuları listeliyor, benim istediğim foruma açılan son konular...Bu mümkün müdür?
Title: Re: son konular blogu ve devam?n? oku ile ilgili sorun
Post by: [SiNaN] on September 18, 2008, 05:55:44 PM
php blok olu?turun ve içerik olarak ?u kodlar? kullan?n:

Code: [Select]
global $context, $settings, $scripturl, $txt, $db_prefix, $ID_MEMBER;
global $user_info, $modSettings, $func, $posts;

$exclude_boards = null;

if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = empty($exclude_boards) ? array() : $exclude_boards;

$request = db_query("
SELECT
ms.subject, m.ID_TOPIC, m.ID_MSG, " . ($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') . ", 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 >= " . ($modSettings['maxMsgID'] - 35 * min($num_recent, 5)) . "
AND t.ID_LAST_MSG = m.ID_MSG
AND b.ID_BOARD = t.ID_BOARD" . (empty($exclude_boards) ? '' : "
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
AND $user_info[query_see_board]
AND ms.ID_MSG = t.ID_FIRST_MSG
ORDER BY t.ID_FIRST_MSG DESC
LIMIT 10", __FILE__, __LINE__);
$posts = array();
while ($row = mysql_fetch_assoc($request))
{

censorText($row['subject']);

$posts[] = array(
'topic' => $row['ID_TOPIC'],
'subject' => $row['subject'],
'short_subject' => shorten_subject($row['subject'], 25),
'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);

if (empty($posts))
return $posts;

foreach ($posts as $post)
echo '
<a href="', $post['href'], '">', $post['subject'], '</a>
', $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>', '<br />';

?kincisi ise ?u an mümkün de?il. Sadece gösterilecek karakter say?s?n? s?n?rlayabilirsiniz.
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: sayfam on September 18, 2008, 07:37:43 PM
Sinan, ilgin için teşekkür ederim. Ancak bu kodla sadece son cevaplanan konu çıktı.. Benim istediğim foruma açılan son konular..Örneğin; son açılan 10 konu..Teşekkür ederim.
Title: Re: son konular blogu ve devam?n? oku ile ilgili sorun
Post by: [SiNaN] on September 18, 2008, 07:49:15 PM
Bunu deneyin:

Code: [Select]
global $context, $settings, $scripturl, $txt, $db_prefix, $ID_MEMBER;
global $user_info, $modSettings, $func, $posts;

$exclude_boards = null;

if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = empty($exclude_boards) ? array() : $exclude_boards;

$request = db_query("
SELECT
ms.subject, m.ID_TOPIC, m.ID_MSG, " . ($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') . ", 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 >= " . ($modSettings['maxMsgID'] - 35 * max(10, 5)) . "
AND t.ID_LAST_MSG = m.ID_MSG
AND b.ID_BOARD = t.ID_BOARD" . (empty($exclude_boards) ? '' : "
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
AND $user_info[query_see_board]
AND ms.ID_MSG = t.ID_FIRST_MSG
ORDER BY t.ID_FIRST_MSG DESC
LIMIT 10", __FILE__, __LINE__);
$posts = array();
while ($row = mysql_fetch_assoc($request))
{

censorText($row['subject']);

$posts[] = array(
'topic' => $row['ID_TOPIC'],
'subject' => $row['subject'],
'short_subject' => shorten_subject($row['subject'], 25),
'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'],
);
}
mysql_free_result($request);

if (empty($posts))
return $posts;

foreach ($posts as $post)
echo '
<a href="', $post['href'], '">', $post['subject'], '</a>
', $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>', '<br />';
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: sayfam on September 18, 2008, 08:07:51 PM
Çok teşekkür ederim Sinan..Eline sağlık. Burada gösterilen konulara karakter sınırlaması koyabilir miyiz, tabloda taşıp aşağı kaymaması için?
Title: Re: son konular blogu ve devam?n? oku ile ilgili sorun
Post by: [SiNaN] on September 18, 2008, 08:38:54 PM
Bunu kullan?n:

Code: [Select]
global $context, $settings, $scripturl, $txt, $db_prefix, $ID_MEMBER;
global $user_info, $modSettings, $func, $posts;

$exclude_boards = null;

if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = empty($exclude_boards) ? array() : $exclude_boards;

$request = db_query("
SELECT
ms.subject, m.ID_TOPIC, m.ID_MSG, " . ($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') . ", 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 >= " . ($modSettings['maxMsgID'] - 35 * max(10, 5)) . "
AND t.ID_LAST_MSG = m.ID_MSG
AND b.ID_BOARD = t.ID_BOARD" . (empty($exclude_boards) ? '' : "
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
AND $user_info[query_see_board]
AND ms.ID_MSG = t.ID_FIRST_MSG
ORDER BY t.ID_FIRST_MSG DESC
LIMIT 10", __FILE__, __LINE__);
$posts = array();
while ($row = mysql_fetch_assoc($request))
{

censorText($row['subject']);

if ($func['strlen']($row['subject']) > 30)
$row['subject'] = $func['substr']($row['subject'], 0, 30) . '...';

$posts[] = array(
'topic' => $row['ID_TOPIC'],
'subject' => $row['subject'],
'short_subject' => shorten_subject($row['subject'], 25),
'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'],
);
}
mysql_free_result($request);

if (empty($posts))
return $posts;

foreach ($posts as $post)
echo '
<a href="', $post['href'], '">', $post['subject'], '</a>
', $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>', '<br />';

30 karakter ile s?n?rlar. Kodlar?n içindeki iki 30 rakam?n? istedi?iniz s?n?r ile de?i?tirebilirsiniz.
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: sayfam on September 20, 2008, 07:52:25 PM
Çok teşekkürler Sinan..
Title: Re: son konular blogu ve devam?n? oku ile ilgili sorun
Post by: Bumin on October 25, 2008, 07:40:11 PM
localde deneme yapt?m  ?öyle bir hata al?yorum

Fatal error: Call to undefined function: db_query() in c:\appserv\www\bumin\Sources\SPortal2.php(1609) : eval()'d code on line 11


neden kaynaklan?yor olabilir sportal kurarken hiçbir dosyas?nda hata almam??t?m
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: asude on October 27, 2008, 07:44:39 AM
Sanırım SMF 1.x versiyonuna ait bir PHP kodu eklediniz. db_query() fonksiyonu SMF 2.x ile değişmiştir. İlgili PHP blokunu sildiğinizde sorun düzelecektir.
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: Bumin on October 28, 2008, 05:24:02 AM
ben yukardaki bloku kurmak istiyorum smf 2.0.4 kurulu buna göre yapmam gerek ne yardımcı olurmusunuz
Title: Re: son konular blogu ve devam?n? oku ile ilgili sorun
Post by: [SiNaN] on November 10, 2008, 05:37:44 AM
Bu kodlar ile bir PHP Bloku olu?turun:

Code: [Select]
global $boarddir;

require_once($boarddir . '/SSI.php');

$topics = ssi_recentTopics(8, null, null, 'array')
foreach ($topics as $post)
echo '
<a href="', $post['href'], '">', $post['subject'], '</a>';
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: sayfam on February 13, 2009, 06:14:46 PM
bunun 2.0 rc1 için olanı var mı?
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: sayfam on February 27, 2009, 04:09:29 PM
http://simpleportal.net/index.php?topic=365.msg2278#msg2278

bu mesajdaki kodu 2.0 rc1 için nasıl uyarlayabiliriz?
Title: Re: son konular blogu ve devam?n? oku ile ilgili sorun
Post by: Paragaya on February 28, 2009, 01:57:18 AM
Bu kodlar ile bir PHP Bloku olu?turun:

Code: [Select]
global $boarddir;

require_once($boarddir . '/SSI.php');

$topics = ssi_recentTopics(8, null, null, 'array')
foreach ($topics as $post)
echo '
<a href="', $post['href'], '">', $post['subject'], '</a>';
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: sayfam on February 28, 2009, 04:19:40 PM
bu hatayı veriyor:
Code: [Select]
PHP sözdizimi hatası. Kodlarınızı kontrol edin.
Title: Re: son konular blogu ve devam?n? oku ile ilgili sorun
Post by: [SiNaN] on March 01, 2009, 12:23:26 PM
Code: [Select]
$topics = ssi_recentTopics(8, null, null, 'array')
?u ?ekilde olmal?:

Code: [Select]
$topics = ssi_recentTopics(8, null, null, 'array');
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: sayfam on March 01, 2009, 02:39:01 PM
bu son konuları değil son cevaplanan konuları veriyor.
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: sayfam on April 25, 2009, 12:38:04 PM
sportal 2.2 için son konuları (son cevaplanan konular değil) blok olarak nasıl göstereceğimize dair bir gelişme var mı?
Title: Re: son konular blogu ve devam?n? oku ile ilgili sorun
Post by: erdem86 on April 27, 2009, 02:33:49 PM
Bunu deneyin:

Code: [Select]
global $context, $settings, $scripturl, $txt, $db_prefix, $ID_MEMBER;
global $user_info, $modSettings, $func, $posts;

$exclude_boards = null;

if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = empty($exclude_boards) ? array() : $exclude_boards;

$request = db_query("
SELECT
ms.subject, m.ID_TOPIC, m.ID_MSG, " . ($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') . ", 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 >= " . ($modSettings['maxMsgID'] - 35 * max(10, 5)) . "
AND t.ID_LAST_MSG = m.ID_MSG
AND b.ID_BOARD = t.ID_BOARD" . (empty($exclude_boards) ? '' : "
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
AND $user_info[query_see_board]
AND ms.ID_MSG = t.ID_FIRST_MSG
ORDER BY t.ID_FIRST_MSG DESC
LIMIT 10", __FILE__, __LINE__);
$posts = array();
while ($row = mysql_fetch_assoc($request))
{

censorText($row['subject']);

$posts[] = array(
'topic' => $row['ID_TOPIC'],
'subject' => $row['subject'],
'short_subject' => shorten_subject($row['subject'], 25),
'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'],
);
}
mysql_free_result($request);

if (empty($posts))
return $posts;

foreach ($posts as $post)
echo '
<a href="', $post['href'], '">', $post['subject'], '</a>
', $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>', '<br />';

Bu Blokta, konular?n önüne madde i?areti * gibi koyabilir miyiz? Ya da araya çok bo?luk yaratmayacak bir ayraç?

Bir de acaba belli forumlar?n exclude olmas?n? sa?layabilir miyiz? O forumlardaki yeni konular? listeye almas?n?
Title: Re: son konular blogu ve devam?n? oku ile ilgili sorun
Post by: grafitus on April 27, 2009, 04:36:56 PM
<a href="', $post['href'], '">', $post['subject'
Kodunun önüne

Code: [Select]
', sp_embed_image('dot'), '
Ekleyiniz..
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: erdem86 on April 27, 2009, 05:20:21 PM
Teşekkür ederim. :)
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: [SiNaN] on April 28, 2009, 03:14:51 AM
sportal 2.2 için son konuları (son cevaplanan konular değil) blok olarak nasıl göstereceğimize dair bir gelişme var mı?

Buradaki (http://simpleportal.net/index.php?topic=365.msg2302#msg2302) kodlar 2.2 ile de çalışıyor olmalı.
Title: Re: son konular blogu ve devam?n? oku ile ilgili sorun
Post by: sayfam on April 30, 2009, 05:02:44 PM
sportal 2.2 için son konular? (son cevaplanan konular de?il) blok olarak nas?l gösterece?imize dair bir geli?me var m??

Buradaki (http://simpleportal.net/index.php?topic=365.msg2302#msg2302) kodlar 2.2 ile de çal???yor olmal?.
maalesef çal??m?yor Sinan
Fatal error: Call to undefined function db_query() in /home/eleleyizor/domains/egitimforumu.com/public_html/Sources/SPortal2.php(3133) : eval()'d code on line 11
Title: Re: son konular blogu ve devam?n? oku ile ilgili sorun
Post by: Daydreamer on April 30, 2009, 06:44:03 PM
sportal 2.2 için son konular? (son cevaplanan konular de?il) blok olarak nas?l gösterece?imize dair bir geli?me var m??

Buradaki (http://simpleportal.net/index.php?topic=365.msg2302#msg2302) kodlar 2.2 ile de çal???yor olmal?.
maalesef çal??m?yor Sinan
Fatal error: Call to undefined function db_query() in /home/eleleyizor/domains/egitimforumu.com/public_html/Sources/SPortal2.php(3133) : eval()'d code on line 11

O kodlar 1.1.8 smf sürümü için. siz muhtemelen 2.0 kullan?yorsunuz.
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: sayfam on May 03, 2009, 06:22:54 PM
evet 2.0 rc1 için uyarlanabilir mi?
Title: Re: son konular blogu ve devam?n? oku ile ilgili sorun
Post by: [SiNaN] on May 04, 2009, 12:45:14 PM
Gecikme için üzgünüm, buyrun:

Code: [Select]
global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
global $modSettings, $smcFunc;

$num_recent = 8;
$exclude_boards = null;
$include_boards = null;

if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = empty($exclude_boards) ? array() : (is_array($exclude_boards) ? $exclude_boards : array($exclude_boards));

// Only some boards?.
if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards = is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method = $include_boards;
$include_boards = array();
}

$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 = $smcFunc['db_query']('substring', '
SELECT
m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.name AS board_name, t.num_replies, t.num_views,
IFNULL(mem.real_name, m.poster_name) AS poster_name, ' . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from') . ', SUBSTRING(m.body, 1, 384) AS body, m.smileys_enabled, m.icon
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)
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 = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' : '') . '
WHERE t.id_last_msg >= {int:min_message_id}
' . (empty($exclude_boards) ? '' : '
AND b.id_board NOT IN ({array_int:exclude_boards})') . '
' . (empty($include_boards) ? '' : '
AND b.id_board IN ({array_int:include_boards})') . '
AND {query_wanna_see_board}' . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}
AND m.approved = {int:is_approved}' : '') . '
ORDER BY t.id_topic DESC
LIMIT ' . $num_recent,
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' : $include_boards,
'exclude_boards' => empty($exclude_boards) ? '' : $exclude_boards,
'min_message_id' => $modSettings['maxMsgID'] - 35 * min($num_recent, 5),
'is_approved' => 1,
)
);
$posts = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => '')));
if ($smcFunc['strlen']($row['body']) > 128)
$row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...';

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

if ($smcFunc['strlen']($row['subject']) > 30)
$row['subject'] = $smcFunc['substr']($row['subject'], 0, 30) . '...';

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['board_name'],
'href' => $scripturl . '?board=' . $row['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['board_name'] . '</a>'
),
'topic' => $row['id_topic'],
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'
),
'subject' => $row['subject'],
'replies' => $row['num_replies'],
'views' => $row['num_views'],
'short_subject' => shorten_subject($row['subject'], 25),
'preview' => $row['body'],
'time' => timeformat($row['poster_time']),
'timestamp' => forum_time(true, $row['poster_time']),
'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" rel="nofollow">' . $row['subject'] . '</a>',
// Retained for compatibility - is technically incorrect!
'new' => !empty($row['is_read']),
'is_new' => empty($row['is_read']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
);
}
$smcFunc['db_free_result']($request);

// Just return it.
if (empty($posts))
return $posts;

foreach ($posts as $post)
echo '
<a href="', $post['href'], '">', $post['subject'], '</a>', !$post['is_new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new" rel="nofollow"><img src="' . $settings['lang_images_url'] . '/new.gif" alt="' . $txt['new'] . '" border="0" /></a>', '<br />';
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: sayfam on May 06, 2009, 07:28:57 PM
Teşekkürler Sinan, konu çözülmüştür.
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: [SiNaN] on May 07, 2009, 05:57:04 AM
Ben teşekkür ederim, engin sabrınız için. ;)
Title: Re: son konular blogu ve devamını oku ile ilgili sorun
Post by: EgeLeee on May 10, 2009, 04:46:36 PM
çok işe yarar bi konu aynen son kod sekliyle son mesajlar yapılabilirse sinan çok makbule gecer..
SimplePortal 2.3.8 © 2008-2024, SimplePortal