Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

Forum 1.1.4

Aloittaja homeless-cowboy, lokakuu 15, 2007, 07:19:30 AP

« edellinen - seuraava »

homeless-cowboy

Hallo ich brauche Eure Hilfe ich  habe mehre Templates auf der Version 1,1,4  und möchte das Menü mit einem Chatbutton und der verlinkung zum Chat dieser Button sollte aber nur für Regestrierte bzw Online User Sichtbar sein .

Ich wäre sehr Dankbar wenn mir jemand verraten könnte wo genau ich das in die Templates einfügen muss und auch der  Code hierfür wäre sehr Hilfreich .



Vielen Dank im vorraus
Marco

Nikwin

Hallo,

schau Dir doch einfach z.B. den Members-Button in der index.template.php an.
Kopiere ihn, füge ihn an der Stelle ein wo Du den neuen Button gerne hättest und ändere den Namen und den Zielpfad. - Sollte funktionieren.l

homeless-cowboy

ja klingt schon mal gut habs auch gefunden nur jetzt die frage wie füge ich da einen eifachen link zu m chat ein wenn ich es auf die übliche methode mache bekomme ich einen Parse error

PfalzNacht

Hi!

Wie ja schon gesagt, in der index.template.php bei "// Show the start of the tab section."

Dort wie gesagt einfach unten den Code an die Stelle einfügen, an der du den "Button" haben willst.

Lainaa// Show the ['Chat'] button.
   if ($context['user']['is_logged'])
   echo ($current_action== 'chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
               <a href="http://www.xxx.tld">Chat</a>
            </td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

Den Link bei "a href" musste noch durch deinen ersetzen.

homeless-cowboy

hallo hat ja  geklappt aber leider nur im template default jetzt habe ich ein templat egfeunde was mir gefallen würde nur dort geht das ned so einfach den dort  gibts die besagte stelle nicht
ApolloBB theme 1.2.6 by HVMDesign and Dizzy Technology vielleicht verwendet jemand dieses template und kann mir sagen wo ich es da einbauen muss


Nikwin

Hallo,

das ist doch das Gleiche.
Auch in diesem Theme wird es einen Code für z.B. den Members-Button in der index.template.php geben.

homeless-cowboy

#6
Im Anhng das Index  ich habs leider ned gefunden


[code]
<?php
// Version: 1.1.4; index

/*   This template is, perhaps, the most important template in the theme. It
   contains the main template layer that displays the header and footer of
   the forum, namely with main_above and main_below. It also contains the
   menu sub template, which appropriately displays the menu; the init sub
   template, which is there to set the theme up; (init can be missing.) and
   the linktree sub template, which sorts out the link tree.

   The init sub template should load any data and set any hardcoded options.

   The main_above sub template is what is shown above the main content, and
   should contain anything that should be shown up there.

   The main_below sub template, conversely, is shown after the main content.
   It should probably contain the copyright statement and some other things.

   The linktree sub template should display the link tree, using the data
   in the $context['linktree'] variable.

   The menu sub template should display all the relevant buttons the user
   wants and or needs.

   For more information on the templating system, please see the site at:
   http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
   global $context, $settings, $options, $txt;

   /* Use images from default theme when using templates from the default theme?
      if this is 'always', images from the default theme will be used.
      if this is 'defaults', images from the default theme will only be used with default templates.
      if this is 'never' or isn't set at all, images from the default theme will not be used. */
   $settings['use_default_images'] = 'never';

   /* What document type definition is being used? (for font size and other issues.)
      'xhtml' for an XHTML 1.0 document type definition.
      'html' for an HTML 4.01 document type definition. */
   $settings['doctype'] = 'xhtml';

   /* The version this template/theme is for.
      This should probably be the version of SMF it was created for. */
   $settings['theme_version'] = '1.1';

   /* Set a setting that tells the theme that it can render the tabs. */
   $settings['use_tabs'] = true;

   /* Use plain buttons - as oppossed to text buttons? */
   $settings['use_buttons'] = true;

   /* Show sticky and lock status seperate from topic icons? */
   $settings['seperate_sticky_lock'] = true;

   /* Set up the version number, for checking. */
   $txt['apollobb_version'] = '1.2.6';
   
   // Color changer
   if(!$context['user']['is_guest'] && isset($_POST['options']['theme_color']))
   {
      include_once($GLOBALS['sourcedir'] . '/Profile.php');
      makeThemeChanges($context['user']['id'], $settings['theme_id']);
      $options['theme_color'] = $_POST['options']['theme_color'];
   }
   elseif ($context['user']['is_guest'])
   {
      if (isset($_POST['options']['theme_color']))
      {
        $_SESSION['theme_color'] = $_POST['options']['theme_color'];
        $options['theme_color'] = $_SESSION['theme_color'];
      }
      elseif (isset($_SESSION['theme_color']))
        $options['theme_color'] = $_SESSION['theme_color'];
   }
}

