phpslash-commit Mailing List for phpSlash (Page 62)
Brought to you by:
joestewart,
nhruby
This list is closed, nobody may subscribe to it.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(59) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(52) |
Feb
(77) |
Mar
(118) |
Apr
(76) |
May
(106) |
Jun
(145) |
Jul
(9) |
Aug
(15) |
Sep
(78) |
Oct
(83) |
Nov
(105) |
Dec
(51) |
2003 |
Jan
(105) |
Feb
(100) |
Mar
(111) |
Apr
(149) |
May
(95) |
Jun
(56) |
Jul
(8) |
Aug
(2) |
Sep
|
Oct
(22) |
Nov
(117) |
Dec
(6) |
2004 |
Jan
(1) |
Feb
|
Mar
(3) |
Apr
(25) |
May
|
Jun
(11) |
Jul
(26) |
Aug
(85) |
Sep
(119) |
Oct
(312) |
Nov
(271) |
Dec
(5) |
2005 |
Jan
(6) |
Feb
|
Mar
|
Apr
(12) |
May
(7) |
Jun
(8) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Matthew L. <sym...@us...> - 2003-02-11 14:03:45
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv17082 Modified Files: functions.inc Log Message: psl_strftime($fmt,$time) now defaults to current time in the second variable Index: functions.inc =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/functions.inc,v retrieving revision 1.128 retrieving revision 1.129 diff -C2 -d -r1.128 -r1.129 *** functions.inc 10 Feb 2003 18:55:18 -0000 1.128 --- functions.inc 11 Feb 2003 14:03:42 -0000 1.129 *************** *** 1035,1039 **** * @return formatted string */ ! function psl_strftime($fmt,$t) { GLOBAL $_PSL; // loadLibrary("tz"); --- 1035,1039 ---- * @return formatted string */ ! function psl_strftime($fmt,$t=false) { GLOBAL $_PSL; // loadLibrary("tz"); |
From: Matthew L. <sym...@us...> - 2003-02-11 14:03:05
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv16803 Modified Files: tz_env.class Log Message: tz_env::strftime($format,$time) now defaults to current time in the second variable Index: tz_env.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/tz_env.class,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tz_env.class 3 Sep 2002 15:06:08 -0000 1.1 --- tz_env.class 11 Feb 2003 14:03:02 -0000 1.2 *************** *** 89,93 **** */ function strftime($fmt,$t=false) { ! return $this->generic('strftime',$fmt,$t); } --- 89,96 ---- */ function strftime($fmt,$t=false) { ! if ($t === false) { ! $t = time(); ! } ! return $this->generic('strftime',$fmt,$t); } |
From: Matthew L. <sym...@us...> - 2003-02-11 14:02:01
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv16243 Modified Files: tz_functions.inc Log Message: cosmetic debugging code changes Index: tz_functions.inc =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/tz_functions.inc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tz_functions.inc 11 Dec 2002 19:39:56 -0000 1.2 --- tz_functions.inc 11 Feb 2003 14:01:57 -0000 1.3 *************** *** 61,70 **** function tz_generic() { $fn = "tz_generic"; ! // echo "$fn: begin\n"; GLOBAL $_TZ; $argv = func_get_args(); $method = array_shift($argv); ! //echo "method: $method\n"; ! //echo "object class: ", get_class($_TZ['obj']), "\n"; return call_user_func_array(array(&$_TZ['obj'],$method),$argv); } --- 61,70 ---- function tz_generic() { $fn = "tz_generic"; ! // debug($fn,'begin'); GLOBAL $_TZ; $argv = func_get_args(); $method = array_shift($argv); ! // debug('method',$method); ! // debug('object class', get_class($_TZ['obj'])); return call_user_func_array(array(&$_TZ['obj'],$method),$argv); } *************** *** 122,126 **** */ function tz_strftime($fmt,$t=false) { ! return tz_generic('strftime',$fmt,$t); } --- 122,127 ---- */ function tz_strftime($fmt,$t=false) { ! // debug(sprintf("tz_strftime(%s,%s)",$fmt, $t? $t: 'FALSE'),'begin'); ! return tz_generic('strftime',$fmt,$t); } |
From: Matthew L. <sym...@us...> - 2003-02-10 18:58:37
|
Update of /cvsroot/phpslash/phpslash-ft In directory sc8-pr-cvs1:/tmp/cvs-serv4548 Modified Files: CHANGES Log Message: changes to lib.resources.php and pslError to more gently handle misconfiguration of class files. Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.685 retrieving revision 1.686 diff -C2 -d -r1.685 -r1.686 *** CHANGES 8 Feb 2003 11:19:33 -0000 1.685 --- CHANGES 10 Feb 2003 18:58:32 -0000 1.686 *************** *** 13,20 **** --- 13,29 ---- 9 - Removal of something (kill -9 :) + 2003-February-10 2:00PM EST Matthew Leingang <sym...@us...> + [W] - pslError made even more robust. + 2003-February-08 11:30AM GMT Peter Cruickshank <kr...@us...> [B] - slashTemplate.class Override filename() function to deal with Windows absolute filepaths (ie test 2nd char is a ':') + + 2003-February-07 2:30PM EST Matthew Leingang <sym...@us...> + [B] - lib.resources.php functions.inc + Fixed the way strings are recognized as class/library names, URNs, + or file names. Also changes pslError to succeed in the absence of + a template class. 2003-February-06 2:30PM CST Joe Stewart <joe...@us...> |
From: Matthew L. <sym...@us...> - 2003-02-10 18:55:23
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv3071 Modified Files: functions.inc Log Message: Changed the pslClassExists to class_exists in pslError. This makes it even more bulletproof. Index: functions.inc =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/functions.inc,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** functions.inc 7 Feb 2003 17:29:35 -0000 1.127 --- functions.inc 10 Feb 2003 18:55:18 -0000 1.128 *************** *** 8,12 **** ****************************************************************************/ function getError ($msg) { ! if (pslClassExists(pslGetClass('slashTemplate'))) { return getMessage( $msg, "error"); } --- 8,12 ---- ****************************************************************************/ function getError ($msg) { ! if (class_exists(pslGetClass('slashTemplate'))) { return getMessage( $msg, "error"); } |
From: Peter C. <kr...@us...> - 2003-02-08 11:19:37
|
Update of /cvsroot/phpslash/phpslash-ft In directory sc8-pr-cvs1:/tmp/cvs-serv1524 Modified Files: CHANGES Log Message: [B] Override filename() function to deal with Windows absolute filepaths (ie test 2nd char is a ':') Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.684 retrieving revision 1.685 diff -C2 -d -r1.684 -r1.685 *** CHANGES 6 Feb 2003 20:28:18 -0000 1.684 --- CHANGES 8 Feb 2003 11:19:33 -0000 1.685 *************** *** 13,16 **** --- 13,21 ---- 9 - Removal of something (kill -9 :) + 2003-February-08 11:30AM GMT Peter Cruickshank <kr...@us...> + [B] - slashTemplate.class + Override filename() function to deal with Windows absolute filepaths + (ie test 2nd char is a ':') + 2003-February-06 2:30PM CST Joe Stewart <joe...@us...> [B] - config-dist.php3, config.php3, slashAuthCR.class, Author.class, |
From: Peter C. <kr...@us...> - 2003-02-08 11:19:37
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv1524/class Modified Files: slashTemplate.class Log Message: [B] Override filename() function to deal with Windows absolute filepaths (ie test 2nd char is a ':') Index: slashTemplate.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/slashTemplate.class,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** slashTemplate.class 7 Jan 2003 19:31:13 -0000 1.2 --- slashTemplate.class 8 Feb 2003 11:19:33 -0000 1.3 *************** *** 115,118 **** --- 115,134 ---- } // end of function set_root + + // As per template.inc, with added test for windows absolute path + function filename($filename) { + if ($this->debug & 4) { + echo "<p><b>filename:</b> filename = $filename</p>\n"; + } + if (substr($filename, 0, 1) != "/" && substr($filename, 1, 1) != ":") { // Test for Windows absolute path - could use preg_match(/[A-Z]:/i,...) test? + $filename = $this->root."/".$filename; + } + + if (!file_exists($filename)) { + $this->halt("filename: file $filename does not exist."); + } + return $filename; + } + } // end of slashTemplate class |
From: Matthew L. <sym...@us...> - 2003-02-07 17:29:40
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv10958 Modified Files: functions.inc Log Message: Changed the behavior of getError() to succeed even when templates are not available. Index: functions.inc =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/functions.inc,v retrieving revision 1.126 retrieving revision 1.127 diff -C2 -d -r1.126 -r1.127 *** functions.inc 6 Feb 2003 20:28:19 -0000 1.126 --- functions.inc 7 Feb 2003 17:29:35 -0000 1.127 *************** *** 8,13 **** ****************************************************************************/ function getError ($msg) { ! ! return getMessage( $msg, "error"); } --- 8,17 ---- ****************************************************************************/ function getError ($msg) { ! if (pslClassExists(pslGetClass('slashTemplate'))) { ! return getMessage( $msg, "error"); ! } ! else { ! return sprintf('<div id="error">ERROR: %s</div>',$msg); ! } } *************** *** 17,22 **** $tpl -> template to use ( "$tpl + ".tpl") ****************************************************************************/ - - function getMessage($msg, $tpl="") { --- 21,24 ---- *************** *** 24,45 **** $template = "message.tpl"; /* Templates */ ! $templ = pslNew('slashTemplate'); if( $tpl == "") { $templ->set_file( 'template', $template); ! } elseif ( $templ->set_file('template' , basename($tpl) .".tpl" )) { ! } else { $templ->set_file( 'template', $template); } ! $templ->set_var(array( ! 'ERROR' => pslgetText($msg) ! )); ! $msg = $templ->parse('OUT','template'); ! ! return $msg; } --- 26,50 ---- $template = "message.tpl"; + $templateClass = 'slashTemplate'; /* Templates */ ! $templ = pslNew($templateClass); if( $tpl == "") { $templ->set_file( 'template', $template); ! } ! elseif ( $templ->set_file('template' , basename($tpl) .".tpl" )) { ! } ! else { $templ->set_file( 'template', $template); } ! $templ->set_var(array( ! 'ERROR' => pslgetText($msg) ! )); ! $msg = $templ->parse('OUT','template'); ! ! return $msg; } *************** *** 51,55 **** function pslError($msg) { ! echo getMessage( $msg, "error"); } --- 56,60 ---- function pslError($msg) { ! echo getError( $msg); } |
From: Matthew L. <sym...@us...> - 2003-02-07 17:28:28
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv9282 Modified Files: lib.resources.php Log Message: Fixed the way strings are recognized as class/library names, URNs, or file names. Formerly only strings which named openable files were allowed. This hid errors when AddClassRequirement("foo","foo.class") was called and foo.class did not exist. Index: lib.resources.php =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/lib.resources.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** lib.resources.php 22 Jan 2003 19:12:32 -0000 1.4 --- lib.resources.php 7 Feb 2003 17:28:21 -0000 1.5 *************** *** 97,100 **** --- 97,114 ---- /** + * Determine if $class is registered + * + * Use this if you want to check if pslNew() will succeed before you + * call it. + * + * @param string class + * @return bool success + **/ + function pslClassExists($class) { + return is_valid_urn(classURN($class)); + } + + + /** * Load the files necessary to guarantee successful instantiation of $class * *************** *** 182,195 **** return add_resource_requirement($reqClass); } ! elseif ($FILE = @fopen($reqClass,'r')) { ! fclose($FILE); ! // not a required class, but a required file ! return add_resource_requirement($urn,$reqClass); } else { ! $reqUrn = classUrn($reqClass); ! return add_resource_requirement($urn,$reqUrn); } } --- 196,208 ---- return add_resource_requirement($reqClass); } ! elseif (is_class_name($reqClass)) { ! $reqUrn = classUrn($reqClass); ! return add_resource_requirement($urn,$reqUrn); } else { ! // last chance: $reqClass is a file that must be loaded. ! return add_resource_requirement($urn,$reqClass); } } *************** *** 214,227 **** return add_resource_requirement($urn,$reqLib); } ! elseif ($FILE = @fopen($reqLib,'r')) { ! // not a required class, but a required file ! fclose($FILE); ! return add_resource_requirement($urn,$reqLib); } else { ! $reqUrn = libUrn($reqLib); ! return add_resource_requirement($urn,$reqUrn); } } --- 227,242 ---- return add_resource_requirement($urn,$reqLib); } ! // since we made up the notion of library, it's not technically ! // confined to any form. However, to be reasonable we'll give it the ! // same form as class names. ! elseif (is_class_name($reqLib)) { ! $reqUrn = libUrn($reqLib); ! return add_resource_requirement($urn,$reqUrn); } else { ! // last chance: $reqLib is a file that must be loaded. ! return add_resource_requirement($urn,$reqLib); } } *************** *** 357,365 **** * Parse $urn into NID and NSS * ! * URNs look like "urn:<NID>:<NSS>". <NID> (Namespace Identifier) can ! * have letters, numbers, or hyphens, but can't start with a hyphen. ! * <NSS> (Namespace Specific String) can have letters, numbers, any of ! * the punctuation marks "()+,-.:=@;$_!*'", or any other character ! * encoded by a hex byte "%xx". * * @link http://www.ietf.org/rfc/rfc2141.txt --- 372,380 ---- * Parse $urn into NID and NSS * ! * URNs look like "urn:<NID>:<NSS>". <NID> (Namespace ! * Identifier) can have letters, numbers, or hyphens, but can't start ! * with a hyphen. <NSS> (Namespace Specific String) can have ! * letters, numbers, any of the punctuation marks "()+,-.:=@;$_!*'", or ! * any other character encoded by a hex byte "%xx". * * @link http://www.ietf.org/rfc/rfc2141.txt *************** *** 394,397 **** --- 409,428 ---- /** + * Check if $string can be the name of a class + * + * AFAIK, a class name is constricted to the same form as a variable + * name; it can consist of letters (including high-bit accented + * letters), numbers, and underscores, with the exception that the first + * letter can't be a number. + * + * @access private + * @param string prospective class name + * @return bool success + **/ + function is_class_name($string) { + return preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/',$string); + } + + /** * URN/RDF low-level functions * *************** *** 408,412 **** */ function is_valid_urn($urn) { ! return $GLOBALS['_PSL']['resources'][$urn] ? true : false; } --- 439,447 ---- */ function is_valid_urn($urn) { ! $fc = "is_valid_urn($urn)"; ! // debug($fc,'begin'); ! $ans = $GLOBALS['_PSL']['resources'][$urn] ? true : false; ! // debug("$fc: return",$ans ? 'TRUE' : 'FALSE' ); ! return $ans; } *************** *** 463,465 **** } ! ?> --- 498,500 ---- } ! ?> \ No newline at end of file |
From: Joe S. <joe...@us...> - 2003-02-06 20:28:54
|
Update of /cvsroot/phpslash/phpslash-ft In directory sc8-pr-cvs1:/tmp/cvs-serv2583/phpslash-ft Modified Files: CHANGES Log Message: skinblock fixes Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.683 retrieving revision 1.684 diff -C2 -d -r1.683 -r1.684 *** CHANGES 6 Feb 2003 17:16:40 -0000 1.683 --- CHANGES 6 Feb 2003 20:28:18 -0000 1.684 *************** *** 13,16 **** --- 13,23 ---- 9 - Removal of something (kill -9 :) + 2003-February-06 2:30PM CST Joe Stewart <joe...@us...> + [B] - config-dist.php3, config.php3, slashAuthCR.class, Author.class, + functions.inc - setSkinTpl should work correctly for skins blocks and + setting user preferences. Setting ?skin to a nonexistent skin will clear + the skin cookie. Setting the GET variable "nocookie" in addition to + "skin"will set the skin for that pageview only. + 2003-February-06 11:00AM CST Joe Stewart <joe...@us...> [B] - Block_render_login.class, Block_render_query.class, |
From: Joe S. <joe...@us...> - 2003-02-06 20:28:26
|
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"); } |
From: Joe S. <joe...@us...> - 2003-02-06 20:28:26
|
Update of /cvsroot/phpslash/phpslash-ft/public_html In directory sc8-pr-cvs1:/tmp/cvs-serv2583/phpslash-ft/public_html Modified Files: config-dist.php3 config.php3 Log Message: skinblock fixes Index: config-dist.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/config-dist.php3,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** config-dist.php3 5 Feb 2003 22:00:38 -0000 1.33 --- config-dist.php3 6 Feb 2003 20:28:20 -0000 1.34 *************** *** 160,166 **** // comment out this block to disable setting theme in url if (!empty($HTTP_GET_VARS['skin'])) { ! $_PSL['templatedir'] = setSkinTpl($HTTP_GET_VARS['skin'], "cookie"); } else { ! $_PSL['templatedir'] = setSkinTpl("", "cookie"); } --- 160,170 ---- // comment out this block to disable setting theme in url if (!empty($HTTP_GET_VARS['skin'])) { ! if (empty($HTTP_GET_VARS['nocookie'])) { ! $_PSL['templatedir'] = setSkinTpl($HTTP_GET_VARS['skin'], "cookie"); ! } else { ! $_PSL['templatedir'] = setSkinTpl($HTTP_GET_VARS['skin'], ""); ! } } else { ! $_PSL['templatedir'] = setSkinTpl("", ""); } Index: config.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/config.php3,v retrieving revision 1.180 retrieving revision 1.181 diff -C2 -d -r1.180 -r1.181 *** config.php3 5 Feb 2003 22:00:36 -0000 1.180 --- config.php3 6 Feb 2003 20:28:20 -0000 1.181 *************** *** 355,361 **** // comment out this block to disable setting theme in url if (!empty($HTTP_GET_VARS['skin'])) { ! $_PSL['templatedir'] = setSkinTpl($HTTP_GET_VARS['skin'], "cookie"); } else { ! $_PSL['templatedir'] = setSkinTpl("", "cookie"); } --- 355,365 ---- // comment out this block to disable setting theme in url if (!empty($HTTP_GET_VARS['skin'])) { ! if (empty($HTTP_GET_VARS['nocookie'])) { ! $_PSL['templatedir'] = setSkinTpl($HTTP_GET_VARS['skin'], "cookie"); ! } else { ! $_PSL['templatedir'] = setSkinTpl($HTTP_GET_VARS['skin'], ""); ! } } else { ! $_PSL['templatedir'] = setSkinTpl("", ""); } |
From: Joe S. <joe...@us...> - 2003-02-06 17:17:55
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv30157/phpslash-ft/class Modified Files: Block_render_skin.class Log Message: standardized the alternate template logic to use template::set_file Index: Block_render_skin.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_skin.class,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Block_render_skin.class 20 Dec 2002 22:17:29 -0000 1.10 --- Block_render_skin.class 6 Feb 2003 17:17:46 -0000 1.11 *************** *** 37,41 **** $db = pslNew("SlashDB"); ! $default_tpl = "skinsblock.tpl"; $options = $block_info["source_url"]; --- 37,41 ---- $db = pslNew("SlashDB"); ! $default_template = "skinsblock.tpl"; $options = $block_info["source_url"]; *************** *** 53,66 **** $templatedir = substr( $this->psl['templatedir'], 0, strrpos($this->psl['templatedir'], "/") ); - // $tpl = ""; // disable template option - if( empty($tpl) ) { - $tpl = $default_tpl; - } elseif ( file_exists($templatedir . "/" . basename($tpl) . ".tpl") ) { - $tpl = basename($tpl) . ".tpl"; - } else { - debug ( "Block_render_skin:Template file doesn't exist, using default instead", $tpl); - $tpl = $default_tpl; - } - if( !empty($GLOBALS['QUERY_STRING'])) { $QUERY_STRING = $GLOBALS['QUERY_STRING']. $this->psl['amp']; --- 53,56 ---- *************** *** 71,78 **** $template = pslNew("slashTemplate",$templatedir . "/" . $skin); $template->debug = 0; ! $template->set_file(array( ! 'block' => $tpl ! )); ! $template->set_block ("block", "each_skin", "skin_block"); $template->set_var (array ( 'QUERYSTRING' => $QUERY_STRING, --- 61,73 ---- $template = pslNew("slashTemplate",$templatedir . "/" . $skin); $template->debug = 0; ! ! if( $tpl == '') { ! $template->set_file( 'template', $default_template); ! } elseif ( $template->set_file('template' , basename($tpl) . ".tpl" )) { ! } else { ! $template->set_file( 'template', $default_template); ! } ! ! $template->set_block ("template", "each_skin", "skin_block"); $template->set_var (array ( 'QUERYSTRING' => $QUERY_STRING, *************** *** 90,102 **** ( $eachfile != "CVS") ) { ! $template->set_var(array( 'SKIN' => $eachfile )); $template->parse("skin_block","each_skin",true); ! } } ! $output = $template->parse('OUT',"block"); unset($db); return $output; --- 85,97 ---- ( $eachfile != "CVS") ) { ! $template->set_var(array( 'SKIN' => $eachfile )); $template->parse("skin_block","each_skin",true); ! } } ! $output = $template->parse('OUT',"template"); unset($db); return $output; |
From: Joe S. <joe...@us...> - 2003-02-06 17:17:15
|
Update of /cvsroot/phpslash/phpslash-ft In directory sc8-pr-cvs1:/tmp/cvs-serv29457/phpslash-ft Modified Files: CHANGES Log Message: standardized the alternate template logic to use template::set_file Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.682 retrieving revision 1.683 diff -C2 -d -r1.682 -r1.683 *** CHANGES 5 Feb 2003 21:58:37 -0000 1.682 --- CHANGES 6 Feb 2003 17:16:40 -0000 1.683 *************** *** 13,16 **** --- 13,21 ---- 9 - Removal of something (kill -9 :) + 2003-February-06 11:00AM CST Joe Stewart <joe...@us...> + [B] - Block_render_login.class, Block_render_query.class, + Block_render_quote.class, Block_render_skin.class, function.inc - + standardized the alternate template logic to use template::set_file. + 2003-February-05 3:30PM CST Joe Stewart <joe...@us...> [B] - Block.class, config-dist.php3,config.php3 - moved block_render class |
From: Joe S. <joe...@us...> - 2003-02-06 17:16:50
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv29457/phpslash-ft/class Modified Files: Block_render_login.class Block_render_query.class Block_render_quote.class functions.inc Log Message: standardized the alternate template logic to use template::set_file Index: Block_render_login.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_login.class,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Block_render_login.class 20 Dec 2002 22:17:29 -0000 1.7 --- Block_render_login.class 6 Feb 2003 17:16:42 -0000 1.8 *************** *** 38,42 **** } ! $default_tpl = "loginblock.tpl"; $options = $block_info["source_url"]; --- 38,42 ---- } ! $default_template = "loginblock.tpl"; $options = $block_info["source_url"]; *************** *** 44,62 **** parse_str( $options); ! // $tpl = ""; // disable template option ! if( empty($tpl) ) { ! $tpl = $default_tpl; ! } elseif ( file_exists($this->psl['templatedir'] . "/" . basename($tpl) . ".tpl") ) { ! $tpl = basename($tpl) . ".tpl"; } else { ! debug ( "Block_render_section:Template file doesn't exist, using default instead", $tpl); ! $tpl = $default_tpl; ! } ! ! $template = pslNew("slashTemplate",$this->psl['templatedir']); $template->debug = 0; - $template->set_file(array( - 'block' => "$tpl" - )); $template->set_var(array( --- 44,57 ---- parse_str( $options); ! $template = pslNew("slashTemplate"); ! ! if( $tpl == '') { ! $template->set_file( 'template', $default_template); ! } elseif ( $template->set_file('template' , basename($tpl) . ".tpl" )) { } else { ! $template->set_file( 'template', $default_template); ! } ! $template->debug = 0; $template->set_var(array( *************** *** 69,75 **** if($this->perm->have_perm('user')) { ! $output = "<a href=\"".$this->psl['rooturl']."/login.php3?logout=yes\">". pslgetText('Logout') ." ". $this->auth->auth['uname']."</a>"; } elseif ($form) { ! $output = $template->parse('OUT',"block"); } else { $output = "<a href=\"".$this->psl['rooturl']."/login.php3?login=yes\">".pslgetText('Login')."</a>"; --- 64,70 ---- if($this->perm->have_perm('user')) { ! $output = "<a href=\"".$this->psl['rooturl']."/login.php3?logout=yes\">". pslgetText('Logout') ." ". $this->auth->auth['uname']."</a>"; } elseif ($form) { ! $output = $template->parse('OUT',"template"); } else { $output = "<a href=\"".$this->psl['rooturl']."/login.php3?login=yes\">".pslgetText('Login')."</a>"; Index: Block_render_query.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_query.class,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Block_render_query.class 20 Dec 2002 22:17:29 -0000 1.12 --- Block_render_query.class 6 Feb 2003 17:16:42 -0000 1.13 *************** *** 46,50 **** $site_homesection = $this->psl['site_homesection']; ! $default_tpl = 'queryblock.tpl'; $options_ary = split( '&',$block_info['source_url'] ); --- 46,50 ---- $site_homesection = $this->psl['site_homesection']; ! $default_template = 'queryblock.tpl'; $options_ary = split( '&',$block_info['source_url'] ); *************** *** 54,74 **** } - $ary['tpl'] = ''; // disable template option - if( empty($ary['tpl']) ) { - $tpl = $default_tpl; - } elseif ( file_exists($this->psl[templatedir] . "/" . basename($ary['tpl']) . ".tpl") ) { - # should be secure as path directives are discarded and extension added - $tpl = basename($ary['tpl']) . ".tpl"; - } else { - debug ( "Block_render_query:Template file doesn't exist, using default instead", $tpl); - $tpl = $default_tpl; - } - $template = pslNew("slashTemplate",$this->psl['templatedir']); $template->debug = 0; ! $template->set_file(array( ! 'block' => $tpl ! )); ! $template->set_block ('block', 'each_query', 'query_block'); $stories_ary = $stories->extractStories( $ary); --- 54,68 ---- } $template = pslNew("slashTemplate",$this->psl['templatedir']); $template->debug = 0; ! ! if( $tpl == '') { ! $template->set_file( 'template', $default_template); ! } elseif ( $template->set_file('template' , basename($tpl) . ".tpl" )) { ! } else { ! $template->set_file( 'template', $default_template); ! } ! ! $template->set_block ('template', 'each_query', 'query_block'); $stories_ary = $stories->extractStories( $ary); *************** *** 123,127 **** )); unset($stories); ! return $template->parse('OUT','block'); } --- 117,121 ---- )); unset($stories); ! return $template->parse('OUT','template'); } Index: Block_render_quote.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_quote.class,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Block_render_quote.class 20 Dec 2002 22:17:29 -0000 1.8 --- Block_render_quote.class 6 Feb 2003 17:16:44 -0000 1.9 *************** *** 23,27 **** // nh - This should be an object property in a skel class... ! $default_tpl = 'quoteblock.tpl'; $options = $block_info['source_url']; --- 23,27 ---- // nh - This should be an object property in a skel class... ! $default_template = 'quoteblock.tpl'; $options = $block_info['source_url']; *************** *** 29,50 **** parse_str($options, $ary); # parse_str($options); ! $ary['tpl'] = ''; // disable template option ! ! if (empty($ary['tpl'])) { ! $tpl = $default_tpl; ! } elseif (file_exists($this->psl['templatedir'] . '/' . basename($ary['tpl']) . '.tpl')) { ! // should be secure as path directives are discarded and extension added ! $tpl = basename($ary['tpl']) . '.tpl'; } else { ! debug('Block_render_quote::Template file does not exist, using default instead', $tpl); ! $tpl = $default_tpl; } - - $template = pslNew("slashTemplate",$this->psl['templatedir']); - $template->debug = 0; - $template->set_file(array( - 'block' => $tpl - )); $db = pslNew("slashDB"); --- 29,42 ---- parse_str($options, $ary); # parse_str($options); + + $template = pslNew("slashTemplate"); + $template->debug = 0; ! if( $tpl == '') { ! $template->set_file( 'template', $default_template); ! } elseif ( $template->set_file('template' , basename($tpl) . ".tpl" )) { } else { ! $template->set_file( 'template', $default_template); } $db = pslNew("slashDB"); *************** *** 70,74 **** unset($db); ! return $template->parse('OUT','block'); } --- 62,66 ---- unset($db); ! return $template->parse('OUT','template'); } Index: functions.inc =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/functions.inc,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** functions.inc 22 Jan 2003 19:12:31 -0000 1.124 --- functions.inc 6 Feb 2003 17:16:44 -0000 1.125 *************** *** 520,539 **** /* Templates */ ! if( empty($tpl) ) { ! $tpl = $default_template; ! } elseif ( file_exists($_PSL['templatedir'] . "/" . basename($tpl) . ".tpl") ) { ! $tpl = basename($tpl) . ".tpl"; ! } else { ! debug ( "getHeader:Template file doesn't exist, using default instead", $tpl); ! $tpl = $default_template; ! } ! ! $templ = pslNew("slashTemplate",$_PSL['templatedir']); $templ->debug = 0; ! $templ->set_file(array( ! 'header' => $tpl ! )); ! $templ->set_block ("header", "each_metatag", "metatag_block"); if ( is_array($metaobject)) { --- 520,533 ---- /* Templates */ ! $templ = pslNew("slashTemplate"); $templ->debug = 0; ! if( $tpl == '') { ! $templ->set_file( 'header', $default_template); ! } elseif ( $templ->set_file('header' , basename($tpl) . ".tpl" )) { ! } else { ! $templ->set_file( 'header', $default_template); ! } ! $templ->set_block ("header", "each_metatag", "metatag_block"); if ( is_array($metaobject)) { *************** *** 550,556 **** $templ->set_var (array ( 'METANAME' => $key, ! 'METADESCRIPTION' => $value ! )); ! $templ->parse ("metatag_block", "each_metatag", true); } } else { --- 544,550 ---- $templ->set_var (array ( 'METANAME' => $key, ! 'METADESCRIPTION' => $value ! )); ! $templ->parse ("metatag_block", "each_metatag", true); } } else { *************** *** 636,659 **** $default_template = "slashFoot.tpl"; - if( empty($tpl) ) { - $tpl = $default_template; - } elseif ( file_exists($_PSL['templatedir'] . "/" . basename($tpl) . ".tpl") ) { - $tpl = basename($tpl) . ".tpl"; - } else { - debug ( "getFooter:Template file doesn't exist, using default instead", - $tpl); - $tpl = $default_template; - } - - $templ = pslNew("slashTemplate",$_PSL['templatedir']); $templ->debug = 0; ! $templ->set_file(array( ! 'footer' => $tpl ! )); ! ! // TODO: Remove this? The logging_mod is dead ! // include("./logging_mod/logit.inc"); $templ->set_var(array( --- 630,642 ---- $default_template = "slashFoot.tpl"; $templ = pslNew("slashTemplate",$_PSL['templatedir']); $templ->debug = 0; ! if( $tpl == '') { ! $templ->set_file( 'footer', $default_template); ! } elseif ( $templ->set_file('footer' , basename($tpl) . ".tpl" )) { ! } else { ! $templ->set_file( 'footer', $default_template); ! } $templ->set_var(array( *************** *** 1520,1524 **** * @param object tpl_object - template object * @param string template - template variable used in set_file ! * @param array options_ary - prviously stored options * * @return tpl_object --- 1503,1507 ---- * @param object tpl_object - template object * @param string template - template variable used in set_file ! * @param array options_ary - previously stored options * * @return tpl_object |
From: Joe S. <joe...@us...> - 2003-02-06 17:16:50
|
Update of /cvsroot/phpslash/phpslash-ft/class/locale In directory sc8-pr-cvs1:/tmp/cvs-serv29457/phpslash-ft/class/locale Modified Files: en.php3 Log Message: standardized the alternate template logic to use template::set_file Index: en.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/locale/en.php3,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** en.php3 23 Jan 2003 02:48:02 -0000 1.14 --- en.php3 6 Feb 2003 17:16:45 -0000 1.15 *************** *** 405,411 **** --- 405,445 ---- // Block_render_quote.class // Block_render_rss.class + "A block that displays the headlines from another site, generated from their RDF file" => + "A block that displays the headlines from another site, generated from their RDF file", + + "Block_render_rss.class:: Parse error reading [%s]" => + "Block_render_rss.class:: Parse error reading [%s]", + + "Block_render_rss.class:: Missing protocol declaration [%s]" => + "Block_render_rss.class:: Missing protocol declaration [%s]", + + "Block_render_rss.class:: No hostname in [%s]" => + "Block_render_rss.class:: No hostname in [%s]", + + "Block_render_rss.class:: No http:// or ftp:// in [%s]" => + "Block_render_rss.class:: No http:// or ftp:// in [%s]", + + // Block_render_section.class // Block_render_topic.class // Block_render_url.class + "A block that displays the HTML returned from the source URL" => + "A block that displays the HTML returned from the source URL", + + "Block_render_url.class:: Parse error reading [%s]" => + "Block_render_url.class:: Parse error reading [%s]", + + "Block_render_url.class:: Missing protocol declaration [%s]" => + "Block_render_url.class:: Missing protocol declaration [%s]", + + "Block_render_url.class:: No hostname in [%s]" => + "Block_render_url.class:: No hostname in [%s]", + + "Block_render_url.class:: No http:// or ftp:// in [%s]" => + "Block_render_url.class:: No http:// or ftp:// in [%s]", + + "Block_render_url.class: %s contained no data." => + "Block_render_url.class: %s contained no data.", + // Comment.class "Nested" => |
From: Joe S. <joe...@us...> - 2003-02-05 22:00:44
|
Update of /cvsroot/phpslash/phpslash-ft/public_html In directory sc8-pr-cvs1:/tmp/cvs-serv5609/phpslash-ft/public_html Modified Files: config.php3 config-dist.php3 Log Message: block_render jit registration Index: config.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/config.php3,v retrieving revision 1.179 retrieving revision 1.180 diff -C2 -d -r1.179 -r1.180 *** config.php3 30 Jan 2003 16:22:36 -0000 1.179 --- config.php3 5 Feb 2003 22:00:36 -0000 1.180 *************** *** 60,64 **** } ! $_PSL['version'] = '0.7RC2'; /**** START DEBUGGING - Comment or delete this for production! ****/ --- 60,64 ---- } ! $_PSL['version'] = '0.7RC3'; /**** START DEBUGGING - Comment or delete this for production! ****/ *************** *** 406,436 **** AddClassRequirement("block_i",$_PSL['classdir'] . "/Block_i.class"); AddClassRequirement("block_render_i",$_PSL['classdir'] . "/Block_render_i.class"); - AddClassRequirement("block_render_cal","block_render_i"); - AddClassRequirement("block_render_cal",$_PSL['classdir'] . "/Block_render_cal.class"); - AddClassRequirement("block_render_html","block_render_i"); - AddClassRequirement("block_render_html",$_PSL['classdir'] . "/Block_render_html.class"); - AddClassRequirement("block_render_login","block_render_i"); - AddClassRequirement("block_render_login",$_PSL['classdir'] . "/Block_render_login.class"); - AddClassRequirement("block_render_navbar","block_render_i"); - AddClassRequirement("block_render_navbar",$_PSL['classdir'] . "/Block_render_navbar.class"); - AddClassRequirement("block_render_poll","block_render_i"); - AddClassRequirement("block_render_poll",$_PSL['classdir'] . "/Block_render_poll.class"); - AddClassRequirement("block_render_query","block_render_i"); - AddClassRequirement("block_render_query",$_PSL['classdir'] . "/Block_render_query.class"); - AddClassRequirement("block_render_quote","block_render_i"); - AddClassRequirement("block_render_quote",$_PSL['classdir'] . "/Block_render_quote.class"); - AddClassRequirement("block_render_rss","block_render_i"); - AddClassRequirement("block_render_rss",$_PSL['classdir'] . "/Block_render_rss.class"); - AddClassRequirement("rdfparser",$_PSL['classdir'] . "/Block_render_rss.class"); - AddClassRequirement("block_render_section","block_render_i"); - AddClassRequirement("block_render_section",$_PSL['classdir'] . "/Block_render_section.class"); - AddClassRequirement("block_render_skin","block_render_i"); - AddClassRequirement("block_render_skin",$_PSL['classdir'] . "/Block_render_skin.class"); - AddClassRequirement("block_render_submission","block_render_i"); - AddClassRequirement("block_render_submission",$_PSL['classdir'] . "/Block_render_submission.class"); - AddClassRequirement("block_render_topic","block_render_i"); - AddClassRequirement("block_render_topic",$_PSL['classdir'] . "/Block_render_topic.class"); - AddClassRequirement("block_render_url","block_render_i"); - AddClassRequirement("block_render_url",$_PSL['classdir'] . "/Block_render_url.class"); AddClassRequirement("block_admin","block_i"); AddClassRequirement("block_admin",$_PSL['classdir'] . "/Block_admin.class"); --- 406,409 ---- Index: config-dist.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/config-dist.php3,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** config-dist.php3 30 Jan 2003 16:22:36 -0000 1.32 --- config-dist.php3 5 Feb 2003 22:00:38 -0000 1.33 *************** *** 74,78 **** $_PSL = parse_ini_file($psl_inifile, TRUE); ! $_PSL['version'] = '0.7RC2'; /**** START DEBUGGING - Comment or delete this for production! ****/ --- 74,78 ---- $_PSL = parse_ini_file($psl_inifile, TRUE); ! $_PSL['version'] = '0.7RC3'; /**** START DEBUGGING - Comment or delete this for production! ****/ *************** *** 577,607 **** AddClassRequirement("block_i",$_PSL['classdir'] . "/Block_i.class"); AddClassRequirement("block_render_i",$_PSL['classdir'] . "/Block_render_i.class"); - AddClassRequirement("block_render_cal","block_render_i"); - AddClassRequirement("block_render_cal",$_PSL['classdir'] . "/Block_render_cal.class"); - AddClassRequirement("block_render_html","block_render_i"); - AddClassRequirement("block_render_html",$_PSL['classdir'] . "/Block_render_html.class"); - AddClassRequirement("block_render_login","block_render_i"); - AddClassRequirement("block_render_login",$_PSL['classdir'] . "/Block_render_login.class"); - AddClassRequirement("block_render_navbar","block_render_i"); - AddClassRequirement("block_render_navbar",$_PSL['classdir'] . "/Block_render_navbar.class"); - AddClassRequirement("block_render_poll","block_render_i"); - AddClassRequirement("block_render_poll",$_PSL['classdir'] . "/Block_render_poll.class"); - AddClassRequirement("block_render_query","block_render_i"); - AddClassRequirement("block_render_query",$_PSL['classdir'] . "/Block_render_query.class"); - AddClassRequirement("block_render_quote","block_render_i"); - AddClassRequirement("block_render_quote",$_PSL['classdir'] . "/Block_render_quote.class"); - AddClassRequirement("block_render_rss","block_render_i"); - AddClassRequirement("block_render_rss",$_PSL['classdir'] . "/Block_render_rss.class"); - AddClassRequirement("rdfparser",$_PSL['classdir'] . "/Block_render_rss.class"); - AddClassRequirement("block_render_section","block_render_i"); - AddClassRequirement("block_render_section",$_PSL['classdir'] . "/Block_render_section.class"); - AddClassRequirement("block_render_skin","block_render_i"); - AddClassRequirement("block_render_skin",$_PSL['classdir'] . "/Block_render_skin.class"); - AddClassRequirement("block_render_submission","block_render_i"); - AddClassRequirement("block_render_submission",$_PSL['classdir'] . "/Block_render_submission.class"); - AddClassRequirement("block_render_topic","block_render_i"); - AddClassRequirement("block_render_topic",$_PSL['classdir'] . "/Block_render_topic.class"); - AddClassRequirement("block_render_url","block_render_i"); - AddClassRequirement("block_render_url",$_PSL['classdir'] . "/Block_render_url.class"); AddClassRequirement("block_admin","block_i"); AddClassRequirement("block_admin",$_PSL['classdir'] . "/Block_admin.class"); --- 577,580 ---- |
From: Joe S. <joe...@us...> - 2003-02-05 21:59:15
|
Update of /cvsroot/phpslash/phpslash-ft In directory sc8-pr-cvs1:/tmp/cvs-serv4630/phpslash-ft Modified Files: CHANGES Log Message: block_render jit registration Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.681 retrieving revision 1.682 diff -C2 -d -r1.681 -r1.682 *** CHANGES 5 Feb 2003 17:51:36 -0000 1.681 --- CHANGES 5 Feb 2003 21:58:37 -0000 1.682 *************** *** 13,16 **** --- 13,25 ---- 9 - Removal of something (kill -9 :) + 2003-February-05 3:30PM CST Joe Stewart <joe...@us...> + [B] - Block.class, config-dist.php3,config.php3 - moved block_render class + registration out of config file to just-in-time when used. + Block_render_rss.class - changed alternate template to use template + class set_file. + Block_render_url.class - added logwrite for source url errors. + Block_render_fmsearch.class - added tobozo's block for parsing + Freshmeat's xml search output. + 2003-February-05 11:30AM CST Joe Stewart <joe...@us...> [B] - slashAuthCR.class - user_info cookie was always being set when logging |
From: Joe S. <joe...@us...> - 2003-02-05 21:58:49
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv4630/phpslash-ft/class Modified Files: Block.class Block_render_rss.class Block_render_url.class Added Files: Block_render_fmsearch.class Log Message: block_render jit registration --- NEW FILE: Block_render_fmsearch.class --- <?php /* Block_render_fmsearch.class -> Methods for parsing Freshmeat xml-search data * * ie : http://freshmeat.net/search-xml/?q=doc§ion=projects&filter=164,847 * /* $Id: Block_render_fmsearch.class,v 1.1 2003/02/05 21:58:43 joestewart Exp $ */ /* * BLOCK OPTIONS USED * target = [_blank],_self etc * max_items = 10 * tpl = alternate template ( no .tpl extension) [rssblock] * title = none - dont display title or image, even if they are available * image - force display of image (if tag present - else show no title) * text - force display of title text (if tag present - else show no title) * both - display both image and text if available * best (default) - display image if tags present, else display title if possible * errors = on - always display errors * off - never display errors * debug - only display errors in debug mode [default] */ /** * Class to interpret and render a newsfeed (eg RSS 0.91). * * * @access private * @author ??. Code amended by Peter Cruickshank, Feb 2002 * @version 0.65 * @since version 0.65 * @package phpslash */ class fmparser { // Settings /** * Maximum number of items to read in from source (not used) * @access public */ var $max_items; /** * Array listing tags to process (channel, image, item). All others are ignored * @access public */ var $tags; // Output information /** * Output array of channel information (title, link, description) * @access public */ var $channel; /** * Output array of information on image (title, link, url) * Image width and height are not used since most sites seem not to give this info anyway * @access public */ var $image; /** * Output array of items (title, link, description) * @access public */ var $items; /** * Output errir message - if you got an error reading a file this will store an error * @access public */ var $error_str = ""; // Private /** * XML processor object * @access private */ var $xml; /** * Current container-element can be "" (ie channel), "match" or "image" (Should be a stack really, but nesting is only one deep) * @access private */ var $node; /** * Element stack(array) * @access private */ var $current; /** * Number of items * @access private */ var $count; /** * Empty constructor function. * @See parse_setup() */ function fmparser() { } /** * Notes start of container-element * * @param xml_parser $xml xml object (not used) * @param string $element element encountered by the xml parser * @param string $attributes (not used) * @access private */ function start_element($xml, $element, $attributes) { $this->current = $element; switch ($element) { case $this->tags["match"]: case $this->tags["search-results"]: case $this->tags["item"]: case $this->tags["image"]: case $this->tags["channel"]: $this->node = $element; // debug("rdf:start element+node","$element+".$this->node); break; default: } } /** * End element function - clear node if necessary * * @param xml_parser $xml xml object (not used) * @param string $element element encountered by the xml parser * @access private */ function end_element($xml, $element) { $this->current = ""; switch ($element) { case $this->tags["match"]: $this->node = ""; $this->count++; break; case $this->tags["search-results"]: $this->node = ""; break; } } /** * Store xml character data in appropriate place (items, image, channel) * * @param xml_parser $xml xml object (not used) * @param string $data xml content * @access private */ function character_data($xml, $data) { switch ($this->node) { case $this->tags["match"]: switch ($this->current) { case $this->tags["projectname_full"]: $this->items[$this->count]["projectname_full"] .= $data; break; case $this->tags["url_homepage"]: $this->items[$this->count]["url_homepage"] .= $data; break; case $this->tags["desc_short"]: $this->items[$this->count]["desc_short"] .= $data; break; default: } break; case $this->tags["search-results"]: switch ($this->current) { case $this->tags["projectname_full"]: $this->channel["projectname_full"] .= $data; break; case $this->tags["url_homepage"]: $this->channel["url_homepage"] .= $data; break; case $this->tags["desc_short"]: $this->channel["desc_short"] .= $data; break; default: } break; default: } } /** * Initialise class before it is called (allows for reuse of class if necessary) * * @param array $tags values of tags to parse. Default: CHANNEL,IMAGE, ITEM,TITLE, LINK,URL,DESCRIPTION * @param string $max_items (not used) * @access public */ function parse_setup($tags="",$max_items="") { if (is_array($tags)) { $this->tags = $tags; } else { // standard rdf setup - must be upper case (assuming case-folding is on which is PHP's default) $this->tags = array("search-results" => "SEARCH-RESULTS", "match" => "MATCH", "projectname_full" => "PROJECTNAME_FULL", "projectname_short" => "PROJECTNAME_SHORT", "url_homepage" => "URL_HOMEPAGE", "desc_short" => "DESC_SHORT", "desc_full" => "DESC_FULL" ); } // Internal initialisation $this->count = 0; $this->node = ""; // can be "" (ie channel), "match" or "image" $this->current = array(); // element stack $this->error_str = ""; $this->channel = array("projectname_full"=>"", "url_homepage"=>"", "desc_short" => ""); $this->image = array('url' =>'http://images.freshmeat.net/logo.gif', 'url_homepage'=>'http://freshmeat.net', 'projectname_full'=>'fm2'); $this->items = array(); $this->xml = xml_parser_create(); xml_set_object($this->xml, &$this); } /** * Carry out parse of rss source defined by parse_setup() * * @param array $tags values of tags to parse. Default: CHANNEL,IMAGE, ITEM,TITLE, LINK,URL,DESCRIPTION * @param string $max_items (not used) * @access public */ function parse_file($url) { // debug("rdfparser::parse_file", "Now parsing $url"); /* check for url structure before opening it (you don't want /etc/passwd to be validated here -- tobozo -- */ $urlParts = parse_url($url); if( (empty($urlParts)) or (!$urlParts) ) { $this->output = "Block_render_fmsearch.class:: Parse error reading [$url]"; return; } $scheme = $urlParts[scheme]; $HostName = $urlParts[host]; if(empty($scheme)) { $this->output = "Block_render_fmsearch.class:: Missing protocol declaration [$url]"; return; } if(empty($HostName)){ $this->output = "Block_render_fmsearch.class:: No hostname in [$url]"; return; } if (!eregi("^(ht|f)tp",$scheme)) { $this->output = "Block_render_fmsearch.class:: No http:// or ftp:// in [$url]"; return; } xml_parser_set_option($this->xml, XML_OPTION_CASE_FOLDING, true); xml_set_element_handler($this->xml, "start_element", "end_element"); xml_set_character_data_handler($this->xml, "character_data"); $fpread = @fopen($url, "r"); if ( !($fpread) ) { // error in opening url $this->error_str = "rdfparser::parse_file could not open $url"; // debug("rdfparser::parse_file", $this->error_str); // Where does $err* come from? // debug("rdfparser::parse_file", "$errstr $errno"); } else { while (($this->error_str == "") && ($data = fread($fpread, 4096))) { if (!xml_parse($this->xml, $data, feof($fpread))) { // error $this->error_str = xml_error_string(xml_get_error_code($this->xml)) . " at line " . xml_get_current_line_number($this->xml); debug("rdfparser::parse_file", $this->error_str); } } fclose($fpread); if ($this->error_str == "") { // debug("rdfparser::parse_file", "Data parsed successfully!"); } } } } /** * Class to display a newsfeed * * @access public * @author ?? - code amended by Peter Cruickshank, Feb 2002 * @version 0.65 * @since version 0.65 * @package phpslash */ class Block_render_fmsearch extends Block_render_i { /** * rdfparser object * @access private */ var $rdf; /** * constructor */ function Block_render_fmsearch() { global $_PSL; $this->Block_render_i(); AddClassRequirement("fmparser",$_PSL['classdir'] . "/Block_render_fmsearch.class"); $this->rdf = pslNew("fmparser"); $this->type = "fmsearch"; /* set the 'type' */ $this->description = "A block that displays the xml-search results from freshmeat, generated from their XML file"; } /** * Generates and stores html code * @param array $block_info block options and other info supplied by caller */ function parse($block_info) { global $_PSL; // debug("Block_render_fmsearch::parse", "Starting RDF Block parsing"); $default_tpl = "rssblock.tpl"; $titletype = "best"; $target = "_self"; $max_items = 10; $tpl = $default_tpl; $errors = "debug"; if (is_array($block_info["block_options"])) { if (is_string($block_info["block_options"]["max_items"])) { $max_items = $block_info["block_options"]["max_items"]; unset($block_info["block_options"]["max_items"]); } if (is_string($block_info["block_options"]["target"])) { $target = $block_info["block_options"]["target"]; unset($block_info["block_options"]["target"]); } if (is_string($block_info["block_options"]["title"])) { $titletype = $block_info["block_options"]["title"]; unset($block_info["block_options"]["title"]); } if (is_string($block_info["block_options"]["tpl"])) { if (@file_exists($this->psl['templatedir'] . "/" . basename($block_info['block_options']['tpl']) . ".tpl") ) { // should be secure as path directives are discarded and extension added $tpl = basename($block_info["block_options"]["tpl"]) . ".tpl"; unset($block_info["block_options"]["tpl"]); } } } // debug("Block_render_fmsearch::parse", "setting parser with $item_element, $title_element, $link_element"); $this->rdf->parse_setup(); //$item_element, $title_element, $link_element); $this->rdf->parse_file($block_info['source_url']); if (empty($this->rdf->error_str)) { // debug("Block_render_fmsearch::parse", "xml has no errors, making block"); // debug("fmsearch::parse::channel",$this->rdf->channel); // debug("fmsearch::parse::image",$this->rdf->image); // debug("fmsearch::parse::items", $this->rdf->items); $template = pslNew("slashTemplate",$this->psl["templatedir"]); $template->set_file ("block", $tpl); $template->set_block ("block", "channel_title","title_block"); $template->set_block ("block", "channel_image","image_block"); $template->set_block ("block", "channel_description","channeldescription_block"); $template->set_block ("block", "each_query", "query_block"); $template->set_block ("block", "each_description", "description_block"); switch ($titletype) { case "none": break; case "text": if ( !empty( $this->rdf->channel["projectname_full"]) ) { $template->set_var(array( "CHANNEL_TITLE" => $this->rdf->channel["projectname_full"], "CHANNEL_LINK" => empty($this->rdf->channel["url_homepage"])?"#":$this->rdf->channel["url_homepage"] )); $template->parse("title_block","channel_title"); } break; case "image": if ( !empty( $this->rdf->channel["image"]) ) { $template->set_var(array( "IMAGE_URL" => $this->rdf->image["url"], "IMAGE_TITLE" => $this->rdf->image["projectname_full"], "IMAGE_LINK" => $this->rdf->image["url_homepage"], )); $template->parse("image_block","channel_image"); } break; case "both": if ( !empty( $this->rdf->channel["projectname_full"]) ) { $template->set_var(array( "CHANNEL_TITLE" => $this->rdf->channel["projectname_full"], "CHANNEL_LINK" => empty($this->rdf->channel["url_homepage"])?"#":$this->rdf->channel["url_homepage"] )); $template->parse("title_block","channel_title"); } if ( !empty( $this->rdf->channel["image"]) ) { $template->set_var(array( "IMAGE_URL" => $this->rdf->image["url"], "IMAGE_TITLE" => $this->rdf->image["projectname_full"], "IMAGE_LINK" => $this->rdf->image["url_homepage"], )); $template->parse("image_block","channel_image"); } break; case "best": default: // <title> and <image> tags seem to hold identical description and link info in most sites // ... so use an image if possible, else show title if (empty($this->rdf->image["url"])) { if ( !empty( $this->rdf->channel["projectname_full"]) ) { // No image, but there is a title $template->set_var(array( "CHANNEL_TITLE" => $this->rdf->channel["projectname_full"], "CHANNEL_LINK" => empty($this->rdf->channel["url_homepage"])?"#":$this->rdf->channel["url_homepage"] )); $template->parse("title_block","channel_title"); } } else { // ...we can show the image $template->set_var(array( "IMAGE_URL" => $this->rdf->image["url"], "IMAGE_TITLE" => $this->rdf->image["projectname_full"], "IMAGE_LINK" => $this->rdf->image["url_homepage"], )); $template->parse("image_block","channel_image"); } } if ( !empty( $this->rdf->channel["desc_short"]) ) { $template->set_var("CHANNEL_DESCRIPTION", $this->rdf->channel["desc_short"]); $template->parse("channeldescription_block","channel_description",true); } $numitems = min($max_items, $this->rdf->count); // debug("fmsearch::numitems",$numitems); for ($items = 0; $items < $numitems; $items++ ) { $template->set_var(array( "TITLE" => $this->rdf->items[$items]["projectname_full"], "LINK" => $this->rdf->items[$items]["url_homepage"] )); $template->parse ("query_block", "each_query", true); if (!empty($this->rdf->items[$items]["desc_short"] )) { $template->set_var("DESCRIPTION",$this->rdf->items[$items]["desc_short"] ); $template->parse ("query_block", "each_description", true); } } $template->set_var(array( "TARGET" => $target, "ROOTDIR" => $this->psl["rooturl"], "IMAGEDIR" => $this->psl["imageurl"] )); $this->output = $template->parse(OUT,"block"); $this->title = $this->rdf->channel["projectname_full"]; return true; } else { $errors = $block_info["block_options"]["errors"]; $this->output = "Error in source file:".$this->rdf->error_str; logwrite("FMSearch Block ".$block_info['title']."(".$block_info['id'].")", $this->output); switch ($errors) { case "on": // display the error message ( already in this->output). break; case "off": // don't display the error text $this->output = $block_info["cache_data"]; break; case "debug": default: // only display the error text if debug mode is on if(!$this->psl['debug']) { $this->output = $block_info["cache_data"]; } break; } return false; } } /** * Returns block title (for use with dynamic blcok titles) * * This wont work until object values are saved between the two stages of rendering a block. * - it currently returns an empty string * * @return htmlstring */ function getTitle() { // debug("fmsearch::parse::getTitle", $this->title); return $this->title; } } Index: Block.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block.class,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Block.class 22 Jan 2003 17:28:42 -0000 1.24 --- Block.class 5 Feb 2003 21:58:41 -0000 1.25 *************** *** 427,430 **** --- 427,434 ---- // debug("Block::getParser::parserName",$parserName); + // register the class + AddClassRequirement($parserName,"block_render_i"); + AddClassRequirement($parserName,$this->psl['classdir'] . "/". $parserFile); + static $parser_arr; Index: Block_render_rss.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_rss.class,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Block_render_rss.class 4 Feb 2003 20:36:35 -0000 1.14 --- Block_render_rss.class 5 Feb 2003 21:58:42 -0000 1.15 *************** *** 307,311 **** --- 307,316 ---- */ function Block_render_rss() { + + global $_PSL; + $this->Block_render_i(); + + AddClassRequirement("rdfparser",$_PSL['classdir'] . "/Block_render_rss.class"); $this->rdf = pslNew("rdfparser"); *************** *** 322,326 **** // debug("Block_render_rss::parse", "Starting RDF Block parsing"); ! $default_tpl = "rssblock.tpl"; --- 327,331 ---- // debug("Block_render_rss::parse", "Starting RDF Block parsing"); ! $default_template = "rssblock.tpl"; *************** *** 334,341 **** /* check for url structure before opening it (you don't want /etc/passwd to be validated here -- tobozo -- */ ! $urlParts = parse_url($block_info['source_url']); if( (empty($urlParts)) or (!$urlParts) ) { $this->output = sprintf(pslgetText("Block_render_rss.class:: Parse error reading [%s]"), $url); return; } --- 339,348 ---- /* check for url structure before opening it (you don't want /etc/passwd to be validated here -- tobozo -- */ ! $url = $block_info['source_url']; ! $urlParts = parse_url($url); if( (empty($urlParts)) or (!$urlParts) ) { $this->output = sprintf(pslgetText("Block_render_rss.class:: Parse error reading [%s]"), $url); + logwrite("RSS Block ".$block_info['title']."(".$block_info['id'].")", $this->output); return; } *************** *** 346,349 **** --- 353,357 ---- if(empty($scheme)) { $this->output = sprintf(pslgetText("Block_render_rss.class:: Missing protocol declaration [%s]"), $url); + logwrite("RSS Block ".$block_info['title']."(".$block_info['id'].")", $this->output); return; } *************** *** 351,354 **** --- 359,363 ---- if(empty($HostName)){ $this->output = sprintf(pslgetText("Block_render_rss.class:: No hostname in [%s]"), $url); + logwrite("RSS Block ".$block_info['title']."(".$block_info['id'].")", $this->output); return; } *************** *** 356,359 **** --- 365,369 ---- if (!eregi("^(ht|f)tp",$scheme)) { $this->output = sprintf(pslgetText("Block_render_rss.class:: No http:// or ftp:// in [%s]"), $url); + logwrite("RSS Block ".$block_info['title']."(".$block_info['id'].")", $this->output); return; } *************** *** 370,381 **** if (is_string($block_info["block_options"]["title"])) { $titletype = $block_info["block_options"]["title"]; ! unset($block_info["block_options"]["title"]); ! } ! if (is_string($block_info["block_options"]["tpl"])) { ! if (@file_exists($this->psl['templatedir'] . "/" . basename($block_info['block_options']['tpl']) . ".tpl") ) { ! // should be secure as path directives are discarded and extension added ! $tpl = basename($block_info["block_options"]["tpl"]) . ".tpl"; ! unset($block_info["block_options"]["tpl"]); ! } } } --- 380,384 ---- if (is_string($block_info["block_options"]["title"])) { $titletype = $block_info["block_options"]["title"]; ! unset($block_info["block_options"]["title"]); } } *************** *** 391,396 **** // debug("rss::parse::items", $this->rdf->items); ! $template = pslNew("slashTemplate",$this->psl["templatedir"]); ! $template->set_file ("block", $tpl); $template->set_block ("block", "channel_title","title_block"); --- 394,406 ---- // debug("rss::parse::items", $this->rdf->items); ! $template = pslNew("slashTemplate"); ! ! if (!is_string($block_info["block_options"]["tpl"])) { ! $template->set_file( 'block', $default_template); ! } elseif ( $template->set_file('block' , basename($block_info["block_options"]["tpl"]) . ".tpl" )) { ! unset($block_info["block_options"]["tpl"]); ! } else { ! $template->set_file( 'block', $default_template); ! } $template->set_block ("block", "channel_title","title_block"); Index: Block_render_url.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_url.class,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Block_render_url.class 4 Feb 2003 20:36:36 -0000 1.5 --- Block_render_url.class 5 Feb 2003 21:58:43 -0000 1.6 *************** *** 25,28 **** --- 25,29 ---- if( (empty($urlParts)) or (!$urlParts) ) { $this->output = sprintf(pslgetText("Block_render_url.class:: Parse error reading [%s]"), $url); + logwrite("URL Block ".$block_info['title']."(".$block_info['id'].")", $this->output); return; } *************** *** 33,36 **** --- 34,38 ---- if(empty($scheme)) { $this->output = sprintf(pslgetText("Block_render_url.class:: Missing protocol declaration [%s]"), $url); + logwrite("URL Block ".$block_info['title']."(".$block_info['id'].")", $this->output); return; } *************** *** 38,41 **** --- 40,44 ---- if(empty($HostName)){ $this->output = sprintf(pslgetText("Block_render_url.class:: No hostname in [%s]"), $url); + logwrite("URL Block ".$block_info['title']."(".$block_info['id'].")", $this->output); return; } *************** *** 43,46 **** --- 46,50 ---- if (!eregi("^(ht|f)tp",$scheme)) { $this->output = sprintf(pslgetText("Block_render_url.class:: No http:// or ftp:// in [%s]"), $url); + logwrite("URL Block ".$block_info['title']."(".$block_info['id'].")", $this->output); return; } |
From: Joe S. <joe...@us...> - 2003-02-05 17:51:40
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv24340/phpslash-ft/class Modified Files: slashAuthCR.class Log Message: user_info cookie was always being set on login Index: slashAuthCR.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/slashAuthCR.class,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** slashAuthCR.class 9 Jan 2003 21:48:22 -0000 1.36 --- slashAuthCR.class 5 Feb 2003 17:51:36 -0000 1.37 *************** *** 192,197 **** // expire cache for this session ! jpcache_gc('string', "-slashSess-" . $sess->id, "100"); ! return $uid; } else { --- 192,198 ---- // expire cache for this session ! if(function_exists('jpcache_gc')) { ! jpcache_gc('string', "-slashSess-" . $sess->id, "100"); ! } return $uid; } else { *************** *** 312,316 **** return false; } else { ! if(isset($setcookie)){ $cookie_challenge = md5($this->magic .":". $this->psl['basedir']); $md5_pw = $this->db->Record['password']; // this is the raw MD5ed user/pass combo --- 313,317 ---- return false; } else { ! if(!empty($setcookie)){ $cookie_challenge = md5($this->magic .":". $this->psl['basedir']); $md5_pw = $this->db->Record['password']; // this is the raw MD5ed user/pass combo *************** *** 351,356 **** // expire cache for this session ! jpcache_gc('string', "-slashSess-" . $sess->id, "100"); ! return $uid; } --- 352,358 ---- // expire cache for this session ! if(function_exists('jpcache_gc')) { ! jpcache_gc('string', "-slashSess-" . $sess->id, "100"); ! } return $uid; } |
From: Joe S. <joe...@us...> - 2003-02-05 17:51:40
|
Update of /cvsroot/phpslash/phpslash-ft In directory sc8-pr-cvs1:/tmp/cvs-serv24340/phpslash-ft Modified Files: CHANGES Log Message: user_info cookie was always being set on login Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.680 retrieving revision 1.681 diff -C2 -d -r1.680 -r1.681 *** CHANGES 4 Feb 2003 21:38:37 -0000 1.680 --- CHANGES 5 Feb 2003 17:51:36 -0000 1.681 *************** *** 13,16 **** --- 13,20 ---- 9 - Removal of something (kill -9 :) + 2003-February-05 11:30AM CST Joe Stewart <joe...@us...> + [B] - slashAuthCR.class - user_info cookie was always being set when logging + in. + 2003-February-04 3:30PM CST Joe Stewart <joe...@us...> [W] - backend.php3 - TITLE_HTML is available to the template to preserve |
From: Joe S. <joe...@us...> - 2003-02-04 21:51:07
|
Update of /cvsroot/phpslash/phpslash-ft/public_html In directory sc8-pr-cvs1:/tmp/cvs-serv1933/phpslash-ft/public_html Modified Files: backend.php3 Log Message: TITLE_HTML available to backend templates Index: backend.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/backend.php3,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** backend.php3 4 Feb 2003 21:38:39 -0000 1.37 --- backend.php3 4 Feb 2003 21:50:58 -0000 1.38 *************** *** 184,188 **** $template->set_var(array( 'STORY_ID' => $stories[$i]['story_id'], ! 'TITLE' => htmlspecialchars($stories[$i]['title']), 'TITLE_HTML' => $stories[$i]['title'], 'INTRO_TEXT' => $description, --- 184,188 ---- $template->set_var(array( 'STORY_ID' => $stories[$i]['story_id'], ! 'TITLE' => htmlspecialchars(strip_tags($stories[$i]['title'])), 'TITLE_HTML' => $stories[$i]['title'], 'INTRO_TEXT' => $description, |
From: Joe S. <joe...@us...> - 2003-02-04 21:39:14
|
Update of /cvsroot/phpslash/phpslash-ft In directory sc8-pr-cvs1:/tmp/cvs-serv28588/phpslash-ft Modified Files: CHANGES Log Message: TITLE_HTML available to backend templates Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.679 retrieving revision 1.680 diff -C2 -d -r1.679 -r1.680 *** CHANGES 4 Feb 2003 20:36:32 -0000 1.679 --- CHANGES 4 Feb 2003 21:38:37 -0000 1.680 *************** *** 13,16 **** --- 13,20 ---- 9 - Removal of something (kill -9 :) + 2003-February-04 3:30PM CST Joe Stewart <joe...@us...> + [W] - backend.php3 - TITLE_HTML is available to the template to preserve + the title for views that can display html. + 2003-February-04 2:30PM CST Joe Stewart <joe...@us...> [B] - Block_render_url.class, Block_render_rss.class, en.php3 - url and rss |
From: Joe S. <joe...@us...> - 2003-02-04 21:38:45
|
Update of /cvsroot/phpslash/phpslash-ft/public_html In directory sc8-pr-cvs1:/tmp/cvs-serv28588/phpslash-ft/public_html Modified Files: backend.php3 Log Message: TITLE_HTML available to backend templates Index: backend.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/backend.php3,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** backend.php3 8 Jan 2003 16:42:48 -0000 1.36 --- backend.php3 4 Feb 2003 21:38:39 -0000 1.37 *************** *** 138,141 **** --- 138,143 ---- $template->set_file('storiesbackend', $viewtpl); + $count = count($stories); + // Start giving placeholders, these aren't parsed till later so // placeholders that crop up during the following set_block loops *************** *** 154,163 **** 'IMAGEDIR' => $_PSL['imageurl'], 'TARGET' => $ary['target'], ! 'COUNT' => count($stories) )); // Process the "each_story" block in the template $template->set_block("storiesbackend", "each_story", "stories"); ! for ($i = 0 ; $i < count($stories); $i++) { switch( $ary['d']) { case '0': --- 156,165 ---- 'IMAGEDIR' => $_PSL['imageurl'], 'TARGET' => $ary['target'], ! 'COUNT' => $count )); // Process the "each_story" block in the template $template->set_block("storiesbackend", "each_story", "stories"); ! for ($i = 0 ; $i < $count; $i++) { switch( $ary['d']) { case '0': *************** *** 169,174 **** case 'l': $description = $_PSL['site_name'] . ' - '; ! $description .= htmlspecialchars(strip_tags($stories[$i]["intro_text"])); ! // $description .= format_mail(eregi_replace("<([font][^>]*)>", "",$stories[$i]["intro_text"]),"80", "scrub"); break; case 'd': --- 171,176 ---- case 'l': $description = $_PSL['site_name'] . ' - '; ! $description .= htmlspecialchars(strip_tags($stories[$i]["intro_text"])); ! // $description .= format_mail(eregi_replace("<([font][^>]*)>", "",$stories[$i]["intro_text"]),"80", "scrub"); break; case 'd': *************** *** 176,180 **** default: $description = htmlspecialchars(strip_tags($stories[$i]["intro_text"])); ! // $description = format_mail(eregi_replace("<([font][^>]*)>", "",$stories[$i]["intro_text"]),"80", "scrub"); break; } --- 178,182 ---- default: $description = htmlspecialchars(strip_tags($stories[$i]["intro_text"])); ! // $description = format_mail(eregi_replace("<([font][^>]*)>", "",$stories[$i]["intro_text"]),"80", "scrub"); break; } *************** *** 183,187 **** --- 185,191 ---- 'STORY_ID' => $stories[$i]['story_id'], 'TITLE' => htmlspecialchars($stories[$i]['title']), + 'TITLE_HTML' => $stories[$i]['title'], 'INTRO_TEXT' => $description, + 'INTRO_TEXT_HTML' => $stories[$i]['intro_text'], 'IDX' => $i, 'DATEF' => $stories[$i]['datef'], *************** *** 201,205 **** if ($ary['view'] = 'rss1') { $template->set_block('storiesbackend', 'each_item', 'items'); ! for ($i = 0; $i < count($link_ary); $i++) { $template->set_var(array( 'STORY_ID' => $link_ary[$i]['storyid'] --- 205,210 ---- if ($ary['view'] = 'rss1') { $template->set_block('storiesbackend', 'each_item', 'items'); ! $link_ary_cnt = count($link_ary); ! for ($i = 0; $i < $link_ary_cnt; $i++) { $template->set_var(array( 'STORY_ID' => $link_ary[$i]['storyid'] |
From: Joe S. <joe...@us...> - 2003-02-04 20:36:41
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv30962/phpslash-ft/class Modified Files: Block_render_rss.class Block_render_url.class Log Message: url structure check Index: Block_render_rss.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_rss.class,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Block_render_rss.class 20 Dec 2002 22:17:29 -0000 1.13 --- Block_render_rss.class 4 Feb 2003 20:36:35 -0000 1.14 *************** *** 311,315 **** $this->type = "rss"; /* set the 'type' */ ! $this->description = "A block that displays the headlines from another site, generated from their RDF file"; } --- 311,315 ---- $this->type = "rss"; /* set the 'type' */ ! $this->description = pslgetText( "A block that displays the headlines from another site, generated from their RDF file"); } *************** *** 331,335 **** $errors = "debug"; ! if (is_array($block_info["block_options"])) { if (is_string($block_info["block_options"]["max_items"])) { --- 331,362 ---- $errors = "debug"; ! ! /* check for url structure before opening it (you don't want ! /etc/passwd to be validated here -- tobozo -- */ ! $urlParts = parse_url($block_info['source_url']); ! ! if( (empty($urlParts)) or (!$urlParts) ) { ! $this->output = sprintf(pslgetText("Block_render_rss.class:: Parse error reading [%s]"), $url); ! return; ! } ! ! $scheme = $urlParts[scheme]; ! $HostName = $urlParts[host]; ! ! if(empty($scheme)) { ! $this->output = sprintf(pslgetText("Block_render_rss.class:: Missing protocol declaration [%s]"), $url); ! return; ! } ! ! if(empty($HostName)){ ! $this->output = sprintf(pslgetText("Block_render_rss.class:: No hostname in [%s]"), $url); ! return; ! } ! ! if (!eregi("^(ht|f)tp",$scheme)) { ! $this->output = sprintf(pslgetText("Block_render_rss.class:: No http:// or ftp:// in [%s]"), $url); ! return; ! } ! if (is_array($block_info["block_options"])) { if (is_string($block_info["block_options"]["max_items"])) { *************** *** 347,353 **** if (is_string($block_info["block_options"]["tpl"])) { if (@file_exists($this->psl['templatedir'] . "/" . basename($block_info['block_options']['tpl']) . ".tpl") ) { ! // should be secure as path directives are discarded and extension added $tpl = basename($block_info["block_options"]["tpl"]) . ".tpl"; ! unset($block_info["block_options"]["tpl"]); } } --- 374,380 ---- if (is_string($block_info["block_options"]["tpl"])) { if (@file_exists($this->psl['templatedir'] . "/" . basename($block_info['block_options']['tpl']) . ".tpl") ) { ! // should be secure as path directives are discarded and extension added $tpl = basename($block_info["block_options"]["tpl"]) . ".tpl"; ! unset($block_info["block_options"]["tpl"]); } } Index: Block_render_url.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_url.class,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Block_render_url.class 3 Sep 2002 20:00:09 -0000 1.4 --- Block_render_url.class 4 Feb 2003 20:36:36 -0000 1.5 *************** *** 11,15 **** $this->type = "url"; /* set the 'type' */ ! $this->description = "A block that displays the HTML returned from the source URL"; } --- 11,15 ---- $this->type = "url"; /* set the 'type' */ ! $this->description = pslgetText("A block that displays the HTML returned from the source URL"); } *************** *** 19,22 **** --- 19,49 ---- $errors = $block_info["block_options"]["errors"]; + /* check for url structure before opening it (you don't want + /etc/passwd to be validated here -- tobozo -- */ + $urlParts = parse_url($url); + + if( (empty($urlParts)) or (!$urlParts) ) { + $this->output = sprintf(pslgetText("Block_render_url.class:: Parse error reading [%s]"), $url); + return; + } + + $scheme = $urlParts[scheme]; + $HostName = $urlParts[host]; + + if(empty($scheme)) { + $this->output = sprintf(pslgetText("Block_render_url.class:: Missing protocol declaration [%s]"), $url); + return; + } + + if(empty($HostName)){ + $this->output = sprintf(pslgetText("Block_render_url.class:: No hostname in [%s]"), $url); + return; + } + + if (!eregi("^(ht|f)tp",$scheme)) { + $this->output = sprintf(pslgetText("Block_render_url.class:: No http:// or ftp:// in [%s]"), $url); + return; + } + /* have to silence 'implode' and 'file' because you don't want the errors showing up on the main page */ *************** *** 27,31 **** if (strlen($string) < 1) { ! $this->output = "Block_render_url.class: $url contained no data."; logwrite("URL Block ".$block_info['title']."(".$block_info['id'].")", $this->output); --- 54,58 ---- if (strlen($string) < 1) { ! $this->output = sprintf(pslgetText("Block_render_url.class: %s contained no data."), $url); logwrite("URL Block ".$block_info['title']."(".$block_info['id'].")", $this->output); |