Different stylesheets in one theme

Started by Gary, July 30, 2006, 10:26:20 PM

Previous topic - Next topic

IchBin™

Well, since I don't know what the code looks like I'll just tell you that the text for the menu needs to be in the language files. Specifically the index.(language).php file. Then each language can use its own language file that will automatically put the users selected language into the menu.
IchBin™        TinyPortal

IchBin™

Please don't derail a topic subject with another matter that isn't related to the topic SinekSekiz. If you need help with something more than the color changer please start another topic.
IchBin™        TinyPortal

SinekSekiz

#42
Quote from: IchBin™ on December 07, 2007, 06:46:57 PM
Please don't derail a topic subject with another matter that isn't related to the topic SinekSekiz. If you need help with something more than the color changer please start another topic.

Hi IchBin™

I still need help with color changer. I thought to make the color changer language specific and the location of it is still related with it. I do not need language specific changer if I could put it where I show it. May be I was not very clear about what I want. Because if you check message history of the topic you'll see questions like mine. But if you think I am hijaking the topic you might delete or tell me to delete my messages.

Thank you.

<<<<<<<<<<<<<<<EDIT>>>>>>>>>>>>>>>>>

Nevermind. I delete them all.
You know you want to use it... So use it.

Dulce et Decorum est Pro SinekSekiz Mori

We are all figures. For men it's the money in your bank. For women it's the cup size of your boobs.

bloc

I actually looked further into this, for my newest themes. As of now i've been using either a form/dropdown (like in Helios) which saved things for members but not guests, or the stylesheet approach(described earlier in this topic)..which saves only to a cookie.

Well, I decided to go for a new approach: I converted slightly the upshrink routine in SMF to save actual names, and also in the cookie, meaning a user choice can be made instantly, but still save and remember both members(into db table) or guests(cookie) choice. I believe this is the best option, rather than using a "hack" (like Helios) or actually both css loading & javascript to just adjust a fontsize or forumwidth. This method only use javascript and directly adjusts the style where its supposed to change.

I need to test it out a bit first, but will happily share it later on. 

SinekSekiz

Quote from: Bloc on December 08, 2007, 05:07:40 AM
I actually looked further into this, for my newest themes. As of now i've been using either a form/dropdown (like in Helios) which saved things for members but not guests, or the stylesheet approach(described earlier in this topic)..which saves only to a cookie.

Well, I decided to go for a new approach: I converted slightly the upshrink routine in SMF to save actual names, and also in the cookie, meaning a user choice can be made instantly, but still save and remember both members(into db table) or guests(cookie) choice. I believe this is the best option, rather than using a "hack" (like Helios) or actually both css loading & javascript to just adjust a fontsize or forumwidth. This method only use javascript and directly adjusts the style where its supposed to change.

I need to test it out a bit first, but will happily share it later on. 

That's what I call good news. But by the time you'll do that could you share with us how to do the drop down menu language specific? I think it has some thing to do with language files of the theme that we are setting as IchBin said.

And is it possible to do icons instead of drop down menu. Like small images of different colors works like hyperlinks and when we click each one thema change it colors to that. Like the one in Dilber MC.

Thank you.
You know you want to use it... So use it.

Dulce et Decorum est Pro SinekSekiz Mori

We are all figures. For men it's the money in your bank. For women it's the cup size of your boobs.

Darkness_

#45
Hi there.

I've worked out everything properly.
There is only one thing where I got problems.

I need to get the ''Color changer to te left of te top linktree, but it says
Fatal error: Call to undefined function: template_menu() in /mnt/web1/42/36/51651736/htdocs/forum/Sources/Load.php(1729) : eval()'d code on line 291

every time.
It doesn't give an error at one place and that's at he left top corner of the page could someone change my index.template please

<?php
// Version: 1.1; 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;

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'];
}

