Update of /cvsroot/phpslash/phpslash-ft/class
In directory sc8-pr-cvs1:/tmp/cvs-serv2583/phpslash-ft/class
Modified Files:
functions.inc slashAuthCR.class Author.class
Log Message:
skinblock fixes
Index: functions.inc
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/functions.inc,v
retrieving revision 1.125
retrieving revision 1.126
diff -C2 -d -r1.125 -r1.126
*** functions.inc 6 Feb 2003 17:16:44 -0000 1.125
--- functions.inc 6 Feb 2003 20:28:19 -0000 1.126
***************
*** 1106,1116 ****
if (file_exists( $_PSL['localedir'] . "/" . trim($lang_ary[$i]) . ".php3")) {
$lang = $_PSL['localedir'] . "/" . trim($lang_ary[$i]) . ".php3";
! $done = true;
! } elseif (file_exists( $_PSL['localedir'] . "/" . $base_lang[0]. ".php3")) {
! // no dialect match - so try base language ( "en" for "en-US")
$lang = $_PSL['localedir'] . "/" . $base_lang[0] . ".php3";
$done = true;
! }
! $i++;
}
}
--- 1106,1116 ----
if (file_exists( $_PSL['localedir'] . "/" . trim($lang_ary[$i]) . ".php3")) {
$lang = $_PSL['localedir'] . "/" . trim($lang_ary[$i]) . ".php3";
! $done = true;
! } elseif (file_exists( $_PSL['localedir'] . "/" . $base_lang[0]. ".php3")) {
! // no dialect match - so try base language ( "en" for "en-US")
$lang = $_PSL['localedir'] . "/" . $base_lang[0] . ".php3";
$done = true;
! }
! $i++;
}
}
***************
*** 1223,1247 ****
if($new_skin) {
! // remove skin name from templatedir path
! $templatedir = substr($templatedir, 0, strrpos($templatedir, "/") );
// check if skin templatedir exists
if(@is_dir($templatedir . "/" . basename($new_skin))) {
if( $method == "cookie") {
setcookie("skin","$new_skin",time()+15552000, "/", ereg_replace("www.", "", "$SERVER_NAME"));
! if(strstr($GLOBALS['QUERY_STRING'], "&skin=")) {
$query_string = substr_replace ($GLOBALS['QUERY_STRING'], '', strpos($GLOBALS['QUERY_STRING'], "&skin="));
! } elseif(strstr($GLOBALS['QUERY_STRING'], "skin=")) {
! $query_string = substr_replace ($GLOBALS['QUERY_STRING'], '', strpos($GLOBALS['QUERY_STRING'], "skin="));
! } else {
$query_string = '';
! }
! $GLOBALS['QUERY_STRING'] = $query_string;
! if($query_string != '') {
$query_string = "?" . $query_string;
! }
! header("Location: ".$_PSL[phpself].$query_string);
! }
} elseif (@is_dir($templatedir . "/" . basename($_PSL['defaultskin']))) {
$new_skin = $_PSL['defaultskin'];
}
--- 1223,1255 ----
if($new_skin) {
!
! if($method == "userpref") {
! // remove skin name from templatedir path
! $templatedir = substr($templatedir, 0, strrpos($templatedir, "/") );
! }
!
// check if skin templatedir exists
if(@is_dir($templatedir . "/" . basename($new_skin))) {
if( $method == "cookie") {
setcookie("skin","$new_skin",time()+15552000, "/", ereg_replace("www.", "", "$SERVER_NAME"));
! if(strstr($GLOBALS['QUERY_STRING'], "&skin=")) {
$query_string = substr_replace ($GLOBALS['QUERY_STRING'], '', strpos($GLOBALS['QUERY_STRING'], "&skin="));
! } elseif(strstr($GLOBALS['QUERY_STRING'], "skin=")) {
! $query_string = substr_replace ($GLOBALS['QUERY_STRING'], '', strpos($GLOBALS['QUERY_STRING'], "skin="));
! } else {
$query_string = '';
! }
! $GLOBALS['QUERY_STRING'] = $query_string;
! if($query_string != '') {
$query_string = "?" . $query_string;
! }
! header("Location: ".$_PSL[phpself].$query_string);
! }
} elseif (@is_dir($templatedir . "/" . basename($_PSL['defaultskin']))) {
$new_skin = $_PSL['defaultskin'];
+ // delete the cookie to reset to default skin
+ if (!empty($HTTP_COOKIE_VARS['skin'])) {
+ setcookie("skin","", time()+15552000, "/", ereg_replace("www.", "", "$SERVER_NAME"));
+ }
}
***************
*** 1251,1255 ****
} else {
// dir not found, delete this cookie and set to default
! setcookie("skin","", "", "/", ereg_replace("www.", "", "$SERVER_NAME"));
$new_skin = $_PSL['defaultskin'];
}
--- 1259,1263 ----
} else {
// dir not found, delete this cookie and set to default
! setcookie("skin","", time()+15552000, "/", ereg_replace("www.", "", "$SERVER_NAME"));
$new_skin = $_PSL['defaultskin'];
}
Index: slashAuthCR.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/slashAuthCR.class,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** slashAuthCR.class 5 Feb 2003 17:51:36 -0000 1.37
--- slashAuthCR.class 6 Feb 2003 20:28:20 -0000 1.38
***************
*** 81,85 ****
if ((isset($this->auth['preferences']['skin'])) &&
($this->psl['defaultskin'] != $this->auth['preferences']['skin'])){
! $_PSL['templatedir'] = setSkinTpl($this->auth['preferences']['skin']);
}
}
--- 81,85 ----
if ((isset($this->auth['preferences']['skin'])) &&
($this->psl['defaultskin'] != $this->auth['preferences']['skin'])){
! $_PSL['templatedir'] = setSkinTpl($this->auth['preferences']['skin'], "userpref");
}
}
***************
*** 171,175 ****
if ((isset($this->auth['preferences']['skin'])) &&
($this->psl['defaultskin'] != $this->auth['preferences']['skin'])){
! $this->psl['templatedir'] = setSkinTpl($this->auth['preferences']['skin']);
}
--- 171,175 ----
if ((isset($this->auth['preferences']['skin'])) &&
($this->psl['defaultskin'] != $this->auth['preferences']['skin'])){
! $this->psl['templatedir'] = setSkinTpl($this->auth['preferences']['skin'], "userpref");
}
***************
*** 336,341 ****
// use skin preference
! if(isset($this->auth['preferences']['skin'])) {
! $this->psl['templatedir'] = setSkinTpl($this->auth['preferences']['skin']);
}
}
--- 336,343 ----
// use skin preference
! // if(isset($this->auth['preferences']['skin'])) {
! if ((isset($this->auth['preferences']['skin'])) &&
! ($this->psl['defaultskin'] != $this->auth['preferences']['skin'])){
! $this->psl['templatedir'] = setSkinTpl($this->auth['preferences']['skin'],"userpref");
}
}
Index: Author.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Author.class,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** Author.class 14 Jan 2003 18:20:43 -0000 1.38
--- Author.class 6 Feb 2003 20:28:20 -0000 1.39
***************
*** 334,338 ****
$author_options_ary['_PSL']['skin'] = $ary['skin'];
$this->auth->auth['preferences']['skin'] = $ary['skin'];
! $this->psl['templatedir'] = setSkinTpl($ary['skin']);
}
--- 334,338 ----
$author_options_ary['_PSL']['skin'] = $ary['skin'];
$this->auth->auth['preferences']['skin'] = $ary['skin'];
! $this->psl['templatedir'] = setSkinTpl($ary['skin'], "userpref");
}
|