Errors Errors
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Errors

Started by termite, March 15, 2007, 04:24:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

termite

Hi,

I've just freshly installed the newest version of coppermine & also have tried to install the cpg1.4 Stramm modpack.

I'm more than sure I've uploaded all the files but I get the following error after running update.php :

Quote/** * filter_content() * * Replace strings that match badwords with tokens indicating it has been filtered. * * @param string or array $str * @return string or array **/ function filter_content($str) { global $lang_bad_words, $CONFIG, $ercp; if ($CONFIG['filter_bad_words']) { static $ercp=array(); if (!count($ercp)) foreach($lang_bad_words as $word) { $ercp[] = '/' . ($word[0] == '*' ? '': '\b') . str_replace('*', '', $word) . ($word[(strlen($word)-1)] == '*' ? '': '\b') . '/i'; } if (is_array($str)) { $new_str=array(); foreach ($str as $key=>$element) { $new_str[$key]=filter_content($element); } $str=$new_str; } else { $stripped_str = strip_tags($str); $str = preg_replace($ercp, '(...)', $stripped_str); } } return $str; } /*function get_post_var($name, $default = '') { return isset($_POST[$name]) ? $_POST[$name] : $default; }*/ function utf_strtolower($str) { if (!function_exists('mb_strtolower')) { require 'include/mb.inc.php'; } return mb_strtolower($str); } function utf_substr($str, $start, $end=null) { if (!function_exists('mb_substr')) { require 'include/mb.inc.php'; } return mb_substr($str, $start, $end); } function utf_strlen($str) { if (!function_exists('mb_strlen')) { require 'include/mb.inc.php'; } return mb_strlen($str); } function utf_ucfirst($str) { if (!function_exists('mb_strtoupper')) { require 'include/mb.inc.php'; } return mb_strtoupper(mb_substr($str, 0, 1)).mb_substr($str, 1); } function replace_forbidden($str) { static $forbidden_chars; if (!is_array($forbidden_chars)) { global $CONFIG, $mb_utf8_regex; if (function_exists('html_entity_decode')) { $chars = html_entity_decode($CONFIG['forbiden_fname_char'], ENT_QUOTES, 'UTF-8'); } else { $chars = str_replace(array('&', '"', '<', '>', ' ', '''), array('&', '"', '<', '>', ' ', "'"), $CONFIG['forbiden_fname_char']); } preg_match_all("#$mb_utf8_regex".'|[\x00-\x7F]#', $chars, $forbidden_chars); } /** * $str may also come from $_POST, in this case, all &, ", etc will get replaced with entities. * Replace them back to normal chars so that the str_replace below can work. */ $str = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $str);; $return = str_replace($forbidden_chars[0], '_', $str); /** * Fix the obscure, misdocumented "feature" in Apache that causes the server * to process the last "valid" extension in the filename (rar exploit): replace all * dots in the filename except the last one with an underscore. */ // This could be concatenated into a more efficient string later, keeping it in three // lines for better readability for now. $extension = ltrim(substr($return,strrpos($return,'.')),'.'); $filenameWithoutExtension = str_replace('.' . $extension, '', $return); $return = str_replace('.', '_', $filenameWithoutExtension) . '.' . $extension; return $return; } /** * resetDetailHits() * * Reset the detailed hits stored in hit_stats table for the given pid * * @param int or array $pid **/ function resetDetailHits($pid) { global $CONFIG; if (is_array($pid)) { if (!count($pid)) { return; } else { $clause = "pid IN (".implode(',', $pid).")"; } } else { $clause = "pid = '$pid'"; } $query = "DELETE FROM {$CONFIG['TABLE_HIT_STATS']} WHERE $clause"; cpg_db_query($query); } /** * resetDetailVotes() * * Reset the detailed votes stored in vote_stats table for the given pid * * @param int or array $pid **/ function resetDetailVotes($pid) { global $CONFIG; if (is_array($pid)) { if (!count($pid)) { return; } else { $clause = "pid IN (".implode(',', $pid).")"; } } else { $clause = "pid = '$pid'"; } $query = "DELETE FROM {$CONFIG['TABLE_VOTE_STATS']} WHERE $clause"; cpg_db_query($query); } ?>ree_result($results); return $USER_DATA; } else { return false; } } // Used for sorting (usort) the userlist by criteria that are not directly in the udb user table, callback function. function adv_sort($a, $b) { global $cpg_udb; if ($cpg_udb->sortdir == 'ASC'){ return strcmp($a[$cpg_udb->sortfield], $b[$cpg_udb->sortfield]); } else { return strcmp($b[$cpg_udb->sortfield], $a[$cpg_udb->sortfield]); } } // Get buddy info function get_buddy_infos($view,$sql2) { global $CONFIG; if($view=="1") $sql = "SELECT id, buddy_block, buddy_id, since, u.{$this->field['username']} as buddy_name, u.{$this->field['avatar_url']} AS avatar_url FROM {$CONFIG['TABLE_BUDDY']} as b LEFT JOIN {$this->usertable} as u on b.buddy_id=u.{$this->field['user_id']} WHERE b.user_id=".(USER_ID)." AND buddy_block='YES' "; if($view=="2") $sql = "SELECT id, since, u.{$this->field['username']} as buddy_name, buddy_from as buddy_id, u.{$this->field['avatar_url']} AS avatar_url FROM {$CONFIG['TABLE_BUDDY_REQ']} as b LEFT JOIN {$this->usertable} as u on b.buddy_from=u.{$this->field['user_id']} WHERE b.buddy_to=".(USER_ID)." "; if($view=="3") $sql = "SELECT id, since, u.{$this->field['username']} as buddy_name, buddy_to as buddy_id, u.{$this->field['avatar_url']} AS avatar_url FROM {$CONFIG['TABLE_BUDDY_REQ']} as b LEFT JOIN {$this->usertable} as u on b.buddy_to=u.{$this->field['user_id']} WHERE b.buddy_from=".(USER_ID)." "; if($view=="0") $sql = "SELECT id, buddy_ok, buddy_block, buddy_id, since, u.{$this->field['avatar_url']} AS avatar_url, u.{$this->field['username']} as buddy_name FROM {$CONFIG['TABLE_BUDDY']} as b LEFT JOIN {$this->usertable} as u on b.buddy_id=u.{$this->field['user_id']} WHERE buddy_ok='YES' AND b.user_id = ".(USER_ID)." "; $sql .= $sql2; $result = cpg_db_query($sql, $this->link_id); return $result; } function get_auto_subscribe_comment($uid) { $sql = "SELECT *, {$this->field['auto_subscribe_comment']} AS auto_subscribe_comment FROM {$this->usertable} WHERE {$this->field['user_id']} = '$uid'"; $result = cpg_db_query($sql, $this->link_id); $user_data = mysql_fetch_array($result); mysql_free_result($result); return $user_data; } function get_auto_subscribe_post($uid) { $sql = "SELECT *, {$this->field['auto_subscribe_post']} AS auto_subscribe_post FROM {$this->usertable} WHERE {$this->field['user_id']} = '$uid'"; $result = cpg_db_query($sql, $this->link_id); $user_data = mysql_fetch_array($result); mysql_free_result($result); return $user_data; } function get_notify_info($pid) { global $CONFIG; if ($this->can_join_tables) { $sql = "SELECT n.user_id, n.mail_sent, u.{$this->field['email']}, u.{$this->field['username']}, p.owner_id, p.owner_name, p.title, p.filename ". " FROM {$CONFIG['TABLE_NOTIFY']} AS n INNER JOIN {$this->usertable} AS u ON n.user_id=u.{$this->field['user_id']} ". " INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON n.picture_id=p.pid WHERE n.picture_id=".$pid; $result = cpg_db_query($sql, $this->link_id); return $result; } else { //no join -> we do not get the username + email and if needed we need to get it later on in another query $sql = "SELECT n.user_id, n.mail_sent, p.owner_id, p.owner_name, p.title, p.filename ". " FROM {$CONFIG['TABLE_NOTIFY']} AS n ". " INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON n.picture_id=p.pid WHERE n.picture_id=".$pid; $result = cpg_db_query($sql); return $result; } } function get_notify_email($id) { $sql = "SELECT u.{$this->field['email']}, u.{$this->field['username']} FROM {$this->usertable} AS u WHERE {$this->field['user_id']} = '$id'"; $result = cpg_db_query($sql, $this->link_id); $user_data = mysql_fetch_array($result); mysql_free_result($result); return $user_data; } function get_comments($pid, $comment_sort_order) { global $CONFIG; if ($this->can_join_tables) { $sql = "SELECT c.msg_id, c.msg_author, c.msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, c.author_id, c.author_md5_id, c.msg_raw_ip, c.msg_hdr_ip, c.pid, u.{$this->field['avatar_url']} AS avatar_url FROM {$CONFIG['TABLE_COMMENTS']} AS c LEFT JOIN {$this->usertable} AS u ON c.author_id=u.{$this->field['user_id']} WHERE pid='$pid' ORDER BY c.msg_id $comment_sort_order"; $result = cpg_db_query($sql, $this->link_id); return $result; } else { //no join -> we do not get the avatar URL and if needed we need to get it later on in another query $sql = "SELECT c.msg_id, c.msg_author, c.msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, c.author_id, c.author_md5_id, c.msg_raw_ip, c.msg_hdr_ip, c.pid FROM {$CONFIG['TABLE_COMMENTS']} AS c WHERE pid='$pid' ORDER BY c.msg_id $comment_sort_order"; $result = cpg_db_query($sql); return $result; } } function get_avatar($id) { global $CONFIG; $sql = "SELECT {$this->field['avatar_url']} AS avatar_url FROM {$this->usertable} WHERE {$this->field['user_id']}='$id'"; $result = cpg_db_query($sql, $this->link_id); $user_data = mysql_fetch_array($result); mysql_free_result($result); return $user_data; } function can_join(){ if ($this->can_join_tables) { return true; } else { return false; } } } ?>$i_group_name) . "' WHERE group_id = '$i_group_id' LIMIT 1"); } } // fix admin grp if (!$this->use_post_based_groups) cpg_db_query("UPDATE {$CONFIG['TABLE_USERGROUPS']} SET has_admin_access = '1' WHERE group_id = '1' LIMIT 1"); } } // and go ! $cpg_udb = new coppermine_udb; ?>
Parse error: syntax error, unexpected '}' in /home/jamesmca/public_html/gallery/include/themes.inc.php on line 2696

Any idea what is causing this, as I have successfully installed coppermine with this mod before. :-[