News:

Join the Facebook Fan Page.

Main Menu

Theme picker at top

Started by Miraenda, April 27, 2005, 08:14:06 PM

Previous topic - Next topic

Miraenda

Hi,

I had a friend who has greater PHP skills than I do to help me add a theme picker to the very top of my forum.  I picked my beta forum as that is the one where I have a bunch of themes on it.  If you'd like to see the theme picker in action, it is at http://miraenda.com/

Now, I asked the friend if it would be okay for me to provide the code to the SMF community before he was going to do it, so this is also with his approval.  Here are the instructions he provided to me:

First, put the following in the Sources/Load.php file:

function theme_name(){
  global $db_prefix,$context,$scripturl;
$resultaa=db_query("
        SELECT * from {$db_prefix}themes WHERE `variable` = 'name' ORDER by `value`", __FILE__, __LINE__);
while($rowaa=mysql_fetch_array($resultaa)){
$theme_rowa=$rowaa['ID_THEME'];
$theme_row_namea=$rowaa['value'];
$context['theme_options']="".$context['theme_options']."<option value=\"$scripturl?theme=$theme_rowa\">$theme_row_namea</option>";
}
}


Then, add in the index.php file:
theme_name();
right after:
loadTheme();

Then, put the theme changer in a global file so you can change it for all your themes in one file, create a file called themechanger.php in the Themes directory. In the themechanger.php file put the following:
<?
global $context;
echo '<center><form name="jumpurl1" onSubmit="return jumpit()">
                <select size="1" name="jumpurl2">
                      '.$context['theme_options'].'
                </select>
                <input type="button" value="Change it!" onClick="jumpit()"></form></center>
                   <script>
                       function jumpit(){
                          window.location=document.jumpurl1.jumpurl2.value
                          return false
                       }
                   </script>';
?>


Now, for all the themes you want to have the theme changer on, you would put the following in the index.template.php file in each of the Theme folders:
global $boarddir;
require ''.$boarddir.'/Themes/themechanger.php';


The best location might be right after the <body>'; tag.

Now, if you want to put the code just directly into the theme file instead of having a global file do this instead:
In the index.template.php file in the themes you wish to have the theme change in put the following:
echo '<center><form name="jumpurl1" onSubmit="return jumpit()">
                <select size="1" name="jumpurl2">
                      '.$context['theme_options'].'
                </select>
                <input type="button" value="Change it!" onClick="jumpit()"></form></center>
                   <script>
                       function jumpit(){
                          window.location=document.jumpurl1.jumpurl2.value
                          return false
                       }
                   </script>';


And that's It!

Let me know if you anyone uses it and/or likes it (or if you have any issues with it working for that matter).

Have a Blessed Day :)

Nyx


dtm.exe

Thanks.  Maybe I'll try that on my website.

-Dan The Man

Kirby

#3
Here is what I'd do

Open index.template.php
Scroll to the end, right before ?> and add:


// This neat function finds and returns info about all of our themes.
function getThemeData()
{
global $db_prefix, $user_info, $scripturl, $settings, $options, $modSettings;

$themes = array();

// Get all of our themes.
$request = db_query("
SELECT value, ID_THEME
FROM {$db_prefix}themes
WHERE variable = 'name'
AND ID_THEME != $settings[theme_id]" . (empty($modSettings['theme_default']) ? '
AND ID_THEME != 1' : '') . "
ORDER BY value", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
$themes[] = array(
'id' => $row['ID_THEME'],
'name' => $row['value'],
);
}
return $themes;
}


Then you can just add this to where you want your theme chooser:

// Simplify this..
$themes = getThemeData();

if (!empty($themes))
{
echo '
<form action="', $scripturl ,'" name="themeForm">
<select name="theme" name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 ? 0 : 1);">';

foreach($themes as $theme)
echo '
<option value="?theme=', $theme['id'] ,'">' .$theme['name'] . '</option>';

echo '
</select>
</form>';
}