// The main sub template above the content.
function template_main_above()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;
  
   // Show right to left and the character set for ease of translating.
   echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "hxxp:www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd [nonactive]">
<html xmlns="hxxp:www.w3.org/1999/xhtml"' [nonactive];, $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
   <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
   <meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
   <meta name="robots" content="noindex" />', '
   <meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
   <script type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>
   <script type="text/javascript"><!-- // --><![CDATA[
      var smf_theme_url = "', $settings['theme_url'], '";
      var smf_images_url = "', $settings['images_url'], '";
      var smf_scripturl = "', $scripturl, '";
      var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
      var smf_charset = "', $context['character_set'], '";
   // ]]></script>
   <title>', $context['page_title'], '</title>';
  
   // Any color set by user?
   if (isset($options['theme_color']))
      $settings['theme_main_color'] = $options['theme_color'];

   // If not set, or if not allowed to set
   if(!isset($options['theme_color']) || (isset($settings['allow_color_change']) && $settings['allow_color_change'] == 'no'))
   {
      // Defaults.
      $options['theme_color'] = isset($settings['theme_main_color']) ? $settings['theme_main_color'] : 'blue';
      $settings['theme_main_color'] = $options['theme_color'];
   }

   // The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
   echo '
   <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style_' , $settings['theme_main_color'] , '.css?fin11" />
   <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" media="print" />
   <!--[if IE]>
   <style type="text/css">
   /* IE hack to emulate the :hover & :focus pseudo-classes
      Add the selectors below that required the extra attributes */
   .hoverbox { behavior: url("', $settings['theme_url'], '/pseudo-hover.htc"); }
   </style>
   <![endif]-->';

   /* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
      Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
      Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
      Standards compliance mode happens when you use xhtml... */
   if ($context['browser']['needs_size_fix'])
      echo '
   <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';

   // Show all the relative links, such as help, search, contents, and the like.
   echo '
   <link rel="help" href="', $scripturl, '?action=help" target="_blank" />
   <link rel="search" href="' . $scripturl . '?action=search" />
   <link rel="contents" href="', $scripturl, '" />';

   // If RSS feeds are enabled, advertise the presence of one.
   if (!empty($modSettings['xmlnews_enable']))
      echo '
   <link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';

   // If we're viewing a topic, these should be the previous and next topics, respectively.
   if (!empty($context['current_topic']))
      echo '
   <link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
   <link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';

   // If we're in a board, or a topic for that matter, the index will be the board's index.
   if (!empty($context['current_board']))
      echo '
   <link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';

   // We'll have to use the cookie to remember the header...
   if ($context['user']['is_guest'])
      $options['collapse_header'] = !empty($_COOKIE['upshrink']);

   // Output any remaining HTML headers. (from mods, maybe?)
   echo $context['html_headers'], '
   <script type="text/javascript"><!-- // --><![CDATA[
      var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';
      function shrinkHeader(mode)
      {';

   // Guests don't have theme options!!
   if ($context['user']['is_guest'])
      echo '
         document.cookie = "upshrink=" + (mode ? 1 : 0);';
   else
      echo '
         smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';
   echo '
         document.getElementById("upshrink").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");
         document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
         document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";
         current_header = mode;
      }
   // ]]></script>';

   // the routine for the info center upshrink
   echo '
   <script type="text/javascript"><!-- // --><![CDATA[
      var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', ';
      function shrinkHeaderIC(mode) {';
   if ($context['user']['is_guest'])
      echo '
         document.cookie = "upshrinkIC=" + (mode ? 1 : 0);';
   else
      echo '
         smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");';
   echo '
         document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");
         document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";
         current_header_ic = mode;
      }
   // ]]></script>
