Üyeliğin hakkında sorunlar👨🏼‍🔧yaşıyorsanız bunu bizimle paylaşa bilirsiniz
Forum içeriğine ve tüm hizmetlerimize erişim sağlamak için foruma kayıt olmalı ya da giriş yapmalısınız.
  • Sitemiz Bir Webmaster forumu ve tartışma platformu dur webmaster forumu dışındaki konular yasaktır direkt silinecektir.
  • Our site is a Webmaster forum and discussion platform. Topics outside the webmaster forum are prohibited and will be deleted immediately.

Smf Menüye Manuel Buton Alt Buton Ekleme

Welcome to our site, Guest

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

orhan

Moderator
Joined
Dec 5, 2018
Messages
466
Reaction score
96
Points
28
Yazıları ekleyebilmek/değiştirebilmek için dil dosyası : Themes/default/languages/index.turkish.php

daha fazla buton ekleyebilmek için : Sources/Subs.php

Subs.php dosyasında :

Bul :
Code:
// All the buttons we can possible want and then some, try pulling the final list of buttons from cache first.
  if (($menu_buttons = cache_get_data('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $cacheTime)) === null || time() - $cacheTime <= $modSettings['settings_updated'])
Bu kodların altında
Code:
$buttons = array(
        'home' => array(
            'title' => $txt['home'],
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
            'is_last' => $context['right_to_left'],
        ),
Ana sayfa butonuyla başlar...

mesela diyelimki google.com.tr sitesine link vereceksiniz. bunun için yeni bir buton yapmanız gerekli diyoruz mantık olarak... ve bu buton ana sayfa düğmesinin hemen sağında olacak diyoruz.

en başta arıyoruz:
Bul:
Code:
'home' => array(
            'title' => $txt['home'],
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
            'is_last' => $context['right_to_left'],
        ),
Altına Ekle :
Code:
        'google' => array(
            'title' => $txt['google'],
            'href' => 'http://www.google.com.tr',
            'show' => true,
            'sub_buttons' => array(
            ),
            'is_last' => $context['right_to_left'],
        ),
Şimdi yapmamız gereken olay dil dosyasına Google ismini yazmak

default/language/index.turkish.php dosyasını açıyoruz ve en altına :
Code:
$txt['google'] = 'Google';

buradaki dikkat etmemiz gereken olay kırmızı ile işaretlenmiştir:
'google' => array(
            'title' => $txt['google'],
            'href' => 'http://www.google.com.tr',
            'show' => true,
            'sub_buttons' => array(
            ),
        ),


yada bir üyenin sayfasına yönlendireceğiz diyelim... Örnek olarak Adminin Sayfasını ele alıyorum

Code:
        'user1' => array(
            'title' => $txt['adminin_sayfasi'],
            'href' => $scripturl . '?action=profile;u=1',
            'show' => true,
            'sub_buttons' => array(
            ),
        ),
ve yine dil dosyasının en altına ekliyoruz...
Code:
$txt['adminin_sayfasi'] = 'Adminin Sayfasý';

Çoklu Buton Ekleme

Code:
        
        'adminler' => array(
            'title' => $txt['adminler'],
            'href' => '#',
            'show' => true,
            'sub_buttons' => array(
              'admin1' => array(
                  'title' => $txt['siteadmin'],
                  'href' => $scripturl . '?action=profile;u=1',
                  'show' => true,
              ),
              'moderator1' => array(
                  'title' => $txt['moderator1'],
                  'href' => $scripturl . '?action=profile;u=2',
                  'show' => true,
              ),
              'moderator2' => array(
                  'title' => $txt['moderator2'],
                  'href' => $scripturl . '?action=profile;u=3',
                  'show' => true,
              ),
              'editor1' => array(
                  'title' => $txt['editor1'],
                  'href' => $scripturl . '?action=profile;u=4',
                  'show' => true,
              ),
              'editor2' => array(
                  'title' => $txt['editor2'],
                  'href' => $scripturl . '?action=profile;u=5',
                  'show' => true,
              ),
              'editor3' => array(
                  'title' => $txt['editor3'],
                  'href' => $scripturl . '?action=profile;u=5',
                  'show' => true,
                  'is_last' => true,
              ),
            ),
        ),
Dil dosyasına gene eklemeler yapılır
Code:
$txt['adminler'] = 'Site Yönetimi';
$txt['siteadmin'] = 'Yönetici';
$txt['moderator1'] = 'Ana Moderator';
$txt['moderator2'] = 'Yardýmcý Moderator';
$txt['editor1'] = '1. Editör';
$txt['editor2'] = '2. Editör';
$txt['editor3'] = '3. Editör';

Anlaşılmayan bir şey olduğunu zannetmiyorum...

sadece dikkat etmeniz gereken olay 'href' => $scripturl . '?action=*******', sonlamadır...

Ana Sayfa Butonunun altına SubButon Ekleme
Örnek olarak Ana Sayfa Butonuna alt buton eklemek...

Sources/Subs.php içinde

Bul:
Code:
'home' => array(
            'title' => $txt['home'],
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
            'is_last' => $context['right_to_left'],
        ),

Değiştir:

Code:
$buttons = array(
        'home' => array(
            'title' => $txt['home'],
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
              'altbuton1' => array(
                  'title' => $txt['altbutonyazisi1'],
                  'href' => $scripturl . '?action=?',
                  'show' => true,
              ),
              'altbuton2' => array(
                  'title' => $txt['altbutonyazisi2'],
                  'href' => $scripturl . '?action=?',
                  'show' => true,
              ),
              'altbuton3' => array(
                  'title' => $txt['altbutonyazisi3'],
                  'href' => $scripturl . '?action=?',
                  'show' => true,
              ),
            ),
            'is_last' => $context['right_to_left'],
        ),

Dikkat edip değiştireceğin yerler:
bu şekilde çoğaltabilirsiniz butonları. kolay gelsin...

'altbuton1' => array(
  'title' => $txt['altbutonyazisi1'],
  'href' => $scripturl . '?action=****',
  'show' => true,
),


Tam anlamıyla her konuda açıklamanın yapıldığını düşünüyorum...

Kolay gelsin...
 
Hocam mobilde alt buton açıldığında, menüde yer alan ana butonun sağ tarafında yer alan butonun yeri değişiyor ve aşağıya doğru kayıyor. Bu ikinci butonu sabit tutmanın bir yolu var mı?

Normal hali

View attachment 20210114

Menüyü açınca

View attachment 20210114
 

Attachments

  • 20210114_010044.webp
    20210114_010044.webp
    7.2 KB · Views: 2
  • 20210114_010029.webp
    20210114_010029.webp
    10.8 KB · Views: 2
Bu kodu bulun

Code:
@media (max-width: 480px) {
.dropmenu li ul, .dropmenu li li:hover ul, .dropmenu li li ul {
    position: relative;
    border-radius: 0;
    left: 0;
}
}

Bunu silin

position: relative;
 
Back
Top Bottom