SMF HELP!

SMF Help! - For Users SMF/TP => Style - Problemy, Integracje, Modyfikacje styli => Wątek zaczęty przez: serafin 14.07.2009 18:17:57



Tytuł: Nowe przyciski theme Urban
Wiadomość wysłana przez: serafin 14.07.2009 18:17:57
Witam mam problem z  przyciskami niemoge dodać przycisku Forum i Galeria moze ktoś mi by pomógł pozdro.

Oto kawałek kodu



Code: [select]
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt;

   // Work out where we currently are.
   $current_action = 'home';
   if (in_array($context['current_action'], array('admin', 'managegames', 'arcadesettings', 'arcadecategory', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
      $current_action = 'admin';
   if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
      $current_action = $context['current_action'];
   if ($context['current_action'] == 'search2')
      $current_action = 'search';
   if ($context['current_action'] == 'theme')
      $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

   // Are we using right-to-left orientation?
   if ($context['right_to_left'])
   {
      $first = 'last';
      $last = 'first';
   }
   else
   {
      $first = 'first';
      $last = 'last';
   }

   // Show the start of the tab section.
      echo '
         <div id="horiz-menu">
            <ul class="topnav" style="overflow: visible; float: left;">
               <li' , $current_action=='home' ? ' class="active"' : '' , '><a href="', $scripturl, '">' , $txt[103] , '</a>';

                  

               echo '<ul style="overflow: hidden; visibility: visible; opacity: 1;">
                     <li><a href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';


                     if ($context['allow_search'])
                  echo '<li' , $current_action=='search' ? ' class="active"' : '' , '><a href="', $scripturl, '?action=search">' , $txt[182] , '</a></li>';

                     if ($context['allow_admin'])
                  echo '<li><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></li>';

                     if ($context['allow_edit_profile'])
                  echo '<li><a href="', $scripturl, '?action=profile">' , $txt[79] , '</a></li>';

                     if ($context['user']['is_logged'] && $context['allow_pm'])
                  echo '<li><a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a></li>';

                     if ($context['allow_calendar'])
                  echo '<li><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></li>';

                     if ($context['allow_memberlist'])
                  echo '<li><a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a></li>';
               echo '</ul>
               </li>';

            echo '<li' , $current_action=='#' ? ' class="active"' : '' , '><a href="#">link</a>
                  <ul style="overflow: hidden; visibility: visible; opacity: 1;">
                     <li><a href="#">Link</a></li>

                     <li><a href="#">Dummy Item 2</a></li>
                   </ul>
               </li>';

            echo '<li' , $current_action=='#' ? ' class="active"' : '' , '><a href="#">przycisk</a>
                  <ul style="overflow: hidden; visibility: visible; opacity: 1;">
                    
                     <li><a href="#">link2</a></li>

                     <li><a href="#">Dummy Item 3</a></li>
                  </ul>
               </li>';

               if ($context['user']['is_logged'])
            echo '<li><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></li>';

               if ($context['user']['is_guest'])
               {
                   echo '<li' , $current_action=='login' ? ' class="active"' : '' , '><a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
                              <ul style="overflow: hidden; visibility: visible; opacity: 1;">
                                  <li><a href="', $scripturl, '?action=register">' , $txt[97] , '</a></li>
                              </ul>
               </li>';
               }
         echo '
            </ul>
         </div>';

}


Przy okazji Roco jak zrobiłes w galeri że tak fajnie sie fotka powiększa jakiś mod do tego jest??
Pozdrowionka :)


Tytuł: Odp: Nowe przyciski theme Urban
Wiadomość wysłana przez: roco 14.07.2009 18:32:32
Emka! :)

Nie ma sprawy, tylko jak wyglądają przywiązane akcje? Normalnie button Home to akcja "index.php", jeśli masz stronę główną, to powinno się dopisać akcje do Home i do buttona Forum. Nie wiem czy o to chodzi, ale będę mógł Ci pomóc z tym kodem, dopiero wtedy, kiedy będę wiedział o co chodzi, ok? To samo z Galerią?
Jaka to Galeria, czy jej akcja to ="gallery" ? Bo może to media gallery? Są różne galerie i też nie wiem o jaką chodzi.

Napisz dokładniej jakie mają być buttony i co ma się wydarzać po kliknięciu na te buttony.

Pozdrawiam :)
roco


Tytuł: Odp: Nowe przyciski theme Urban
Wiadomość wysłana przez: serafin 14.07.2009 19:03:57
tak akcja to gallery i na forum akcja =forum  galerie mam SMF Gallery Lite niewiem czy tobie to wystarczy jak coś to pisz
pozdro :)


Tytuł: Odp: Nowe przyciski theme Urban
Wiadomość wysłana przez: roco 14.07.2009 19:58:39
Jeszcze pytanie.. skoro Forum ma akcję forum, to jaka akcję ma Home?

- index.php? (czyli w linku tylko: ', $scripturl, ')
- czy ation=home ? (czyli w linku: ', $scripturl, '?action=home)

Co widzisz w pasku przeglądarki, kiedy jesteś na stylu w którym masz jak powinno być, tj. interesuje mnie co widzisz na końcu linka czyli po "?" po kliknięciu na button Home, a co po kliknięciu na button Forum?

To żaden problem, jednak potrzebne mi dokładne info, dlatego pytam.

Narka :)
roco


Tytuł: Odp: Nowe przyciski theme Urban
Wiadomość wysłana przez: serafin 14.07.2009 20:14:52
zerknij bo jest tylko index.php          to stronka niewiem czy mozna pokazywac jak cos to usun adres tu  :)          
http://portal.matrixelite.pl/index.php (http://portal.matrixelite.pl/index.php)


Tytuł: Odp: Nowe przyciski theme Urban
Wiadomość wysłana przez: roco 14.07.2009 21:28:44
Spoko, żebyś chociaż coś reklamował.. hehe a Ty pytasz tylko to linka w menu nie? Mozna wsio co się chce ok? przynajmniej na razie, chyba, żeby jacyś ludzie zaczęli się żreć, to insza inszość..

Dobra sorki, ale dziś wszystko robię na raty..

Masz bardzo wygodne menu, gdzie łatwo można dopisywać różne linki.. Ale rozumiem, że chodziło tu o stronę główną, ponieważ masz tam portal.

Link na główną zostawiłem jako Home, natomiast dopisałem Forum.

Podmień sobie kod i sprawdź czy działa, czy nie ma errorów, pisze to z ręki, sadzę, że tak powinno być, ale w tej chwili nie mogę sprawdzić, ponieważ mam włączony inny server, (produkcyjny) i w tej chwili nie mogę swojej testowalni, ok?

Tu podaję Ci kod, pamiętaj, żeby robić wszystko uważnie i pracowac wyłącznie na kopiach.

