Mmm... I'll look into this over the weekend and report back.
Talking about sort orders... would it be possible to display the most popular (links with most clicks) first? This would be a nice feature. :)
Printable View
Alex,Quote:
2 - When trying to add links from admin this error message was displayed.
Without fixing these errors (mainly number 2) I am unable to add any links!PHP Code:
Catchable fatal error: Object of class queryFactoryResult could not be converted to string in path\to\zencart\admin\includes\functions\html_output.php on line 333
Evidently this has something to do with line 365 in admin/links.php
and its interaction with this function in admin/includes/functions/html_output.phpPHP Code:
echo zen_draw_pull_down_menu('links_category', $categories_array, $lInfo->links_category, '', true);
at line 325PHP Code:
function zen_draw_pull_down_menu
Sort Order Update:
I'll incorporate this into the regular release at a later date, but for now if you want to have sort order options for your links you can use this.
Unzip the files:
run the included links_sort_order.sql using the Zen-Cart Sql Patches tool
(admin -> tools -> install sql patches)
Change the YOUR_TEMPLATE folder to match the name of your custom directory
FTP the includes folder to your site
Attachment 1173
Once the the sort order option is installed just go to admin ->configuration -> links manager -> select sort order and choose the option you want.
Excellent! :)
I'm currently working on a fix for my 'error number 2'.
Everything works fine when running php 5.1.6, but on my live server I'm running php 5.2.0. :(
However, it houldn't be too hard to fix this... I'll post back when I'm done.
Thanks again for your support and this great contribution! :)
Isn't it lines 478 - 495 that are causing this error?
Code:<?php
$link_statuses = array();
$links_status_array = array();
$links_status = $db->Execute("select links_status_id, links_status_name from " . TABLE_LINKS_STATUS . " where language_id = '" . $_SESSION['languages_id'] . "'");
while (!$links_status->EOF) {
$link_statuses[] = array('id' => $links_status->fields['links_status_id'],
'text' => $links_status->fields['links_status_name']);
$links_status_array[$links_status->fields['links_status_id']] = $links_status->fields['links_status_name'];
$links_status->MoveNext();
}
echo zen_draw_pull_down_menu('links_status', $link_statuses, $lInfo->links_status);
if ($action == 'edit' || $action == 'update') {
echo ' ' . ENTRY_LINKS_NOTIFY_CONTACT;
echo zen_draw_checkbox_field('links_notify');
}
?>
Ok, it appears that line 489 is causing all the problems.
I've also noticed that the admin menu doesn't work on my links.php page.Code:echo zen_draw_pull_down_menu('links_status', $link_statuses, $lInfo->links_status);
I could be.
The error:
points to line 333 in html_output.php which is inside the function for drawing the dropdown.Code:Catchable fatal error: Object of class queryFactoryResult could not be converted to string in pathtozencartadminincludesfunctionshtml_output.php on line 333
That's what I'm thinking, but I'm not sure how to fix it. :(
Ok, I've sorted it.
Just replacing line 333 in admin\includes\functions\html_output.php with the following worked.
However, my admin menu still doesn't work when I'm on the links.php page. :(Code:// bof php5 fix - aclarke - 301206
if (empty($default) && isset($GLOBALS['$name'])) $default = stripslashes($GLOBALS['$name']);
// eof php5 fix - aclarke - 301206
Also, when adding a new link the category field is marked as required? Is this correct? I've just added a link without a category (as I have no categories setup yet) and it didn't nag me to specify a category.