26 (edited by 2013-05-18 11:51:31)

Re: Visit Counter

Hi Support,

After another test and chmod 755 (max OVH) on folder "news", many files (1700) are created now like that ".nfs00000000066b55d80001c37a"

For the moment, it doesn't works, the counter has no implemented it for a unknown reason... the size of the file counter.txt is bloqued to : 100 572

Maybe is due to the number of news, more than 2500... for the moment...

Thanks for your help...

Re: Visit Counter

Unfortunately the plugin isn't suited for highly loaded projects because file editing takes time and lock process in windows based platform doesn't work. If you have an opportunity to connect to MySQL we can rewrite it for MySQL.

Best regards,
CN Support team

Re: Visit Counter

Hi Support Team,

Thanks you.

Yes, I can connect to MySQL... Could you think you can create a plugin like this ?

Re: Visit Counter

Thanks filou83 but I just want a simple counter of hits and this website is not free...

Re: Visit Counter

We've attached you an mysql version of the counter.
Before its use you need: 1) point host, user, password, db; 2) create a table cn_visit_counter, its structure is in the plugin's file.

Best regards,
CN Support team

Re: Visit Counter

Thanks you so much, I test it and I make a feedback tomorrow...

Re: Visit Counter

For the moment (since 2 hours), it works like a charm !

Re: Visit Counter

Hello,

The script is good. No reboot with MySQL. Perfect !

Thanks you.

34 (edited by 2013-06-13 16:24:51)

Re: Visit Counter

Hi Support Team,

Finally, I think there is a small problem with hit counter (MySQL). In fact, there is a fonction in the script who execute and block the server.

Response of OVH in French :

Votre base est actuellement suspendue ceci vient du fait que vous surchargez le serveur mysql51-71
Vous avez des requêtes qui s'exécutent en boucle et qui bloquent le serveur.

===========================
SELECT * FROM cn_visit_counter WHERE id = 1361700169 ORDER
BY accesstime ASC
=============================

So, have you got a solution for this problem ?

The base MySQL :

http://img854.imageshack.us/img854/4654/26541878.jpg

Thanks for all.

Re: Visit Counter

1) How many report are there in your database?
SELECT COUNT(*) FROM cn_visit_counter;

2) The amount of reports for 1 news SELECT COUNT(*) FROM cn_visit_counter WHERE id = 1361700169;

Change in the line's script

    $q = mysql_query("SELECT * FROM cn_visit_counter WHERE id = $ID ORDER BY accesstime ASC", $cn_connection);
    while ($a = mysql_fetch_assoc($q)) $news[] = $a;

to the following

    $q = mysql_query("SELECT * FROM cn_visit_counter WHERE id = $ID", $cn_connection);
    while ($a = mysql_fetch_assoc($q)) $news[ $a['accesstime'] ] = $a;
    ksort($news);

If the database is rather big and you can avoid keeping files of more that 3 days long you can add the lines after ksort($news)
    $the_old_time = 60*60*24*3; // 3 day
    mysql_query("DELETE FROM cn_visit_counter WHERE id = $ID AND accesstime < UNIX_TIMESTAMP(NOW()) - $the_old_time", $cn_connection);

Best regards,
CN Support team

36 (edited by 2013-06-14 11:28:59)

Re: Visit Counter

I've deleted it and rebuild it this morning so I can say that since 2 hours :
cn_visit_counter 1  393    MyISAM    utf8_general_ci    101,9 Kio   

I've approximately 3000 news (but I archive it manually regularly : archive : 11173 news).

I've made all modifications in the file visit_counter.php like you said.

Do you think it's possible to replace 3 days by 2 like that : $the_old_time = 60*60*24*2; // 2 day

I use only {page-views}, can you think I can deleted this code :

$output = str_replace("{unique-views}", count($unique), $output);
    $output = str_replace("{your-views}", $your_views, $output);
    $output = str_replace("{online}", count($online), $output);
    $output = str_replace("{first-view}", date($config_timestamp_active, $first_view), $output);

I say you if the problem is still present.

Thanks you for your help.

37 (edited by 2013-06-20 15:46:32)

Re: Visit Counter

