vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Looking for a JavaScript code for counting clicks (https://vborg.vbsupport.ru/showthread.php?t=149090)

4x4 Mecca 06-07-2007 01:09 AM

Looking for a JavaScript code for counting clicks
 
What I want is a javascript I could add to links, where if they click on a link it adds 1 point to userfieldX. The catch is that they could only get the point once per day (Not necessarly 24 hours, but if that's how it would have to work, so be it). So they could only click the link once a day.

Could someone here create that and if so would it be hard to create? :erm: :D

4x4 Mecca 06-08-2007 06:57 PM

Ok, is it possible?

cyberphr 06-08-2007 07:59 PM

Java is not JavaScript.

4x4 Mecca 06-08-2007 11:54 PM

Thanks. I should have known that.

Dismounted 06-09-2007 04:01 AM

Quote:

Originally Posted by 4x4 Mecca (Post 1264318)
Ok, is it possible?

To answer your question, yes, it is possible.

4x4 Mecca 06-09-2007 04:43 AM

Thanks, now I'm off to google how I might accomplish that.

VBDev 06-09-2007 07:33 PM

For that, you should add an onclick event to your link.

Your tag shall look like that :
Code:

<a href="your_url" onclick="my_js_function();">URL_TEXT</a>
Then you should create a my_js_function javascript function which update the field you want in the database by executing an ajax call (as it is called on a click on the link).

4x4 Mecca 06-09-2007 09:36 PM

Thanks vbdev.


All times are GMT. The time now is 08:27 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00946 seconds
  • Memory Usage 1,721KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete