Report#79: Change Style - activate this function - Code provided by Christian_N

This commit is contained in:
Kevin
2008-03-16 13:56:26 +00:00
parent ca743e8809
commit e22397bb64
9 changed files with 77 additions and 65 deletions

View File

@@ -167,6 +167,12 @@ Dieses Portal basiert auf dem phpBB3 Portal a.k.a canverPortal ( www.phpbb3por
<find><![CDATA[// End session management]]></find>
<action type="after-add"><![CDATA[$user->add_lang('mods/lang_portal_acp_logs');]]></action>
</edit>
</open>
<open src="includes/session.php">
<edit>
<find><![CDATA[if (!empty($_GET['style']) && $auth->acl_get('a_styles'))]]></find>
<action type="replace-with"><![CDATA[if (!empty($_GET['style']))]]></action>
</edit>
</open>
<open src="styles/prosilver/template/overall_header.html">
<edit>

View File

@@ -162,15 +162,19 @@ Dieses Portal basiert auf dem phpBB3 Portal a.k.a canverPortal ( www.phpbb3por
<file from="root/styles/prosilver/template/portal/block/*.*" to="styles/prosilver/template/portal/block/*.*" />
<file from="root/styles/prosilver/template/portal/block/donation/*.*" to="styles/prosilver/template/portal/block/donation/*.*" />
</copy>
<open src="includes/session.php">
<edit>
<find><![CDATA[if (!empty($_GET['style']) && $auth->acl_get('a_styles'))]]></find>
<action type="replace-with"><![CDATA[if (!empty($_GET['style']))]]></action>
</edit>
</open>
<open src="styles/prosilver/template/overall_header.html">
<edit>
<find><![CDATA[<!-- IF not $S_IN_PORTAL -->]]></find>
<action type="replace-with"><![CDATA[<!-- IF not $S_IN_PORTAL or not S_DISPLAY_MAINMENU -->]]></action>
</edit>
</open>
<diy-instructions lang="en-gb">No need to run the installer.
Please rember to do the same changes in subsilver2!</diy-instructions>
<diy-instructions lang="de">Die install_portal/install.php muß nicht ausgeführt werden.
Bitte daran denken die Änderungen auch im subsilver2 Style vorzunehmen!</diy-instructions>
<diy-instructions lang="en-gb">Browse to install_portal/install.php and run the installer, after successfull installation delete the installer.</diy-instructions>
<diy-instructions lang="de">install_portal/install.php aufrufen und ausführen, nach erfolgreicher Installation löschen</diy-instructions>
</action-group>
</mod>

View File

@@ -220,6 +220,12 @@ DirectoryIndex portal.php index.php index.html index.htm]]></action>
<find><![CDATA['U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),]]></find>
<action type="before-add"><![CDATA[ 'U_PORTAL' => append_sid("{$phpbb_root_path}portal.$phpEx"),]]></action>
</edit>
</open>
<open src="includes/session.php">
<edit>
<find><![CDATA[if (!empty($_GET['style']) && $auth->acl_get('a_styles'))]]></find>
<action type="replace-with"><![CDATA[if (!empty($_GET['style']))]]></action>
</edit>
</open>
<open src="language/en/acp/common.php">
<edit>

View File

@@ -234,6 +234,12 @@ DirectoryIndex portal.php index.php index.html index.htm]]></action>
<find><![CDATA['U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),]]></find>
<action type="before-add"><![CDATA[ 'U_PORTAL' => append_sid("{$phpbb_root_path}portal.$phpEx"),]]></action>
</edit>
</open>
<open src="includes/session.php">
<edit>
<find><![CDATA[if (!empty($_GET['style']) && $auth->acl_get('a_styles'))]]></find>
<action type="replace-with"><![CDATA[if (!empty($_GET['style']))]]></action>
</edit>
</open>
<open src="language/en/acp/common.php">
<edit>

View File

@@ -192,6 +192,12 @@ Deny from All
<find><![CDATA['U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),]]></find>
<action type="before-add"><![CDATA[ 'U_PORTAL' => append_sid("{$phpbb_root_path}portal.$phpEx"),]]></action>
</edit>
</open>
<open src="includes/session.php">
<edit>
<find><![CDATA[if (!empty($_GET['style']) && $auth->acl_get('a_styles'))]]></find>
<action type="replace-with"><![CDATA[if (!empty($_GET['style']))]]></action>
</edit>
</open>
<open src="styles/prosilver/template/overall_header.html">
<edit>

View File

@@ -54,7 +54,7 @@ class acp_portal
'portal_birthdays_ahead' => array('lang' => 'PORTAL_BIRTHDAYS_AHEAD' , 'validate' => 'int' , 'type' => 'text:3:3' , 'explain' => true),
'portal_random_member' => array('lang' => 'PORTAL_RANDOM_MEMBER' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_whois_online' => array('lang' => 'PORTAL_WHOIS_ONLINE' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
//'portal_change_style' => array('lang' => 'PORTAL_CHANGE_STYLE' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_change_style' => array('lang' => 'PORTAL_CHANGE_STYLE' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_main_menu' => array('lang' => 'PORTAL_MAIN_MENU' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_user_menu' => array('lang' => 'PORTAL_USER_MENU' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_friends' => array('lang' => 'PORTAL_FRIENDS' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),

View File

@@ -20,57 +20,44 @@ if (!defined('IN_PORTAL'))
exit;
}
$lang = request_var('lang', '', false, true);
$style = request_var('style', 0);
if (file_exists($phpbb_root_path . 'language/' . $lang . "/common.$phpEx"))
{
$this->lang_name = $lang;
$this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/';
$sql = 'SELECT style_id, style_name, style_copyright
FROM ' . STYLES_TABLE . '
WHERE style_active = 1
ORDER BY style_name ASC';
$cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000);
$this->set_cookie('lang', $lang, $cookie_expire);
unset($cookie_expire);
}
$result = $db->sql_query($sql);
$style_select = '<option selected="selected" disabled="disabled">' . $user->lang['STYLE_CHOOSE'] . '</option>';
while ($row = $db->sql_fetchrow($result))
{
$selected = ( $style == $row['style_id'] ) ? ' selected="selected"' : '';
$style_value = append_sid("{$phpbb_root_path}portal.$phpEx", 'style=' . $row['style_id']);
$style_select .= '<option value="' . $style_value . '"' . $selected . '>&nbsp; ' . $row['style_name'] . ' &nbsp;</option>';
}
$db->sql_freeresult($result);
$requested_style = request_var('style', 0, false, true);
// style info
$sql2 = 'SELECT style_id, style_name, style_copyright
FROM ' . STYLES_TABLE . '
WHERE style_active = 1
AND style_id = ' . $style;
if ($requested_style && (!$config['override_user_style'] || $auth->acl_get('a_styles')))
{
$style = $requested_style;
$result = $db->sql_query($sql2);
$row = $db->sql_fetchrow($result);
$cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000);
$this->set_cookie('style', $style, $cookie_expire);
unset($cookie_expire);
}
$template->assign_vars(array(
'S_STYLE_ACTION'=> append_sid("{$phpbb_root_path}portal.$phpEx"),
'STYLE_NAME' => $row['style_name'],
'STYLE_COPY' => $row['style_copyright'],
'STYLE_SELECT' => $style_select,
));
$all = false;
$default = '';
$sql_where = (!$all) ? 'WHERE style_active = 1 ' : '';
$sql = 'SELECT style_id, style_name, style_copyright
FROM ' . STYLES_TABLE . "
$sql_where
ORDER BY style_name";
$result = $db->sql_query($sql);
$style_options = '';
while ($row = $db->sql_fetchrow($result))
{
$selected = ($row['style_id'] == $default) ? ' selected="selected"' : '';
$style_options .= '<option value="' . $row['style_id'] . '"' . $selected . '>' . $row['style_name'] . '</option>';
$template->assign_block_vars('styles', array(
'STYLE_ID' => $row['style_id'],
'STYLE_NAME' => $row['style_name'],
'STYLE_COPY' => $row['style_copyright'],
'U_STYLE' => append_sid("{$phpbb_root_path}portal.$phpEx", 'style=' . $row['style_id']),
));
}
$db->sql_freeresult($result);
$db->sql_freeresult($result);
// Assign specific vars
$template->assign_vars(array(
'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['style']),
'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['style']),
'S_DISPLAY_CHANGE_STYLE' => true,
));

View File

@@ -13,14 +13,12 @@
}
//-->
</script>
<form method="get" name="jumpbox" action="portal.php" onsubmit="if(document.jumpbox.f.value == -1){return false;}">
<select name="demo" onchange="jumpMenu('self',this,0)" class="input">
<option selected="selected" disabled="disabled">{L_STYLE_CHOOSE}</option>
<!-- BEGIN styles-->
<option value="{styles.U_STYLE}">{styles.STYLE_NAME}</option>
<!-- END styles -->
</select>
<form method="get" action="{S_STYLE_ACTION}" onsubmit="if(document.jumpbox.f.value == -1){return false;}">
<fieldset class="style_change">
<select name="demo" id="demo" onchange="jumpMenu('parent',this,0)">
{STYLE_SELECT}
</select>
</fieldset>
</form>
<br />

View File

@@ -14,14 +14,13 @@
}
//-->
</script>
<form method="get" name="jumpbox" action="portal.php" onsubmit="if(document.jumpbox.f.value == -1){return false;}">
<select name="demo" onchange="jumpMenu('self',this,0)" class="input">
<option selected="selected" disabled="disabled">{L_STYLE_CHOOSE}</option>
<!-- BEGIN styles-->
<option value="{styles.U_STYLE}">{styles.STYLE_NAME}</option>
<!-- END styles -->
</select>
</form>
<form method="get" action="{S_STYLE_ACTION}" onsubmit="if(document.jumpbox.f.value == -1){return false;}">
<fieldset class="style_change">
<select name="demo" id="demo" onchange="jumpMenu('parent',this,0)">
{STYLE_SELECT}
</select>
</fieldset>
</form>
</td>
</tr>
</table>