cadalist Posted December 5, 2007 Posted December 5, 2007 Help, I get a 100k hits per month and i am getting error messages http://www.ucsutah.com Warning: file() expects parameter 2 to be long, string given in /home/ucsutah/www/www/ucs/templates/HTML/main_page.tpl.php on line 36 Warning: Invalid argument supplied for foreach() in /home/ucsutah/www/www/ucs/templates/HTML/main_page.tpl.php on line 38 Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/ucsutah/www/www/ucs/templates/HTML/main_page.tpl.php on line 63 It was working perfectly and i put in my website address and now i get all these errors. I can change the template but then i put my html template and i get this error message. Does anybody have any ideas of how i can fix this? thanks
nimz Posted December 5, 2007 Posted December 5, 2007 look in main_page.tpl.php around line 36-38. that's what's causing the error you might have made modifications there that are causing problems. I hope you have a back up Santa's little freelancer
cadalist Posted December 5, 2007 Author Posted December 5, 2007 i haven't made any modifications and i copied a fresh copy of the file main_page.tpl.php over top of the original thinking there may have been a corruption but that didn't work either. I didn't do anything different it just came up with these errors. Could of my hosting service caused this? any suggestions would be great.
cadalist Posted December 5, 2007 Author Posted December 5, 2007 i haven't made any modifications and i copied a fresh copy of the file main_page.tpl.php over top of the original thinking there may have been a corruption but that didn't work either. I didn't do anything different it just came up with these errors. Could of my hosting service caused this? The contribution i am using is html to bts. And here is some of the code within those error messages. // loop the html array and ouput eval'ed php (if a tag is detected) or HTML foreach ($bts_html_array as $key => $value) { if (array_key_exists($value,$bts_php_array)){ // existing php code tag detected => evaluate php eval($bts_php_array[$value]); } else { // no existing php code tag => it's HTML => echo echo $value; } } /* functions */ function bts_read_php($php_template = 'main_page.code.php') { // read the php file, detecting tags and using these tags as key // read the PHP file into array (each line is one array element) $file_array = file(DIR_WS_TEMPLATES . $php_template, 'r'); // detect the tags "begin{", and use these tags as key for the new array foreach ($file_array as $value){ if (strpos ($value, 'begin{')){ // it's a {tag}, strip "//" and clean tag string $position = strpos ($value, '{'); $tag_value = trim(substr ( $value, $position)); } elseif (isset($tag_value)) { // it's php code, save into array using the {tag} as key $php_code_array[$tag_value] .= $value; } } return $php_code_array; } any suggestions would be great.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.