Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 ?
Comment | File | Size | Author |
---|---|---|---|
#9 | count_clicks.patch | 8.53 KB | dimon4ikzp |
#6 | clicks_count.patch | 8.7 KB | dimon4ikzp |
Comments
Comment #1
iori57 CreditAttribution: iori57 commentedI would like to have this features as well :)
Comment #2
goldlilys CreditAttribution: goldlilys commentedThis 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.
Comment #3
Vako CreditAttribution: Vako commentedEnable the statistics module in core and set the properties.
Then download and install the count module.
Comment #4
Elvys CreditAttribution: Elvys commentedHi, I'm new to Drupal. Could you be more specific?
Thanks!
Comment #5
W.M. CreditAttribution: W.M. commentedI want to ask whether the Drupal 7 version supports the above mentioned feature ?! I think this would be a great addon for this module.
Comment #6
dimon4ikzp CreditAttribution: dimon4ikzp commentedhere is the patch which add this feature to the latest version 7.x-1.0.
please, review it and give your feedback.
thanks
Comment #7
jcfiala CreditAttribution: jcfiala commentedHey 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.
Comment #8
dqddimon4ikzp, 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!
Comment #9
dimon4ikzp CreditAttribution: dimon4ikzp commentedHi
All you suggestions have been implemented excluding javascript functionality. Hope all is well.
Please give your feedback, thanks
Comment #10
fiveaces CreditAttribution: fiveaces commentedHi,
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
Comment #11
dqddimon4ikzp++
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.
Comment #12
fiveaces CreditAttribution: fiveaces commentedDigidog,
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
Comment #13
berdyshev CreditAttribution: berdyshev commentedthanks, dimon4ikzp. it works great for me.
Comment #14
dqdreview fails:
First:
after refreshing cache
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/0
and 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 ...
Comment #15
dqdComment #16
Encarte CreditAttribution: Encarte commentedThe 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?
Comment #17
dqdthanks for info! I will take a look on how it works there ...
Comment #18
krembo CreditAttribution: krembo commentedHi, everyone. What is the solution for 6.x Link version?
Comment #19
grey_ CreditAttribution: grey_ commented+1 For this feature also in the 6.x version.
Sorry, cant help with a patch.
Comment #20
sa3er CreditAttribution: sa3er commentedPublic Download Count
http://drupal.org/project/pubdlcnt
Comment #21
jenlamptonSee also https://www.drupal.org/project/link_click_count for link field values.
Comment #22
dqdThanks for the link to the module providing this feature, @jen!
Aprt from that: Thanks for the reports and all the efforts in here. But due to inactivity in this issue for some years and because of the upcoming EOL of Drupal 7, I will close this issue on the way by cleaning up the issue queue.
Feel free to re-open as "Needs review" if you found a solution or have a patch to be reported to help others on this outdated version.
If you think this issue or missing feature should be addressed in a newer Drupal core 8 and above compatible version of this project, then please file a new issue to the latest dev.
Comment #23
DamienMcKennaThanks for spotting this.
I'd like to further state that this module is not the correct tool for data logging, use a separate analytics tool if you want to do that.