Tested and working with latest 1.1 beta :)

Miraenda

I think mine works with 1.1 Beta 1 as that is what my board runs on anyway as well... :)

Kirby

Yeah I know, I just did changes more on the code side :)
I like the idea behind this "trick"..

Miraenda

Now if we can just get SMF to add something like this to a demo gallery of themes for this site ;)

Neol

Quote from: Kirby on April 28, 2005, 11:12:51 PM
Here is what I'd do

Open index.template.php
Scroll to the end, right before ?> and add:


// This neat function finds and returns info about all of our themes.
function getThemeData()
{
global $db_prefix, $user_info, $scripturl, $settings, $options, $modSettings;

$themes = array();

// Get all of our themes.
$request = db_query("
SELECT value, ID_THEME
FROM {$db_prefix}themes
WHERE variable = 'name'
AND ID_THEME != $settings[theme_id]" . (empty($modSettings['theme_default']) ? '
AND ID_THEME != 1' : '') . "
ORDER BY value", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
$themes[] = array(
'id' => $row['ID_THEME'],
'name' => $row['value'],
);
}
return $themes;
}


Then you can just add this to where you want your theme chooser:

// Simplify this..
$themes = getThemeData();

if (!empty($themes))
{
echo '
<form action="', $scripturl ,'" name="themeForm">
<select name="theme" name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 ? 0 : 1);">';

foreach($themes as $theme)
echo '
<option value="?theme=', $theme['id'] ,'">' .$theme['name'] . '</option>';

echo '
</select>
</form>';
}


Tested and working with latest 1.1 beta :)

Kirby, I used your code but there is a problem. There is a theme chooser, but no button to change after I have choose a theme!

Here is a screenshot.


Kirby

#8
It should choose automatically, try...

adding this before ?>

// This neat function finds and returns info about all of our themes.
function getThemeData()
{
global $db_prefix, $user_info, $scripturl, $settings, $options, $modSettings;

$themes = array();

// Get all of our themes.
$request = db_query("
SELECT value, ID_THEME
FROM {$db_prefix}themes
WHERE variable = 'name'
AND ID_THEME != $settings[theme_id]" . (empty($modSettings['theme_default']) ? '
AND ID_THEME != 1' : '') . "
ORDER BY value", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
$themes[] = array(
'id' => $row['ID_THEME'],
'name' => $row['value'],
);
}
return $themes;
}


and this where you want the select box:

$themes = getThemeData();
// Super duper theme changer slash! :D
if (!empty($themes))
{
echo '
<form action="', $scripturl ,'" name="themeForm">
<select name="theme" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + \'?theme=\' + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 ? 0 : 1);">';

foreach($themes as $theme)
echo '
<option value="', $theme['id'] ,'">' .$theme['name'] . '</option>';

echo '
</select>
<input type="submit" value="Change Themes!" />
</form>';
}


I updated a few things as well.

rolandog


mank

I used Kirbys code on 1.1 beta 2 and it works a treat  ;D

Ohms

This is an excellent hack. I really needed it for my non-techie users to realize there actually were more themes. I did modify one thing, though:
I changed this:global $boarddir;
require ''.$boarddir.'/Themes/themechanger.php';

to
if ($modSettings['theme_allow']){   
    global $boarddir;
    require ''.$boarddir.'/Themes/themechanger.php';
    }


So if I turn off the ability for users to change their theme, the theme chooser is not shown at all.
Thanks a million for this!

nokonium

Quote from: ??? on May 01, 2005, 12:37:35 PM
It should choose automatically, try...

I updated a few things as well.

I've installed it in our 1.1beta2 test site, after the Search & Advanced Search. We have a range of colour variations based on the default theme. To allow anyone using a theme to select a new theme I have copied the indextemplate to each theme directory

It does choose automatically, on the selector on all except the first one in the list. If I use the button, it brings up the Search: in the selected theme. saying "Did you forget to put something to search for?"

