Hey I implemented a way to do this but I don't vouch that this is the best way to do it, but it worked for me @
www.meshedlinks.com, you can see it in action. Follow this steps - however this requires that you have a little, just a little, technical knowledge:
1. create a field in your pligg_links table to store the number of clicks (NOTE: I guess this can be done simply by using extrafields, but I guess someone can work on this solution and have something better)
To create field in your pligg_links table execute this against your database :
ALTER TABLE pligg_links ADD COLUMN clicks BIGINT DEFAULT 1;
2. Modify link.php (in libs folder as follows):
a. add var $clicks = 1; just after var $current_user_reports = 0;
b. replace this:
$db->query("UPDATE " . table_links . " set link_summary='$link_summary', link_title_url='$link_title_url', link_url='$link_url', link_url_title='$link_url_title', link_title='$link_title', link_content='$link_content', link_tags='$link_tags', link_field1='$link_field1', link_field2='$link_field2', link_field3='$link_field3', link_field4='$link_field4', link_field5='$link_field5', link_field6='$link_field6', link_field7='$link_field7', link_field8='$link_field8', link_field9='$link_field9', link_field10='$link_field10', link_field11='$link_field11', link_field12='$link_field12', link_field13='$link_field13', link_field14='$link_field14', link_field15='$link_field15', clicks='$clicks' WHERE link_id=$this->id");
with the $db->query you have in the store function. or alternatively just include ,clicks='$clicks' after $link_field15 in the $db->query function in the store function.
c. In the read function look for if($link) and at the end of it where you have $this->link_summary = $link->link_summary; include $this->clicks = $link->clicks; just below it.
d. In read_basic function replace the $db->get_row.... by $db->get_row("SELECT link_author, link_status, link_randkey, link_category, link_date, link_votes, link_karma, link_published_date, clicks FROM " . table_links . " WHERE link_id = $id"))) OR simply append , clicks to $db->get row just after link_published_date
e. add $this->clicks=$link->clicks; just after $this->published_date=unixtimestamp($date); still in read_basic
f. add this entry : $smarty->assign('clicks', $this->clicks); just after $smarty->assign('link_category', $this->category_name());
That is all for that file
3. Open out.php in your pliggroot directory. include this:
$db->query("UPDATE " . table_links . " SET clicks = clicks + 1 WHERE link_id = " . $id); just before header("HTTP/1.1 301 Moved Permanently");
4. open up link_summary.tpl in your templates directory and include this:
<span class="clicks">
Views : {$clicks}
</span>
where you want the clicks to be displayed. In your css fine you can define how it should look by creating an entry class clicks and defining it.
Well, that is about it. As I said this is my solution. I am certain there can be an optimized version, but this method does get things to work. Remember you can check it out at
www.meshedlinks.com
Am working on displaying and viewing links by votes. So for instance you have a tab at the top that says top links by votes or upcoming links by votes, if you get what I mean.
If you have any questions don't hesitate to post them.