</head>
<body onload="PreloadFlag = true;">';
   //Display ads on the top of the page
   if (function_exists("show_topofpageAds"))
   {
      $ads = show_topofpageAds();  
      if(!empty($ads))
         if($ads['type']==0)
            echo $ads['content'];
         else
            eval($ads['content']);  
      unset($ads);
   }
   echo '
<table cellspacing="0" cellpadding="0" align="center" style="border:0 none;width:' , (isset($settings['page_div_width']) && !empty($settings['page_div_width'])) ? $settings['page_div_width'] : '100%' ,  '">
   <tr>
      <td class="border_left"></td>
      <td class="content">
      <div class="topbar">
         <table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
            <tr>
               <td id="header_logo" width="1">';
   // Show the logo.  It'll be either the default image, or one you set in the Theme Settings.  The stock logo is logo.gif in the images directory for each color.
   if (empty($settings['header_logo_url']))
      echo '
                  <a href="', $scripturl, '" class="topimg"><img src="', $settings['images_url'] . '/'. $settings['theme_main_color'], '/logo.gif" style="margin: 0px;border: 0 none;height: 89px" ',  (empty($settings['show_name_near_logo'])) ? 'alt="'.$context['forum_name'].'"' : 'alt=""' ,' title="', $context['forum_name'], '" /></a>';
      else echo '
                  <a href="', $scripturl, '" title="', $context['forum_name'], '" class="topimg"><img src="', $settings['header_logo_url'], '" style="border: 0 none;vertical-align:middle;margin: 0px;" ',  (empty($settings['show_name_near_logo'])) ? 'alt="'.$context['forum_name'].'"' : 'alt=""' ,' /></a>';
   echo '
               </td>';

   // Show the name near the logo, if it's wanted.
   if (!empty($settings['show_name_near_logo']))
      echo '   
               <td>
                  <span class="toptitle">', $context['forum_name'], '</span>
               </td>';

   // If set, show the search box or login box in the header.
   if(empty($settings['boxes_in_header'])) {
      // Are they logged in?  Show the search box.
      if ($context['user']['is_logged']) {  
         echo '
               <td id="header_right">
                              <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '"><br />
                                 <input class="login_bg" type="text" name="search" value="" /><br />
                     <input class="login_bg_submit" type="submit" name="submit" value="', $txt[182], '" />
                                 <input type="hidden" name="advanced" value="0" />';
   // Search within current topic?
   if (!empty($context['current_topic']))
      echo '
                                 <input type="hidden" name="topic" value="', $context['current_topic'], '" />';
   // If we're on a certain board, limit it to this board ;).
   elseif (!empty($context['current_board']))
      echo '
                     <input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

   echo '
                              </form>
                        </td>';
   // Otherwise they're a guest:  show a login box...
   } else {
      echo '
               <td id="header_right">
                              <script type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>
                              <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '><br />
                                 <input class="login_bg" type="text" name="user" alt="',$txt[35],'" title="',$txt[35],'" /><br />
                                 <input class="login_bg" type="password" name="passwrd" maxlength="32" alt="', $txt[36], '" title="', $txt[36], '" /><br />
                                 <input type="hidden" name="cookielength" value="-1" />
                                 <input type="submit" class="login_bg_submit" name="login" value="', $txt[34], '" />
                                 <input type="hidden" name="hash_passwrd" value="" />
                              </form>
               </td>';
      }
   }

   echo '
            </tr>
         </table>
      </div>';

   // Here we got another bar!  This one serves up random news lines, the current time, and those neat little bar peanuts!
   echo '
         <div style="width: 100%; padding-top: 4px;" id="bg_header_bar">
            <table border="0" cellspacing="0" cellpadding="0" style="width: 100%;">
               <tr style="vertical-align:middle">';

   // Show a random news item? (or you could pick one from news_lines...)
   if (!empty($settings['enable_news']))
      echo '

                  <td class="smalltext" style="vertical-align:middle;padding-left:10px; padding-top:0px; padding-bottom:0px;">
                     <strong>', $txt[102], '</strong>: ', $context['random_news_line'], '
                  </td>';
   echo '
                  <td class="smalltext" style="vertical-align:middle;text-align:right;padding-right:10px; padding-top:0px; padding-bottom:0px;font-weight:bold">
                        ' , $context['current_time'], '
                  </td>
               </tr>
            </table>
         </div>';

   // Show that lovable template menu.
   template_menu();

   // Start the contect section.
   echo '
         <div class="content">';

   // Below the menu ads go here, oh boy!
   if (function_exists("show_indexAds")) {
      $ads = show_indexAds();  
      if(!empty($ads)) {
         echo '
      <div class="memberbardiv" align="center">';
         if($ads['type']==0)
            echo $ads['content'];
         else
            eval($ads['content']);
      echo '</div>';
      }
      unset($ads);
   }

   // PM box, from Apollo.
   if ($context['user']['is_logged'] && $context['allow_pm'] && $context['user']['unread_messages']>=1)
      echo '
         <div id="pm_new" align="center"><a class="hoverbox" href="', $scripturl, '?action=pm">', $txt[660], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt[471] : $txt[153], '.  ', $txt[661], ' ', $txt[662], ' ', $txt[663], '</a></div>';

   // We start with the member bar.  Guests only have a thin bar with the guest greeting and color chooser.
   // In the settings, you can also set whether guests/users see a login box/search box here, like in Dilber MC.
   // Members have the greeting, color changer, avatar, PM links, new post links, and some warnings.
   echo '  
            <div class="memberbardiv">
               <table width="100%" cellpadding="0" cellspacing="0" border="0">
                  <tr>
                     <td width="20"></td>
                     <td class="memberbar">';
                 
   if($context['user']['is_logged'])
      echo '
                     ', $txt['hello_member_ndt'], ' <strong>', $context['user']['name'] , '</strong>';
   else
      echo $txt['welcome_guest'];
              
      echo '
                     </td>
                     <td class="middletext" align="right" valign="top" style="padding-right:10px; padding-left:10px;">
                        <a style="float:right" href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="vertical-align:top" /></a>  
                     </td>
                  </tr>
              
                  <tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
                     <td valign="middle" width="1" style="padding-right:10px; padding-left:10px;">';

   // Complicated stuff!  If you're logged in and have an avatar, show it.  If you're
   // logged in and don't have one, show a "No Avatar" avatar based on your color and
   // language.  Otherwise, show a "Guest" avatar based on your color and language.
   if($context['user']['is_logged'])
      echo '
                        ',  !empty($context['user']['avatar']) ? $context['user']['avatar']['image'] : '<img src="'. $settings['images_url']. '/'. $context['user']['language']. '/'. $settings['theme_main_color']. '/no_avatar.gif" width="80" height="80" alt="" />';
   else echo '
                        <img src="', $settings['images_url'], '/', $context['user']['language'], '/', $settings['theme_main_color'], '/guest_avatar.gif" width="80" height="80" alt="" />';
      echo '
                     </td>
                     <td class="memberbar">';
   // If you're logged in, show PM info and links to new posts.
   if($context['user']['is_logged'])
      echo '
                        <br />
                        <span class="middletext">'
                           , $context['allow_pm'] ? '<strong>' . $txt[152] . ' <a href="' . $scripturl . '?action=pm">' . $context['user']['messages'] . ' ' . ($context['user']['messages'] != 1 ? $txt[153] : $txt[471]) . '</a>' . $txt['newmessages4'] . ' ' . $context['user']['unread_messages'] . ' ' . ($context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1']).'</strong>' : '<br/>', '.<br/><br/>
                           &raquo; <a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
                           &raquo; <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
                        </span>';
      echo '
                     </td>
                     <td class="middletext" style="text-align:right;vertical-align:top;padding-right:10px; padding-left:10px;">
                        <br />';
      // Are they logged in?
      if ($context['user']['is_logged']) {  
         // Show the total time logged in?
         if (!empty($context['user']['total_time_logged_in'])) {
            echo '
                        ', $txt['totalTimeLogged1'];
           
         // If days is just zero, don't bother to show it.
         if ($context['user']['total_time_logged_in']['days'] > 0)
            echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];
           
         // Same with hours - only show it if it's above zero.
         if ($context['user']['total_time_logged_in']['hours'] > 0)
            echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
           
         // But, let's always show minutes - Time wasted here: 0 minutes ;).
            echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
      }

      // Is the forum in maintenance mode?
      if ($context['in_maintenance'] && $context['user']['is_admin'])
         echo '
                                    <strong>', $txt[616], '</strong><br />';
           
      // Are there any members waiting for approval?
      if (!empty($context['unapproved_members']))
         echo '
                        ', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';

      // If searching is allowed, and you can't show the boxes in the header, put it here.
      if(!empty($settings['boxes_in_header']) && ($context['allow_search'])) {
            echo '
                        <br />
                        <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
                           <a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" alt="" /></a>
                           <input type="text" name="search" value="" />
                           <input type="submit" name="submit" value="', $txt[182], '" style="vertical-align:top" />
                           <input type="hidden" name="advanced" value="0" />';
         // Search within current topic?
         if (!empty($context['current_topic']))
            echo '
                           <input type="hidden" name="topic" value="', $context['current_topic'], '" />';
         // If we're on a certain board, limit it to this board ;).
         elseif (!empty($context['current_board']))
            echo '
                           <input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
         echo '
                        </form>';
      }
   }
   // If they're guests, and you can't put the boxes in the header, put them here.
   elseif (!empty($settings['boxes_in_header'])) {
      echo '
                        <script type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>
                        <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
                           <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" /><br />
                           <select name="cookielength">
                              <option value="60">', $txt['smf53'], '</option>
                              <option value="1440">', $txt['smf47'], '</option>
                              <option value="10080">', $txt['smf48'], '</option>
                              <option value="43200">', $txt['smf49'], '</option>
                              <option value="-1" selected="selected">', $txt['smf50'], '</option>
                           </select>
                           <input type="submit" value="', $txt[34], '" /><br />
                           <input type="hidden" name="hash_passwrd" value="" />
                        </form>';
   }
   echo '
                     </td>
                  </tr>
               <tr id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
                  <td colspan="3" valign="middle" style="padding: 0 10px">';
              
   // color selection box
   if(isset($settings['allow_color_change']) && $settings['allow_color_change'] == 'box')
      echo '
                    <div style="float:right">
                     <form action="', $scripturl, '" method="post" class="smalltext">
                        <select name="options[theme_color]">
                              <option value="black"'  ,$settings['theme_main_color'] == 'black' ? ' selected="selected"': '', '>',$txt['apollobb_color_black'],'</option>
                                 <option value="blue"'  ,$settings['theme_main_color'] == 'blue' ? ' selected="selected"': '', '>',$txt['apollobb_color_blue'],'</option>
                                 <option value="green"' ,$settings['theme_main_color'] == 'green' ? ' selected="selected"': '', '>',$txt['apollobb_color_green'],'</option>
                                 <option value="purple"',$settings['theme_main_color'] == 'purple' ? ' selected="selected"': '', '>',$txt['apollobb_color_purple'],'</option>
                                 <option value="red"'   ,$settings['theme_main_color'] == 'red' ? ' selected="selected"': '', '>',$txt['apollobb_color_red'],'</option>
                        </select>
                        <input type="submit" name="submit" value="Change" style="width: 11ex;" />
                     </form>
                  </div>';
   if(isset($settings['allow_color_change']) && $settings['allow_color_change'] == 'bars')
      echo '
                    <div style="float:right;padding-top:5px">
                     <form action="', $scripturl, '" method="post" class="smalltext">
                              <input style="border:solid 2px #6C7F93;background:#6C7F93;color:#6C7F93;width:20px;height:20px;font-size:1px" type="submit" value="black" name="options[theme_color]"/>
                              <input style="border:solid 2px #6699CC;background:#6699CC;color:#6699CC;width:20px;height:20px;font-size:1px" type="submit" value="blue" name="options[theme_color]"/>
                              <input style="border:solid 2px #4DB45D;background:#4DB45D;color:#4DB45D;width:20px;height:20px;font-size:1px" type="submit" value="green" name="options[theme_color]"/>
                              <input style="border:solid 2px #A185D6;background:#A185D6;color:#A185D6;width:20px;height:20px;font-size:1px" type="submit" value="purple" name="options[theme_color]"/>
                              <input style="border:solid 2px #E15050;background:#E15050;color:#E15050;width:20px;height:20px;font-size:1px" type="submit" value="red" name="options[theme_color]"/>
                     </form>
                  </div>';
   echo '
                  </td>
               </tr>
               </table>
            </div>';

   //Welcome Ads
   if (function_exists("show_welcomeAds")) {
      $ads = show_welcomeAds();
      if(!empty($ads)) {
         echo '<div class="memberbardiv" align="center">';
         if($ads['type']==0)
            echo $ads['content'];
         else
            eval($ads['content']);
         echo '</div>';
      }
      unset($ads);
   }

   // Extra stuff here.  
   if(!empty($settings['custom_global_html']))
      echo '
         <div align="center" style="width: 90%; margin-left: auto; margin-right: auto; margin-top:10px; border: 0px solid;" class="middletext">
            ', $settings['custom_global_html'], '
         </div>';

   //Below the menu ads
   if (function_exists("show_towerleftAds") && function_exists("show_towerrightAds")) {

   //Tower left Ads
   $ads = show_towerleftAds();
   if(!empty($ads))
      echo '<table><tr><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td><td width="100%" valign="top">';
         unset($ads);

   //Tower Right Ads
   $ads = show_towerrightAds();  
   if(!empty($ads))
      echo '<table><tr><td width="100%" valign="top">';
      unset($ads);
   }

   // Congrats, we're done!  Let's go the content!
}

