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> <find><![CDATA[// End session management]]></find>
<action type="after-add"><![CDATA[$user->add_lang('mods/lang_portal_acp_logs');]]></action> <action type="after-add"><![CDATA[$user->add_lang('mods/lang_portal_acp_logs');]]></action>
</edit> </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>
<open src="styles/prosilver/template/overall_header.html"> <open src="styles/prosilver/template/overall_header.html">
<edit> <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/*.*" to="styles/prosilver/template/portal/block/*.*" />
<file from="root/styles/prosilver/template/portal/block/donation/*.*" to="styles/prosilver/template/portal/block/donation/*.*" /> <file from="root/styles/prosilver/template/portal/block/donation/*.*" to="styles/prosilver/template/portal/block/donation/*.*" />
</copy> </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"> <open src="styles/prosilver/template/overall_header.html">
<edit> <edit>
<find><![CDATA[<!-- IF not $S_IN_PORTAL -->]]></find> <find><![CDATA[<!-- IF not $S_IN_PORTAL -->]]></find>
<action type="replace-with"><![CDATA[<!-- IF not $S_IN_PORTAL or not S_DISPLAY_MAINMENU -->]]></action> <action type="replace-with"><![CDATA[<!-- IF not $S_IN_PORTAL or not S_DISPLAY_MAINMENU -->]]></action>
</edit> </edit>
</open> </open>
<diy-instructions lang="en-gb">No need to run the installer. <diy-instructions lang="en-gb">Browse to install_portal/install.php and run the installer, after successfull installation delete the installer.</diy-instructions>
Please rember to do the same changes in subsilver2!</diy-instructions> <diy-instructions lang="de">install_portal/install.php aufrufen und ausführen, nach erfolgreicher Installation löschen</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>
</action-group> </action-group>
</mod> </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> <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> <action type="before-add"><![CDATA[ 'U_PORTAL' => append_sid("{$phpbb_root_path}portal.$phpEx"),]]></action>
</edit> </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>
<open src="language/en/acp/common.php"> <open src="language/en/acp/common.php">
<edit> <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> <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> <action type="before-add"><![CDATA[ 'U_PORTAL' => append_sid("{$phpbb_root_path}portal.$phpEx"),]]></action>
</edit> </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>
<open src="language/en/acp/common.php"> <open src="language/en/acp/common.php">
<edit> <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> <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> <action type="before-add"><![CDATA[ 'U_PORTAL' => append_sid("{$phpbb_root_path}portal.$phpEx"),]]></action>
</edit> </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>
<open src="styles/prosilver/template/overall_header.html"> <open src="styles/prosilver/template/overall_header.html">
<edit> <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_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_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_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_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_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), '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; exit;
} }
$lang = request_var('lang', '', false, true); $style = request_var('style', 0);
$sql = 'SELECT style_id, style_name, style_copyright
FROM ' . STYLES_TABLE . '
WHERE style_active = 1
ORDER BY style_name ASC';
if (file_exists($phpbb_root_path . 'language/' . $lang . "/common.$phpEx")) $result = $db->sql_query($sql);
{ $style_select = '<option selected="selected" disabled="disabled">' . $user->lang['STYLE_CHOOSE'] . '</option>';
$this->lang_name = $lang; while ($row = $db->sql_fetchrow($result))
$this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/'; {
$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);
// style info
$sql2 = 'SELECT style_id, style_name, style_copyright
FROM ' . STYLES_TABLE . '
WHERE style_active = 1
AND style_id = ' . $style;
$cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000); $result = $db->sql_query($sql2);
$this->set_cookie('lang', $lang, $cookie_expire); $row = $db->sql_fetchrow($result);
unset($cookie_expire);
}
$requested_style = request_var('style', 0, false, true); $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,
));
if ($requested_style && (!$config['override_user_style'] || $auth->acl_get('a_styles'))) $db->sql_freeresult($result);
{
$style = $requested_style;
$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);
}
$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);
// Assign specific vars // Assign specific vars
$template->assign_vars(array( $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, 'S_DISPLAY_CHANGE_STYLE' => true,
)); ));

View File

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

View File

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