/* 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.4';

/* 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;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

if (isset($options['theme_color']))
   
$mycolor $options['theme_color'];
else{
   
// Defaults.
   
$options['theme_color'] = isset($settings['default_theme_color']) ? $settings['default_theme_color'] : 'rood';
   
$mycolor=$options['theme_color'];
}

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$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 language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" 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>';

// 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'], '/'.$mycolor.'_style.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?fin11" media="print" />';

/* 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 language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_leftbar = '
, empty($options['collapse_leftbar']) ? 'false' 'true'';

                function shrinkHeaderLeftbar(mode)
                {'
;

        
// Guests don't have theme options!!
        
if ($context['user']['is_guest'])
                echo 
'
                        document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
        else
                echo 
'
                        smf_setThemeOption("collapse_leftbar", mode ? 1 : 0, null, "'
$context['session_id'], '");';
        echo 
'
                        document.getElementById("upshrinkLeftbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("leftbarHeader").style.display = mode ? "none" : "";

                        current_leftbar = mode;
                }
          // ]]></script>
       <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_rightbar = '
, empty($options['collapse_rightbar']) ? 'false' 'true'';

                function shrinkHeaderRightbar(mode)
                {'
;

        
// Guests don't have theme options!!
        
if ($context['user']['is_guest'])
                echo 
'
                        document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
        else
                echo 
'
                        smf_setThemeOption("collapse_rightbar", mode ? 1 : 0, null, "'
$context['session_id'], '");';

        echo 
'
                        document.getElementById("upshrinkRightbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("rightbarHeader").style.display = mode ? "none" : "";

                        current_rightbar = mode;
                }
        // ]]></script>

<script language="JavaScript" 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 ? "/upshrink2.gif" : "/upshrink.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 language="JavaScript" 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>
  <div id="wrapper">
   <div id="shad-l">
    <div id="shad-r">
     <div id="header">
<div id="head-l">
 <div id="head-r">
  <div id="userarea">'
;
if ($context['user']['is_logged'])
{
echo '
<b>'
$txt['hello_member_ndt'], ' '$context['user']['name'], '</b><br />';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo $txt[152], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt[153] : $txt[471], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'] , '.<br />';

echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo '
'
$txt['welcome_guest'], '
<script language="JavaScript" 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: 4px 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" />
<input type="submit" value="'
$txt[34], '" />
<input type="hidden" name="hash_passwrd" value="" />
</form>'
$context['current_time'],'<br />';
}

echo '
</div>
<div id="searcharea">'
;
      echo 
'
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '">
<input type="text" name="search" value="'
$txt[182], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\''$txt[182], '...\';" /> ';

    // 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>
</div>
<a href="'
.$scripturl.'" title=""><span id="logo">&nbsp;</span></a>';
      echo 
'
     </div> 
    </div>
   </div>
     <div id="toolbar">
'
,template_menu(),'
     </div>
     <div id="bodyarea">'
;

}

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


        echo 
'
      </div>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
      <div id="footer">
 <div id="foot-l">
  <div id="foot-r">
         <div id="footerarea">
            <span class="smalltext">'
theme_copyright(), '
            <br />Theme by <a href="http://www.dzinerstudio.com"><b>DzinerStudio</b></a></span>'
;

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

// 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 language="JavaScript" 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[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].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[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].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[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

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

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

echo '
         </div>
  </div>
       </div>
      </div>'
;

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

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

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

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

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

// 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;>&nbsp;';
}

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

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

echo 
'</div>';
}
 if(
$context['user']['is_logged'])
      echo 
'
      <form action="'
$scripturl'" style="margin: 0px; margin-top: 10px;" method="post" class="smalltext"><select name="options[theme_color]" onchange="this.form.submit();">
        <option selected="selected" value="'
$options['rood'], '">Use default</option>
        <option value="rood">Rood</option>
        <option value="blauw">Blauw</option>
        <option value="groen">Groen</option>
        </select><br /><input alt="submit" type="submit" value="Verander" /></form>'
;

// Show the start of the tab section.
echo '
        <div id="topmenu">
           <ul>'
;
                    // Show the [home] button.
echo '<li><a' $current_action=='home' ' class="current"' '' ' href="'$scripturl'"><span>' $txt[103] , '</span></a></li>';

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

                    // How about the [search] button?
if ($context['allow_search'])
echo '<li><a' $current_action=='search' ' class="current"' '' ' href="'$scripturl'?action=search"><span>Search</span></a></li>';

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

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

              // Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '<li><a' $current_action=='profile' ' class="current"' '' ' 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><a' $current_action=='pm' ' class="current"' '' ' href="'$scripturl'?action=pm"><span>' $txt['pm_short'] , ' '$context['user']['unread_messages'] > '[<strong>'$context['user']['unread_messages'] . '</strong>]' '' '</span></a></li>';

                   // the [member] list button
                        if ($context['allow_memberlist'])
                        echo '<li><a ' $current_action=='mlist' ' class="current"' '' ' href="'$scripturl'?action=mlist"><span>' $txt[331] , '</span></a></li>';

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

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

                    // Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '<li><a ' $current_action=='logout' ' class="current"' '' '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>&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>';
}

?>


echo '</div>';
}
if($context['user']['is_logged'])
      echo '
      <form action="', $scripturl, '" style="margin: 0px; margin-top: 10px;" method="post" class="smalltext"><select name="options[theme_color]" onchange="this.form.submit();">
        <option selected="selected" value="', $options['rood'], '">Use default</option>
        <option value="rood">Rood</option>
        <option value="blauw">Blauw</option>
        <option value="groen">Groen</option>
        </select><br /><input alt="submit" type="submit" value="Verander" /></form>';


this is the code that has to be replaced.

I will be very thankfull when someone helps me, that you PM me thank you

MinasC

wow , great stuff in this topic , gonna try some out ! thnx a lot !

Antechinus

I just tried it out.  :D
Tis running without error messages on my test forum but there is a problem with images.
I'm doing a five colour version of Bikken's Outline_tp, which is based on default. I had to import a copy of Settings.template.php from default as Outline doesn't usually have one of its own.

Then I made the code edits specified in Bloc's posts, up to post#8 in this thread. (Yes, I sorted the parse error in haven't too   ;)  ).

What's happening is that the theme runs without dramas and most of the images from the image files are showing properly. Post icons, on.gif, etc, etc.
The only one that isn't showing is catbg.gif (and maybe catbg2.gif)
So the paths to the images files seem to be correct, except for these particular images.

Outline also uses an images/custom folder and none of those images are showing at all.
So the theme can call on.gif out of images, but can't call logo.png out of images/custom.
I'm stumped. Mind you that doesn't take much. I've attached Settings.template.php and index.template.php if anyone wants to take a look.

IchBin™

How about a URL to see it in action so we can test it out?
IchBin™        TinyPortal

Antechinus

#49
Yoaky. You want admin again?

(Removed obsolete link to stop 404 in my server log) ;)

Just grab it out of the themebox if you don't want admin.

ETA: Btw, it would save a lot of bytes if it could be coded so that all the standard post icons and the thumbs.db were in one folder, with the colour variants just being subsiduary custom folders and the stylesheets. The way it is now there are five thumbs.db files at around 100 kb each.

Antechinus

#50
Ok, I found two silly mistakes in the image packs ( one superfluous file and one mis-named one).
I'll go through everything again as the basic theme structure is right and I've obviously missed something simple.

ETA: All superfluous files are now gone and images names have been checked. The problem appears to be elsewhere.
You get that.

IchBin™

When the images aren't showing up, did you check the paths of the images? I guess I can't see the color changer because its not visible to the guests. You have a test account we can use? No need for admin at this point.
IchBin™        TinyPortal

Antechinus

Hang on a sec and I'll do a demo account.

As far as I can tell the image paths are ok but it's obvious I'm missing something somewhere.
I mean the default colour is just Bikken's original images and stylesheet, so I can't see why those paths wouldn't work. The "Outrageous" selection is the same theme I put up as a going concern over at TP and I know that one works. I've checked that images are actually present on the server by downloading them to my desktop.

It must be a path thing somewhere along the line.

I'll try another check while I set up the demo account. Back shortly.

Antechinus

#53
Ok, the account name is  closed test account
and the password:

Web Developer tells me which images are broken (and it's the ones I could tell were broken).

Ok, here's the funny bit I mentioned earlier:

QuoteOutline also uses an images/custom folder and none of those images are showing at all.
So the theme can call on.gif out of images, but can't call logo.png out of images/custom.

That's the thing. The path to the images folder is correct because on.gif and off.gif show up, as do other small icons and smileys. It's only catbg that doesn't show from images, and the entire images/custom folder doesn't show either.

ETA: I think catbg might be a clue. The image is definitely present but isn't showing.

IchBin™

#54
If the image is present, you should be able to hit it directly in your browser.

(Removed obsolete link to stop 404 in my server log) ;)

Gives a 404 not found error. If that is the case, its either named wrong or spelled  wrong in your code or image name.
IchBin™        TinyPortal

Antechinus

#55
Ok, I'll have another look.

ETA: Hang on, that should give a 404. The images files are all named after the colour variations.

For the default the path is

(Removed obsolete link to stop 404 in my server log) ;)

And I just tried it. No problem. The image comes up in my browser, so that path is correct.

Here it is in img tags: (Removed obsolete link to stop 404 in my server log) ;)


Antechinus

#56
Just tried another one. For the Blue Silk variation the banner is

(Removed obsolete link to stop 404 in my server log) ;)

That path works too, but it's one of the images not showing in the theme.

ETA: Have done some more checking. I can hit any of the missing images with my browser.
Image paths are correct. The problem is somewhere else. Narrowed it down anyway.

Antechinus

#57
Hey I think I just figured it out. You guys shouldn't give open source software to beginners.  ;D

I bet it'll work now.

Yee_ha! It's alive! Next time I ask for support tell me to think for longer.

IchBin™

It helps if you leave your resolution so others won't make the same mistake. :) Glad you got it sorted.
IchBin™        TinyPortal

Antechinus

Ok. It is really embarrassing, but someone may benefit from it.  ;)

What I'd done was to use the basic css and image files from Outline, Outrageous and Outline Aqua. I renamed them to outrageous_style.css and images_outrageous etc, etc so they could be called by the modified index.template and Settings.template

All good so far. I was so concerned about getting the coding right for those files (which make up the main multi-version structure) that I completely forgot that each stye.css file still had the calls for the images from the original, single version themes.

So instead of calling up images_outrageous/custom/logo.png (for example) it still said images/custom/logo.png

This is why the image path was correct when hit with a browser, but the image wouldn't show on the theme. D'oh.

So I went through all the css files with Notepad++ and edited in the right names for the image files and overwrote them via ftp. Hey presto, it works.

Like I said, I'll think harder next time. Your tip about hitting the image path directly with a browser was helpful though because it ruled something out and got me thinking on a different track.

Advertisement: