Remove the bold line with $PHP_SELF.

If you want full story links to go to another page, I'd suggest setting up a new template and using something like

[url=article.php?subaction=showfull&article={article-id}]Read more[/url]

The file search.php cannot show full stories. Only show_news.php can.

When you search with search.php, it will make links for show_news.php, but of course if you only have:


There will be no show_news.php anywhere to understand the links that search.php makes.


I see the problem with $PHP_SELF and I apologize for not checking. It looks like $PHP_SELF now says to which page the search request (and not the results) should be sent to. If you have a file just including search.php and would like it to show the results & full story to another page (let's name it full.php), something like this would work:


$PHP_SELF = 'full.php';




It is possible to show the results on the same page but to have the links go to another page. This will need some editing in a TPL file, and I'm a little lazy right now, so just shout if you want to do that and I'll tell you what to do (if no one beats me to it).


It's also possible to have search.php and show_news.php on the same page. This would be the best way if you want to show active news (or whatever) and have a search sidebar somewhere. The results would then be shown in the same page.
This is how CuteNews' example2.php works.

For future reference — "it doesn't work" isn't very helpful feedback. If something is wrong, please explain what you did and how it is not working to your wishes. That way, we can address your problems a lot better. Thanks!

Link to your site would be very helpful. This could be anything, really.


In Options > Edit Templates, please locate the following:

<textarea cols="40" rows="6" id=commentsbox name="Kommentar"></textarea>

and change it back to

<textarea cols="40" rows="6" id=commentsbox name="comments"></textarea>

Etwas wie name="comments" gibt an, welcher Name das Feld haben soll. Das heisst, wenn dem Server eine Anfrage geschickt wird, dass ein Kommentar gespeichert werden soll, wird er abfragen, was unter dem Namen comments zu finden ist. Da das entsprechende Feld jetzt Kommentar heisst sucht er den Text des neuen Kommentars vergeblich, denn unter comments wird dem Server ja nichts mehr geschickt.

Thanks for the update! That piece of code definitely shouldn't clash with CuteNews.
My guess: If you just leave the line

<?php include("mytcg/settings.php") ?>

CuteNews still won't show. If you could verify that, we could know that it's this include line doing some trouble. Could you share the contents of that settings.php file?, minus the obvious sensitive stuff like database password, of course. (If you're worried about privacy, you're very welcome to send me a private message with its contents or post the code here and we can edit it out once your issue is solved.)

Failing that, if you could remove the include() line to mytcg/settings.php and just add some working SQL code as close as possible to that above, it would be interesting to see if CuteNews will show. Right now we're trying to narrow down the problem.


Woah, what, you're including CuteNews' index.php page in another page?

search.php only shows results but doesn't handle the display of news. If you have a page only with:

<?php include('./cutenews/search.php'); ?>

searching will work, but there is no show_news.php code to display the news.

You have two options:
a) Redirect the search results to be shown with another page, using $PHP_SELF:

$PHP_SELF = 'news.php';

The file news.php (referrenced to in $PHP_SELF) being a page including show_news.php

b) Include show_news.php in the same page as search.php:

<div class="search">

<div class="news">

Does your server suppress errors? It's always good to know what's going on and what the server isn't happy about.

Could you perhaps share that MySQL script, or at least the important parts? CuteNews doesn't use MySQL but it may be that CuteNews and the other script use the same variable or function or something. Since you say CuteNews shows up once the MySQL script is removed, the cause obviously lies there.

Sorry, I saw this topic but didn't reply to it as I'm not that knowledgeable when it comes to plugins. What I know is the following:

- You can find a list of official plugins here:
- Information about developing plugins are in this topic.
- When you install CuteNews, a folder /cutenews/cdata/plugins/ is created. It's my understanding that you just drop the plugin files in there. But I wouldn't put my hand in the fire.

output started at [...]/data/english.clf:1

This is from UTF-8 CuteNews. In this case, some people were having some problem with the first few characters of the CLF file. They're saved in UTF-8, which adds a couple of characters at the beginning of files to tell the system that it's in UTF-8. If a system is not UTF-8 aware, it will simply think it's data to output, therefore outputs those two characters, and then cookies can't be set anymore and sessions can't be created/modified.