function template_main_below()
{
   global $context, $settings, $options, $scripturl, $txt;

   // What?!  Done already?  Fine, let's get to the footer.

   //Close table for towerright ads
   if (function_exists("show_towerrightAds") && function_exists("show_towerleftAds") && function_exists("show_bottomAds"))
   {
      $ads = show_towerrightAds();   
      if(!empty($ads))
         echo '</td><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td></tr></table>';

      unset($ads);
      //Close table for towerleft ads
      $ads = show_towerleftAds();   
      if(!empty($ads))
         echo '</td></tr></table>';
      unset($ads);

      //Show ads on the bottom of the page
      $ads = show_bottomAds();
      if(!empty($ads))
         if($ads['type']==0)
            echo $ads['content'];
         else
            eval($ads['content']);
      unset($ads);
   }

   // The following will be used to let the user know that some AJAX process is running
   echo '
            <div id="ajax_in_progress" class="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>';

   // Now we close out the content, and move on to the footers.
   echo '
         </div>
         <div id="footer">
            <span class="smalltext">
               ApolloBB theme ',$txt['apollobb_version'],' by <a href="hxxp:www.hvmdesign.com [nonactive]">HVMDesign</a>
               and <a href="hxxp:www.dizzytechnology.com [nonactive]">Dizzy Technology</a>';

   // Show custom copyright?
   if ($settings['custom_copyright']!="")
      echo '<br />
               ',$settings['custom_copyright'];

   // Show the load time?
   if ($context['show_load_time'])
      echo '<br />
               ', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'];

   echo '
               <br />
            </span>
         </div><br />
         <div id="bg_footer">

            <div id="footer_left" class="smalltext">',theme_copyright(),'</div>
            <div id="footer_right" class="smalltext">
               <a href="hxxp:validator.w3.org/check/referer [nonactive]" title="',$txt['valid_xhtml'],'">', $txt['apollobb_footer_xhtml'],'</a> |
               <a href="hxxp:jigsaw.w3.org/css-validator/check/referer [nonactive]" title="', $txt['valid_css'], '">',$txt['apollobb_footer_css'],'</a> |
               <a href="hxxp:www.php.net/ [nonactive]" title="', $txt['powered_by_php'], '">',$txt['apollobb_footer_php'],'</a> |
               <a href="hxxp:www.mysql.com/ [nonactive]" title="', $txt['powered_by_mysql'], '">',$txt['apollobb_footer_sql'],'</a>
            </div>
         </div>
      </td>
      <td class="border_right"></td>
   </tr>
