Parse error: syntax error, unexpected $end in
/includes/functions.php(2914) : eval()'d code on line 16
Any ideas? I'm on current version vb 3.6.2
I put it in the plugin manager ----
Product vbulletin
Hook cache_ordered_forums
Title Alpha sort subforums
Exec order 5 [Use this field to enter the order in which code at the same hook will be executed.]
Plugin PHP code [copied from RHSimard here]
$forumcheck = end($vbulletin->forumcache);
if (!$forumcheck['sorted'])
{
function forumsort($forum1, $forum2)
{
if ($forum1['displayorder'] == $forum2['displayorder'])
{
return strnatcasecmp($forum1['title_clean'], $forum2['title_clean']);
}
return ($forum1['displayorder'] < $forum2['displayorder'])
? -1
: 1;
}
uasort($vbulletin->forumcache, 'forumsort');
$lastforum = end($vbulletin->forumcache);
Plugin is active Yes.
RESULT
Parse error: syntax error, unexpected $end in
/includes/functions.php(2914) : eval()'d code on line 16
My vb is not installed in a folder named "forums" but I wouldn't have thought that affects this.
When I tried Andreas code (after switching RMSimard's verson to inactive)
it seemed to work fine - sight for sore eyes!
until I moved off the page I'd refreshed to check other pages.
I tried the main forums link in the breadcrumbs and got error below
- also same stuff if I try to do a fresh login.
Warning: array_keys() [function.array-keys]: The first argument should be an array in /includes/functions.php on line 3688
Warning: Invalid argument supplied for foreach() in /includes/functions.php on line 3688
Warning: end() [function.end]: Passed variable is not an array or object in /includes/functions.php(2914) : eval()'d code on line 1
Warning: uasort() [function.uasort]: The argument should be an array in /includes/functions.php(2914) : eval()'d code on line 8
Warning: end() [function.end]: Passed variable is not an array or object in /includes/functions.php(2914) : eval()'d code on line 9
Fatal error: Unsupported operand types in /includes/functions.php on line 2972
|