* adjust for add tid for session.

This commit is contained in:
王怡栋
2021-08-30 10:56:52 +08:00
parent 1f068e6601
commit aa5a8bdd33
6 changed files with 147 additions and 8 deletions
+18 -3
View File
@@ -160,9 +160,12 @@ class baseHelper
public static function processOnlyBodyParam($link, $onlyBody = false)
{
global $config;
if(!$onlyBody and !self::inOnlyBodyMode()) return $link;
$onlybodyString = strpos($link, '?') === false ? "?onlybody=yes" : "&onlybody=yes";
return $link . $onlybodyString;
$sign = strpos($link, '?') === false ? "?" : "&";
$appendString = '';
if($onlyBody or self::inOnlyBodyMode()) $appendString = $sign . "onlybody=yes";
if(self::isWithTID()) $appendString .= empty($appendString) ? "{$sign}tid={$_GET['tid']}" : "&tid={$_GET['tid']}";
return $link . $appendString;
}
/**
@@ -177,6 +180,18 @@ class baseHelper
return (isset($_GET['onlybody']) and $_GET['onlybody'] == 'yes');
}
/**
* Is with tid.
*
* @static
* @access public
* @return bool
*/
public static function isWithTID()
{
return (!empty($config->tabSession) and isset($_GET['tid']));
}
/**
* 使用helper::import()来引入文件,不要直接使用include或者require.
* Using helper::import() to import a file, instead of include or require.