1 micha69 Jan 31, 2012 09:41
3 micha69 Feb 04, 2012 15:07
Hello Sam2kb,
thx for help,
I did these two changes except _upgrade.funcs.php was in my installation at /inc/_core/model/db/ and I did paste the change in
_misc.funcs.php at the end but before */?>.
Hope that was o.k.
I'm sorry to say but I get the same error-code as before.
My php is v.4.49
Any idea what else I can try?
micha
4 sam2kb Feb 04, 2012 17:02
You should definitely not see this error
Fatal error: Call to undefined function: array_combine()
Are you sure the file _misc.funcs.php was edited and saved on the server
5 micha69 Feb 04, 2012 17:38
Hmm,
I've definetly overwritten the file on the server. Maybe I did something wrong with editing. Here is the end of _misc.funcs.php.
function sanitize_id_list( $str, $return_array = false, $quote = false )
{
// Explode and trim
$array = array_map( 'trim', explode(',', $str) );
// Convert to integer and remove all empty values
$array = array_filter( array_map('intval', $array) );
if( !$return_array && $quote )
{ // Quote each element and return a string
global $DB;
return $DB->quote($array);
}
return ( $return_array ? $array : implode(',', $array) );
}
/**
* Create json_encode function if it does not exist ( PHP < 5.2.0 )
*
* @return string
*/
if ( !function_exists( 'json_encode' ) )
{
function json_encode( $a = false )
{
if( is_null( $a ) )
{
return 'null';
}
if( $a === false )
{
return 'false';
}
if( $a === true )
{
return 'true';
}
if( is_scalar( $a ) )
{
if( is_float( $a ) )
{ // Always use "." for floats.
return floatval( str_replace( ",", ".", strval( $a ) ) );
}
if( is_string( $a ) )
{
$jsonReplaces = array( array( "\\", "/", "\n", "\t", "\r", "\b",
"\f", '"' ), array( '\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"' ) );
return '"'.str_replace( $jsonReplaces[0], $jsonReplaces
[1], $a ).'"';
}
return $a;
}
$isList = true;
for( $i = 0, reset($a); $i < count($a); $i++, next($a) )
{
if( key($a) !== $i )
{
$isList = false;
break;
}
}
$result = array();
if( $isList )
{
foreach( $a as $v )
{
$result[] = json_encode($v);
}
return '['.join( ',', $result ).']';
}
else
{
foreach( $a as $k => $v )
{
$result[] = json_encode($k).':'.json_encode($v);
}
return '{'.join( ',', $result ).'}';
}
}
}
/*
* $Log: _misc.funcs.php,v $
if (!function_exists('array_combine')) {
function array_combine($arr1, $arr2) {
$out = array();
$arr1 = array_values($arr1);
$arr2 = array_values($arr2);
foreach($arr1 as $key1 => $value1) {
$out[(string)$value1] = $arr2[$key1];
}
return $out;
}
}
*/
?>
...an here's a link to the error message:
www.medienwerkstatt.eu/members
6 sam2kb Feb 04, 2012 17:45
Ok, you did it wrong :) Notice how the code you added is printed in orange.
remove
/*
* $Log: _misc.funcs.php,v $
and closing
*/
7 micha69 Feb 04, 2012 18:39
Ah :D o.k.
I had to overwrite the last line w/out putting the */ at the end.
I'm sorry but my php knowledge is only rudimentary - to say the least. I do things like this only once a year and have always forgotten most of it before year is over... :-/
Thank you very much Sam2kb you made my weekend! :D
8 sam2kb Feb 04, 2012 18:44
No problem :)
Apply these two patches:
http://forums.b2evolution.net/viewtopic.php?p=111268#111268
http://forums.b2evolution.net/viewtopic.php?p=111288#111288