If you then click the button, it does the same with the new first on the list. This one is OK when selected via the drop down.



bloc

Probably because the submit button in the theme form interfere with the search form. Did you put the code  inside the <form></form> for the search - or in a new form underneath?

nokonium

I pasted in exactly as above, which includes <form action..........  </form> and I inserted it immediately above // If we're on a certain board, limit it to this board ;).

This is the code of both forms

<form action="', $scripturl, '?action=search2" method="post" style="margin: 0; margin-top: 7px;">
<b>', $txt[182], ': </b><input type="text" name="search" value="" style="width: 175px;" />&nbsp;
<input type="submit" name="submit" value="', $txt[182], '" style="width: 8ex;" />&nbsp;
<a href="', $scripturl, '?action=search;advanced">', $txt['smf298'], '</a>
<input type="hidden" name="advanced" value="0" />';

$themes = getThemeData();
// Super duper theme changer slash! :D
if (!empty($themes))
{
echo '
<form action="', $scripturl ,'" name="themeForm">
<select name="theme" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + \'?theme=\' + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 ? 0 : 1);">';

foreach($themes as $theme)
echo '
<option value="', $theme['id'] ,'">' .$theme['name'] . '</option>';

echo '
</select>
<input type="submit" value="Change Themes!" />
</form>';
}



bloc

#15
Nokonium, you need to close the first form..add a </form> right after the "input type="hidden" name="advanced" value="0" />".


nokonium

Quote from: Bloc on June 19, 2005, 07:14:10 AM
Nokonium, you need to close the first form..add a </form> right after the "input type="hidden" name="advanced" value="0" />".


Thanks Bloc, that has sorted the search problem.

Unfortunately now they are on different lines. Is it possible to keep them on the same line?

I have saved the other code and may try it later, when I feel braver  ;)



bloc

That code had some error, so don't use it - yet. I will fix it later. :)

I don't think they can be on the same line..since forms are like div's ..maybe if you did a style="position: relative; float: right;" on the second form it might help?

nokonium

Quote from: Bloc on June 19, 2005, 07:53:15 AM
That code had some error, so don't use it - yet. I will fix it later. :)

I don't think they can be on the same line..since forms are like div's ..maybe if you did a style="position: relative; float: right;" on the second form it might help?

Thanks for the warning.

If that doesn't work, I'll see if I can put it underneath the Key stats or inside the User info, I'd like to try and keep it in the header.



Ohms

I forgot to mention that I was using Miraenda's code and that I also changed the code that was supposed to go in Sources/Load.php slightly. I changed it so that the current theme the member is using is the one selected in the dropdown menu:]// Quick theme changer
function theme_name(){
// Added $settings to the global definition
  global $settings,$db_prefix,$context,$scripturl;
$resultaa=db_query("
        SELECT * from {$db_prefix}themes WHERE `variable` = 'name' ORDER by `value`", __FILE__, __LINE__);
while($rowaa=mysql_fetch_array($resultaa)){
$theme_rowa=$rowaa['ID_THEME'];
$theme_row_namea=$rowaa['value'];
// Reset $selected to ""
$selected = "";
// Find the theme the member is currently using and set it to be the one selected in the form
if ($settings['theme_id'] == $theme_rowa){
   $selected = "selected";
   }
$context['theme_options']="".$context['theme_options']."<option value=\"$scripturl?theme=$theme_rowa\" $selected>$theme_row_namea</option>";
}
}


bloc

Nice, Ohms. :) Easier to see which theme you are watching, with current auto-selected.

Ohms

#21
I just decided to add the Theme in Profile Mod and discovered that if they use the Quick Theme Changer to pick their theme, it did not get changed in their profile (e.g. the database), so I did some more tweaking with this.

