My MOD is outdated. Use another MOD. Otherwise, you'll have to open
source code and study it in order to find your problem.
I don't code anymore for phpBB. I don't like the new guys leading
the project.
My MOD is outdated. Use another MOD. Otherwise, you'll have to open
source code and study it in order to find your problem.
I don't code anymore for phpBB. I don't like the new guys leading
the project.
Code: Select all
#
#-----[ OPEN ]------------------------------------------------
#
common.php
#
#-----[ FIND ]------------------------------------------------
#
$gen_simple_header = FALSE;
#
#-----[ AFTER, ADD ]------------------------------------------
#
//---------start mod: Switch Style From URL-------------------------
$ssu_get = false;
//---------fin mod: Switch Style From URL---------------------------
#
#-----[ OPEN ]------------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------------
#
define('POST_GROUPS_URL', 'g');
#
#-----[ AFTER, ADD ]------------------------------------------
#
//---------start mod: Switch Style From URL-------------------------
define('POST_STYLE_URL', 'style');
//---------fin mod: Switch Style From URL---------------------------
#
#-----[ OPEN ]------------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------------
#
//
// Set up style
//
if ( !$board_config['override_user_style'] )
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
//---------start mod: Switch Style From URL-------------------------
global $HTTP_GET_VARS;
if ( !defined('IN_ADMIN') && isset($HTTP_GET_VARS[POST_STYLE_URL]) && ($GLOBALS['ssu_get'] = intval($HTTP_GET_VARS[POST_STYLE_URL])) && ($theme = setup_style($GLOBALS['ssu_get'])) )
{
return;
}
$GLOBALS['ssu_get'] = false;
//---------fin mod: Switch Style From URL---------------------------
#
#-----[ OPEN ]------------------------------------------------
#
includes/sessions.php
#
#-----[ FIND ]------------------------------------------------
#
if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//---------start mod: Switch Style From URL-------------------------
// nb - ptirhiik: when style is on a form (usercp_*), it is always recovered from $HTTP_POST_VARS, never from $HTTP_GET_VARS: we don't need so to check it
if ( !defined('IN_ADMIN') && isset($GLOBALS['ssu_get']) && intval($GLOBALS['ssu_get']) && !preg_match('#' . POST_STYLE_URL . '=#i', $url) )
{
$url .= (strpos($url, '?') !== false ? ($non_html_amp ? '&' : '&') : '?') . POST_STYLE_URL . '=' . intval($GLOBALS['ssu_get']);
}
//---------fin mod: Switch Style From URL---------------------------
###################################################
#
# The following is specific to topic calendar 1.2.2
#
#
#-----[ OPEN ]------------------------------------------------
#
includes/class_calendar_backport.php
#
#-----[ FIND ]------------------------------------------------
#
if ( $add_sid && empty($parms['sid']) )
{
$parms['sid'] = substr($this->SID, strlen('sid='));
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//---------start mod: Switch Style From URL-------------------------
if ( $add_sid && !defined('IN_ADMIN') && isset($GLOBALS['ssu_get']) && intval($GLOBALS['ssu_get']) && !isset($parms[POST_STYLE_URL]) )
{
$parms[POST_STYLE_URL] = intval($GLOBALS['ssu_get']);
}
//---------fin mod: Switch Style From URL---------------------------
###################################################
#
# The following reflects my tests: selecting a style sends back to index
#
#
#-----[ OPEN ]------------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------------
#
$template->pparse('overall_header');
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//---------start mod: Switch Style From URL-------------------------
$sql = 'SELECT themes_id, style_name
FROM ' . THEMES_TABLE . '
ORDER BY style_name';
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query themes table', '', __LINE__, __FILE__, $sql);
}
while ( ($row = $db->sql_fetchrow($result)) )
{
$template->assign_block_vars('ssu_style', array(
'ID' => intval($row['themes_id']),
'NAME' => htmlspecialchars($row['style_name']),
'SELECTED' => isset($GLOBALS['ssu_get']) && (intval($GLOBALS['ssu_get']) == intval($row['themes_id'])) ? ' selected="selected"' : '',
));
}
$template->assign_vars(array(
'L_SSU_STYLE' => $lang['Board_style'],
'L_SSU_GO' => $lang['Go'],
'L_SSU_DEFAULT' => $lang['color_default'], // erm... well, not a really a color, but who cares ? ;)
'SSU_VARNAME' => POST_STYLE_URL,
'U_SSU_BACK' => preg_replace('#((&|&)?' . POST_STYLE_URL . '=[0-9]*)#i', '', append_sid('index')),
));
$db->sql_freeresult($result);
//---------fin mod: Switch Style From URL---------------------------
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------------
#
# at end of the file
#
</table>
<br />
#
#-----[ AFTER, ADD ]------------------------------------------
#
<form name="ssu_style" method="get" action="{U_SSU_BACK}"><div class="genmed" style="text-align: right">{L_SSU_STYLE}: <select name="{SSU_VARNAME}">
<option value="0">{L_SSU_DEFAULT}</option>
<!-- BEGIN ssu_style -->
<option value="{ssu_style.ID}"{ssu_style.SELECTED}>{ssu_style.NAME}</option>
<!-- END ssu_style -->
</select> <input type="submit" class="liteoption" value="{L_SSU_GO}" /></div></form>
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
Code: Select all
<form name="ssu_style" method="get" action="{U_SSU_BACK}"><div class="genmed" style="text-align: right">{L_SSU_STYLE}: <select name="{SSU_VARNAME}">
<option value="0">{L_SSU_DEFAULT}</option>
<!-- BEGIN ssu_style -->
<option value="{ssu_style.ID}"{ssu_style.SELECTED}>{ssu_style.NAME}</option>
<!-- END ssu_style -->
</select> <input type="submit" class="liteoption" value="{L_SSU_GO}" /></div></form>
Code: Select all
// nb - ptirhiik: when style is on a form (usercp_*), it is always recovered from $HTTP_POST_VARS, never from $HTTP_GET_VARS: we don't need so to check it