What does your folder structure look like? Do you have a folder with the same name as your domain? Because links to* work the same way as*, which is rather odd.

I think you're missing http:// or something in the configuration. Please check Options > System Configurations and ensure that the field "Full URL to CuteNews directory" contains the correct link to your CuteNews folder, starting with http://.

It's important not to confuse what the tutorial does, which Piotr kindly posted. It extracts the news from the CuteNews file into a MySQL database, but CuteNews [currently] doesn't understand SQL, so once you have your database, its management is beyond the scope of CuteNews and up to you.

There's an unofficial fork of CuteNews called (at that offers MySQL support, but I've never tried it and I think it hasn't been developed actively for a while now.

As things are right now, these are the following options:
- Stick with flat-file for CuteNews, archive regularly (manually or using a monthly auto-archive; this can be set in Options > System Configurations > General)
- If flat-file isn't doable/desirable, a <acronym title='Content management system'>CMS</acronym> with MySQL support has to be found.

@Support_Team Seeing as this is not the first topic within the last 30 days about files becoming too big, an automatic archiving function dependent on file size might be interesting (i.e. automatically make an archive if news.txt exceeds 1 MB, for instance).

Cool, thanks. Some explanations:

Warning: disk_free_space(): Access is denied. ; \inc\main.php:210;
Warning: disk_total_space(): Access is denied. ; \inc\main.php:210;
Warning: Division by zero; \inc\main.php:210;

    $factor = (int)(100 * (1 - disk_free_space('/') / disk_total_space('/')));

On the main admin page of CuteNews, there's a little table with some stats — among the rows is one that shows the free disk space. Your host probably disabled the functions disk_free_space() and disk_total_space(), so when CuteNews tries to use it, it produces an error. Since the functions are supposed to return a value, another problem appears ("Division by zero"); the code divides by the number it's supposed to get, but since it didn't get any, it's equals to 0.
Your free disk space is probably fine and CuteNews wouldn't randomly erase configuration files to gain more space. Especially not a little file that is probably around 1 KB, if not smaller.

Warning: Invalid argument supplied for foreach(); \inc\tools.php:476;

    foreach ($cfg['more_fields'] as $i => $v)

Now, this is already more relevant to our problem. This problem is twice in your logs, with timestamps 1369160052 (21st of May) and 1369760454 (28 May). Hmm... this code is in the section that deals with XFields. I was optimistic at first, but I'm afraid the only thing it tells us is that the fields weren't there anymore when you visited the XFields module. Well, it was a try, but this doesn't help much.

I have some time to spare today/tomorrow, so I'll look for any other instances where /cdata/conf.php is written to and we'll see from there.

OK, we're getting somewhere...

So no other users? Do you have anything in the error logs? (The file is /cdata/logs/dump.log, I think)
Comments are enabled?

If fields were there and then gone when you logged on the next time, we have two obvious possibilities:
- Something can go wrong when comments get added
- Something can go wrong during the login process

I'm confused. What is exactly the difference between your other topic and this one?
What error messages does it output? What other errors occur? ("the list of errors goes on and on")

Lastly, are you updating with CuteNews' built-in module or are you doing it manually?

That's a smart idea (though unfortunately with iframes). As far as I know, it's not possible to show comments in the active news section without major modification of code.

What did you do before? Anything "special" that you don't do every day? (Such as changing the settings, changing your password, creating a new user, ...)

I tried getting the bug myself but I just can't, so I have no idea where to look. This week is finals week for me, so it isn't exactly at the top of my list, but I'll look at it again on Thursday. This is really bothering me


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

1.) Options > Additional fields: Create new field "image"

2.) Options > Edit Templates: Add tag {image} where you want. E.g:


In the Edit News and Add News modules, a link under "Title" appears saying "Additional fields." Click on it to display the new image field.

Unfortunately, it is currently impossible to show the image field immediately (without the "Additional fields" link), but I'm sure that's close enough. ^^

Edit: As FUNimations kindly pointed out in the post below, adding the full path to the image in the templates will solve a lot of potential path problems. Something like the code below should do the trick:


