To apply the same modification in WordPress, edit pto_atoz.php and look for the following code at line 98:
$sql = "SELECT DISTINCT(".$module.") FROM `".$pto_config_databaseTablePrefix."products` WHERE ".$module." <> '' ORDER BY ".$module;
...and REPLACE with:
if ($module=="category")
{
$letter = (isset($_GET["letter"])?$_GET["letter"]:"");
if ($letter)
{
$sql = "SELECT DISTINCT(category) FROM `".$pto_config_databaseTablePrefix."products` WHERE category LIKE '".$wpdb->escape($letter)."%' ORDER BY category";
}
else
{
$sql = "SELECT DISTINCT(UCASE(SUBSTRING(category,1,1))) as letter FROM `".$pto_config_databaseTablePrefix."products` ORDER BY category";
if ($wpdb->query($sql))
{
$rows = $wpdb->last_result;
foreach($rows as $letters)
{
$html .= "<p><a href='?letter=".$letters->letter."'>".$letters->letter."</a></p>";
}
}
return $html;
}
}
else
{
$sql = "SELECT DISTINCT(".$module.") FROM `".$pto_config_databaseTablePrefix."products` WHERE ".$module." <> '' ORDER BY ".$module;
}
Hi,
To apply the same modification in WordPress, edit pto_atoz.php and look for the following code at line 98:
$sql = "SELECT DISTINCT(".$module.") FROM `".$pto_config_databaseTablePrefix."products` WHERE ".$module." <> '' ORDER BY ".$module;
...and REPLACE with:
if ($module=="category")
{
$letter = (isset($_GET["letter"])?$_GET["letter"]:"");
if ($letter)
{
$sql = "SELECT DISTINCT(category) FROM `".$pto_config_databaseTablePrefix."products` WHERE category LIKE '".$wpdb->escape($letter)."%' ORDER BY category";
}
else
{
$sql = "SELECT DISTINCT(UCASE(SUBSTRING(category,1,1))) as letter FROM `".$pto_config_databaseTablePrefix."products` ORDER BY category";
if ($wpdb->query($sql))
{
$rows = $wpdb->last_result;
foreach($rows as $letters)
{
$html .= "<p><a href='?letter=".$letters->letter."'>".$letters->letter."</a></p>";
}
}
return $html;
}
}
else
{
$sql = "SELECT DISTINCT(".$module.") FROM `".$pto_config_databaseTablePrefix."products` WHERE ".$module." <> '' ORDER BY ".$module;
}
Hope this helps!
Cheers,
David.
--
PriceTapestry.com