News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Viewing Recent Posts

Started by VO, November 04, 2010, 12:28:42 AM

Previous topic - Next topic

VO

Okay here is my site: hxxp:khelite.com/forums [nonactive]

I just installed SMF 2.0 RC4 (I had nothing installed before) a couple of days ago, and whenever I click on the "View the most recent posts on this forum" link I get this error...


Fatal error: Call to undefined function: array_diff_key() in .../Sources/Recent.php on line 252


I reuploaded Recent.php but I am still getting the same error. This is from the full SMF 2.0 RC4 download I got off of this site.

Thanks for your help and time!

EDIT: I added Recent.php as an attachment. Sorry for forgetting this!

twig/al

Did you run the Error check in the maintenance section of the Administration Panel? It will fix a lot of problems.

VO

I just ran it and it didn't detect any errors. Thanks for pointing that out though it was worth a try.

VO

I still haven't been able to resolve this.

Joker™

Try using this option

Any errors in error log regarding this problem?
Administration Center » Server Settings » General » Disable evaluation of templates.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

maharenterprises

Same issue here - tried "Disable Evaluation of Templates" and still got the error.

(using stock RC4 platform with only a couple modifications to the Index [copyright, subscriptions and form fields]).
NOTE: This occurs even when logged in as Admin (not user level related issue).

Please advise.
Thanks.

Joker™

Quote from: maharenterprises on November 19, 2010, 06:34:58 PM
Same issue here - tried "Disable Evaluation of Templates" and still got the error.
Was the error same? check your error log too regarding this issue.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Kays

Hi, what version PHP is running on your server?

array_diff_key() is a PHP 5 only function. So if your server is running PHP 4 then that could explain the error.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Norv

If you are using PHP4 or early versions of PHP5, please add the following code to your file Sources-Subs-Compat.php: (at the end of the file it would do just fine, right before ?>)



if (!function_exists('array_diff_key'))
{
function array_diff_key()
{
$arrays = func_get_args();
$result = array_shift($arrays);
foreach ($arrays as $array)
{
foreach ($result as $key => $v)
{
if (array_key_exists($key, $array))
{
unset($result[$key]);
}
}
}
return $result;
}
}
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Norv

Update: please, if you use PHP versions before PHP 5.1, try installing the attached package on your SMF installation, then access again the recent links.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Joshua Dickerson

VO, off-topic, but you should really upgrade PHP.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

maharenterprises

NORV - Thank You! (had the same problem - fixed with one gadget - you guys rock)
Cheers,
ME

Norv

Glad it helped. :)

This will be fixed in SMF 2.0 Final version.
However, please note that SMF 2.1+ will no longer be compatible with PHP4.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Advertisement: