Try this for the click count:
Open includes/functions/links.php
Replace:
Code:
////
// Return the links url
function zen_get_links_url($identifier) {
global $db;
$link = $db->Execute("select links_id, links_url from " . TABLE_LINKS . " where links_id = '" . (int)$identifier . "'");
$links_string = $link->fields['links_url'];
return $links_string;
}
With:
Code:
////
// Return the links url
function zen_get_links_url($identifier) {
global $db;
$link = $db->Execute("select links_id, links_url from " . TABLE_LINKS . " where links_id = '" . (int)$identifier . "'");
if(ENABLE_LINKS_COUNT == 'true') {
$links_string = zen_href_link(FILENAME_REDIRECT, 'action=link&goto=' . $link->fields['links_id']);
} else {
$links_string = $link->fields['links_url'];
}
return $links_string;
}
Save and close.
Open includes/modules/pages/redirect/header.php
Find:
Code:
case 'banner':
$banner_query = "SELECT banners_url
FROM " . TABLE_BANNERS . "
WHERE banners_id = :bannersID";
$banner_query = $db->bindVars($banner_query, ':bannersID', $_GET['goto'], 'integer');
$banner = $db->Execute($banner_query);
if ($banner->RecordCount() > 0) {
zen_update_banner_click_count($_GET['goto']);
zen_redirect($banner->fields['banners_url']);
}
break;
Add After:
Code:
case 'link':
$link_query = "SELECT links_url
FROM " . TABLE_LINKS . "
WHERE links_id = :linksID";
$link_query = $db->bindVars($link_query, ':linksID', $_GET['goto'], 'integer');
$link = $db->Execute($link_query);
if($link->RecordCount() > 0) {
require(DIR_WS_FUNCTIONS . 'links.php');
zen_update_links_click_count($_GET['goto']);
zen_redirect($link->fields['links_url']);
}
break;
Save and close.
Don't forget to switch Enable Click Count to true under Configuration > Links Manager
Bookmarks