</table>';

   // Don't even worry about this stuff.  Things do screw up without it, at least I think.
   // This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
   if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
   {
      // The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
      echo '
      <script type="text/javascript"><!-- // --><![CDATA[';

      // Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
      if ($context['browser']['is_safari'])
         echo '
         window.addEventListener("load", smf_codeFix, false);

         function smf_codeFix()
         {
            var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

            for (var i = 0; i < codeFix.length; i++)
            {
               if ((codeFix.className == "code" || codeFix.className == "post" || codeFix.className == "signature") && codeFix.offsetHeight < 20)
                  codeFix.style.height = (codeFix.offsetHeight + 20) + "px";
            }
         }';
      elseif ($context['browser']['is_firefox'])
         echo '
         window.addEventListener("load", smf_codeFix, false);
         function smf_codeFix()
         {
            var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

            for (var i = 0; i < codeFix.length; i++)
            {
               if (codeFix.className == "code" && (codeFix.scrollWidth > codeFix.clientWidth || codeFix.clientWidth == 0))
                  codeFix.style.overflow = "scroll";
            }
         }';         
      else
         echo '
         var window_oldOnload = window.onload;
         window.onload = smf_codeFix;

         function smf_codeFix()
         {
            var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

            for (var i = codeFix.length - 1; i > 0; i--)
            {
               if (codeFix.currentStyle.overflow == "auto" && (codeFix.currentStyle.height == "" || codeFix.currentStyle.height == "auto") && (codeFix.scrollWidth > codeFix.clientWidth || codeFix.clientWidth == 0) && (codeFix.offsetHeight != 0 || codeFix.className == "code"))
                  codeFix.style.height = (codeFix.offsetHeight + 36) + "px";
            }

            if (window_oldOnload)
            {
               window_oldOnload();
               window_oldOnload = null;
            }
         }';

      echo '
      // ]]></script>';
   }

   echo '
