bolubeyi
03.Ağustos.2014, 11:26
Hızlı cevabın altında görüntülenen benzer konular listesini daha sade hale getirir ve konunun ilk iletisinde de görüntülenmesini sağlar.
ışlem Basamakları:
Öncelikle Benzer Konular - Related Topics - Konu - SMF Destek (https://www.smfdestek.com/konu/benzer-konular-related-topics/) modu kurulu değilse kurulur.
Display.template.php
Bul:
Kod:
// Assuming there are attachments...
Üstüne ekle:
Kod:
if ($message['id'] == $context['topic_first_message'] and (!empty($context['related_topics'])) )
{
echo '
', $txt['related_topics'], '
';
// Added by Related Topics
if (!empty($context['related_topics'])) // TODO: Have ability to display no related topics?
{
foreach ($context['related_topics'] as $topic)
{
echo '
', $topic['first_post']['link'], '
';
}
}
echo '
';
}
Bul:
Kod:
// Added by Related Topics
if (!empty($context['related_topics'])) // TODO: Have ability to display no related topics?
{
echo '
';
// Are there actually any topics to show?
if (!empty($context['related_topics']))
{
echo '
', $txt['related_topics'], '
', $txt['replies'], '
', $txt['last_post'], '
';
}
// No topics.... just say, "sorry bub".
else
echo '
', $txt['msg_alert_none'], '
';
echo '
';
foreach ($context['related_topics'] as $topic)
{
// Is this topic pending approval, or does it have any posts pending approval?
if ($topic['board']['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked'])
$color_class = 'stickybg locked_sticky';
// Sticky topics should get a different color, too.
elseif ($topic['is_sticky'])
$color_class = 'stickybg';
// Locked topics get special treatment as well.
elseif ($topic['is_locked'])
$color_class = 'lockedbg';
// Last, but not least: regular topics.
else
$color_class = 'windowbg';
// Some columns require a different shade of the color class.
$alternate_class = $color_class . '2';
echo '
https://webmaster.bbs.tr/', $settings['images_url'], '/topic/', $topic['class'], '.gif
https://webmaster.bbs.tr/', $topic['first_post']['icon_url'], '
', $topic['is_sticky'] ? '' : '', '', $topic['first_post']['link'], (!$topic['board']['can_approve_posts'] && !$topic['approved'] ? ' (' . $txt['awaiting_approval'] . ')' : ''), '', $topic['is_sticky'] ? '' : '' ;
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
https://webmaster.bbs.tr/', $settings['lang_images_url'], '/new.gif (https://webmaster.bbs.tr/', $topic['new_href'], ')';
echo '
', $topic['replies'], ' ', $txt['replies'], '
/
', $topic['views'], ' ', $txt['views'], '
https://webmaster.bbs.tr/', $settings['images_url'], '/icons/last_post.gif (https://webmaster.bbs.tr/', $topic['last_post']['href'], ')
', $topic['last_post']['time'], '
';
}
echo '
';
}
Değiştir:
Kod:
if (!empty($context['related_topics']))
{
echo '
', $txt['related_topics'], '
';
if (!empty($context['related_topics']))
{
foreach ($context['related_topics'] as $topic)
{
echo '
', $topic['first_post']['link'], '
';
}
}
echo '
';
}
index.css en alta ekle:
Kod:
ul.related_topics {padding-left: 30px; margin-top: -10px;}
.related_topics li {margin-bottom: -10px; }
.related_topics_right{width: 50%; }
Bul
Kod:
fieldset
{
border: 1px solid #c4c4c4;
padding: 1em;
margin: 0 0 0.5em 0;
}
Değiştir:
Kod:
fieldset{border:1px solid #c4c4c4;padding:1em;margin:0 0 0.5em 0; border-radius: 5px;}
Orjinakonu: Benzer Konular - Related Topics - Edit - 2.0 Modifikasyonlar (https://www.smfdestek.com/2-0-modifikasyonlari/benzer-konular-related-topics-edit/)
Kaynak: Benzer Konular - Related Topics - Edit (https://www.webmasterlord.net/2337-benzer-konular-related-topics-edit-konusu.html)
ışlem Basamakları:
Öncelikle Benzer Konular - Related Topics - Konu - SMF Destek (https://www.smfdestek.com/konu/benzer-konular-related-topics/) modu kurulu değilse kurulur.
Display.template.php
Bul:
Kod:
// Assuming there are attachments...
Üstüne ekle:
Kod:
if ($message['id'] == $context['topic_first_message'] and (!empty($context['related_topics'])) )
{
echo '
', $txt['related_topics'], '
';
// Added by Related Topics
if (!empty($context['related_topics'])) // TODO: Have ability to display no related topics?
{
foreach ($context['related_topics'] as $topic)
{
echo '
', $topic['first_post']['link'], '
';
}
}
echo '
';
}
Bul:
Kod:
// Added by Related Topics
if (!empty($context['related_topics'])) // TODO: Have ability to display no related topics?
{
echo '
';
// Are there actually any topics to show?
if (!empty($context['related_topics']))
{
echo '
', $txt['related_topics'], '
', $txt['replies'], '
', $txt['last_post'], '
';
}
// No topics.... just say, "sorry bub".
else
echo '
', $txt['msg_alert_none'], '
';
echo '
';
foreach ($context['related_topics'] as $topic)
{
// Is this topic pending approval, or does it have any posts pending approval?
if ($topic['board']['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked'])
$color_class = 'stickybg locked_sticky';
// Sticky topics should get a different color, too.
elseif ($topic['is_sticky'])
$color_class = 'stickybg';
// Locked topics get special treatment as well.
elseif ($topic['is_locked'])
$color_class = 'lockedbg';
// Last, but not least: regular topics.
else
$color_class = 'windowbg';
// Some columns require a different shade of the color class.
$alternate_class = $color_class . '2';
echo '
https://webmaster.bbs.tr/', $settings['images_url'], '/topic/', $topic['class'], '.gif
https://webmaster.bbs.tr/', $topic['first_post']['icon_url'], '
', $topic['is_sticky'] ? '' : '', '', $topic['first_post']['link'], (!$topic['board']['can_approve_posts'] && !$topic['approved'] ? ' (' . $txt['awaiting_approval'] . ')' : ''), '', $topic['is_sticky'] ? '' : '' ;
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
https://webmaster.bbs.tr/', $settings['lang_images_url'], '/new.gif (https://webmaster.bbs.tr/', $topic['new_href'], ')';
echo '
', $topic['replies'], ' ', $txt['replies'], '
/
', $topic['views'], ' ', $txt['views'], '
https://webmaster.bbs.tr/', $settings['images_url'], '/icons/last_post.gif (https://webmaster.bbs.tr/', $topic['last_post']['href'], ')
', $topic['last_post']['time'], '
';
}
echo '
';
}
Değiştir:
Kod:
if (!empty($context['related_topics']))
{
echo '
', $txt['related_topics'], '
';
if (!empty($context['related_topics']))
{
foreach ($context['related_topics'] as $topic)
{
echo '
', $topic['first_post']['link'], '
';
}
}
echo '
';
}
index.css en alta ekle:
Kod:
ul.related_topics {padding-left: 30px; margin-top: -10px;}
.related_topics li {margin-bottom: -10px; }
.related_topics_right{width: 50%; }
Bul
Kod:
fieldset
{
border: 1px solid #c4c4c4;
padding: 1em;
margin: 0 0 0.5em 0;
}
Değiştir:
Kod:
fieldset{border:1px solid #c4c4c4;padding:1em;margin:0 0 0.5em 0; border-radius: 5px;}
Orjinakonu: Benzer Konular - Related Topics - Edit - 2.0 Modifikasyonlar (https://www.smfdestek.com/2-0-modifikasyonlari/benzer-konular-related-topics-edit/)
Kaynak: Benzer Konular - Related Topics - Edit (https://www.webmasterlord.net/2337-benzer-konular-related-topics-edit-konusu.html)