The section in Load.php now looks like this:// Quick theme changer
function theme_name(){
  global $settings,$db_prefix,$context,$scripturl;
  $context['theme_options'] = "";
$resultaa=db_query("
        SELECT * from {$db_prefix}themes WHERE `variable` = 'name' ORDER by `value`", __FILE__, __LINE__);
while($rowaa=mysql_fetch_array($resultaa)){
$theme_rowa=$rowaa['ID_THEME'];
$theme_row_namea=$rowaa['value'];
$selected = "";
if ($settings['theme_id'] == $theme_rowa){
   $selected = "selected";
   }

$blech = $context['user']['id'];
$blech2 = $context['session_id'];
// $context['theme_options']="".$context['theme_options']."<option value=\"$scripturl?theme=$theme_rowa\" $selected>$theme_row_namea</option>";
$context['theme_options']="".$context['theme_options']."<option value=\"$scripturl?action=theme;sa=quickpick;u=$blech;id=$theme_rowa;sesc=$blech2\" $selected>$theme_row_namea</option>";
}
}


In Themes.php, near the top I changed:
$subActions = array(
'admin' => 'ThemeAdmin',
'settings' => 'SetThemeSettings',
'options' => 'SetThemeOptions',
'remove' => 'RemoveTheme',
'pick' => 'PickTheme',
'install' => 'ThemeInstall',
'edit' => 'EditTheme'
);

to:$subActions = array(
'admin' => 'ThemeAdmin',
'settings' => 'SetThemeSettings',
'options' => 'SetThemeOptions',
'remove' => 'RemoveTheme',
'pick' => 'PickTheme',
'quickpick' => 'QuickPick',
'install' => 'ThemeInstall',
'edit' => 'EditTheme'
);


Then I made a copy of the function PickTheme, calling it instead QuickPick and made some changes in the function [just replaced the 'redirectexit('blahblah')' code where you see my comments in two places with a javascript back() function]:
function QuickPick()
{
global $txt, $db_prefix, $sc, $context, $modSettings, $user_info, $ID_MEMBER, $language;

checkSession('get');

loadTemplate('Themes');
loadLanguage('Profile');

$_SESSION['ID_THEME'] = 0;

// Have we made a desicion, or are we just browsing?
if (isset($_GET['id']))
{
// Save for this user.
if (!isset($_REQUEST['u']) || !allowedTo('admin_forum'))
{
updateMemberData($ID_MEMBER, array('ID_THEME' => (int) $_GET['id']));
   // I changed redirectexit to this.
                   ?><script>
                       back()
                   </script><?php
                  
// End of this change. One more.
}
// For everyone.
elseif ($_REQUEST['u'] == '0')
{
updateMemberData(null, array('ID_THEME' => (int) $_GET['id']));

redirectexit('');
}
// Change the default/guest theme.
elseif ($_REQUEST['u'] == '-1')
{
updateSettings(array('theme_guests' => (int) $_GET['id']));

redirectexit('');
}
// Change a specific member's theme.
else
{
updateMemberData((int) $_REQUEST['u'], array('ID_THEME' => (int) $_GET['id']));
                   
// I changed redirectexit to this, too.      
                  
?>
<script>
                       back()
                   </script><?php
                  
// End of my change.
}
}

// Figure out who the member of the minute is, and what theme they've chosen.
if (!isset($_REQUEST['u']) || !allowedTo('admin_forum'))
{
$context['current_member'] = $ID_MEMBER;
$context['current_theme'] = $user_info['theme'];
}
// Everyone can't chose just one.
elseif ($_REQUEST['u'] == '0')
{
$context['current_member'] = 0;
$context['current_theme'] = 0;
}
// Guests and such...
elseif ($_REQUEST['u'] == '-1')
{
$context['current_member'] = -1;
$context['current_theme'] = $modSettings['theme_guests'];
}
// Someones else :P.
else
{
$context['current_member'] = (int) $_REQUEST['u'];

$request db_query("
SELECT ID_THEME
FROM 
{$db_prefix}members
WHERE ID_MEMBER = 
$context[current_member]
LIMIT 1"
__FILE____LINE__);
list ($context['current_theme']) = mysql_fetch_row($request);
mysql_free_result($request);
}
// Get the theme name and descriptions.
$context['available_themes'] = array();
if (!empty($modSettings['knownThemes']))
{
$knownThemes implode("', '"explode(','$modSettings['knownThemes']));

$request db_query("
SELECT ID_THEME, variable, value
FROM 
{$db_prefix}themes
WHERE variable IN ('name', 'theme_url', 'theme_dir', 'images_url')" 
. (empty($modSettings['theme_default']) && !allowedTo('admin_forum') ? "
AND ID_THEME IN ('
$knownThemes')
AND ID_THEME != 1" 
'') . "
AND ID_THEME != 0
LIMIT " 
count(explode(','$modSettings['knownThemes'])) * 4__FILE____LINE__);
while ($row mysql_fetch_assoc($request))
{
if (!isset($context['available_themes'][$row['ID_THEME']]))
$context['available_themes'][$row['ID_THEME']] = array(
'id' => $row['ID_THEME'],
'selected' => $context['current_theme'] == $row['ID_THEME'],
'num_users' => 0
);
$context['available_themes'][$row['ID_THEME']][$row['variable']] = $row['value'];
}
mysql_free_result($request);
}

// Okay, this is a complicated problem: the default theme is 1, but they aren't allowed to access 1!
if (!isset($context['available_themes'][$modSettings['theme_guests']]))
{
$context['available_themes'][0] = array(
'num_users' => 0
);
$guest_theme 0;
}
else
$guest_theme $modSettings['theme_guests'];

$request db_query("
SELECT COUNT(ID_MEMBER) AS theCount, ID_THEME
FROM 
{$db_prefix}members
GROUP BY ID_THEME DESC"
__FILE____LINE__);
while ($row mysql_fetch_assoc($request))
{
// Figure out which theme it is they are REALLY using.
if ($row['ID_THEME'] == && empty($modSettings['theme_default']))
$row['ID_THEME'] = $guest_theme;
elseif (empty($modSettings['theme_allow']))
$row['ID_THEME'] = $guest_theme;

if (isset($context['available_themes'][$row['ID_THEME']]))
$context['available_themes'][$row['ID_THEME']]['num_users'] += $row['theCount'];
else
$context['available_themes'][$guest_theme]['num_users'] += $row['theCount'];
}

foreach ($context['available_themes'] as $ID_THEME => $theme_data)
{
// Don't try to load the forum or board default theme's data... it doesn't have any!
if ($ID_THEME == 0)
continue;

$settings $theme_data;
$settings['theme_id'] = $ID_THEME;

if (file_exists($settings['theme_dir'] . '/languages/Settings.' $user_info['language'] . '.php'))
include($settings['theme_dir'] . '/languages/Settings.' $user_info['language'] . '.php');
elseif (file_exists($settings['theme_dir'] . '/languages/Settings.' $language '.php'))
include($settings['theme_dir'] . '/languages/Settings.' $language '.php');
else
{
$txt['theme_thumbnail_href'] = $settings['images_url'] . '/thumbnail.gif';
$txt['theme_description'] = '';
}

$context['available_themes'][$ID_THEME]['thumbnail_href'] = $txt['theme_thumbnail_href'];
$context['available_themes'][$ID_THEME]['description'] = $txt['theme_description'];
}

// As long as we're not doing the default theme...
if (!isset($_REQUEST['u']) || $_REQUEST['u'] >= 0)
{
if ($guest_theme != 0)
$context['available_themes'][0] = $context['available_themes'][$guest_theme];
$context['available_themes'][0]['id'] = 0;
$context['available_themes'][0]['name'] = $txt['theme_forum_default'];
$context['available_themes'][0]['selected'] = $context['current_theme'] == 0;
$context['available_themes'][0]['description'] = $txt['theme_global_description'];
}

ksort($context['available_themes']);

$context['page_title'] = &$txt['theme_pick'];
$context['sub_template'] = 'pick';
}


The entire function probably didn't need to remain intact, but I figured I would err on the side of security and leave it in. If any PHP gurus out there can tell me what I can leave out, that would be awesome.

Doing it this way, the theme they are using gets updated in the database (e.g. their profile) and then they are redirected back to wherever they were when they changed the theme.

So, now the Theme in Profile Mod works with this as well.

This probably slows this down quite a bit.

LostProphecy

hmmm nice :)

i'll have to remember to try this out when i get home tonight :D
Angelus Ex Quo Nox

LostProphecy

looking at this it's quite massive... has anyone thought of making it a mod??
Angelus Ex Quo Nox

Terroriste

Thank you. You're best coder :)

IamV

I just tried Kirby's theme changer & it is the best I've tried so far!

It should be renamed 'The Ultimate Theme Changer/Selector'

Thank you so much for sharing this with us  ;D

LostProphecy

i'm generating this error all the time from the themechanger thingy...

8: Undefined index: theme_options
File: /home/kodee/public_html/forums/Themes/themechanger.php
Line: 5

can anyone help me in how you define "theme_options"
Angelus Ex Quo Nox

Escobar

#27
Problem:
I have smf 1.05.
I tried this code.
I placed the second part in various places...but it doesn't show up.  :(
Any help?

EDIT (SOLUTION FOUND AFTER TINKERING):
I put it above
// Show the menu up top.  Something like [home] [help] [profile] [logout]...function template_menu()
and it showed up.

Next problem is having the change show up in the users profile...
I can't locate load.php and the other files ohms is talking about...



I chose SMF because you get your questions answered.

DemonicInfluence

Quote from: ashoka1 on September 13, 2005, 05:44:22 PM
Problem:
I have smf 1.05.
I tried this code.
I placed the second part in various places...but it doesn't show up.  :(
Any help?

EDIT (SOLUTION FOUND AFTER TINKERING):
I put it above
// Show the menu up top.  Something like [home] [help] [profile] [logout]...function template_menu()
and it showed up.

Next problem is having the change show up in the users profile...
I can't locate load.php and the other files ohms is talking about...




It is in the Sources folder..

barnjo

So where do I put the code that starts function QuickPick ()?

DemonicInfluence


berserk87

how do i put the theme chooser at the bottom of the page next to the xhtml, and css and myslq buttons and such?

were are they?
smf and php n00b

bloc

In index.template.php..look for <img id="powered-mysql"....etc. In default theme there is 3 <td>'s there.

Xarcell

I'm lost.
-------------------------------------------------------------
Instructions:
------------------------------------------------------------
Then, add in the index.php file:

theme_name();

right after:

loadTheme();

--------------------------------------------------------------

The Index file in the main smf directory right? I can't seem to find "theme_name();". My dropdown is blank.



-Xarcell, using 1.1rc1

bloc

No, find the second ("loadTheme") first and put the first("theme_name") after it...

Xarcell

#35
I already tried adding "theme_name();" before the theme_load but all I got was an error.

<-- Session verification failed. Please try logging out and back in again, and then try again.-->

I did, but it still kept doing the same thing. Now I tried moving the "theme_name();" around a bit and can't egt it to do anything.

BTW, I must be blind, because I only see one "theme_load()" in the file. Thanx for your help though. I got frustrated and had to take a break. Now I'm back on it again, lol...

-Xarcell

Xarcell

#36
Ok, I've tinkered with it a little more and it works now. However, after I select a theme, I have to refresh to get it to work. Or view the theme I picked.

Also, is there anyway to get the thumbnails of the theme to appear?

Thanx again,

EDIT: I thougt it would help to mention this, but I didn't use the global file/code for layout reasons, although the themechanger.php is in place. I used this



echo '<center><form name="jumpurl1" onSubmit="return jumpit()">
                <select size="1" name="jumpurl2">
                      '.$context['theme_options'].'
                </select>
                <input type="button" value="Change it!" onClick="jumpit()"></form></center>
                   <script>
                       function jumpit(){
                          window.location=document.jumpurl1.jumpurl2.value
                          return false
                       }
                   </script>';



I also used Ohms code suggestion for the load.php. theme.php, etc.

-Xarcell

bloc

In fact, my latest version of TinyPortal have a theme-chooser that show thumbnails of the themes... ;)

