Jump to content

scferg

Members
  • Posts

    68
  • Joined

  • Last visited

    Never

Everything posted by scferg

  1. Is there some other PHP function (instead of the include) to include PHP files, so that they wouldn't interfere with each other?
  2. Here they are [attachment deleted by admin]
  3. Err...the second file alone is too many characters. How can I show it to anybody? Any help would be greatly appreciated!
  4. I have 2 PHP files used on my page. One is to pull information from my forum, and the other is to show my news. When one file code in included in the code, that function works fine, but once the other code is added, the page renders and a blank document. I'm assuming they're are functions that both of them use...but I used UltraCompare Professional to see if there was, but nothing matched in both documents. So, I really need help because both functions are vital to my site. I've included both file codes in case any of you PHP geniuses know why the heck the two files are not cooperating with each other. show_news.php <?PHP error_reporting (E_ALL ^ E_NOTICE); $cutepath = __FILE__; $cutepath = preg_replace( "'\\\show_news\.php'", "", $cutepath); $cutepath = preg_replace( "'/show_news\.php'", "", $cutepath); require_once("$cutepath/inc/functions.inc.php"); require_once("$cutepath/data/config.php"); // If we are showing RSS, include some need variables. if($template == 'rss'){ include("$cutepath/data/rss_config.php"); } //---------------------------------- // Check if we are included by PATH //---------------------------------- if($HTTP_SERVER_VARS["HTTP_ACCEPT"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_CHARSET"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"] or $HTTP_SERVER_VARS["HTTP_CONNECTION"]){ /* do nothing */ } elseif(eregi("show_news.php", $PHP_SELF)){ die("<h4>CuteNews has detected that you are including show_news.php using the URL to this file.<br> This is incorrect and you must include it using the PATH to show_news.php</h4><br>Example:<br> this is <font color=red>WRONG</font> : <?PHP include(\"http://yoursite.com/cutenews/show_news.php\"); ?><br> this is <font color=green>CORRECT</font>: <?PHP include(\"cutenews/show_news.php\"); ?><br> <br><BR>// <font size=2>if you think this message shouldn't be shown, open show_news.php and delete it from there</font>"); } //---------------------------------- // End of the check //---------------------------------- if(!isset($subaction) or $subaction == ""){ $subaction = $POST["subaction"]; } if(!isset($template) or $template == "" or strtolower($template) == "default"){ require_once("$cutepath/data/Default.tpl"); } else{ if(file_exists("$cutepath/data/${template}.tpl")){ require("$cutepath/data/${template}.tpl"); } else{ die("Error!<br>the template <b>".htmlspecialchars($template)."</b> does not exists, note that templates are case sensetive and you must write the name exactly as it is"); } } // Prepare requested categories if(eregi("[a-z]", $category)){ die("<b>Error</b>!<br>CuteNews has detected that you use \$category = \"".htmlspecialchars($category)."\"; but you can call the categories only with their <b>ID</b> numbers and not with names<br> example:<br><blockquote><?PHP<br>\$category = \"1\";<br>include(\"path/to/show_news.php\");<br>?></blockquote>"); } $category = preg_replace("/ /", "", $category); $tmp_cats_arr = explode(",", $category); foreach($tmp_cats_arr as $key=>$value){ if($value != ""){ $requested_cats[$value] = TRUE; } } if($archive == ""){ $news_file = "$cutepath/data/news.txt"; $comm_file = "$cutepath/data/comments.txt"; }else{ $news_file = "$cutepath/data/archives/$archive.news.arch"; $comm_file = "$cutepath/data/archives/$archive.comments.arch"; } $allow_add_comment = FALSE; $allow_full_story = FALSE; $allow_active_news = FALSE; $allow_comments = FALSE; //<<<------------ Detarime what user want to do if( $CN_HALT != TRUE and $static != TRUE and ($subaction == "showcomments" or $subaction == "showfull" or $subaction == "addcomment") and ((!isset($category) or $category == "") or ($requested_cats[$ucat] == TRUE ) ) ){ if($subaction == "addcomment"){ $allow_add_comment = TRUE; $allow_comments = TRUE; } if($subaction == "showcomments"){ $allow_comments = TRUE; } if(($subaction == "showcomments" or $allow_comments == TRUE) and $config_show_full_with_comments == "yes"){$allow_full_story = TRUE; } if($subaction == "showfull") $allow_full_story = TRUE; if($subaction == "showfull" and $config_show_comments_with_full == "yes") $allow_comments = TRUE; } else{ if($config_reverse_active == "yes"){ $reverse = TRUE; } $allow_active_news = TRUE; } //----------->>> Detarime what user want to do require("$cutepath/inc/shows.inc.php"); if($_GET['archive'] and $_GET['archive'] != ''){ $archive = $_GET['archive']; } // stupid fix ? unset($static, $template, $requested_cats, $category, $catid, $cat,$reverse, $in_use, $archives_arr, $number, $no_prev, $no_next, $i, $showed, $prev, $used_archives); ?> <!-- News Powered by CuteNews: http://cutephp.com/ --> Umm....it says my message exceeds the maximum length, so I'll post the other code in a reply. Sorry.
  5. Nope...I'm on Windows Vista (unfortunately) :-\
  6. Is there a way to compare the two files and check and see if there's anything that's the same function?
  7. Oh wait....now that I tested something...there must be something of the same function. I tried going to a page other than the show_news.php (a simple html page) and it's just fine. I think this is an even more serious problem than what I thought because... 1) I don't know PHP so I can't diagnose the problem 2) If/ when I do find the issue...I don't think I'll be able to change any of it without causing other problems on either the SSI on my forum, or the show_news.php on my CuteNews. Any ideas?
  8. Hello, I'm having yet another issue with php... I'm making a new version of my website and I've added some new features to it. Well, along with new features comes new problems. For my site's navigation, I use simple PHP. For example, to go to my contact page: http://mywebsite.com/?page=contact . http://mywebsite.com/index.php?page=contact works too. Simple enough, right? Well, I also have a SMF forum, and I've included the SSI example codes. I worked on the SSI first, and it was working fine...until I added m PHP nav code. (below) <?php if($section && $page) {include("./$section/$page"); } elseif($page == "case1") { echo "case1 goes here no page was written for this statement.";} elseif($page) {include("./$page.html");} else {$number=10; $only_active=TRUE; include("./news/show_news.php"); } ?> And here's an example of one of my SSI codes: <?php ssi_welcome(); ?> I must also include this code into my page above the <html> tag: <?php require("/home/MYWEBSITE/public_html/forum/SSI.php"); ?> Once I added that code to my page...the page become completely blank. The SSI codes and my navigation code seems to be conflicting with each other. Because once I remove either one of them, it renders just fine. I can't change the SSI codes, but I can change my PHP navigation code. So is there any problem that's causing this issue within my nav code? Is there a better way of doing the same thing?
  9. THANKS!!!!!!! It worked!!!! I owe you big time!
  10. And, Ken2k7, your latest code still did not work. I really appreciate you trying though! In case this would help, my site is http://sims2news.com . To see these errors, just click the "Add a comment" button on any news article.
  11. I do use Notepad, but when I entered "469" it said "Out of range." So I figured Word would have a larger "range." I've tried many, many times to learn PHP. All I know as of now is how to include external files. My site's navigation is based off of PHP. It's just that, none of it makes sense. HTML and CSS makes more sense, but PHP is just soooo many numbers and symbols that seem to mean nothing I'm only 14, so with school work ans such, I just need things to work right...
  12. Then MS Word must be stupid. I copied all that code into a blank document, and I pressed Ctrl+f and selected Go To Line: and entered 469 and it said "No Such Line" Anyways, thanks...I'll give it a try Edit: Nothing different...still those same errors I also don't know how this happened. One day, I was skimming my site, and saw those errors. Me, not knowing much about PHP wouldn't dare touch those codes xD
  13. I just need for my comment system to get back up and running... Edit: It works, but it has those unsightly PHP errors. Something has to be wrong though.
  14. I don't think it's solved...somebody moved it ??? <?PHP // bad practice, i know if ($HTTP_SESSION_VARS) {extract($HTTP_SESSION_VARS, EXTR_SKIP);} if ($_SESSION) {extract($_SESSION, EXTR_SKIP);} if ($HTTP_COOKIE_VARS) {extract($HTTP_COOKIE_VARS, EXTR_SKIP);} if ($_COOKIE) {extract($_COOKIE, EXTR_SKIP);} if ($HTTP_POST_VARS) {extract($HTTP_POST_VARS, EXTR_SKIP);} if ($_POST) {extract($_POST, EXTR_SKIP);} if ($HTTP_GET_VARS) {extract($HTTP_GET_VARS, EXTR_SKIP);} if ($_GET) {extract($_GET, EXTR_SKIP);} if ($HTTP_ENV_VARS) {extract($HTTP_ENV_VARS, EXTR_SKIP);} if ($_ENV) {extract($_ENV, EXTR_SKIP);} //---------------------------------- // Sanitize Variables //---------------------------------- if( isset($template) and $template != "" and !eregi("^[_a-zA-Z0-9-]{1,}$", $template)){ die("invalid template characters"); } if( isset($archive) and $archive != "" and !eregi("^[_a-zA-Z0-9-]{1,}$", $archive)){ die("invalid archive characters"); } if($PHP_SELF == ""){ $PHP_SELF = $HTTP_SERVER_VARS["PHP_SELF"]; } $phpversion = @phpversion(); $a7f89abdcf9324b3 = ""; $comm_start_from = htmlspecialchars($comm_start_from); $start_from = htmlspecialchars($start_from); $archive = htmlspecialchars($archive); $subaction = htmlspecialchars($subaction); $id = htmlspecialchars($id); $ucat = htmlspecialchars($ucat); if(is_array($category)){ foreach($category as $ckey=>$cvalue){ $category[$ckey] = htmlspecialchars($category[$ckey]);} } else{ $category = htmlspecialchars($category); } $number = htmlspecialchars($number); $template = htmlspecialchars($template); $show = htmlspecialchars($show); $config_version_name = "CuteNews v1.4.5"; $config_version_id = 180; //---------------------------------- // Some Special Chars //---------------------------------- $HTML_SPECIAL_CHARS = Array ( // Master array replaced ALWAYS !!! '”' => '&#8221;', '“' => '&#8220;', 'œ' => '&#339;', '™' => '&#8482;', '’' => '&#8217;', '‘' => '&#8216;', '‰' => '&#8240;', '…' => '&#8230;', '€' => '€', '¡' => '¡', '¢' => '¢', '£' => '£', '¤' => '¤', '¥' => '¥', '¦' => '¦', '§' => '§', '¨' => '¨', '©' => '©', 'ª' => 'ª', '«' => '«', '¬' => '¬', '­' => '­', '®' => '®', '¯' => '¯', '°' => '°', '±' => '±', '²' => '²', '³' => '³', '´' => '´', '·' => '·', '¸' => '¸', '¹' => '¹', 'º' => 'º', '»' => '»', '¼' => '¼', '½' => '½', '¾' => '¾', '¿' => '¿', ); /////////////////////////////////////////////////////// // Function: ResynchronizeAutoArchive // Description: Auto-Archives News function ResynchronizeAutoArchive(){ global $cutepath, $config_auto_archive, $config_notify_email,$config_notify_archive,$config_notify_status; $count_news = count(file("$cutepath/data/news.txt")); if($count_news > 1){ if($config_auto_archive == "yes"){ $now[year] = date("Y"); $now[month] = date("n"); $db_content = file("$cutepath/data/auto_archive.db.php"); list($last_archived[year], $last_archived[month]) = split("\|", $db_content[0] ); $tmp_now_sum = $now[year] . sprintf("%02d", $now[month]) ; $tmp_last_sum = (int)$last_archived[year] . sprintf("%02d", (int)$last_archived[month]) ; if($tmp_now_sum > $tmp_last_sum){ $error = FALSE; $arch_name = time(); if(!@copy("$cutepath/data/news.txt","$cutepath/data/archives/$arch_name.news.arch")) { $error = "Can not copy news.txt from data/ to data/archives"; } if(!@copy("$cutepath/data/comments.txt","$cutepath/data/archives/$arch_name.comments.arch")) { $error = "Can not copy comments.txt from data/ to data/archives"; } $handle = fopen("$cutepath/data/news.txt","w") or $error = "Can not open news.txt"; fclose($handle); $handle = fopen("$cutepath/data/comments.txt","w") or $error = "Can not open comments.txt"; fclose($handle); $fp = @fopen("$cutepath/data/auto_archive.db.php", "w"); @flock ($fp,2); if(!$errors){ fwrite($fp, $now[year]."|".$now[month]."\n"); } else{ fwrite($fp, "0|0|$error\n"); } foreach($db_content as $line){ @fwrite($fp, $line); } @flock ($fp,3); @fclose($fp); if($config_notify_archive == "yes" and $config_notify_status == "active"){ send_mail("$config_notify_email", "CuteNews - AutoArchive was Performed", "CuteNews has performed the AutoArchive function.\n$count_news News Articles were archived.\n$error"); } } } } } /////////////////////////////////////////////////////// // Function: ResynchronizePostponed // Description: Refreshes the Postponed News file. function ResynchronizePostponed(){ global $cutepath,$config_notify_postponed,$config_notify_status,$config_notify_email; $all_postponed_db = file("$cutepath/data/postponed_news.txt"); if(!empty($all_postponed_db)){ $new_postponed_db = fopen("$cutepath/data/postponed_news.txt", w); @flock ($new_postponed_db,2); $now_date = time(); foreach ($all_postponed_db as $p_line){ $p_item_db = explode("|",$p_line); if($p_item_db[0] <= $now_date){ // Item is old and must be Activated, add it to news.txt $all_active_db = file("$cutepath/data/news.txt"); $active_news_file = fopen("$cutepath/data/news.txt", "w"); @flock ($active_news_file,2); fwrite($active_news_file,"$p_line"); foreach ($all_active_db as $active_line){ fwrite($active_news_file, "$active_line");} @flock ($active_news_file,3); fclose($active_news_file); if($config_notify_postponed == "yes" and $config_notify_status == "active"){ send_mail("$config_notify_email", "CuteNews - Postponed article was Activated", "CuteNews has activated the article '$p_item_db[2]'"); } }else{ // Item is still postponed fwrite($new_postponed_db,"$p_line"); } } @flock ($new_postponed_db,3); fclose($new_postponed_db); } } /////////////////////////////////////////////////////// // Function: send_mail // Description: sends mail ... huh function send_mail($to, $subject, $message){ if(!isset($to) or !$to or $to == ''){ }else{ $tos = FALSE; $to = str_replace(' ', '', $to); if(eregi(',', '')){ $tos = explode(',', $to); } $from = 'CuteNews@' . $_SERVER['SERVER_NAME']; $headers = ''; $headers .= "From: $from\n"; $headers .= "Reply-to: $from\n"; $headers .= "Return-Path: $from\n"; $headers .= "Message-ID: <" . md5(uniqid(time())) . "@" . $_SERVER['SERVER_NAME'] . ">\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-type: text/plain;\n"; $headers .= "Date: " . date('r', time()) . "\n"; if($tos){ foreach($tos as $my_to){ @mail($my_to,$subject,$message,$headers); } }else{ @mail($to,$subject,$message,$headers); } } } /////////////////////////////////////////////////////// // Function: formatsize // Description: Format the size of given file function formatsize($file_size){ if($file_size >= 1073741824) {$file_size = round($file_size / 1073741824 * 100) / 100 . "Gb";} elseif($file_size >= 1048576) {$file_size = round($file_size / 1048576 * 100) / 100 . "Mb";} elseif($file_size >= 1024) {$file_size = round($file_size / 1024 * 100) / 100 . "Kb";} else{$file_size = $file_size . "b";} return $file_size; } /////////////////////////////////////////////////////// // Class: microTimer // Description: calculates the micro time class microTimer { function start() { global $starttime; $mtime = microtime (); $mtime = explode (' ', $mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime; } function stop() { global $starttime; $mtime = microtime (); $mtime = explode (' ', $mtime); $mtime = $mtime[1] + $mtime[0]; $endtime = $mtime; $totaltime = round (($endtime - $starttime), 5); return $totaltime; } } /////////////////////////////////////////////////////// // Function: check_login // Description: Check login information function check_login($username, $md5_password){ $result = FALSE; $full_member_db = file("./data/users.db.php"); global $member_db; foreach($full_member_db as $member_db_line) { if(!eregi("<\?",$member_db_line)){ $member_db = explode("|",$member_db_line); if(strtolower($member_db[2]) == strtolower($username) && $member_db[3] == $md5_password) { $result = TRUE; break; } } } return $result; } /////////////////////////////////////////////////////// // Function: cute_query_string // Description: Format the Query_String for CuteNews purpuses index.php? function cute_query_string($q_string, $strips, $type="get"){ foreach($strips as $key){ $strips[$key] = TRUE; } $var_value = explode("&", $q_string); foreach($var_value as $var_peace){ $parts = explode("=", $var_peace); if($strips[$parts[0]] != TRUE and $parts[0] != ""){ if($type == "post"){ $my_q .= "<input type=\"hidden\" name=\"".@htmlspecialchars($parts[0])."\" value=\"".@htmlspecialchars($parts[1])."\" />\n"; }else{ $my_q .= "$var_peace&"; } } } if( substr($my_q, -5) == "&" ){ $my_q = substr($my_q, 0, -5); } return $my_q; } /////////////////////////////////////////////////////// // Function: Flooder // Description: Flood Protection Function function flooder($ip, $comid){ global $cutepath, $config_flood_time; $old_db = file("$cutepath/data/flood.db.php"); $new_db = fopen("$cutepath/data/flood.db.php", w); $result = FALSE; foreach($old_db as $old_db_line){ $old_db_arr = explode("|", $old_db_line); if(($old_db_arr[0] + $config_flood_time) > time() ){ fwrite($new_db, $old_db_line); if($old_db_arr[1] == $ip and $old_db_arr[2] == $comid) { $result = TRUE; } } } fclose($new_db); return $result; } //////////////////////////////////////////////////////// // Function: msg // Description: Displays message to user function msg($type, $title, $text, $back=FALSE){ echoheader($type, $title); global $lang; echo"<table border=0 cellpading=0 cellspacing=0 width=100% height=100%><tr><td >$text"; if($back){ echo"<br /><br> <a href=\"$back\">go back</a>"; } echo"</td></tr></table>"; echofooter(); exit(); } //////////////////////////////////////////////////////// // Function: echoheader // Description: Displays header skin function echoheader($image, $header_text){ global $PHP_SELF, $is_loged_in, $config_skin, $skin_header, $lang_content_type, $skin_menu, $skin_prefix, $config_version_name; if($is_loged_in == TRUE){ $skin_header = preg_replace("/{menu}/", "$skin_menu", "$skin_header"); } else { $skin_header = preg_replace("/{menu}/", " $config_version_name", "$skin_header"); } $skin_header = get_skin($skin_header); $skin_header = preg_replace("/{image-name}/", "${skin_prefix}${image}", $skin_header); $skin_header = preg_replace("/{header-text}/", $header_text, $skin_header); $skin_header = preg_replace("/{content-type}/", $lang_content_type, $skin_header); echo $skin_header; } //////////////////////////////////////////////////////// // Function: echofooter // Description: Displays footer skin function echofooter(){ global $PHP_SELF, $is_loged_in, $config_skin, $skin_footer, $lang_content_type, $skin_menu, $skin_prefix, $config_version_name; if($is_loged_in == TRUE){ $skin_footer = preg_replace("/{menu}/", "$skin_menu", "$skin_footer"); } else { $skin_footer = preg_replace("/{menu}/", " $config_version_name", "$skin_footer"); } $skin_footer = get_skin($skin_footer); $skin_footer = preg_replace("/{image-name}/", "${skin_prefix}${image}", $skin_footer); $skin_footer = preg_replace("/{header-text}/", $header_text, $skin_footer); $skin_footer = preg_replace("/{content-type}/", $lang_content_type, $skin_footer); // Do not remove the Copyrights! $skin_footer = preg_replace("/{copyrights}/", "<div style='font-size: 9px'>Powered by <a style='font-size: 9px' href=\"http://cutephp.com/cutenews/\" target=_blank>$config_version_name</a> © 2005 <a style='font-size: 9px' href=\"http://cutephp.com/\" target=_blank>CutePHP</a>.</div>", $skin_footer); echo $skin_footer; } //////////////////////////////////////////////////////// // Function: b64dck // Description: And the duck fly away. function b64dck(){ $cr = bd_config('e2NvcHlyaWdodHN9');$shder = bd_config('c2tpbl9oZWFkZXI=');$sfter = bd_config('c2tpbl9mb290ZXI='); global $$shder,$$sfter; $HDpnlty = bd_config('PGNlbnRlcj48aDE+Q3V0ZU5ld3M8L2gxPjxhIGhyZWY9Imh0dHA6Ly9jdXRlcGhwLmNvbSI+Q3V0ZVBIUC5jb208L2E+PC9jZW50ZXI+PGJyPg=='); $FTpnlty = bd_config('PGNlbnRlcj48ZGl2IGRpc3BsYXk9aW5saW5lIHN0eWxlPVwnZm9udC1zaXplOiAxMXB4XCc+UG93ZXJlZCBieSA8YSBzdHlsZT1cJ2ZvbnQtc2l6ZTogMTFweFwnIGhyZWY9XCJodHRwOi8vY3V0ZXBocC5jb20vY3V0ZW5ld3MvXCIgdGFyZ2V0PV9ibGFuaz5DdXRlTmV3czwvYT4gqSAyMDA1ICA8YSBzdHlsZT1cJ2ZvbnQtc2l6ZTogMTFweFwnIGhyZWY9XCJodHRwOi8vY3V0ZXBocC5jb20vXCIgdGFyZ2V0PV9ibGFuaz5DdXRlUEhQPC9hPi48L2Rpdj48L2NlbnRlcj4='); if(!stristr($$shder,$cr) and !stristr($$sfter,$cr)){ $$shder = $HDpnlty.$$shder; $$sfter = $$sfter.$FTpnlty; } } //////////////////////////////////////////////////////// // Function: CountComments // Description: Count How Many Comments Have a Specific Article function CountComments($id, $archive = FALSE){ global $cutepath; if($cutepath == ""){ $cutepath = "."; } $result = "0"; if($archive and ($archive != "postponed" and $archive != "unapproved")){ $all_comments = file("$cutepath/data/archives/${archive}.comments.arch"); } else{ $all_comments = file("$cutepath/data/comments.txt"); } foreach($all_comments as $comment_line) { $comment_arr_1 = explode("|>|", $comment_line); if($comment_arr_1[0] == $id) { $comment_arr_2 = explode("||", $comment_arr_1[1]); $result = count($comment_arr_2)-1; } } return $result; } //////////////////////////////////////////////////////// // Function: insertSmilies // Description: insert smilies for adding into news/comments function insertSmilies($insert_location, $break_location = FALSE, $admincp = FALSE, $wysiwyg = FALSE) { global $config_http_script_dir, $config_smilies; $smilies = explode(",", $config_smilies); foreach($smilies as $smile) { $i++; $smile = trim($smile); if($admincp){ if($wysiwyg){ // $advanced_smile = "<img alt=\':$smile:\' src=\'data/emoticons/$smile.gif\' />"; // $output .= "<a href=# onclick=\"javascript:InsertIntoArea('$insert_location','$advanced_smile'); return false;\"><img style=\"border: none;\" alt=\"$smile\" src=\"$config_http_script_dir/data/emoticons/$smile.gif\" /></a>"; $output .= "<a href=# onclick=\"document.getElementById('$insert_location').contentWindow.document.execCommand('InsertImage', false, '$config_http_script_dir/data/emoticons/$smile.gif'); return false;\"><img style=\"border: none;\" alt=\"$smile\" src=\"$config_http_script_dir/data/emoticons/$smile.gif\" /></a>"; } else{ $output .= "<a href=# onclick=\"javascript:document.getElementById('$insert_location').value += ' :$smile:'; return false;\"><img style=\"border: none;\" alt=\"$smile\" src=\"$config_http_script_dir/data/emoticons/$smile.gif\" /></a>"; } }else{ $output .= "<a href=\"javascript:insertext(':$smile:','$insert_location')\"><img style=\"border: none;\" alt=\"$smile\" src=\"$config_http_script_dir/data/emoticons/$smile.gif\" /></a>"; } if( isset($break_location) && $i%$break_location == 0 ) { $output .= "<br />"; }else{ $output .= " "; } } return $output; } //////////////////////////////////////////////////////// // Function: replace_comments // Description: Replaces comments charactars function replace_comment($way, $sourse){ global $HTML_SPECIAL_CHARS, $config_allow_html_in_news, $config_allow_html_in_comments, $config_http_script_dir, $config_smilies; $sourse = stripslashes(trim($sourse)); if($way == "add"){ $find = array( "'\"'", "'\''", "'<'", "'>'", "'\|'", "'\n'", "'\r'", ); $replace = array( """, "&#039;", "<", ">", "&#124;", " <br />", "", ); } elseif($way == "show"){ $find = array( "'\[b\](.*?)\[/b\]'i", "'\[i\](.*?)\[/i\]'i", "'\[u\](.*?)\[/u\]'i", "'\[link\](.*?)\[/link\]'i", "'\[link=(.*?)\](.*?)\[/link\]'i", "'\[quote=(.*?)\](.*?)\[/quote\]'", "'\[quote\](.*?)\[/quote\]'", ); $replace = array( "<strong>\\1</strong>", "<em>\\1</em>", "<span style=\"text-decoration: underline;\">\\1</span>", "<a href=\"\\1\">\\1</a>", "<a href=\"\\1\">\\2</a>", "<blockquote><div style=\"font-size: 13px;\">quote (\\1):</div><hr style=\"border: 1px solid #ACA899;\" /><div>\\2</div><hr style=\"border: 1px solid #ACA899;\" /></blockquote>", "<blockquote><div style=\"font-size: 13px;\">quote:</div><hr style=\"border: 1px solid #ACA899;\" /><div>\\1</div><hr style=\"border: 1px solid #ACA899;\" /></blockquote>", ); $smilies_arr = explode(",", $config_smilies); foreach($smilies_arr as $smile){ $smile = trim($smile); $find[] = "':$smile:'"; $replace[] = "<img style=\"border: none;\" alt=\"$smile\" src=\"$config_http_script_dir/data/emoticons/$smile.gif\" />"; } } $sourse = preg_replace($find,$replace,$sourse); foreach ( $HTML_SPECIAL_CHARS as $key=>$value ){ $sourse = str_replace($key,$value,$sourse); } return $sourse; } //////////////////////////////////////////////////////// // Function: rteSafe // Description: safe data for the RTE function rteSafe($strText) { //returns safe code for preloading in the RTE $tmpString = $strText; //convert all types of single quotes $tmpString = str_replace(chr(145), chr(39), $tmpString); $tmpString = str_replace(chr(146), chr(39), $tmpString); $tmpString = str_replace("'", "&#39;", $tmpString); //convert all types of double quotes $tmpString = str_replace(chr(147), chr(34), $tmpString); $tmpString = str_replace(chr(148), chr(34), $tmpString); // $tmpString = str_replace("\"", """, $tmpString); // we are pasting the content within '' quotes so " are valid //replace carriage returns & line feeds $tmpString = str_replace(chr(10), " ", $tmpString); $tmpString = str_replace(chr(13), " ", $tmpString); return $tmpString; } //////////////////////////////////////////////////////// // Function: get_skin // Description: Hello skin! function get_skin($skin){ if(!file_exists('./data/reg.php')){ $stts = base64_decode('KHVucmVnaXN0ZXJlZCk='); } else{ include('./data/reg.php'); if(preg_match('/\\A(\\w{6})-\\w{6}-\\w{6}\\z/', $reg_site_key, $mmbrid)){ if(!isset($reg_display_name) or !$reg_display_name or $reg_display_name == ''){ $stts = "<!-- (-$mmbrid[1]-) -->"; }else{ $stts = "<label title='(-$mmbrid[1]-)'>". base64_decode('TGljZW5zZWQgdG86IA==').$reg_display_name.'</label>'; } } else{ $stts = '!'.base64_decode('KHVucmVnaXN0ZXJlZCk=').'!'; } } $msn = bd_config('c2tpbg=='); $cr = bd_config('e2NvcHlyaWdodHN9'); $lct = bd_config('PGRpdiBzdHlsZT0nZm9udC1zaXplOiA5cHgnPlBvd2VyZWQgYnkgPGEgc3R5bGU9J2ZvbnQtc2l6ZTogOXB4JyBocmVmPSJodHRwOi8vY3V0ZXBocC5jb20vY3V0ZW5ld3MvIiB0YXJnZXQ9Il9ibGFuayI+Q3V0ZU5ld3MgMS40LjU8L2E+ICCpIDIwMDYgIDxhIHN0eWxlPSdmb250LXNpemU6IDlweCcgaHJlZj0iaHR0cDovL2N1dGVwaHAuY29tLyIgdGFyZ2V0PSJfYmxhbmsiPkN1dGVQSFA8L2E+Ljxicj57bC1zdGF0dXN9PC9kaXY+'); $lct = preg_replace("/{l-status}/", $stts, $lct); $$msn = preg_replace("/$cr/", $lct, $$msn); return $$msn; } //////////////////////////////////////////////////////// // Function: replace_news // Description: Replaces news charactars function replace_news($way, $sourse, $replce_n_to_br=TRUE, $use_html=TRUE){ global $HTML_SPECIAL_CHARS, $config_allow_html_in_news, $config_allow_html_in_comments, $config_http_script_dir, $config_smilies; $sourse = stripslashes($sourse); if($way == "show") { $find= array( /* 1 */ "'\[upimage=([^\]]*?) ([^\]]*?)\]'i", /* 2 */ "'\[upimage=(.*?)\]'i", /* 3 */ "'\[b\](.*?)\[/b\]'i", /* 4 */ "'\[i\](.*?)\[/i\]'i", /* 5 */ "'\[u\](.*?)\[/u\]'i", /* 6 */ "'\[link\](.*?)\[/link\]'i", /* 7 */ "'\[color=(.*?)\](.*?)\[/color\]'i", /* 8 */ "'\[size=(.*?)\](.*?)\[/size\]'i", /* 9 */ "'\[font=(.*?)\](.*?)\[/font\]'i", /* 10 */ "'\[align=(.*?)\](.*?)\[/align\]'i", /* 12 */ "'\[image=(.*?)\]'i", /* 13 */ "'\[link=(.*?)\](.*?)\[/link\]'i", /* 14 */ "'\[quote=(.*?)\](.*?)\[/quote\]'i", /* 15 */ "'\[quote\](.*?)\[/quote\]'i", /* 16 */ "'\[list\]'i", /* 17 */ "'\[/list\]'i", /* 18 */ "'\[\*\]'i", "'{nl}'", ); $replace=array( /* 1 */ "<img \\2 src=\"${config_http_script_dir}/skins/images/upskins/images/\\1\" style=\"border: none;\" alt=\"\" />", /* 2 */ "<img src=\"${config_http_script_dir}/skins/images/upskins/images/\\1\" style=\"border: none;\" alt=\"\" />", /* 3 */ "<strong>\\1</strong>", /* 4 */ "<em>\\1</em>", /* 5 */ "<span style=\"text-decoration: underline;\">\\1</span>", /* 6 */ "<a href=\"\\1\">\\1</a>", /* 7 */ "<span style=\"color: \\1;\">\\2</span>", /* 8 */ "<span style=\"font-size: \\1pt;\">\\2</span>", /* 9 */ "<span style=\"font-family: \\1;\">\\2</span>", /* 10 */ "<div style=\"text-align: \\1;\">\\2</div>", /* 12 */ "<img src=\"\\1\" style=\"border: none;\" alt=\"\" />", /* 13 */ "<a href=\"\\1\">\\2</a>", /* 14 */ "<blockquote><div style=\"font-size: 13px;\">quote (\\1):</div><hr style=\"border: 1px solid #ACA899;\" /><div>\\2</div><hr style=\"border: 1px solid #ACA899;\" /></blockquote>", /* 15 */ "<blockquote><div style=\"font-size: 13px;\">quote:</div><hr style=\"border: 1px solid #ACA899;\" /><div>\\1</div><hr style=\"border: 1px solid #ACA899;\" /></blockquote>", /* 16 */ "<ul>", /* 17 */ "</ul>", /* 18 */ "<li>", "\n", ); $smilies_arr = explode(",", $config_smilies); foreach($smilies_arr as $smile){ $smile = trim($smile); $find[] = "':$smile:'"; $replace[] = "<img style=\"border: none;\" alt=\"$smile\" src=\"$config_http_script_dir/data/emoticons/$smile.gif\" />"; } } elseif($way == "add"){ $find = array( "'\|'", "'\r'", ); $replace = array( "&#124;", "", ); if($use_html != TRUE){ $find[] = "'<'"; $find[] = "'>'"; $replace[] = "<"; $replace[] = ">"; } if($replce_n_to_br == TRUE){ $find[] = "'\n'"; $replace[] = "<br />"; }else{ $find[] = "'\n'"; $replace[] = "{nl}"; } } elseif($way == "admin"){ $find = array( "''", "'{nl}'", ); $replace = array( "", "\n", ); //this is for 'edit news' section when we use WYSIWYG if(!$replce_n_to_br){$find[] = "'<br />'"; } if(!$replce_n_to_br){$replace[] = "\n"; } } $sourse = preg_replace($find,$replace,$sourse); foreach ( $HTML_SPECIAL_CHARS as $key=>$value ){ $sourse = str_replace($key,$value,$sourse); } return $sourse; } function bd_config($str){ return base64_decode($str); } ?>
  15. Huh? ??? There isn't even a line of such that the error is describing. Should I email you the code?
  16. It's really long, so I'll just email it to you. I hope that's ok... Thanks!
  17. Hello, I use a php news system, and I've recently be experiencing issues with my add-comment form. This is the error it's returning: Warning: Division by zero in /home/SITENAME/public_html/news/inc/functions.inc.php on line 469 Warning: Division by zero in /home/SITENAME/public_html/news/inc/functions.inc.php on line 469 Warning: Division by zero in /home/SITENAME/public_html/news/inc/functions.inc.php on line 469 Warning: Division by zero in /home/SITENAME/public_html/news/inc/functions.inc.php on line 469 Warning: Division by zero in /home/SITENAME/public_html/news/inc/functions.inc.php on line 469 Warning: Division by zero in /home/SITENAME/public_html/news/inc/functions.inc.php on line 469 Warning: Division by zero in /home/SITENAME/public_html/news/inc/functions.inc.php on line 469 Warning: Division by zero in /home/SITENAME/public_html/news/inc/functions.inc.php on line 469 I've tried re-uploading the functions.inc/php file, and nothing changes. I've even tried going to line 469 in the file, but there is no such line. Any help would be greatly appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.