Simple Machines Community Forum

SMF Support => العربية (Arabic) => Language Specific Support => تعليمي (Tutorials) => Topic started by: islam2hamy on January 05, 2010, 02:55:35 AM

Title: كيفة إستبداء "النص" الخاص بالازرار الى "صورة زر"
Post by: islam2hamy on January 05, 2010, 02:55:35 AM
بسم الله الرحمن الرحيم

سوف نتعلم فى هذا الدرس كيفية إستبداء "النص" الخاص بالازرار الى "صورة زر"
إى إستبدال كلمة "موضوع جديد" الى هذه الصورة "(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.smfarabic.com%2FThemes%2Fdefault%2Fimages%2Farabic-utf8%2Fnew_topic.gif&hash=1fc9b2809553680ede28935b3d673607dbf6e3b8)" على سبيل المثال

1 - بالنسبة للنسخة 1.1.x

قم بفتح الملف "index.template.php"

إبحث عن :


$settings['use_buttons'] = true;

إستبدله بـ :

$settings['use_buttons'] = false;

إبحث عن :

// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
    global $settings, $buttons, $context, $txt, $scripturl;

    // Create the buttons...
    foreach ($button_strip as $key => $value)
    {
        if (isset($value['test']) && empty($context[$value['test']]))
        {
            unset($button_strip[$key]);
            continue;
        }
        elseif (!isset($buttons[$key]) || $force_reset)
            $buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';

        $button_strip[$key] = $buttons[$key];
    }

    if (empty($button_strip))
        return '<td>&nbsp;</td>';

    echo '
        <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '">&nbsp;</td>
        <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' &nbsp;|&nbsp; ', $button_strip) , '</td>
        <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';
}


إستبدله بـ :


// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
    global $settings, $buttons, $context, $txt, $scripturl;

    if (empty($button_strip))
        return '';

    // Create the buttons...
    foreach ($button_strip as $key => $value)
    {
        if (isset($value['test']) && empty($context[$value['test']]))
        {
            unset($button_strip[$key]);
            continue;
        }
        elseif (!isset($buttons[$key]) || $force_reset)
            $buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . ($value['lang'] ? $context['user']['language'] . '/' : '') . $value['image'] . '" alt="' . $txt[$value['text']] . '" border="0" />' : $txt[$value['text']]) . '</a>';

        $button_strip[$key] = $buttons[$key];
    }

    echo '
        <td ', $custom_td, '>', implode($context['menu_separator'], $button_strip) , '</td>';
}



2 - بالنسبة للنسخة 2.0

قم بفتح الملف "index.template.php"

إبحث عن :

$settings['use_buttons'] = true;

إستبدله بـ :

$settings['use_buttons'] = false;

إبحث عن :

// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
    global $settings, $buttons, $context, $txt, $scripturl;

    // Create the buttons...
    foreach ($button_strip as $key => $value)
    {
        if (isset($value['test']) && empty($context[$value['test']]))
        {
            unset($button_strip[$key]);
            continue;
        }
        elseif (!isset($buttons[$key]) || $force_reset)
            $buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';

        $button_strip[$key] = $buttons[$key];
    }

    if (empty($button_strip))
        return '<td>&nbsp;</td>';

    echo '
        <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '">&nbsp;</td>
        <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' &nbsp;|&nbsp; ', $button_strip) , '</td>
        <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';
}


إستبدله بـ :


// Generate a strip of buttons, out of buttons.
function template_button_strip($button_strip, $direction = 'top', $custom_td = '')
{
    global $settings, $context, $txt, $scripturl;

    if (empty($button_strip))
        return '';

    // Create the buttons...
    $buttons = array();
    foreach ($button_strip as $key => $value)
        if (!isset($value['test']) || !empty($context[$value['test']]))
            $buttons[] = '<a href="' . $value['url'] . '"' . (isset($value['content']) ? $value['content'] : (isset($value['active']) ? ' class="active"' : '') . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . ($value['lang'] ? $context['user']['language'] . '/' : '') . $value['image'] . '" alt="' . $txt[$value['text']] . '" border="0" />' : $txt[$value['text']])) . '</a>';

    if (empty($button_strip))
        return '';

    echo '
        <div ', $custom_td, '>', implode($context['menu_separator'], $buttons) , '</div>';
}


ملحوظه: لا تنس نسخ المجلد الخاص بالازرار الى مجلد الاستايل الذى تستخدمه
مبروك الأن الازرار تعمل  ;D