The code is tailored for TP though, with options to choose which themes should show in the chooser - so its not instantly appliable for "normal" themes/SMF.

DemonicInfluence

Could u show. So that we could try to modify it so it works normally?

Xarcell

Your a good man bloc.

I applied for beta testing TP.

-Xarcell

Az

Can anyone make this work with mambo too?

Xarcell

#41
Is there a better code to use then this:



echo '<center><form name="jumpurl1" onSubmit="return jumpit()">
                <select size="1" name="jumpurl2">
                      '.$context['theme_options'].'
                </select>
                <input type="button" value="Change it!" onClick="jumpit()"></form></center>
                   <script>
                       function jumpit(){
                          window.location=document.jumpurl1.jumpurl2.value
                          return false
                       }
                   </script>';



Without using the global file? It just doesn't load the theme, I have to "refresh" to see what I selected on Firefox. On Internet Explorer, it takes me to the profile > theme selection page.

DemonicInfluence

you have to use quickpick.. You have to edit the themes.php file..

Xarcell

#43
I did...

Exactly where do place the function code in the theme.php file?

Using rc1.

-Xarcell

DemonicInfluence


Xarcell

Sorry for the misunderstanding, but I was talking about the part that started with:



function QuickPick()
{

DemonicInfluence

I still mean after function PickTheme() is over. Then.
you copy it and change the redirect and name.

I can give u my themes.php if u want

Gobo

so exactly which code do I need to use?

cos there are like 4 or 5 chunk of codes posted by different people....so which one is the best and safest with SMF 1.1rc2?

thanks

DemonicInfluence


silverdragonrs

Ok this has gotten confusing.... Anybody mind putting all steps to this in one solid post? The original was a little confusing... and then the "better one" was cool... but it had problems?... and then several updates and edits to one or both.... hmm... this thread has gotten a little scattered... I (and most people i know) are not expert programmers... so one "tutorial" on this addin would be great... :) thanks,
danny
I'd like to quote my idol. Homer Simpson. "Press any key now!... Any Key? Where's the any key?!... Doh!" ---- One day I'll be that good with computers..... ~ danny ~ feel free to IM me about anything!

