We are using your ccounter script on a JQuery DataTable - and long story short - it populates the table but the table wont sort the output....
I think it is because this JQuery doesnt like this string: <script>ccount_display('XXXX')</script><
Here's the demo - https://www.concise-courses.com/hacking-tools/e.html (view source)
Any idea/ suggestions?
Thanks VERY much as ever!
PS here is the DataTables JQuery - http://www.datatables.net/
Jquery conflict with CCounter?
Re: Jquery conflict with CCounter?
It seems JQuery does like the string <script>ccount_display('XXXX')</script>
It just uses this string literally and does not use the values that are returned by the script.
I do not have a working solution for you, but I think you should create a php page that reads the CCount database file and displays it's values so that jquery gets actual values instead of the <script>ccount_display('XXXX')</script> string.
To achieve what you want you can probably use some of the code that is already used by the ccount script.
Option 1:
Use code inside the admin.php file because that already has the capabalities to display all the values and sort the columns (it seems to use jquery.tablesorter).
You would have to find a way to add your own columns 'Category', 'Name of Hacking Tool' and 'Tutorial Link' though.
So I guess it is not a very easy task.
Otion 2 (I thought of this after I wrote option 1):
Use the code inside display.php.
It contains the code that is used by the <script>ccount_display('XXXX')</script> so I think can you use this code (with some tweaking) to display the ccount links directly in a php page instead of using javascript.
I just can not tell you what you would have to tweak exactly because I have never tried to use it this way.
Maybe Klemen can give you more to the point advise because this is his script and he knows better how it works than I do (it would take me several hours of trial and error tweaking because I just know the basics of php and javascript and are not a real programmer).
Greetings,
Henrie
It just uses this string literally and does not use the values that are returned by the script.
I do not have a working solution for you, but I think you should create a php page that reads the CCount database file and displays it's values so that jquery gets actual values instead of the <script>ccount_display('XXXX')</script> string.
To achieve what you want you can probably use some of the code that is already used by the ccount script.
Option 1:
Use code inside the admin.php file because that already has the capabalities to display all the values and sort the columns (it seems to use jquery.tablesorter).
You would have to find a way to add your own columns 'Category', 'Name of Hacking Tool' and 'Tutorial Link' though.
So I guess it is not a very easy task.
Otion 2 (I thought of this after I wrote option 1):
Use the code inside display.php.
It contains the code that is used by the <script>ccount_display('XXXX')</script> so I think can you use this code (with some tweaking) to display the ccount links directly in a php page instead of using javascript.
I just can not tell you what you would have to tweak exactly because I have never tried to use it this way.
Maybe Klemen can give you more to the point advise because this is his script and he knows better how it works than I do (it would take me several hours of trial and error tweaking because I just know the basics of php and javascript and are not a real programmer).
Greetings,
Henrie
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
Re: Jquery conflict with CCounter?
Just like Henrie said, table gets sorted by the string inside <td>, not by the value returned by ccount_display function.
The easiest and most reliable way around it would be to use a server-side script (PHP) to read display values from CCount database and populate the table with integers, rather than JS (Henrie's option 2).
The easiest and most reliable way around it would be to use a server-side script (PHP) to read display values from CCount database and populate the table with integers, rather than JS (Henrie's option 2).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 6
- Joined: Fri Dec 19, 2014 8:32 pm
Re: Jquery conflict with CCounter?
Thanks guys -
I don't have the skill to write this code -
If either of you are able to write me a script (obviously I'll pay for your time) that would be great. Let me contact you offline.
Alternatively - if you know of anyone that might be able to help that would be awesome - thanks again.
I don't have the skill to write this code -
If either of you are able to write me a script (obviously I'll pay for your time) that would be great. Let me contact you offline.
Alternatively - if you know of anyone that might be able to help that would be awesome - thanks again.
Re: Jquery conflict with CCounter?
I am not available for hire at the moment, but you can for example hire a coder here.
This should be a straight-forward job for someone experienced with PHP:
1. read everything after // from the database file
2. unserialize
3. for each id of the array print the "C" key value for clicks and/or "U" key value for unique clicks
This should be a straight-forward job for someone experienced with PHP:
1. read everything after // from the database file
2. unserialize
3. for each id of the array print the "C" key value for clicks and/or "U" key value for unique clicks
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools