ผู้เขียน หัวข้อ: Redirect on Login , Logout  (อ่าน 2115 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ smf

  • [color=green][i]"ถ้าคุณไม่สามารถอธิบายอย่างง่ายๆ ให้คนอื่นเข้าใจได้แล้วล่ะก็ แสดงว่าคุณยังเข้าใจมันไม่ดีพอ"[/i][/color]
  • Administrator
  • Hero Member
  • *****
  • กระทู้: 1,368
  • พอยท์: 5
    • ดูรายละเอียด
    • pordoo.com
    • อีเมล์
Redirect on Login , Logout
« เมื่อ: 7 ตุลาคม 2015, 23:36:29 »
Mod Name:Redirect on Login and/or Logout mod.
http://custom.simplemachines.org/mods/index.php?mod=1443





File Edits

./Sources/LogInOut.php

Find:
โค๊ด: [Select]
// Set the login_url if it's not already set (but careful not to send us to an attachment).
if (empty($_SESSION['login_url']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0)
$_SESSION['login_url'] = $_SESSION['old_url'];
Add After:
โค๊ด: [Select]
// PJL Redirect on login/logout Mod.
if (!empty($modSettings['logon_redirect_enable']) && !empty($modSettings['logon_redirect_url']))
{
if (empty($_SESSION['login_url']))
$_SESSION['login_url'] = $modSettings['logon_redirect_url'];
}
// End Mod.

Find:
โค๊ด: [Select]
// Off to the merry board index we go!
if ($redirect){
Add Before:
โค๊ด: [Select]
// PJL Redirect on login/logout Mod.
if (!empty($modSettings['logout_redirect_enable']) && !empty($modSettings['logout_redirect_url']))
{
if (empty($_SESSION['logout_url']))
$_SESSION['logout_url'] = $modSettings['logout_redirect_url'];
}
// End Mod.



./Sources/ManageSettings.php

Find:
โค๊ด: [Select]
$config_vars = array(
// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!
Add After:
โค๊ด: [Select]
// PJL Redirect on login/logout Mod
array('check', 'logon_redirect_enable',
&$txt['logon_redirect_enable']),
array('text', 'logon_redirect_url'),
array('check', 'logout_redirect_enable',
&$txt['logout_redirect_enable']),
array('text', 'logout_redirect_url'),
   



./Themes/default/languages/Modifications.english.php

Find:
โค๊ด: [Select]
?>Add Before:
โค๊ด: [Select]
// PJL : Start of Redirect on login/logout Mod.
$txt['logon_redirect_enable'] = 'Enable Logon Redirect<br /><span class="smalltext">(This redirect users to given URL when they login)</span>';
$txt['logon_redirect_url'] = 'Enter Login URL';
$txt['logout_redirect_enable'] = 'Enable Logout Redirect?<br /><span class="smalltext">(This redirect users to given URL when they logout)</span>';
$txt['logout_redirect_url'] = 'Enter Logout URL';
// End Mod.



./Themes/default/languages/Modifications.english-utf8.php

Find:
โค๊ด: [Select]
?>Add Before:
โค๊ด: [Select]
// PJL : Start of Redirect on login/logout Mod.
$txt['logon_redirect_enable'] = 'Enable Logon Redirect?<br /><span class="smalltext">(This redirect users to given URL when they logout)</span>';
$txt['logon_redirect_url'] = 'Enter Login URL';
$txt['logout_redirect_enable'] = 'Enable Logout Redirect?<br /><span class="smalltext">(This redirect users to given URL when they logout)</span>';
$txt['logout_redirect_url'] = 'Enter Login URL';
// End Mod.



./Themes/default/languages/Help.english.php

Find:
โค๊ด: [Select]
?>Add Before:
โค๊ด: [Select]
// PJL : Start of Redirect on login/logout Mod.
$helptxt['logon_redirect_url'] = ' Enter the url you wish to direct the user to when they login<br /> e.g. if you want to sent them to the front page of your site enter http://yoursite.com/<br /> To send them to the forum enter action=forum etc<br />If you don�t provide the full url path (i.e. http://yoursite.xxx/home.html) SMF assumes it�s an SMF function and appends http://yoursite.xxx/index.php? before the URL address.<br />For example if you specify board=1.0 this automatically becomes http://yoursite.xxx/index.php?board=1.0</br />';
$helptxt['logout_redirect_url'] = ' Enter the url you wish to direct the user to when they logout<br /> e.g. if you want to sent them to the front page of your site enter http://yoursite.com/<br /> To send them to the forum enter action=forum etc<br />If you don�t provide the full url path (i.e. http://yoursite.xxx/home.html) SMF assumes it�s an SMF function and appends http://yoursite.xxx/index.php? before the URL address.<br />For example if you specify board=1.0 this automatically becomes http://yoursite.xxx/index.php?board=1.0</br />';
// End Mod.