Hi Support Team,

Since 1 week, here the result on the server :

120  618 ligns and 5,6 Mio

With the modification, it seems to be good :

$q = mysql_query("SELECT * FROM cn_visit_counter WHERE id = $ID", $cn_connection);
while ($a = mysql_fetch_assoc($q)) $news[ $a['accesstime'] ] = $a;
ksort($news);

I've deleted this :

$output = str_replace("{unique-views}", count($unique), $output);
$output = str_replace("{your-views}", $your_views, $output);
$output = str_replace("{online}", count($online), $output);
$output = str_replace("{first-view}", date($config_timestamp_active, $first_view), $output);

And finally I don't use this :

$the_old_time = 60*60*24*3; // 3 day
mysql_query("DELETE FROM cn_visit_counter WHERE id = $ID AND accesstime < UNIX_TIMESTAMP(NOW()) - $the_old_time", $cn_connection);

Regards,

Re: Visit Counter

Hi,

For Support Team, it works like a charm !

Thanks you.

Re: Visit Counter

Hi, I'd like to hicierais a tutorial for this plugin can be worth in version 2.0.

Thank you,
A greeting.

translate google spanish - English.
(Original):
Hola, me gustaría que me hicierais un tutorial para que este plugin pueda valen en la versión 2.0.

Gracias,
Un saludo.

Re: Visit Counter

Hi,

Visit counter plug-in with MySQL works like a charm.

I've said to the support that It would be greatful to have a plug-in that will classify news by visits. I think users would like this fonction.

Regards.

Re: Visit Counter

Hi,

Visit counter plug-in with MySQL works like a charm.

I've said to the support that It would be greatful to have a plug-in that will classify news by visits. I think users would like this fonction.

Regards.


Could You give a link to a fully working file visit-counter.php ?
I have the plugin does not work. MySQL database is created, the table is created.
CuteNews 2.0 last

Re: Visit Counter

Hi,

The file I use in attach.

The original file is in post #31
For MySQL, the post is the #35

I use the tag {page-views} in full story template.

Regards.

Re: Visit Counter

Hi,

The file I use in attach.

The original file is in post #31
For MySQL, the post is the #35

I use the tag {page-views} in full story template.

Regards.


Thank you very much.
a pop up window with the full news in the upper right corner
http://detcorp.ru/ok.png

Re: Visit Counter

Hello!
I'm sorry, but..
1 - I  download plugin and copy him ../cutenews/cdata/plugins
2 - I edited Templates > Active News
<div style="word-wrap:break-word; width:500px; float:left;"><strong>[link]{title}[/link] {page-views} </strong></div>
3 - and.....nothing. No counter. Why?

Re: Visit Counter

Hi Netta,

For MySQL, the post is the #35

Re: Visit Counter

Hi Netta,

For MySQL, the post is the #35


nothing. Why not write to the table?
I checked: MySQL and table available.
I closed in visit_counter.php tag  php?>
It did not help.

Re: Visit Counter

Hi,

You must create table on your MySQL database like this :

/*
  CREATE TABLE `cn_visit_counter` (
  `id` int(11) NOT NULL,
  `ip` varchar(16) NOT NULL,
  `accesstime` int(11) NOT NULL,
  KEY `id` (`id`)
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8
*/

Re: Visit Counter

Hi,

You must create table on your MySQL database like this :

/*
  CREATE TABLE `cn_visit_counter` (
  `id` int(11) NOT NULL,
  `ip` varchar(16) NOT NULL,
  `accesstime` int(11) NOT NULL,
  KEY `id` (`id`)
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8
*/


yes, I did it, but nothing is displayed. What I am doing wrong?

Re: Visit Counter

yes, I did it, but nothing is displayed. What I am doing wrong?


Here is how the table looks at me
An hour trying to make it work...

https://cutephp.com/forum/uploads/monthly_03_2014/post-82253-1394353800.jpg
https://cutephp.com/forum/uploads/monthly_03_2014/post-82253-1394353827.jpg
https://cutephp.com/forum/uploads/monthly_03_2014/post-82253-1394353836.jpg

Re: Visit Counter

You use the tag in the template but only in full story ?