Posted by drupallogic on February 25, 2010 at 12:19pm
19 followers
| Project: | Link |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
I know it's too much to ask but will try my chance.
is it possible to add a "this link has been visited x times" feature to this module ?
Comments
#1
I would like to have this features as well :)
#2
This feature would be nice to have. Actually shouldn't it be basic since people would like to know how many times a link has been clicked or have a conditional for it. The number of times it has been clicked can be enabled for each node type and can choose where to place the counter. Should it be to the right or left of the link title, etc .
Also have the ability to use the click count in views for popularity as an example.
#3
Enable the statistics module in core and set the properties.
Then download and install the count module.
#4
Hi, I'm new to Drupal. Could you be more specific?
Thanks!
#5
I want to ask whether the Drupal 7 version supports the above mentioned feature ?! I think this would be a great addon for this module.
#6
here is the patch which add this feature to the latest version 7.x-1.0.
please, review it and give your feedback.
thanks
#7
Hey dimon4ikzp!
You've definately got the basics down for what the module needs to do, but there's a couple of problems that come to mind:
1) What i the link field is a multi-value one, or what if there's two link fields on the same entity? Then the code won't know which link to increment, or may increment the wrong one.
2) What if we've got two entities with a link field that may have a vid? Then the code won't know which entity to use.
3) What if the entity you add a link to doesn't have a vid? Users, for instance, don't.
One possibility would be to expand the link_goto to be something like 'link_goto////' It's long, but it's fairly comprehensive. So, for a node you might have 'link_goto/node/548/field_favorite_link/0', for instance. Again, a bit of a pain, but the user's not supposed to see it for very long.
Also, it might be cool to also have an option for a javascript counter for folks who have javascript, so that the link can be the normal link and the javascript calls the link_goto path invisibly. That might be better for your SEO.
But it's a good start, honestly.
#8
dimon4ikzp, thanks for the contribution. I agree with jcfiala, this is really an awesome start. But please try to diff/patch always against latest --dev so we can be sure that it keeps in line with other solved issues and development which is already in the repo and changes line numbers and so on ...
thanks 4 all the effort, much appreciated!
#9
Hi
All you suggestions have been implemented excluding javascript functionality. Hope all is well.
Please give your feedback, thanks
#10
Hi,
Firstly I would like to thank the people who put this great module together.
Thanks also to dimon4ikzp for patch #9. I applied the patch to version 7.x-1.0 and it works great with no errors.
I was wondering if it would be possible to extend this functionality further and have the link count filtering on user IP address over a time period so that a users will not be able to register a click count numerous times in a row. What I suggest is having a time limit on the Link creation page allowing custom time periods; 2 hours, 1 day etc. for click per IP address.
This would be a beneficial feature as it would log more realistic statistics for Site administrators.
Keep up the good work.
Many thanks
#11
dimon4ikzp++
thx for the patch!
fiveaces please don't change the version for the issue, if there is patch already provided for another version agreed with others. But thanks for your report and contribution. Please repeat you report on latest --dev and let us know.
@others: Patch needs more reviews. Please give feedback so that I can commit it asap.
#12
Digidog,
I apologize for changing the version in my comment.
To make up for it, I tested #9 on the 7.x-1x-dev version. It cleanly applied and installed without any errors.
Please consider my previous suggestion. Thanks
#13
thanks, dimon4ikzp. it works great for me.
#14
review fails:
First:
after refreshing cache
Notice: Undefined property: stdClass::$field_link_test_count in field_sql_storage_field_storage_load() (line 360 of /home/digidog/www/digidog/modules/field/modules/field_sql_storage/field_sql_storage.module).Notice: Undefined property: stdClass::$field_link_test_count in field_sql_storage_field_storage_load() (line 360 of /home/digidog/www/digidog/modules/field/modules/field_sql_storage/field_sql_storage.module).
is thrown out ...
recalling the page without another cache clear, the Notice disappears, but after pressing a link, site breaks with this error message
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_link_test_count' in 'field list': UPDATE {field_data_field_link_test} SET field_link_test_count=field_link_test_count + 1 WHERE (entity_type = :db_condition_placeholder_0) AND (revision_id = :db_condition_placeholder_1) AND (entity_id = :db_condition_placeholder_2) AND (delta = :db_condition_placeholder_3) ; Array ( [:db_condition_placeholder_0] => node [:db_condition_placeholder_1] => 113 [:db_condition_placeholder_2] => 78 [:db_condition_placeholder_3] => 0 ) in link_goto_url() (line 1250 of /home/digidog/www/digidog/sites/all/modules/link/link.module).Only after deleteing link field on content-type and re-inserting link field, the errors disappear. This is not good for a usual commit or push since it would break existing sites with existing link fields. If we sty on this concept, it would need other ways around to keep old link fields untouched. Were we come to my next, last and maybe most hurting point here:
Second:
Using a widget selector to switch to "Quantity of clicks" which shows nothing than a number and without any warning that it removes the entered link from before, is not good nor I see the use of having just a number on the page without the ability to click on anything. Switching back to another widget turns out a link like this
http://digidog.pc/link_goto/node/78_113/field_link_test/0and there is no chance to turn it back to the old value. I don't really understand what this behaviour is good for ...Summary: In the moment I would rather suggest something like this http://drupal.org/project/pop_links to use or would like to see another way to go for this than the solution provided in this issue here. Sorry, I think this is the wrong road ...
Feel free to refresh the issue if you have any other ideas to solve it. Otherwise I will come back on this later for some ideas when I finished the other issues in my queue ...
#15
#16
The Links Package module has the click counting feature implemented at least since 2006. And it's working even though the module is more or less abandoned. How does it do it?
#17
thanks for info! I will take a look on how it works there ...
#18
Hi, everyone. What is the solution for 6.x Link version?
#19
+1 For this feature also in the 6.x version.
Sorry, cant help with a patch.
#20
Public Download Count
http://drupal.org/project/pubdlcnt