</body>
</html>';
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"...
// Has a nice, cool style from Apollo.
function theme_linktree()
{
   global $context, $settings, $options, $txt;

   echo '
            <table width="100%" cellspacing="1" cellpadding="0" border="0" align="center" class="nav" style="width:100%;margin:2px 0">
               <tr>
                  <td class="nav" style="padding-left:4px" align="left">';
   // Each tree item has a URL and name. Some may have extra_before and extra_after.
   foreach ($context['linktree'] as $link_num => $tree)
   {
      // Show something before the link?
      if (isset($tree['extra_before']))
         echo $tree['extra_before'];

      $navcond = '';

      // If we're at the last link, make the link discolored.
      if ($link_num == count($context['linktree']) -1)
         $navcond = 'nav-current';

      // Show the link, including a URL if it should have one.
      echo '<strong>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav '.$navcond.'">' . $tree['name'] . '</a>' : $tree['name'], '</strong>';

      // Show something after the link...?
      if (isset($tree['extra_after']))
         echo $tree['extra_after'];

      // Don't show a separator for the last one.
      if ($link_num != count($context['linktree']) - 1)
         echo '&nbsp;&raquo;&nbsp;';
   }

   echo '
                  </td>
               </tr>
         </table><br />';
}

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

   // Open up our <div>.
   echo'
            <div id="bg_nav_links">';
   // Show the [home] button.
   echo '
               <a href="', $scripturl, '" ' , $current_action == 'home' ? 'class="nav_important"' : '' , '>' , $txt[103] , '</a>&nbsp;|';
   // Show the [help] button.
   echo '
               <a href="', $scripturl, '?action=help" ' , $current_action == 'help' ? 'class="nav_important"' : '' , '>' , $txt[119] , '</a>&nbsp;|';
   // How about the [search] button?
   if ($context['allow_search'])
   echo '
               <a href="', $scripturl, '?action=search" ' , $current_action == 'search' ? 'class="nav_important"' : '' , '>' , $txt[182] , '</a>&nbsp;|';
   // Is the user allowed to administrate at all? ([admin])
   if ($context['allow_admin'])
      echo '
               <a href="', $scripturl, '?action=admin" ' , $current_action == 'admin' ? 'class="nav_important"' : '' , '>' , $txt[2] , '</a>&nbsp;|';
   // Edit Profile... [profile]
   if ($context['allow_edit_profile'])
      echo '
               <a href="', $scripturl, '?action=profile" ' , $current_action == 'profile' ? 'class="nav_important"' : '' , '>' , $txt[79] , '</a>&nbsp;|';
   // Go to PM center... [pm]
   if ($context['user']['is_logged'] && $context['allow_pm'])
      echo '
               <a href="', $scripturl, '?action=pm" ' , $current_action == 'pm' ? 'class="nav_important"' : '' , '>' , $txt['pm_short'] , ' ('. $context['user']['unread_messages'] . ')' , '</a>&nbsp;|';
   // The [calendar]!
   if ($context['allow_calendar'])   
      echo '
               <a href="', $scripturl, '?action=calendar" ' , $current_action == 'calendar' ? 'class="nav_important"' : '' , '>' , $txt['calendar24'] , '</a>&nbsp;|';            
   // the [member] list button
   if ($context['allow_memberlist'])
      echo '

               <a href="', $scripturl, '?action=mlist" ' , $current_action == 'mlist' ? 'class="nav_important"' : '' , '>' , $txt[331] , '</a>&nbsp;|';            

   // If the user is a guest, show [login] button.
   if ($context['user']['is_guest'])
      echo '
               <a href="', $scripturl, '?action=login" ' , $current_action == 'login' ? 'class="nav_important"' : '' , '>' , $txt[34] , '</a>&nbsp;|';         
   // If the user is a guest, also show [register] button.
   if ($context['user']['is_guest'])
      echo '
               <a href="', $scripturl, '?action=register" ' , $current_action == 'register' ? 'class="nav_important"' : '' , '>' , $txt[97] , '</a>';         
   // Otherwise, they might want to [logout]...
   if ($context['user']['is_logged'])
      echo '
               <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '" ' , $current_action == 'logout' ? 'class="nav_important"' : '' , '>' , $txt[108] , '</a>';         
      // Dummy place holder, to end things
   echo'
            </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>&nbsp;</td>';

   echo '
      <td class="', $direction == 'top' ? 'main' : 'main', 'strip_first', '">&nbsp;</td>
      <td class="', $direction == 'top' ? 'main' : 'main', 'strip">', implode(' &nbsp;|&nbsp; ',

Nikwin

   // the [member] list button
   if ($context['allow_memberlist'])
      echo '

               <a href="', $scripturl, '?action=mlist" ' , $current_action == 'mlist' ? 'class="nav_important"' : '' , '>' , $txt[331] , '</a>&nbsp;|'; 


Befindet sich fast am Ende.

', $scripturl, '?action=mlist mit der neuen url ersetzen, neuen Textcode einfügen z.B. [1234] und in der language.deine sprache.php definieren. Also txt[1234]='Chat'

homeless-cowboy

so die letzte wahrscheinlich saudumme frage  und welchen code brige ich nun hier zur genauen anwndung ???

Advertisement: