News:

Join the Facebook Fan Page.

Main Menu

Menu Buttons

Started by DoDouLiS, May 26, 2010, 11:55:15 AM

Previous topic - Next topic

DoDouLiS

Εγκατέστησα το εν λόγο mod και δουλεύει μόνο στο default theme..
Πως θα μπορέσω να το βάλω και σε άλλο theme...

villasg

Κοιτας τις
Οδηγίες εγκατάστασης με το χέρι για το SMF

DoDouLiS

Τις είδα αλλά άκρη δεν έβγαλα.. Δεν υπάρχουν αυτά που λέει...

Acans

Ότι η τροποποίηση που έχετε λειτουργεί μόνο για το βασικό θέμα προεπιλογή. Εάν χρησιμοποιείτε το 2.0, μπορείτε να επεξεργαστείτε και να κάνουν νέες κουμπιά του μενού με την επεξεργασία των αρχείων subs.php. Εάν χρησιμοποιείτε το 1.1.x πρέπει να επεξεργαστείτε το index.template.php του προσαρμοσμένο θέμα.

Συγγνώμη αν δεν καταλαβαίνετε, εγώ μεταχειρισμένος Google Translate.
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

DoDouLiS

Έκανα αρκετές δοκιμές αλλά αποτέλεσμα κανένα!!!

Άν μπορεί κανείς να πεί καμιά ιδέα....

Acans

Πρώτον, ποια έκδοση χρησιμοποιείτε;
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

DoDouLiS


Acans

Από ό, τι θα χρειαστεί να τροποποιήσετε το έθιμο index.template.php θέματα αρχείο για να προσθέσουν νέα κουμπιά του μενού.

2,0 θα προσθέσει αυτόματα τις απαιτούμενες τροποποιήσεις για τα θέματα συνήθειας, εάν επιλεγεί.
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

DoDouLiS

Δεν μπορώ να σε καταλάβω πλήρως.. :(

Butcher

Είναι πολύ απλό. Θα ανοίξεις το index.template.php του theme που χρησιμοποιείς και θα βρεις το:


if ($context['user']['is_logged']........
........ ;


και μετά θα προσθέσεις το:


/** start x-Links **/
if(isset($context['xlinks']))
foreach($context['xlinks'] as $button)
{
echo '
<td valign="top" class="maintab_back">
<a href="'.$button['href'].'" style="'.$button['style'].'" title="'.$button['title'].'"'.(($button['in_new'])?' target="_blank"':'').'>'.$button['name'].'</a>
</td>';
}
/** end x-Links **/



Το πρώτο κομμάτι που σου έχω υποδείξει είναι ημιτελές γιατί δεν ξέρω πως είναι τα κουμπιά του theme που έχεις. Οπότε θα βρεις το κομμάτι αυτό που σου έχω δώσει και μετά από αυτό το οποίο τελειώνει στο ; θα πας και θα προσθέσεις το κουμπί.

DoDouLiS

#10
Φίλε Butcher το έκανα αλλά εμφανίζεται το κουμπί που πρόσθεσα στο θέμα που έχω αλλά με την ίδια μορφή που έχουν και τα άλλα...

Butcher

Άλλαξε το style="'.$button['style'].'"  με το style που έχουν τα δικά σου κουμπιά.

DoDouLiS

Το κουμπί του forum π.χ στο theme μου είναι αυτό :

// Show the [forum] button.
echo '<li', $current_action == 'forum' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=forum"><b>' , $txt['sp-forum'] , '</b></a></li>';


Ποιό είναι το style ?? :)

Butcher

Δοκίμασε να αλλάξεις το <td valign="top" class="maintab_back"> με το <td valign="top" class="chosen"> στο κουμπί που σου είχα δώσει.

fiestalunatic

#14
Προσπαθω να βαλω ενα κενουργιο κουμπι gallery στο αρχικο μενου για να το συνδεσω με το
smf gallery mod που κατεβασα αλλα δεν μπορω με τιποτα.

Στο index.template η δομη των κουμπιων ειναι καπως ετσι


// The [member] list button.
if ($context['allow_memberlist'])
   echo '<li', $current_action == 'mlist' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=mlist"><span>' , $txt[331] , '</span></a></li>';

// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
   echo '<li', $current_action == 'register' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=register"><span>' , $txt[97] , '</span></a></li>';


Στο index.greek.utf8 εχω δηλωσει πεδιο $txt[χχχ] = gallery

Στην μπαρα βγαζει το κουμπι gallery αλλα οταν το πατας δεν σε παει στην gallery
αλλα στην αρχικη σελιδα του forum.(με λιγα λογια δεν δουλευει το action του κουμπιου)

Πως το φτιαχνω αυτο?

Butcher

Για δοκίμασε αυτό


if ($context['user']['is_guest'])
   echo '<li', $current_action == 'gallery' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=gallery"><span>' , $txt[smfgallery_menu] , '</span></a></li>';

fiestalunatic

Δοκιμασα τον κωδικα που μου ειπες Butcher αλλα δεν το εμφανιζει καθολου δυστυχως...
Το ειχα δοκιμασει και εγω αυτο παρεμπιπτοντως χωρις αποτελεσμα.
Eγω προσπαθω να αφαιρεσω τα κουμπια ημερολογιο - μελη και στην θεση τους να βαλω
gallery και forum.

Aυτο γινεται,αλλα δεν γινεται η ενφανιση των δυο κενουργιων κουμπιων.
Επσιης δοκιμασα στα δυο υπαρχοντα να προσθεσω τα 2 κενουργια αλλαζοντας τα actions απο
calendar σε gallery και απο mlist σε forum αλλα τιποτα......

Ο πληρης κωδικας του μενου ειναι αυτος:


   echo '<div id="tabs6">
             <ul>';

// Show the [home] button.
    echo '<li', $current_action == 'home' ? ' id="chosen"' : '', '><a href="', $scripturl, '"><span>' , $txt[103] , '</span></a></li>';

// Show the [help] button.
    echo '<li', $current_action == 'help' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=help"><span>' , $txt[119] , '</span></a></li>';

// How about the [search] button?
if ($context['allow_search'])
    echo '<li', $current_action == 'search' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=search"><span>' , $txt[182] , '</span></a></li>';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
    echo '<li', $current_action == 'admin' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=admin"><span>' , $txt[2] , '</span></a></li>';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
    echo '<li', $current_action == 'profile' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=profile"><span>' , $txt[79] , '</span></a></li>';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
   echo '<li', $current_action == 'pm' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=pm"><span>' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<blink> '. $context['user']['unread_messages'] . ' </blink>]' : '' , '</span></a></li>';

// The [calendar]!
if ($context['allow_calendar'])
   echo '<li', $current_action == 'calendar' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=calendar"><span>' , $txt['calendar24'] , '</span></a></li>';

// The [member] list button.
if ($context['allow_memberlist'])
   echo '<li', $current_action == 'mlist' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=mlist"><span>' , $txt[331] , '</span></a></li>';

// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
   echo '<li', $current_action == 'register' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=register"><span>' , $txt[97] , '</span></a></li>';

// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
   echo '<li', $current_action == 'login' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=login"><span>' , $txt[34] , '</span></a></li>';

// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
   echo '<li', $current_action == 'logout' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '"><span>' , $txt[108] , '</span></a></li>';
   echo '
    </ul>
  </div>';
}

// 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> </td>';

Butcher

Το ημερολόγιο θα το αφαιρέσεις από το Διαχείριση -> Δημόσια συζήτηση -> Ημερολόγιο -> Ενεργοποίηση του ημερολογίου

Πιο gallery έχεις εγκαταστήσει?

Τι εννοείς να βάλεις ένα κουμπί forum, έχεις κάποιο άλλο index το οποίο θες να είναι το home page σου? Το action=home αλλάζει σε action=forum όταν εγκαταστήσεις το tiny portal αν δεν κάνω λάθος.

βάζε τον κώδικα μέσα σε [ code ] [ /code ] για να διαβάζετε πιο εύκολα

fiestalunatic

εχω το SMF Gallery Lite 2.2

οταν λεω να βαλω κουμπι 'forum' εννοοω να σε εχει action = forum και οχι
http://www......./forum/index.php που με βγαζει στην αρχικη σελιδα του simple portal(2.3.2)



DoDouLiS

Quote from: Butcher on June 24, 2010, 03:27:26 PM
Δοκίμασε να αλλάξεις το <td valign="top" class="maintab_back"> με το <td valign="top" class="chosen"> στο κουμπί που σου είχα δώσει.

Δυστήχως δεν έφτιαξε!!! Έχεις καμιά άλλη ιδέα τι μπορεί να φταίει?

Advertisement: