با سلام .
امروز مي خواهم يک مود خيلي توپ را به شما معرفي کنم . با اين مود يک قدم ديگر به انجمن ويبولتين نزديکتر ميشويد .
ابتدا به عکس زير نگاه کنيد .
[img width=640 height=295]http://i34.tinypic.com/33v1z0z.jpg[/img]
اين مود همانطور که حتما در خيلي از انجمن هاي ويبولتين ديده ايد موضوعات مشابه با موضوعات شما را پيدا و به کاربر نمايش مي دهد .
مثلا شما به آدرس زير برويد و کارايي مود را ملاحظه بفرماييد : [مهمان/کاربر گرامی برای دیدن لینک ها ابتدا باید عضو سایت شوید و لاگین کنید برای ثبت نام اینجا کلیک کنید]
اين مود رو امروز من فارسي کردم و براي دانلود شما دوستان عزيز گذاشتم . البته اصل اين مود براي SMF 2 هستش و با SMF 1.1.5
مشکل داره ولي بهر حال من به شما راهي رو نشون ميدم که بتوانيد از مود استفاده نماييد :
خوب ابتدا مود را از فايل ضميمه دانلود و نصب کنيد . با هر خطايي که ميده مشکلي نيست .
حال با کد هايي که در پايين گذاشتم مي توانيد اين مود را در ساير قالب ها هم نصب نماييد :
اگه در هنگام نصب در فايل خاصي ارور داد تغييرات همان فايل را اعمال کنيد :
sourcedir / ModSettings.php کد زير را پيدا :
کد:
'',
// Reactive on email, and approve on delete
حالا قبلش کد زير را بگذاريد :
کد:
'',
// Related Topics
array('check', 'relatedTopicsEnabled'),
array('int', 'relatedTopicsCount'),
array('select', 'relatedMethod', array('fulltext' => &$txt['relatedFulltext'], 'custom' => &$txt['relatedCustom'])),
sourcedir / RemoveTopic.php کد زير را پيدا نماييد :
کد:
else
$condition = 'IN (' . implode(', ', $topics) . ')';
حالا بعدش کد زير را بگذاريد :
کد:
// Added by Related Topics
require_once($sourcedir . '/Subs-Related.php');
removeRelated($topics);
// Related Topics END
sourcedir / Subs-Post.php کد زير را پيدا :
کد:
$topicOptions['id'] = db_insert_id();
حالا بعدش کد زير را قرار دهيد :
کد:
// Added by Related Topics
global $sourcedir;
require_once($sourcedir . '/Subs-Related.php');
addRelated($topicOptions['id'], $msgOptions['subject']);
// Related Topics END
کد زير را پيدا :
کد:
updateStats('subject', $topicOptions['id'], $msgOptions['subject']);
mysql_free_result($request);
حالا بعدش کد زير را قرار دهيد :
کد:
// Added by Related Topics
global $sourcedir;
require_once($sourcedir . '/Subs-Related.php');
addRelated($topicOptions['id'], $msgOptions['subject']);
// Related Topics END
sourcedir / Display.php کد زير را پيدا :
کد:
$topicinfo = mysql_fetch_assoc($request);
mysql_free_result($request);
بعدش کد زير را قرار دهيد :
کد:
// Added by Related Topics
if (!empty($modSettings['relatedTopicsEnabled']))
{
require_once($sourcedir . '/Subs-Related.php');
$context['related_topics'] = getRelated($topic, $topicinfo['subject']);
}
themedir / Display.template.php کد زير را پيدا :
کد:
echo '
<input type="hidden" name="sc" value="' . $context['session_id'] . '" />
<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
</form>
</td>
</tr>
</table>';
}
حالا بعدش کد زير را قرار دهيد :
کد:
// Added by Related Topics
if (!empty($context['related_topics']) > 0)
{
echo '
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' : '', '>
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="titlebg">
<td colspan="7">', $txt['related_topics'], '</td>
</tr>
<tr>
<td width="9%" colspan="2" class="catbg3"></td>
<td class="catbg3">', $txt[70],'</td>
<td class="catbg3">', $txt[109],'</td>
<td class="catbg3">', $txt[110],'</td>
<td class="catbg3">', $txt[301],'</td>
<td class="catbg3">', $txt[111],'</td>
</tr>';
foreach ($context['related_topics'] as $topic)
{
// Do we want to seperate the sticky and lock status out?
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));
echo '
<tr>
<td class="windowbg2" valign="middle" align="center" width="5%">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td class="windowbg2" valign="middle" align="center" width="4%">
<img src="', $topic['first_post']['icon_url'], '" alt="" />
</td>
<td class="windowbg' , !empty($settings['seperate_sticky_lock']) && $topic['is_sticky'] ? '3' : '' , '" valign="middle" ', (!empty($topic['quick_mod']['remove']) ? 'id="topic_' . $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\', \'' . $context['session_id'] . '\');"' : ''), '>';
if (!empty($settings['seperate_sticky_lock']))
echo '
' , $topic['is_locked'] ? '<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" align="right" alt="" id="lockicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '' , '
' , $topic['is_sticky'] ? '<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" id="stickyicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '';
echo '
', $topic['is_sticky'] ? '<b>' : '' , '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], '</span>', $topic['is_sticky'] ? '</b>' : '';
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" /></a>';
echo '
<small>', $topic['board_link'], '</small>
<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
</td>
<td class="windowbg2" valign="middle" width="14%">
', $topic['first_post']['member']['link'], '
</td>
<td class="windowbg' , $topic['is_sticky'] ? '3' : '' , '" valign="middle" width="4%" align="center">
', $topic['replies'], '
</td>
<td class="windowbg' , $topic['is_sticky'] ? '3' : '' , '" valign="middle" width="4%" align="center">
', $topic['views'], '
</td>
<td class="windowbg2" valign="middle" width="22%">
<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" style="float: right;" /></a>
<span class="smalltext">
', $topic['last_post']['time'], '<br />
', $txt[525], ' ', $topic['last_post']['member']['link'], '
</span>
</td>';
echo '
</tr>';
}
echo '
</table>
</div>';
}
languagedir/Modifications.persian.php کد زير را پيدا :
حالا قبلش کد زير را قرار دهيد :
کد:
// Added by Related Topics
$txt['related_topics'] = '&#1578;&#1575;&#1662;&#1610;&#1705; &#1607;&#1575;&#1610; &#1605;&#1588;&#1575;&#1576;&#1607;';
$txt['relatedTopicsEnabled'] = '&#1601;&#1593;&#1575;&#1604; &#1705;&#1585;&#1583;&#1606; &#1576;&#1582;&#1588; &#1578;&#1575;&#1662;&#1610;&#1705; &#1607;&#1575;&#1610; &#1605;&#1588;&#1575;&#1576;&#1607;';
$txt['relatedTopicsCount'] = '&#1578;&#1593;&#1583;&#1575;&#1583; &#1578;&#1575;&#1662;&#1610;&#1705; &#1607;&#1575;&#1610; &#1606;&#1605;&#1575;&#1610;&#1588;&#1610;';
$txt['relatedFulltext'] = 'Full Index';
$txt['relatedMethod'] = '&#1588;&#1610;&#1608;&#1607; &#1580;&#1587;&#1578;&#1580;&#1608;<br /><span class="smalltext"><b><a href="' . $scripturl . '?action=related;sa=index;begin">&#1587;&#1575;&#1582;&#1578;&#1606; &#1580;&#1583;&#1608;&#1604; &#1576;&#1585;&#1575;&#1610; &#1605;&#1583;&#1604; Normalx</a></span></b>';
$txt['relatedCustom'] = 'Normal';
boarddir / index.php کد زير را پيدا :
کد:
'register2' => array('Register.php', 'Register2'),
بعدش کد زير را قرا دهيد :
کد:
'related' => array('Subs-Related.php', 'Related'),
خوب تمام شد . موفق باشيد . اين مود براي انجمن perisnsmf است پس کپي رايت را رعايت فرماييد .
در پست بعدي آموزش راه اندازي مود را هم ميدهم .
دانلود مد:
کد:
http://forum.persiansmf.ir/index.php?action=dlattach;topic=153.0;attach=87
علاقه مندی ها (Bookmarks)