1

(57 replies, posted in Problem Solving / Help & Support)

Support ?

2

(57 replies, posted in Problem Solving / Help & Support)

Hello Support,

Actually, I use :

<?php

/*
  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
*/

$MYSQL_HOST = '###';
$MYSQL_USER = '###';
$MYSQL_PASS = '###';
$MYSQL_DB = '###';

$cn_connection = mysql_connect($MYSQL_HOST, $MYSQL_USER, $MYSQL_PASS);
mysql_select_db($MYSQL_DB, $cn_connection);
unset($MYSQL_HOST, $MYSQL_USER, $MYSQL_PASS, $MYSQL_DB);

if (!defined('CN_CONNECT'))
    define("CN_CONNECT", $cn_connection);

add_hook('core/entry_make_start', '*visit_counter');

function visit_counter($template, $data, $template_name)
{
    global $_plugin_visit_access;

    $ID = intval($data['id']);
    $online_time = intval(getoption('client_online'));

    if ($online_time == 0 || !empty($_plugin_visit_access))
        return array($template);

    // Part 1: Add
    if ($data['id'] && $template_name == 'full')
    {
        $_ip = mysql_real_escape_string($_SERVER['REMOTE_ADDR'], CN_CONNECT);

        mysql_query("INSERT INTO cn_visit_counter (`id`, `ip`, `accesstime`) VALUES ($ID, '$_ip', UNIX_TIMESTAMP(NOW()))", CN_CONNECT);
        mysql_query("DELETE FROM cn_visit_counter WHERE accesstime < ".(time() - $online_time), CN_CONNECT);
    }

    // Part 2: Calc
    $views = mysql_fetch_assoc( mysql_query("SELECT COUNT(*) as `count` FROM cn_visit_counter WHERE id = $ID", CN_CONNECT) );
    $template = str_replace("{page-views}", $views['count'], $template);

    $_plugin_visit_access = TRUE;
    return array($template);
}

This plugin work fine.

I test it on my private SQL (with port) and the connection is not good. I don't understand why. I've tested too with this code but don't work :

<?php

/*
  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
*/

$MYSQL_HOST = '###';
$MYSQL_USER = '###';
$MYSQL_PASS = '###';
$MYSQL_DB = '###';
$MYSQL_PORT = '###';

$cn_connection = mysql_connect($MYSQL_HOST, $MYSQL_USER, $MYSQL_PASS, $MYSQL_PORT);
mysql_select_db($MYSQL_DB, $cn_connection);
unset($MYSQL_HOST, $MYSQL_USER, $MYSQL_PASS, $MYSQL_DB, $MYSQL_PORT);

if (!defined('CN_CONNECT'))
    define("CN_CONNECT", $cn_connection);

add_hook('core/entry_make_start', '*visit_counter');

function visit_counter($template, $data, $template_name)
{
    global $_plugin_visit_access;

    $ID = intval($data['id']);
    $online_time = intval(getoption('client_online'));

    if ($online_time == 0 || !empty($_plugin_visit_access))
        return array($template);

    // Part 1: Add
    if ($data['id'] && $template_name == 'full')
    {
        $_ip = mysql_real_escape_string($_SERVER['REMOTE_ADDR'], CN_CONNECT);

        mysql_query("INSERT INTO cn_visit_counter (`id`, `ip`, `accesstime`) VALUES ($ID, '$_ip', UNIX_TIMESTAMP(NOW()))", CN_CONNECT);
        mysql_query("DELETE FROM cn_visit_counter WHERE accesstime < ".(time() - $online_time), CN_CONNECT);
    }

    // Part 2: Calc
    $views = mysql_fetch_assoc( mysql_query("SELECT COUNT(*) as `count` FROM cn_visit_counter WHERE id = $ID", CN_CONNECT) );
    $template = str_replace("{page-views}", $views['count'], $template);

    $_plugin_visit_access = TRUE;
    return array($template);
}



Could you help me to solve this small problem ?

Thanks you!

Great work !

Hi,

Use something like that :

<?php $number = "8";$category = "....";$template = "....";$PHP_SELF ="....";include("cutenews/show_news.php");?>

I've tested with your updates.

No error PHP but many problems.

The website is too long to load (3x more than the version 2.0.2).

+1

For the moment, my website is on 2.0.2 for this problem.

Support ??? Need this answer too.

Up!

SUPPORT ???

Up !

Support Team ? Where are you ?

up

still same problem...

https://cutephp.com/forum/style_emoticons/default/questionmark.gif

Hi Support Team,

A solution ? because I'm blocked, I can't finalized the update...

Thanks you for your work.

If I can help you, when I upload the file db/coreflat.php :

In home page, ex news appears... not the last one... The Headlines shows no entries.

// For speed, it seems to be solved.

Hi Support Team,

So, I've deleted all files in cdata/news

I've uploaded updates.

THE RESULT :

in cdata/news, all files have been regenerated with this time files A2_cache etc...

