Posted on: 09/21/02 09:48am
By: etegration
Posted on: 09/21/02 10:47am
By: Dirk
The code from this story[*2] should work.
bye, Dirk
Posted on: 09/23/02 04:36pm
By: Anonymous (Anonymous)
Posted on: 03/11/04 09:45am
By: Anonymous (Nic)
Posted on: 03/11/04 10:33am
By: Turias
function phpblock_themetester() { global $PHP_SELF, $HTTP_POST_VARS, $HTTP_GET_VARS, $_TABLES, $_USER, $_CONF; $thememode = $HTTP_GET_VARS['thememode']; if ($thememode == 'save') { $usetheme = $HTTP_GET_VARS['usetheme']; } else { $usetheme = $HTTP_POST_VARS['usetheme']; } if ($_USER['uid'] > 1 AND $thememode == 'save' AND !empty($usetheme)) { DB_query("UPDATE {$_TABLES['users']} SET theme='$usetheme' WHERE uid = {$_USER['uid']}"); echo COM_refresh($PHP_SELF); } $themes = COM_getThemes(); if (count($themes) == 1) { return 'Sorry, there is only one theme installed on this system'; } $retval .= 'Test out available themes by selecting one below:<br>'; $retval .= '<form action="' . $PHP_SELF . '" method="POST"><select name="usetheme" onChange="this.form.submit()">'; $retval .= '<option value="">--</option>'; for ($i = 1; $i <= count($themes); $i++) { $retval .= '<option value="' . current($themes); if ($usetheme == current($themes)) { $retval .= ' selected="SELECTED"'; } $retval .= '">' . current($themes) . '</option>'; next($themes); } if ($_USER['uid'] > 1 AND !empty($usetheme)) { $args = 'thememode=save&usetheme=' . $usetheme; for ($i = 1; $i <= count($HTTP_GET_VARS); $i++) { if (key($HTTP_GET_VARS) <> 'thememode' AND key($HTTP_GET_VARS) <> 'usetheme') { $args .= '&' . key($HTTP_GET_VARS) . '=' . urlencode(current($HTTP_GET_VARS)); } next($HTTP_GET_VARS); } $retval .= '</select></form></center><a href="' . $PHP_SELF . '?' . $args . '">Use Permanently</a>'; } else { $retval .= '</select></form></center></a>'; } return $retval; }
Posted on: 03/11/04 10:42am
By: Anonymous (Nic)
Posted on: 03/11/04 02:51pm
By: Dirk
Posted on: 05/03/04 08:53pm
By: daynah
Posted on: 08/23/06 03:17am
By: young_dfler
function phpblock_themetester() { global $PHP_SELF, $HTTP_POST_VARS, $HTTP_GET_VARS, $_TABLES, $_USER, $_CONF; $thememode = $HTTP_GET_VARS['thememode']; if ($thememode == 'save') { $usetheme = $HTTP_GET_VARS['usetheme']; } else { $usetheme = $HTTP_POST_VARS['usetheme']; } if ($_USER['uid'] > 1 AND $thememode == 'save' AND !empty($usetheme)) { DB_query("UPDATE {$_TABLES['users']} SET theme='$usetheme' WHERE uid = {$_USER['uid']}"); echo COM_refresh($PHP_SELF); } $themes = COM_getThemes(); if (count($themes) == 1) { return 'Sorry, there is only one theme installed on this system'; } $retval .= 'Test out available themes by selecting one below:<br>'; $retval .= '<form action="' . $PHP_SELF . '" method="POST"><select name="usetheme" onChange="this.form.submit()">'; $retval .= '<option value="">--</option>'; for ($i = 1; $i <= count($themes); $i++) { $retval .= '<option value="' . current($themes); if ($usetheme == current($themes)) { $retval .= ' selected="SELECTED"'; } $retval .= '">' . current($themes) . '</option>'; next($themes); } if ($_USER['uid'] > 1 AND !empty($usetheme)) { $args = 'thememode=save&usetheme=' . $usetheme; for ($i = 1; $i <= count($HTTP_GET_VARS); $i++) { if (key($HTTP_GET_VARS) <> 'thememode' AND key($HTTP_GET_VARS) <> 'usetheme') { $args .= '&' . key($HTTP_GET_VARS) . '=' . urlencode(current($HTTP_GET_VARS)); } next($HTTP_GET_VARS); } $retval .= '</select></form></center><a href="' . $PHP_SELF . '?' . $args . '">Use Permanently</a>'; } else { $retval .= '</select></form></center></a>'; } return $retval; }[/QUOTE]
Posted on: 08/23/06 01:50pm
By: Dirk
Posted on: 08/23/06 02:08pm
By: Anonymous (young_dfler)
Posted on: 08/23/06 02:21pm
By: Dirk
Posted on: 08/23/06 02:29pm
By: Anonymous (young_dfler)
Posted on: 08/23/06 03:10pm
By: Dirk
Posted on: 08/23/06 03:47pm
By: Anonymous (young_dfler)
Posted on: 08/23/06 11:20pm
By: young_dfler