Oh, you're using UTF-8 CuteNews! The code is right and I'm glad your issue is over for the most part. When style elements load slowly, it can mean either
a) the browser has to wait a while to get the data (e.g. PHP is processing the templates really slowly, the server is sending back files really slowly, ...), or
b) mark-up errors are confusing the browser and it takes it some time until it has decided how to work it out. (I'm not exactly sure on the specifics, as you can tell from this pseudo-explanation, haha, but I have observed a few times that weird mark-up doesn't help a website in things performance. Not that I'm calling your mark-up weird! Haha)

Either way, take care!

What code did you add to the top of the page?
Link to site is always useful.

Try adding


just below <?php in the file and see if it gives you any errors. Error messages are our friends.

I reckon the captcha uses sessions or cookies and they can only be set when there has been no output at all. This means no whitespace either, so please ensure that "<?php" is at the very top of your file and that there is not any of the following before: a new line, a tab or a space.

What errors is CuteNews 1.5.3 giving you? What PHP version are you running? Are you running CuteNews locally (= on your computer) or on a web server?

The errors you posted about in the first post suggest that you're using at least PHP 5.3 and that you were using an old version written in the times of PHP, where functions like eregi() were still valid. The old functions have been removed in the 1.5 branch, so using CuteNews 1.5.3 will definitely not give you the same errors.


It sounds as if you don't have the appropriate tag in the templates. You can edit your templates at Options > Edit Templates. Please note the 2 help links next to the "?" icon — these show all the available tags. The quote is taken from the link "2 Template variables"

Social buttons
{fb-comments}     Facebook comments
{fb-like}     Facebook Like button
{twitter}     Twitter send button

So add {fb-like} and {fb-comments} at the places where they should appear.

Upgrade to a newer version of CuteNews. You're using an old version that was probably written in the times of PHP 4.


Before we start, please make a backup. You can do so via the Options module or just download the /cdata/ folder.

1) How big is /cdata/news.txt and /cdata/comments.txt ? If one of the files is big (around 1 MB or more), please make an archive (this module, too, can be found in the Options section).

2) We should make sure that the problem really comes from CuteNews. Do you have any other pages on your website that are similar but that don't have any CuteNews on them? Do they time out as well? Your host would be the place to contact if the whole website is responding slowly.

3) Do you have anything in the Options > Word Replacement module? If so, what? Anything special in the templates?

A link to your site would be very helpful.

That's a very good way of handling backups! Personally, I would also download the entire /cdata/ folder once a month (it includes templates, settings, categories — basically everything that is different from a new, default CuteNews installation). Don't forget to also download the comments file /cdata/comments.txt if you have them enabled.

Oh, also, if you're uploading a lot of things to CuteNews, it might be good to download the /uploads/ folder every now and then. I reckon you have the files on your computer (or not if many people are contributing to your website via CuteNews) but it may be nice to have a backup so all images in the news articles will automatically work and you won't have to look around your folders for them... this depends on how you've organized your website things locally on your computer.

EDIT: CuteNews has a backup module but it's always good to keep a backup on your local hard drive. If something happens to the CuteNews folder, the backups will be gone, too. Moreover, the backups only make a copy of the active news, comments and the archives but not of your users or your settings. Sporadically downloading the entire /cdata/ folder will make you fully covered.

Speaking of archives, are you downloading those as well? That might be another thing to consider as well.

Thanks a lot, Kristoff1875!

I'm afraid my hunch was a bad one... What I did was I edited the file and changed "Intro" to e.g. "introduction" as a test, whereupon it would just wipe the file. But that's because the length of the string just before the text (e.g. 5:"intro") has to be adjusted, too, or it will be messed up.
Since all the immediate handling of the data of that file is handled with PHP's own serialize() and unserialize(), it's impossible that there would be a bug like that in the code.

I'm still looking and trying things to reproduce the bug, but it's hard to really pin it down with all the code in CuteNews and having no idea where to look.

Posts found: 1 to 25 of 93

Pages 1 2 3 4 Next

CutePHP Forums → Posts by (lKj)

The pun_antispam official extension is installed. Copyright © 2003–2009 PunBB.