BUT BIG PROBLEM (I've clear the cache, cookies etc) :

In home page, ex news appears... not the last one...

The Headlines shows no entries.

I've been obliged to upload old files to fix the problem. I've let files A2-cache etc in cdata/news.

Thanks you for your help...

Please indicate what template code you have in  Active news for Headlines.

As to the problems with headlines, we need to understand whether it is related to cache or algorithms – try clearing your cache (by removing all files in cdata/news/, that start with cache_A2). If the problem is solved after the process, please let us know. If it persists, more tests will need to be carried out.

Code in active news :

<div class="headlines1"><div class="headlines2"><h3>{category} {category-icon}</h3></div><div class="headlines3"><span class="date">{day} {month} {hours}h{minute}</span></div><div class="headlines4"><h2>[full-link]{title}[/full-link]</h2></div></div>

In the cdata/news/ I don't see a file cache_A2...

OK, I'll test the updates and :

I can delete all files in cdata/news/ without risk ?

Thanks you

15

(2 replies, posted in Problem Solving / Help & Support)

Hi Support Team,

Work fine for category... great

But

Don't work for tagline (I've tested many time etc)

Thanks you

Hi Support Team,

Let me know when I can test a new update...

Best regards.

17

(2 replies, posted in Problem Solving / Help & Support)

Hi Support Team,

In the tag section, how to implement a specific title :

Instead of <title>News by tag - Title site</title>

Something like that <title>Tag Name - Title site</title>

.......

Same thing with categorie :

Instead of <title>News by category - Title site</title>

Something like that <title>Catagory Name - Title site</title>

Thanks you for your help.

Hi Support,

I've tested your last update on Github.

Maybe the home page is more speed but is better on 2.0.2...

Also, there is another problem with headlines (with links to the news). I use this code :

<?php $static = TRUE;$number = "12";$template = "Headlines";$PHP_SELF ="../actu/news.php";include("news/show_news.php");?>

And the result is :

No entries to show

With related post, I've always the a blank title with 1th January 1970

Hi Support,

Let know please when I can download and test modifications.

Thanks you.

Hi Support Team,

1/ Probably but in version 2.0.2, no problem in the home page with 23000 news... On the home page, I've only the 16 last news classified by date.
Thanks you for caching https://cutephp.com/forum/style_emoticons/default/wink.gif

2/ The problem appears only in the news with 6 related news (based on tag) : https://cutephp.com/forum/index.php?showtopic=44649. It doesn't appear on 2.0.2.
Maybe I can delete the news in errors with the date of 1th January 1970 ? If i can, how to find this news on the dashboard cutenews ?

Thanks you.

Hi Support Team,

1/ The website is really long to load, approximately 3 times superior. I talk about the home page (16 news are present on the home page) but I use CDN etc
Yes, I use tags like this in the template :

<div id="left"><div class="une">[full-link][img]{photo}[/img][/full-link]<div class="cat"><h3>{unetag}</h3></div><div class="une1"><h1>[full-link]{title}[/full-link]</h1></div></div><div class="dateshare2"><div class="dateshareleft1"><span class="date">{day} {month} {hours}h{minute}</span></div><div class="dateshareright1"><div class="shareme" data-url="{rss-news-include-url}"></div></div></div>

Also on home page, I use php code like this : <?php $number = "1";$category = "59";$template = "Une";$PHP_SELF ="../info/news.php";include(« info/show_news.php");?>
On home page, I don’t use pagination.

What do you mean by meta-indexes ?

I’ve 23000 news.

2/ I’ve a blank page when I upload old files (2.0.2) because the website was too long to load in version 2.0.3. If I delete cookies, it’s ok. If not, the blank page persists.

I use your script related news (on topic on the forum). It works perfectly on 2.0.2 but on 2.0.3, in the headlines (6 links with related news), I’ve (sometimes, depends on type of news, maybe category) the date 1 January 1970 and a blank link...

Hi Support Team,

I've tested with your updates.

No error PHP but many problems.

The website is too long to load (3x more than the version 2.0.2).

I use your code (related news) : https://cutephp.com/forum/index.php?showtopic=44649 and when a news is shown, sometimes there is a blank link with the date 1 January 1970. No problem on 2.0.2

So, I've re-upload version 2.0.2 // note : when I upload old files, I've to clean the cookies in my browser so as to have the website online, if not, the page is all blank. Maybe a problem with cookies in the new version ? don't know...

Could you fix this two problem ?

Best regards.

ok Thanks you Support, I'll test it tomorrow...

I've the version 2.0.2 who works perfectly.

So, I've download the ZIP on https://github.com/CuteNews/cutenews-2.0 and replace the old files by the new one, files modified. I'm extremely prudent so, I've replace the good one.

When it's done, I've uploaded new files on old files by FTP process.

That's all. And I've many errors, the news are not shown and PHP message error on the screen. I can't said what kind of errors because when I see that, I've upload old files to correct the problem...

Hi Support Team,

No response ? https://cutephp.com/forum/style_emoticons/default/smile.gif

I try to upload files modified on Github on the server (FTP) but many errors.