سلام
با عرض پوزش خدمت نوید عزیز ... چون قبلا قول این آموزش رو به دوستمون دادم اینجا آموزش میدم
جناب sanr عزیز
من آموزش اضافه کردن دکمه پاسخ رو برای قالب پیش فرض براتون میذارم
فایل display.template.php قالب پیش فرض را باز کنید
دنبال کد زیر بگردید
و کد زیر را جایگزین کد بالا کنیدکد:// Build the normal button array. $normal_buttons = array( 'reply' => array('test' => 'can_reply', 'text' => 146, 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']), 'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']), 'custom' => array(), 'send' => array('test' => 'can_send_topic', 'text' => 707, 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0'), 'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'), );
کد:$buttonArray = array(); if ($context['can_reply']) $buttonArray[] = '<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>'; // Build the normal button array. $normal_buttons = array( 'reply' => array('test' => 'can_reply', 'text' => 146, 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']), 'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']), 'custom' => array(), 'send' => array('test' => 'can_send_topic', 'text' => 707, 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0'), 'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'), ); echo implode($context['menu_separator'], $buttonArray); echo '</td> <td align="left" style="padding-right: 1ex;"> <td align="left" class="middletext2">', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><b>' . $txt['topbottom4'] . '</b></a>' : '', '</td> </tr> </td> </tr> </table>';
سپس دنبال کد زیر بگردید
و کد زیر را جایگزین کد بالا کنیدکد:// As before, build the custom button right. if ($context['can_add_poll']) $normal_buttons['custom'] = array('text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']); elseif ($context['user']['is_logged'] && $settings['show_mark_read']) $normal_buttons['custom'] = array('text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']); echo ' <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td class="middletext">', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><b>' . $txt['topbottom4'] . '</b></a>' : '', '</td> <td align="right" style="padding-right: 1ex;"> <table cellpadding="0" cellspacing="0"> <tr> ', template_button_strip($normal_buttons, 'top', true), ' </tr> </table> </td> </tr> </table>';
سعی کردم به ساده ترین روش آموزش بدم ...کد:// As before, build the custom button right. if ($context['can_add_poll']) $normal_buttons['custom'] = array('text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']); elseif ($context['user']['is_logged'] && $settings['show_mark_read']) $normal_buttons['custom'] = array('text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']); echo ' <table dir="rtl" width="100%" cellpadding="0" cellspacing="4" border="0"> <tr> '; echo ' </td> <td align="right" style="font-size: smaller;">'; $buttonArray = array(); if ($context['can_reply']) $buttonArray[] = '<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>'; echo implode($context['menu_separator'], $buttonArray); echo ' <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td class="middletext">', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><b>' . $txt['topbottom4'] . '</b></a>' : '', '</td> <td align="right" style="padding-right: 1ex;"> <table cellpadding="0" cellspacing="0"> <tr> ', template_button_strip($normal_buttons, 'top', true), ' </tr> </table> </td> </tr> </table>';
یا علی





علاقه مندی ها (Bookmarks)