Vinspire

Quote from: akulion on April 29, 2006, 09:44:27 AM
so exactly which code do I need to use?

cos there are like 4 or 5 chunk of codes posted by different people....so which one is the best and safest with SMF 1.1rc2?

thanks

Same question here & can i have a screenshot of how does it look like ?

DemonicInfluence

Quote from: silverdragonrs on May 17, 2006, 01:52:35 AM
Ok this has gotten confusing.... Anybody mind putting all steps to this in one solid post? The original was a little confusing... and then the "better one" was cool... but it had problems?... and then several updates and edits to one or both.... hmm... this thread has gotten a little scattered... I (and most people i know) are not expert programmers... so one "tutorial" on this addin would be great... :) thanks,
danny

http://www.simplemachines.org/community/index.php?topic=26637.msg351367#msg351367

I have it posted. Should help..


Harro

My apologies for this necroposting :p
But anyone know if this still works for the current release?

Pieces

Quote from: Harro on February 20, 2007, 06:52:44 PM
My apologies for this necroposting :p
But anyone know if this still works for the current release?

I applied this to my forum last week.

Theme picker is working fine, though you have to keep in mind that the first part is missing the session stuff which Ohms describes. I didn't apply that part yet(so the chosen themes are not stored in the user profile yet :()

For the rest it's almost the same for 1.1.2
Alphagamer: Game Discussion Blogs and Forum [nofollow]

Advertisement: