PDA

View Full Version : Links Manager II V 1.16



michael_s
09-29-2007, 04:01 AM
A small correction... the code below does resolve the error shown below, but it was missing a ; when originally posted. This will cause a syntax error. The correction is made below. All credit to original contributor! **no downloads attached**

habe diese tolle constrib mal installiert und bin echt begeistert

die Sprachdateien sind teilweise unvollständig gewesen. Ich habe versucht diese zu ergänzen

ein kleiner Bug in adminbereich behoben wenn Fehlermeldung
"1064 - You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near '-20, 20' at line 1"
in admin/link.php

finde:
$where = '';
if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
$keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
$where = ' where ';
$search = " ld.links_title like '%" . $keywords . "%' or l.links_url like '%" . $keywords . "%'";
}

if ($showLinkStatus == 'All')
$links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_reciprocal_disable, l.links_status from " . TABLE_LINKS . " l left join ( " . TABLE_LINKS_DESCRIPTION . " ld ) on ( l.links_id = ld.links_id ) " . $where . $search . " order by " . $order;
else
$links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_reciprocal_disable, l.links_status from " . TABLE_LINKS . " l left join ( " . TABLE_LINKS_DESCRIPTION . " ld ) on ( l.links_id = ld.links_id ) " . $where . " l.links_status = '" . $showLinkStatus . "' and " . $search . " order by " . $order;

und ersetze durch:
$where = ' where ';
if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
$keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
$where = ' where ';
$search = " and ld.links_title like '%" . $keywords . "%' or l.links_url like '%" . $keywords . "%'";
}
else if ($showLinkStatus == 'All')
$where = '';

if ($showLinkStatus == 'All')
$links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_reciprocal_disable, l.links_status from " . TABLE_LINKS . " l left join ( " . TABLE_LINKS_DESCRIPTION . " ld ) on ( l.links_id = ld.links_id ) " . $where . $search . " order by " . $order;
else
$links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_reciprocal_disable, l.links_status from " . TABLE_LINKS . " l left join ( " . TABLE_LINKS_DESCRIPTION . " ld ) on ( l.links_id = ld.links_id ) " . $where . " l.links_status = '" . $showLinkStatus . "'" . $search . " order by " . $order;



More... (http://addons.oscommerce.com/info/5272)