[Phpslash-commit] CVS: phpslash-dev/include/class functions.inc,1.17,1.18
Brought to you by:
joestewart,
nhruby
From: Peter C. <kr...@us...> - 2004-10-18 17:05:14
|
Update of /cvsroot/phpslash/phpslash-dev/include/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3827 Modified Files: functions.inc Log Message: General notice squashing, adding MAINPAGE var to getHeader, tidyup of mail-related functions Index: functions.inc =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/include/class/functions.inc,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** functions.inc 29 Jul 2004 15:38:52 -0000 1.17 --- functions.inc 18 Oct 2004 17:05:04 -0000 1.18 *************** *** 8,12 **** * June 2004 - There's been a bit of a rationalisation of this file - you might have notcied! * This is a detailed list of how things are grouped. Feel free to suggest new sections (or changes ! * to categorisations, but when you add a new function, please try to put it in the right place! * * HTML FORMATTING: ERRORS AND MESSAGES --- 8,12 ---- * June 2004 - There's been a bit of a rationalisation of this file - you might have notcied! * This is a detailed list of how things are grouped. Feel free to suggest new sections (or changes ! * to categorisations), but when you add a new function, please try to put it in the right place! * * HTML FORMATTING: ERRORS AND MESSAGES *************** *** 253,256 **** --- 253,257 ---- 'ROOTDIR' => $_PSL['rooturl'], 'IMAGEDIR' => $_PSL['imageurl'], + 'MAINPAGE' => $_PSL['mainpage'], 'SITETITLE' => $title, 'SEARCH_ACTION_URL' => $action_url, *************** *** 894,898 **** } // start with cookie value if it's set ! $cookie_TZ = $HTTP_COOKIE_VARS['TZ']; if (!empty($cookie_TZ)) { $tzname = $cookie_TZ; --- 895,899 ---- } // start with cookie value if it's set ! $cookie_TZ = @$HTTP_COOKIE_VARS['TZ']; if (!empty($cookie_TZ)) { $tzname = $cookie_TZ; *************** *** 960,964 **** $locale || $locale = $_PSL['locale'][$category]; ! if (!is_array($localinfo[$locale][$category])) { $filename = sprintf('%s/%s.%s.php',$_PSL['localedir'],$locale,$category); if (!is_readable($filename)) { --- 961,965 ---- $locale || $locale = $_PSL['locale'][$category]; ! if (!is_array(@$localinfo[$locale][$category])) { $filename = sprintf('%s/%s.%s.php',$_PSL['localedir'],$locale,$category); if (!is_readable($filename)) { *************** *** 1192,1197 **** // let the template parse any tag variables submitted. if(is_array($ary['vars'] )) { ! while( list( $key, $val) = @each( $ary['vars'] )) { ! $template->set_var(strtoupper($key), $ary['vars'][$key]); } } --- 1193,1198 ---- // let the template parse any tag variables submitted. if(is_array($ary['vars'] )) { ! foreach ($ary['vars'] as $key => $val) { ! $template->set_var(strtoupper($key), $val); } } *************** *** 1199,1226 **** // parse the to_block to the mail_to variable $template->set_block("emailnotify","to_block","mail_to"); ! $template->parse("mail_to", "to_block", true); ! ! $mail_to = trim($template->get_var("mail_to")); // debug("mail_to", $mail_to); // parse the subject_block to the mail_subject variable $template->set_block("emailnotify","subject_block","mail_subject"); ! $template->parse("mail_subject", "subject_block", true); ! ! $mail_subject = trim($template->get_var("mail_subject")); // debug("mail_subject", $mail_subject); // parse the headers_block to the mail_headers variable $template->set_block("emailnotify","headers_block","mail_headers"); ! $template->parse("mail_headers", "headers_block", true); ! ! $mail_headers = trim($template->get_var("mail_headers")); // debug("mail_headers", $mail_headers); // parse the body_block to the mail_body variable $template->set_block("emailnotify","body_block","mail_body"); ! $template->parse("mail_body", "body_block", true); ! ! $mail_body = $template->get_var("mail_body"); // debug("mail_body", $mail_body); --- 1200,1219 ---- // parse the to_block to the mail_to variable $template->set_block("emailnotify","to_block","mail_to"); ! $mail_to = trim($template->parse("mail_to", "to_block", true)); // debug("mail_to", $mail_to); // parse the subject_block to the mail_subject variable $template->set_block("emailnotify","subject_block","mail_subject"); ! $mail_subject = trim($template->parse("mail_subject", "subject_block", true)); // debug("mail_subject", $mail_subject); // parse the headers_block to the mail_headers variable $template->set_block("emailnotify","headers_block","mail_headers"); ! $mail_headers = trim($template->parse("mail_headers", "headers_block", true)); // debug("mail_headers", $mail_headers); // parse the body_block to the mail_body variable $template->set_block("emailnotify","body_block","mail_body"); ! $mail_body = $template->parse("mail_body", "body_block", true); // debug("mail_body", $mail_body); *************** *** 1237,1273 **** /************* TEMP MAIL LIST STUFF ********************/ ! //Begin function for email this is stupid, needs to be shorter ! function format_mail($str, $char_len, $scrub) { //BEGIN FUNCTION ! ! if ($scrub) { //Open if Scrub $str = stripslashes($str); // lh: Hopefully this is the short replacement ! $str = eregi_replace('<(/?)(a|b|br|i|p)+[^>]*>', "", $str); ! $str = eregi_replace("\n|\r|[[:space:]]+|10|13|&#....;", " ", $str); ! $str = stripslashes($str); ! } //Close if Scrub ! while(strlen($str) != 0) { //Open While ! if (strlen($str) > $char_len) { ! $len = strrpos(substr($str, 0, $char_len - 1), " "); ! } else { ! $len = 0; ! } ! // in case of no spaces ! if(!$len) { ! $len = $char_len - 1; ! } ! $str_out .= substr($str, 0, $len) . "\n"; ! $str = ltrim(substr($str, $len, strlen($str))); ! } //End While return $str_out; ! } //END FUNCTION /** * Check format of email. * ! * No DNS or MX checks are performed. This function is duplicated in mailinglist.class * * @access public --- 1230,1261 ---- /************* TEMP MAIL LIST STUFF ********************/ ! /** ! * Begin function for email this is stupid, needs to be shorter ! * @todo Change to use preg_replace or strip_tags ! */ ! function format_mail($str, $char_len=76, $scrub=true) { //BEGIN FUNCTION + if ($scrub) { $str = stripslashes($str); // lh: Hopefully this is the short replacement ! #$str = eregi_replace('<(/?)(a|b|br|i|p)+[^>]*>', "", $str); ! #$str = eregi_replace("\n|\r|[[:space:]]+|10|13|&#....;", " ", $str); ! $str = str_replace(array('<h1','<h2','<h3','<h4','<h5'),"\n\n<h9",$str); ! $str = str_replace(array('</h1>','</h2>','</h3>','</h4>','</h5>'),"\n",$str); ! $str = strip_tags($str); ! // ...and reverse any html-encoding ! $str = strtr($str,array_flip(get_html_translation_table(HTML_ENTITIES))); $str = stripslashes($str); ! } ! ! $str_out = wordwrap($str,$char_len); return $str_out; ! } //end format_mail /** * Check format of email. * ! * No DNS or MX checks are performed. * * @access public |