GeSHi -› Code: [select]
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
    global $context, $settings, $options, $scripturl, $txt;

    // Work out where we currently are.
    $current_action = 'home';
    if (in_array($context['current_action'], array('admin', 'managegames', 'arcadesettings', 'arcadecategory', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
        $current_action = 'admin';
    if (in_array($context['current_action'], array('search', 'home', 'forum', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
        $current_action = $context['current_action'];
    if ($context['current_action'] == 'search2')
        $current_action = 'search';
    if ($context['current_action'] == 'theme')
        $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
    if ($context['current_action'] == 'home')
        $current_action = 'home';
        if ($context['current_action'] == 'forum')
        $current_action = 'forum';

    // Are we using right-to-left orientation?
    if ($context['right_to_left'])
    {
        $first = 'last';
        $last = 'first';
    }
    else
    {
        $first = 'first';
        $last = 'last';
    }

    // Show the start of the tab section.
    echo '
        <div id="horiz-menu">
            <ul class="topnav" style="overflow: visible; float: left;">
                <li'
, $current_action=='home' ? ' class="active"' : '' , '><a href="', $scripturl, '">' , $txt[103] , '</a></li>
                <li'
, $current_action=='home' ? ' class="active"' : '' , '><a href="', $scripturl, '?action=forum">Forum</a>';

            echo '<ul style="overflow: hidden; visibility: visible; opacity: 1;">
                        <li><a href="'
, $scripturl, '?action=help">' , $txt[119] , '</a></li>';

            if ($context['allow_search'])
                echo '<li' , $current_action=='search' ? ' class="active"' : '' , '><a href="', $scripturl, '?action=search">' , $txt[182] , '</a></li>';

            if ($context['allow_admin'])
                echo '<li><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></li>';

            if ($context['allow_edit_profile'])
                echo '<li><a href="', $scripturl, '?action=profile">' , $txt[79] , '</a></li>';

            if ($context['user']['is_logged'] && $context['allow_pm'])
                echo '<li><a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a></li>';

            if ($context['allow_calendar'])
                echo '<li><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></li>';

            if ($context['allow_memberlist'])
                echo '<li><a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a></li>';
            echo '</ul>
                </li>'
;

        // Drugie menu
        echo '<li' , $current_action=='#' ? ' class="active"' : '' , '><a href="#">link</a>
                    <ul style="overflow: hidden; visibility: visible; opacity: 1;">
                        <li><a href="#">Link</a></li>
                        <li><a href="#">Dummy Item 2</a></li>
                    </ul>
                </li>'
;

        // Trzecie menu
        echo '<li' , $current_action=='#' ? ' class="active"' : '' , '><a href="#">przycisk</a>
                    <ul style="overflow: hidden; visibility: visible; opacity: 1;">
                        <li><a href="#">link2</a></li>
                        <li><a href="#">Dummy Item 3</a></li>
                    </ul>
                </li>'
;

        if ($context['user']['is_logged'])
        echo '<li><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></li>';

        if ($context['user']['is_guest'])
        {
            echo '<li' , $current_action=='login' ? ' class="active"' : '' , '><a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
                        <ul style="overflow: hidden; visibility: visible; opacity: 1;">
                            <li><a href="'
, $scripturl, '?action=register">' , $txt[97] , '</a></li>
                        </ul>
                    </li>'
;
        }
        echo '
                </ul>
            </div>'
;

}
// Created by GeSHi 1.0.8.10 | code: -› [code=PHP] | load:0.050s | speed:79.73 KB/s



Załatw to i coś napisz, jak będzie źle to poprawię. Opiszę co zrobiłem również wtedy kiedy będzie na stewke ok.

Pozdrówka :)
roco


Tytuł: Odp: Nowe przyciski theme Urban
Wiadomość wysłana przez: serafin 14.07.2009 21:56:58
Działa super dzięki wielkie tylko zapomiałeś dodac gallery  Galeria
:) Pozdrówka


Tytuł: Odp: Nowe przyciski theme Urban
Wiadomość wysłana przez: roco 14.07.2009 22:06:38
siax! fakt niezaprzeczalny!

Napisz w którym miejscu może zostawić te wolne, rozwijane i dać oddzielnie przed "Link" ?

Napisz gdzie ma być link?

Jestem on-line, to zmienię zaraz.. ;)


Tytuł: Odp: Nowe przyciski theme Urban
Wiadomość wysłana przez: roco 14.07.2009 22:16:47
OK, tam jednak było źle, ponieważ powinienem jeszcze ustawic akcję dla forum, a tak jest 2x powtórzone, (w samych linkach), akcja = home..

Dopisałem Ci przed Link, a po Forum, ok?

Oto kod:

GeSHi -› Code: [select]
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
    global $context, $settings, $options, $scripturl, $txt;

    // Work out where we currently are.
    $current_action = 'home';
    if (in_array($context['current_action'], array('admin', 'managegames', 'arcadesettings', 'arcadecategory', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
        $current_action = 'admin';
    if (in_array($context['current_action'], array('search', 'home', 'forum', 'gallery', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
        $current_action = $context['current_action'];
    if ($context['current_action'] == 'search2')
        $current_action = 'search';
    if ($context['current_action'] == 'theme')
        $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
    if ($context['current_action'] == 'home')
        $current_action = 'home';
    if ($context['current_action'] == 'forum')
        $current_action = 'forum';
    if ($context['current_action'] == 'gallery')
        $current_action = 'gallery';

    // Are we using right-to-left orientation?
    if ($context['right_to_left'])
    {
        $first = 'last';
        $last = 'first';
    }
    else
    {
        $first = 'first';
        $last = 'last';
    }

    // Show the start of the tab section.
    echo '
        <div id="horiz-menu">
            <ul class="topnav" style="overflow: visible; float: left;">
                <li'
, $current_action=='home' ? ' class="active"' : '' , '><a href="', $scripturl, '">' , $txt[103] , '</a></li>
                <li'
, $current_action=='forum' ? ' class="active"' : '' , '><a href="', $scripturl, '?action=forum">Forum</a>';

            echo '<ul style="overflow: hidden; visibility: visible; opacity: 1;">
                        <li><a href="'
, $scripturl, '?action=help">' , $txt[119] , '</a></li>';

            if ($context['allow_search'])
                echo '<li' , $current_action=='search' ? ' class="active"' : '' , '><a href="', $scripturl, '?action=search">' , $txt[182] , '</a></li>';

            if ($context['allow_admin'])
                echo '<li><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></li>';

            if ($context['allow_edit_profile'])
                echo '<li><a href="', $scripturl, '?action=profile">' , $txt[79] , '</a></li>';

            if ($context['user']['is_logged'] && $context['allow_pm'])
                echo '<li><a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a></li>';

            if ($context['allow_calendar'])
                echo '<li><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></li>';

            if ($context['allow_memberlist'])
                echo '<li><a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a></li>';
            echo '</ul>
                </li>'
;

        // [Galeria]
        echo '
                <li'
, $current_action=='gallery' ? ' class="active"' : '' , '><a href="', $scripturl, '?action=gallery">Galeria</a></li>';

        // Drugie menu
        echo '<li' , $current_action=='#' ? ' class="active"' : '' , '><a href="#">link</a>
                    <ul style="overflow: hidden; visibility: visible; opacity: 1;">
                        <li><a href="#">Link</a></li>
                        <li><a href="#">Dummy Item 2</a></li>
                    </ul>
                </li>'
;

        // Trzecie menu
        echo '<li' , $current_action=='#' ? ' class="active"' : '' , '><a href="#">przycisk</a>
                    <ul style="overflow: hidden; visibility: visible; opacity: 1;">
                        <li><a href="#">link2</a></li>
                        <li><a href="#">Dummy Item 3</a></li>
                    </ul>
                </li>'
;

        if ($context['user']['is_logged'])
        echo '<li><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></li>';

        if ($context['user']['is_guest'])
        {
            echo '<li' , $current_action=='login' ? ' class="active"' : '' , '><a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
                        <ul style="overflow: hidden; visibility: visible; opacity: 1;">
                            <li><a href="'
, $scripturl, '?action=register">' , $txt[97] , '</a></li>
                        </ul>
                    </li>'
;
        }
        echo '
                </ul>
            </div>'
;

}
// Created by GeSHi 1.0.8.10 | code: -› [code=PHP] | load:0.048s | speed:88.17 KB/s



Może się okazać, że galleria wymaga czegoś jeszcze, podmień kod, podmień plik i napisz czy jest ok?

Narka :)
roco


Tytuł: Odp: Nowe przyciski theme Urban
Wiadomość wysłana przez: serafin 14.07.2009 22:29:52
teraz jest super :) niechcę być natretny ale powiedz mi tylko jeszcze jak zrobiłeś u siebie w galeri ze jak klikne na fotke to się tak fajnie powieksza fotka :)
Pozdro :)


Tytuł: Odp: Nowe przyciski theme Urban
Wiadomość wysłana przez: roco 14.07.2009 22:34:52
Zastosowałem efekt Lightboxa, jednak ostatnia wersja ..jego skrypty gryzą się ze skryptami smf.

W chwili obecnej brak mi na to czasu, ale przypomnij się to pomyśle, co można u Ciebie, ok?

Teraz jest ok? Akcja w linkach powoduje, ze jak np. jesteś na Forum, to link forum jest wyróżniony.. Chciałem się rozpisac, ale to jest tak proste, i wszystko tu jest w tym topie, wystarczy porównać.. Oczywiście w razie niejasności, rozwieje je.

Pozdrawiam :)
roco


Tytuł: Odp: Nowe przyciski theme Urban
Wiadomość wysłana przez: serafin 14.07.2009 22:41:58
Przypomne sie napewno, teraz wszystko ładnie działa dzieki jeszcze raz za pomoc  :drinks: zimny browar sie należy
Pozdro :)


Tytuł: Odp: Nowe przyciski theme Urban
Wiadomość wysłana przez: roco 14.07.2009 22:49:12
Dzięki, właśnie się uraczyłem.. jutro pewnie burza będzie, coś tak czuję w gnatach..

Kodu się nie obawiaj, bądź tylko uważny i każdą zmianę testuj/sprawdzaj..
Okay, idę rzeźbić dalej w kodzie hehe czasami myślę, ze to jakieś nienormalne.. jak nie będzie burzy to siadam na rower! ;)

Pozdrawiam :)
roco