https://cutephp.com/forum/index.php?showtopic=43095

Try using a relative link in the  include rather than an absolute one.

I am not familiar with the differences in your version of cutenews but in the original cutenews the category ids can be changed in your data/category.db.php and the next available number to use is in cat.num.php

To log in use step 2 from this post:
https://cutephp.com/forum/index.php?s=&...st&p=154951
To move your data from one cutenews install to another move the data folder.
(Make backups first)

Line 20 should look like this:

if( isset($template) and $template != "" and !preg_match("/^[_a-zA-Z0-9-]{1,}$/", $template)){ die("invalid template characters"); }

If you have updated to php 5 then all your scripts will need to be updated if they give errors.
It is not possible to rewrite cutenews 1.5 to downgrade it. You could use an earlier version of cutenews but this is not a good idea as it will not be as secure.

preg_match needs a delimiter and you have not used one, eregi does not.
Usually / is used. You need to put one at each end of the values you are using like this:
/^[_a-zA-Z0-9-]{1,}$/

So

eregi("^[_a-zA-Z0-9-]{1,}$"

becomes

preg_match("/^[_a-zA-Z0-9-]{1,}$/"


This error should not occur in php5.3. Upgrade your PHP installation?


Language — Some wrong or weird sounding things

A search result displays "Founded news articles".
Proposition: "News articles found"

It seems that they work like NEWS field, because it search post have that criteria also in the text of the story...

Yes, it does.

This needs to be fixed by the script author. Support_Team.

On the page search for where you have

<input type=text value="Italia fuori dallÂ’euro"


It is where you have the search selection.

As Filou83 has explained, the problem is the  include and input in indexb.php

I have tested the code on my server and there are no problems with categories being displayed correctly in a main include. The latest comments code displays the last X comments regardless of category. So the problem may lie in your main include.

In the previous thread I asked if you were using the second script for PHP 5.
You said you were but you have used the first one.
Use this one.
https://cutephp.com/forum/index.php?s=&amp;...ost&amp;p=49288
Modify the code to suit your server.

<?php

//set your absolute path to cutenews here
$mPath = "home*****public_htmlcutenews";
$reverse = false; //false = newest comments first.
//number of latest comments to show
if(!isset($comments_number)) $comments_number = 4;
//URL to where you include your news, example: http://site.com/news.php
$site_url = 'http://www.pasqualemarinelli.com/indexb.php';
//more help on the format: http://www.php.net/manual/en/function.date.php
$date_format = 'd M y';
//can use: {url}, {name}, {date}, {comment}, {ip}, {mail}, {newsid}, {comid}, {title}
$ctemplate = ' {date}  by {name} - {comment}
';

$latest_comments = array();

$all_comments = file("$mPath/cdata/comments.txt");

foreach($all_comments as $comment_line)
{
$comment_line_arr = explode("|>|", $comment_line);
$newsid = $comment_line_arr[0];
$comment_arr = explode("||", $comment_line_arr[1]);
foreach($comment_arr as $single_comment)
{
$single_comment_arr = explode("|",$single_comment);
$latest_comments[$single_comment_arr[0]] = array_merge( array( $newsid ), $single_comment_arr );

}
}
if($reverse)
ksort($latest_comments);
else
krsort($latest_comments);

$t=0;
foreach($latest_comments as $comment){
$output = $ctemplate;

if ($comment[2]){

$title = get_title($comment[0], $mPath); //make sure path is passed to prevent open errors
$category = get_cat($comment[0], $mPath); //make sure path is passed to prevent open errors

$output = str_replace("{url}", $site_url."?subaction=showcomments&id={newsid}&ucat={category}#{comid}", $output);
$output = str_replace("{name}", $comment[2], $output);
$output = str_replace("{title}", $title, $output);
$output = str_replace("{mail}", $comment[3], $output);
$output = str_replace("{ip}", $comment[4], $output);
$output = str_replace("{comment}", $comment[5], $output);
$output = str_replace("{date}", date($date_format, $comment[1]), $output);
$output = str_replace("{newsid}", $comment[0], $output);
$output = str_replace("{comid}", $comment[1], $output);
$output = str_replace("{category}", $category, $output);
$output = replace_comment("show", $output);

echo $output . "n";
$t++;
}
if($t == $comments_number) break;
}

function get_title($id, $mPath){

$all_news = file("$mPath/cdata/news.txt");
foreach ($all_news as $news) {
$news_arr = explode("|", $news);
if ($news_arr[0] == "$id") {
$title = $news_arr[2];
}
}
$title = ereg_replace("<[^>]*>","",$title); // incase there is html tags
$title = str_stop($title, 40); // keep the title length under 40 chars, edit to taste
return $title;
}

function get_cat($id, $mPath){

$all_news = file("$mPath/cdata/news.txt");
foreach ($all_news as $news) {
$news_arr = explode("|", $news);
if ($news_arr[0] == "$id") {
return $news_arr[6];
}
}
return $title;
}

function str_stop($string, $max_length){
if (strlen($string) > $max_length){
$string = substr($string, 0, $max_length);
$pos = strrpos($string, " ");
if ($pos === false) {
return substr($string, 0, $max_length)."...";
}
return substr($string, 0, $pos)."...";
}else{
return $string;
}
}
unset($reverse);
?>

190

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

Your code works here without giving an error, although it repeats the same comment. Try changing $template to a different name. Are you using any other variables both in your main include and in the comments hack?

191

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

Did you use the version for PHP 5?
Post your modified version here.

192

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

I have tested the script and it works, when modified, on one of my servers.
503 Service Unavailable error is usually due to something overloading the server.
Take out the latest comments script and see if the error is still there.
If it is then the problem is in the central include.

193

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

There was a hack for this in 1.3.6 here:
https://cutephp.com/forum/index.php?showtopic=10545

With slight modification it works in 1.5
i.e the require_once lines
change references from data folder to cdata
add correct $mPath references

Open it with a text editor and check what is in it.

Have you got a news.txt file in your cdata directory?

196

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

If your host has given you access to your php.ini file.
then you should put it there.

You can find out where your php.ini file is by creating a file called phpinfo.php with the following in it

<?php phpinfo(); ?>


Upload it to your site and call it with your browser using
www.yourwebsite/phpinfo.php
Then look for  the exact path for where your default php.ini is located on the server.
It may be in your public_html directory.

If not just make your own.

<?php
ini_set( "session.save_path", "/web/htdocs/www.domain.com/home/" );
ini_set("session.gc_maxlifetime","3600");
?>

Save it as php.ini
and upload it to the root folder of your site.

Which version of cutenews are you using?
There is a hack for this for the 1.3.6 and  1.4.7 version.
https://cutephp.com/forum/index.php?showtopic=33970
A temporary fix if you are using 1.5 then delete lines 111 to 143 in addnews.php
Use this at your own risk.
Hopefully the Support Team will add an option to allow journalists to post without approval as in the hack.

Try a relative path instead of an absolute one
include("nieuws/show_news.php");

As you have a backup you should be able to delete the cutenews directory and re-install the new version in a new directory to get a clean installation. Copy the old data directory into the new cutenews directory and then run cutenews/index.php to let the installer migrate your old data.

200

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

It uses the css of the page in which you put the include

Posts found: 176 to 200 of 305

Pages Previous 1 6 7 8 9 10 13 Next

CutePHP Forums → Posts by Damoor