TinyPortal

Development => Support => Topic started by: WebMasterZ on November 06, 2005, 01:22:08 AM

Title: Theme Selector redirection
Post by: WebMasterZ on November 06, 2005, 01:22:08 AM
Hi Bloc
great portal running .75 and its sweet  :)

Just a quick question
If I change theme using the theme selector here no problems (?action=forum;theme=)

If a registered user on my board changes theme it takes them to there profile (?action=profile;sa=theme)

Title: Re: Theme Selector redirection
Post by: snork13 on November 06, 2005, 03:14:27 AM
I get the same thing for what it is worth!


-snork
Title: Re: Theme Selector redirection
Post by: bloc on November 06, 2005, 04:36:35 PM
Yes..working on it. Basically if a user changes theme, it changes permanent, but for a guest it doesn't. And the function to change permanent is usually done in the profile.
Title: Re: Theme Selector redirection
Post by: WebMasterZ on November 07, 2005, 11:43:04 AM
Thats fine Bloc

How about if for registered users it changed it for the current session only and the button said something like Preview with a bubble to advise registered users to change in there profile to make it permanent ?
Title: Re: Theme Selector redirection
Post by: feline on November 07, 2005, 03:59:37 PM
Hello,

i have created a 'inside php' article for change themes temporary .. (while session id is valid). It works for all users ...
global $context, $settings, $options, $txt, $scripturl, $modSettings, $user_info;

$request = db_query("SELECT ID_THEME, value
  FROM smf_themes WHERE variable = 'images_url' order by ID_THEME",  __FILE__, __LINE__);

$themes = array();
while ($row = mysql_fetch_assoc($request))
  $themes[$row['ID_THEME']] = $row['value'];

mysql_free_result($request);

$action = '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST">';
$i=0;

echo '<br><div class="catbg2"><center>Hier kannst du dein Design auswÃÆ'Ã,¤hlen, indem du auf das Vorschaubild klickst</center></div><br>
<table border="0" width="99%" align="center"><tr>';

foreach ($themes as $id => $theme) {
  if ($i == 4) {
    echo '</tr><tr height="30"><td colspan="4"></td></tr><tr>';
    $i = 0;
  }
  echo $action . '<td width="30"></td><td><input type="hidden"
   name="theme" value="'. $id .'">
  <input type="image" src="' . $theme . '/thumbnail.gif"
   onclick="submit()"></form></td><td width="30">';
  $i ++;
}

echo '</tr></table><br><div class="catbg2"></div>';


Test it  ;)

Fel
Title: Re: Theme Selector redirection
Post by: bloc on November 07, 2005, 04:07:56 PM
Very nice. :)