In my opinion it isn't a kb problem but a pixel problem :S

OK, that would be a first.
And through your ftp you can upload images images taht have higher pixels?

I really think it's some restriction on your hosts end; As the uplaod script is ment to just upload the file and then it applies watermark etc, creates thumbs.
Could it be you host doesn't have the GD library

So if I delete the biggest image from FTP

and the image that is bigger, does it have the correct size on your ftp, or is it smaller then the size on your computer?

also just check with your host anywayand ask them if there's a file size limit when uplaoding a file through a form.
As this migth be the problem.

I have found THIS code

that's an older version of this, hack. Though it sounds as if your images.mdu of v3 wasn't uplaoded completly.

As for the thumbs. beside the things posted in this topic, there are many other topics about thumbs.

I installed this mod but it doesn't work

the mod does work. I have it so you can't say it doesn't work https://cutephp.com/forum/style_emoticons/default/wink.gif
As for uploading an image, do you have the same problem with the original image module?

205

(0 replies, posted in Hacks & Tricks / FAQ)

Thank you for your interest in purchasing a license for CuteNews.
First of all, The forum support members have nothing to do with the licenses. So any license related questions should be addressed to the author --> support@cutephp.com

With every purchased license you are allowed to remove the annoying "Powered by CuteNews..." line and your copy of the script will be authorized on the domain where the installation is located.

This is NOT an automated process so this may take a while before you receive your license.
And with 'a while' i do mean within a few hours -> a month.
Or you may be lucky and receive it the next day.
This extra notice is for people who complained about this on the forum. Though i doubt people search about buying a license first.
Anyhow, here it is.


Registration Process:
<ol type='1'> * Purchase a CuteNews license through our various payment options. (PayPal, ShareIt, Bank Transfer)
* You'll recieve email confirming your purchase and a unique registration number. Which may take some time. Be aware the mail wi'll be send to the email address connected to your paypal/share it acount.
* Login to the Customer Area to obtain your reg. file
* Simply upload the reg. file and CuteNews will become licensed, all the annoying lines are removed.
</ol>

license.txt that came with the CuteNews zip file wrote:

CutePHP.com Software License Agreement

1. This Software License Agreement is a legal agreement between you,
the end-user ("Licensee"), and Authors of software ("Authors"). By
using our software or storing it on a computer hard drive (or other
type of media), you are agreeing to be bound by the terms of this
Agreement.

2. CutePHP Software IS DISTRIBUTED "AS IS". NO WARRANTY OF ANY KIND IS
EXPRESSED OR IMPLIED. You Use our software AT YOUR OWN RISK. CutePHP
Author hereby disclaims all warranties and guarantees regarding the
use, or the results of use, of the software in terms of correctness,
accuracy, reliability or otherwise. The Author will not be responsible
for any incidental, consequential, direct or indirect damages. You
also agree that the disclaimer is the complete and exclusive statement
of agreement between the parties and supersede all proposals or prior
agreements, oral or written, and any other communications between the
parties relating to the subject matter of the disclaimer.

3. All copyrights to "CutePHP.com" are exclusively owned by the author
- Georgi Avramov.

4. You can use CutePHP.com Software for free (non-commercial needs) as
long as you do not remove / edit, and keep visible the "Powered by..."
line (displayed on every page where the script is included) without
the explicit written permission of CutePHP.com or payed registration.
The Software is licensed only to you. You may not rent, lease,
sublicense, sell, assign, pledge, transfer or otherwise dispose of the
Software in any form, on a temporary or permanent basis, without the
prior written consent of CutePHP.com

5. Users may modify software code for their personal use (at their own
risk), but any altered code must not be redistributed or resold in any
form without the explicit written permission of CutePHP.com

6. Registered Users/Customers (purchased-license holders) are allowed
to remove the 'Powered by...' line.

6.1 All customers must include the URL of the domain where the Script
will be used. This is done through the Customer Area at CutePHP.com

6.2 Customers are allowed to install the script only on the domain
stated in their license. This means that the Licensee can install the
script only on one domain per license purchased. Multiple instances of
the script (installations) are allowed in the scope of the licensed
domain.

6.3 Once you are in receipt of our software, License fees are
non-refundable. We encourage you to verify (by installing the free
version) that the software is working on your server and no problems
are occurring.

6.4 Un-Official technical support will be provided in our forums from
voluntary members to both Registered and Un-Registered Users.

TERMINATION
This Agreement will terminate automatically upon failure to comply
with the limitations described herein or on written notice from an
authorized representative of CutePHP.com. On termination, you must
destroy all copies of the Software within 48 hours.

206

(1 replies, posted in Hacks & Tricks / FAQ)

Name: "Sticky" Top Article
Author: FUNimations
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: We'll discuss how to have 1 specific article on a page.
Instructions:
In the previous post the idea is to have other news as well that does not influence the 1 stickied.
But if you want just 1 specific article displayed on a page without using categories.
Something along the line of this should work better. And is easier to understand as less code is required then the example above.

$number="1";
if(!isset($_GET['subaction']) && !isset($_POST['subaction']))
$subaction="showfull";
$id="xxx"; // the id of the sticky article
$template="xxx";
$category="xxx";
$ucat = $category;
include("news/show_news.php");


the xxx's have the same value as in the previous post

$number="1";
shows one post....the sticky article

$subaction="showfull";
only for cutenews 1.x.x

$id="xxx";
The news id (very important) .... write a news article, add it, post it.....Now go to "edit news" and hover your mouse over the title or click on it...See the long number digit? .... its usually about 11 characters long (not hard to miss) . write that in place of the "xxx".

$template="xxx";

Make a template (if you want) and include it where the "xxx" is.

$category="xxx";
Make a category (if you want) and include it where the "xxx" is.

include("news/show_news.php");
The main include, essential.

if(!isset($_GET['subaction']) && !isset($_POST['subaction']))
this is the only code different from the above hack. This code is added in case want commenting on that article. As when you submit a comment, $subaction needs to be some other value.

207

(1 replies, posted in Hacks & Tricks / FAQ)

Name: Comments Manager Module
Author: superhero
Updated by: Dook
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Add's a module that lists all comments by last added.
Features:
* it shows latest comments in admin panel (default 30)
*     delete comment (for editor and Admin only)
*     edit comment (for editor and Admin only)
*     Add reply (for all users)
*     Block ip (for editor and Admin only)
*     check ip (all users)
*     ban user (Admin only) //reported not working
*     send e-mail (all user if commenter put his e-mail)


Requirements: PHP5
Instructions:
find this in index.php

'editusers'                => 'admin',


and add below

'moderator'                   => 'user',

in inc/option.mdu find this

array(
                                        'name'                => "Block IP's from posting comments",
                                        'url'                => "$PHP_SELF?mod=ipban",
                                        'access'        => "2",
                    ),


and below add this

array(
                           'name'                => "Moderator",
                           'url'                => "$PHP_SELF?mod=moderator&action=moderator",
                           'access'        => "3",
                    ),


make a file called moderator.mdu and upload it to your inc folder
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?PHP
////////////////////////////////////////////////////////////////////
// Moderator hack created by superhero
// I used for it latest_comments.php v 1.6 by BadDog
// Updated By Dook
// http://www.aborowski.prv.pl
//
//can use in line 66-97:
//{url}, {name} - author, {date}, {comment}, {ip}, {mail}, {newsid}, {comid}, {title},
//{ipurl} - check ip link, {editurl} - edit comment link, {ipbanurl} - block ip link, {delete} = delete link {addurl} - add replay link
//
//you can change date format in line 25
////////////////////////////////////////////////////////////////////

if($member_db[1] > 3){ msg("error", "Access Denied", "You don't have permission for this section"); }

//////////////////////////////////////////
//////////// MODERATOR ///////////////

if($action == "moderator"){

echoheader("options", "Moderator");

//change date formt
$date_format = 'd-M-y H:m:i';
$flag = 1;
///////////////////// option bar

// Count Comments
$count_comments = 0;
$all_comments = file("./data/comments.txt");
foreach($all_comments as $news_comments){
$single_news_comments = explode("|>|", $news_comments);
$individual_comments = explode("||", $single_news_comments[1]);
$count_comments += count($individual_comments) - 1;
}
// How Many Comments to show on one page
if($comments_number == ""){ $comments_number = 30; }

// How many Comments are on page

$entries_showed = $count_comments - $comments_number;
if ( $entries_showed < 0) { $entries_showed = $count_comments;}
else { $entries_showed = $comments_number;}

echo "<table class=panel border=0 cellpading=0 cellspacing=0 width=99% >
<tr>
<td >Showing $entries_showed comments from total $count_comments


<div>
<form action=\"?mod=moderator\" method=POST name=options_bar style=\"display:inline;\">

Comments per page
<input style=\"text-align: Center\" name=\"comments_number\" value=\"$comments_number\" type=text size=3>
<input type=submit value=\"Show\">
<input type=hidden name=action value=moderator>
</form>
<form action=\"?mod=moderator\" method=POST name=options_bar style=\"display:inline;\">


<input style=\"text-align: Center\" name=\"comments_number\" value=\"$count_comments\" type=hidden size=3>
<input type=submit value=\"Show All\">
<input type=hidden name=action value=moderator>

</form>
</div>
</td></tr></table>
";

/////////////////////////// edit list section

echo '<table width="99%" border="0" cellspacing="0" cellpadding="0">';
echo '<tr><td width="100">Author/IP/Date</td><td >(News):Comment</td></tr>';
echo '</tabel><table width="99%" border="0" cellspacing="0" cellpadding="0">';

//can use: {url}, {name} - author, {date}, {comment}, {ip}, {mail}, {newsid}, {comid}, {title}, {ipurl} - check ip link, {editurl} - edit comment link, {ipbanurl} - block ip link, {delete} = delete link {addurl} - add replay link

if($member_db[1] == 1)
{
$ctemplate = '<tr valign="top">
<td width="100" bgcolor={bg}><div style="padding:5px; margin:5px;">{name}
{ipurl}<br/>{date}</div></td>
<td ><div style="padding:5px; margin:5px;" class=panel>({title}): {comment}<hr>{editurl} + {ipbanurl} + {delete} + {addurl} + {banuser} {mailurl}</div></td>
</tr>';
}

elseif($member_db[1] == 2)
{
$ctemplate = '<tr valign="top" >
<td width="100" bgcolor={bg}><br/>{name}
{ipurl}<br/>{date}</td>
<td width="505"><br/><div style="padding:5px; margin:5px;" class=panel>({title}): {comment}<hr>{editurl} + {ipbanurl} + {delete} + {addurl} {mailurl}</div></td>
</tr>';
}

else{
$ctemplate = '<tr valign="top" >
<td width="100" bgcolor={bg}><br/>{name}
{ipurl}<br/>{date}</td>
<td width="505"><br/><div style="padding:5px; margin:5px;" class=panel>({title}): {comment}<hr>{addurl} {mailurl}</div></td>
</tr>';
}

// end editing


require_once("$cutepath/data/config.php");
require_once("$cutepath/inc/functions.inc.php");
$comm_num = $config_comments_per_page;

if($archive == "" or !$archive){
$news_file = "$cutepath/data/news.txt";
$comm_file = "$cutepath/data/comments.txt";
}elseif(is_numeric($archive)){
$news_file = "$cutepath/data/archives/$archive.news.arch";
$comm_file = "$cutepath/data/archives/$archive.comments.arch";
}else{
die("Archive varialbe is invalid");
}

$latest_comments = array_fill(1, $comments_number, array('newsid'=>'0','comid'=>'0','name'=>'','mail'=>'','ip'=>'','comment'=>''));

function check_latest_comment($comment_line, $newsid)
{
global $latest_comments;

$insertpoint = 0;
$comment_arr = explode("|", $comment_line);

foreach($latest_comments as $key=>$latest_comment)
{
if($comment_arr[0] > $latest_comment['comid'] )
{
$insertpoint = $key;
break;
}
}

if ($insertpoint)
{
$previous = $latest_comments[$insertpoint];
foreach($latest_comments as $my_key=>$latest_comment_arr)
{
if($my_key > $insertpoint)
{
$current = $latest_comments[$my_key];
$latest_comments[$my_key] = $previous;
$previous = $current;
}
}

$latest_comments[$insertpoint] = array(
'newsid' => $newsid,
'comid' => $comment_arr[0],
'name' => $comment_arr[1],
'mail' => $comment_arr[2],
'ip' => $comment_arr[3],
'comment'=> $comment_arr[4],
);
}
}

$all_comments = file("$comm_file");
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)
{
check_latest_comment($single_comment, $newsid);
}
}

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

if ($comment['name']){
$i++;

$title = get_title($comment['newsid'], $news_file); //make sure path is passed to prevent open errors

$output = str_replace("{editurl}", "[url=]Edit[/url]", $output);
$output = str_replace("{addurl}", "[url=]Add reply[/url]", $output);
$output = str_replace("{ipurl}", "[url=]{ip}[/url]", $output);
$output = str_replace("{ipbanurl}", "[url=]Block ip[/url]", $output);
$output = str_replace("{delete}", "[url=]Delete[/url]", $output);
$output = str_replace("{banuser}", "[url=]Ban user[/url]", $output);

if( $comment['mail'] != "none"){$output = str_replace("{mailurl}", "+ [url=]send e-mail[/url]", $output);}
else {$output = str_replace("{mailurl}", "", $output);}

$tnum = countComments($comment['newsid'], $archive);
if($comm_num == 0){
$tnum = 0;
}
else{
$tnum = ($tnum / $comm_num);
}
$tnum = preg_replace("/\.(.*)/","",$tnum);
$tnum = ($tnum * $comm_num);

$output = str_replace("{start}", $tnum, $output);
$output = str_replace("{name}", $comment['name'], $output);
$output = str_replace("{title}", $title, $output);
$output = str_replace("{mail}", $comment['mail'], $output);
$output = str_replace("{ip}", $comment['ip'], $output);
$output = str_replace("{comment}", $comment['comment'], $output);
$output = str_replace("{date}", date($date_format, $comment['comid']), $output);
$output = str_replace("{newsid}", $comment['newsid'], $output);
$output = str_replace("{comid}", $comment['comid'], $output);

if($flag == 1){ $output = str_replace("{bg}", "#F7F6F4", $output); $flag = 0; }
else { $output = str_replace("{bg}", "#ffffff", $output); $flag = 1; }

echo $output . "\n";

}
}

echo '</table>';

/////////////////// cutenews copyrigths
echofooter();
}

/////////////////////////////////////////////////////
// Delete Comment
////////////////////////////////////////////////////

elseif($action == "doeditcomment")
{
if($member_db[1] > 2 ){ msg("error", "Access Denied", "You don't have permission for this section"); }
$news_file = "./data/news.txt";
$com_file = "./data/comments.txt";

$old_com = file("$com_file");
$new_com = fopen("$com_file","w");

foreach($old_com as $line)
{
$line_arr = explode("|>|",$line);
if($line_arr[0] == $newsid)
{
fwrite($new_com,"$line_arr[0]|>|");

$comments = explode("||", $line_arr[1]);
foreach($comments as $single_comment)
{
$single_comment = trim($single_comment);
$comment_arr = explode("|", $single_comment);
if($comment_arr[0] == $comid and $comment_arr[0] != "" and $delcomid != "all")
{
fwrite($new_com,"$comment_arr[0]|$poster|$mail|$comment_arr[3]|$comment||");
}
elseif($delcomid[$comment_arr[0]] != 1 and $comment_arr[0] != "" and $delcomid[all] != 1){
fwrite($new_com,"$single_comment||");
}
}
fwrite($new_com,"\n");
}
else{ fwrite($new_com, "$line"); }
}

if(isset($deletecomment) and $delcomid[all] == 1){ msg("info", "Comments Deleted", "All comments were deleted.", "$PHP_SELF?mod=moderator&action=moderator"); }
elseif(isset($deletecomment) and isset($delcomid)){ msg("info", "Comment Deleted", "The selected comment(s) has been deleted.", "$PHP_SELF?mod=moderator&action=moderator"); }
else{ echo"



<center>Comment is saved."; }
}

//////////////////////////////////////////
// Add Replay form
//////////////////////////////////////////

if($action == "editcomment")
{
echo"<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">
<title>Add comment</title>
<style type=\"text/css\">
<!--
SELECT, option, textarea, input {
BORDER-RIGHT: #808080 1px dotted;
BORDER-TOP: #808080 1px dotted;
BORDER-BOTTOM: #808080 1px dotted;
BORDER-LEFT: #808080 1px dotted;
COLOR: #000000;
FONT-SIZE: 11px;
FONT-FAMILY: Verdana; BACKGROUND-COLOR: #ffffff }
TD {text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt;}
BODY {text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 3pt;}
.header { font-size : 16px; font-weight: bold; color: #808080; font-family: verdana; text-decoration: none; }
-->
</style>
</head>
<body bgcolor=\"#FFFFFF\">
<form method=post action=\"$PHP_SELF\">
<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
<td width=\"1108\" height=\"8%\" colspan=\"2\">
<div class=header>ADD Comment</div>
<tr>
<td height=20 valign=middle width=\"102\" bgcolor=\"#F9F8F7\">
Poster
<td height=20 valign=middle width=\"1002\" bgcolor=\"#F9F8F7\">
<input type=hidden name=\"poster\" value=\"$member_db[2]\">$member_db[2]
</tr>
<tr>
<td height=20 valign=middle width=\"102\" bgcolor=\"#F9F8F7\">
Comment 
<td height=20 valign=middle width=\"1002\" bgcolor=\"#F9F8F7\">
<textarea rows=\"8\" name=\"comment\" cols=\"45\"></textarea>
</tr>
<tr>
<td valign=\"top\" width=\"1104\" colspan=\"2\">
<p align=\"left\">

<input type=submit value=\"Add Comment\" accesskey=\"s\"> 
<input type=button value=Cencel onClick=\"window.close();\" accesskey=\"c\">
<input type=hidden name=mod value=moderator>
<input type=hidden name=newsid value=$newsid>
<input type=hidden name=action value=addcomment>
</tr>
</table>
</form>
</body>
</html>";

}

/////////////////////////////////////////////////
///////////////////////////////// Save Reply
/////////////////////////////////////////////////

elseif($action == "addcomment")
{

$com_file = "./data/comments.txt";
$comment = str_replace("\r\n","
",$comment);
$comment = str_replace("|","I",$comment);

$time = time()+($config_date_adjust*60);

if($comment == "" ){ die("comment can not be blank [url=]+ Back[/url]</div>"); }

////////////////////////// Get IP
if (getenv("HTTP_CLIENT_IP")) {$ip = getenv("HTTP_CLIENT_IP");}
elseif(getenv("HTTP_X_FORWARDED_FOR")) {$ip = getenv("HTTP_X_FORWARDED_FOR");}
elseif(getenv("REMOTE_ADDR")){ $ip = getenv("REMOTE_ADDR");}
else {$ip = "not detected";}
////////////////////////////////

$old_com = file("$com_file");
$new_com = fopen("$com_file","w");
@flock ($new_com,2);
$found = FALSE;
foreach($old_com as $old_comments_line)
{
$old_comments_arr = explode("|>|", $old_comments_line);
if($old_comments_arr[0] == $newsid)
{
$old_comments_arr[1] = trim($old_comments_arr[1]);
fwrite($new_com, "$old_comments_arr[0]|>|$old_comments_arr[1]$time;|$poster|none|$ip|$comment||\n");
$found = TRUE;
echo"



<center><b>Comment is saved.<br/><input type=button value=Close onClick=\"window.close();\" accesskey=\"c\">";
}else
{
fwrite($new_com, $old_comments_line);
}
}
if(!$found){/* // do not add comment if News ID is not found \\ fwrite($new_comments, "$id|>|$time|$name|$mail|$ip|$comments||\n");*/ }
@flock ($new_com,3);
fclose($new_com);

}

/////////////////////////////////////////////////
//////// functions /////////////////////////

function get_title($id, $mPath){
$all_news = file("$mPath");
foreach ($all_news as $news) {
$news_arr = explode("|", $news);
if ($news_arr[0] == "$id") {
$title = $news_arr[2];
break;
}
}
$title = preg_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 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;
}
}
?></div>

208

(1 replies, posted in Hacks & Tricks / FAQ)

Name: Comments Manager Module
Author: superhero
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Adds a module that lists all comments by last added.
Features:
* it shows latest comments in admin panel (default 30)
*     delete comment (for editor and Admin only)
*     edit comment (for editor and Admin only)
*     Add reply (for all users)
*     Block ip (for editor and Admin only)
*     check ip (all users)
*     ban user (Admin only) //reported not working
*     send e-mail (all user if commenter put his e-mail)


Requirements: PHP4.
Instructions:
find this in index.php

'editusers'                => 'admin',


and add below

'moderator'                   => 'user',

in inc/option.mdu find this

array(
                                        'name'                => "Block IP's from posting comments",
                                        'url'                => "$PHP_SELF?mod=ipban",
                                        'access'        => "2",
                    ),


and below add this

array(
                           'name'                => "Moderator",
                           'url'                => "$PHP_SELF?mod=moderator&action=moderator",
                           'access'        => "3",
                    ),


make a file called moderator.mdu and uplaod it to your inc folder
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?PHP
////////////////////////////////////////////////////////////////////
// Moderator hack created by superhero
// I used for it latest_comments.php v 1.6 by BadDog
//
// http://www.aborowski.prv.pl
//
//can use in line 66-97:
//{url}, {name} - author, {date}, {comment}, {ip}, {mail}, {newsid}, {comid}, {title},
//{ipurl} - check ip link, {editurl} - edit comment link, {ipbanurl} - block ip link, {delete} = delete link {addurl} - add replay link
//
//you can change date format in line 25
////////////////////////////////////////////////////////////////////

if($member_db[1] > 3){ msg("error", "Access Denied", "You don't have permission for this section"); }

//////////////////////////////////////////
//////////// MODERATOR ///////////////

if($action == "moderator"){

echoheader("options", "Moderator");

//change date formt
$date_format = 'd-M-y H:m:i';
$flag = 1;
///////////////////// option bar

// Count Comments
$count_comments = 0;
        $all_comments = file("./data/comments.txt");
        foreach($all_comments as $news_comments){
                $single_news_comments = explode("|>|", $news_comments);
            $individual_comments = explode("||", $single_news_comments[1]);
            $count_comments += count($individual_comments) - 1;
        }
        // How Many Comments to show on one page
    if($comments_number == ""){ $comments_number = 30; }
   
// How many Comments are on page

$entries_showed = $count_comments - $comments_number;
if ( $entries_showed < 0) { $entries_showed = $count_comments;}
else  { $entries_showed = $comments_number;}

echo "<table class=panel border=0 cellpading=0 cellspacing=0 width=99% >
        <tr>
          <td >Showing $entries_showed comments from total $count_comments


<div>
<form action=\"?mod=moderator\" method=POST name=options_bar style=\"display:inline;\">

Comments per page
<input style=\"text-align: Center\" name=\"comments_number\" value=\"$comments_number\" type=text size=3>
<input type=submit value=\"Show\">
<input type=hidden name=action value=moderator>
</form>
<form action=\"?mod=moderator\" method=POST name=options_bar style=\"display:inline;\">


<input style=\"text-align: Center\" name=\"comments_number\" value=\"$count_comments\" type=hidden size=3>
<input type=submit value=\"Show All\">
<input type=hidden name=action value=moderator>

</form>
</div>
</td></tr></table>
";

///////////////////////////  edit list section

echo '<table width="99%" border="0" cellspacing="0" cellpadding="0">';
echo '<tr><td width="100">Author/IP/Date</td><td  >(News):Comment</td></tr>';
echo '</tabel><table width="99%" border="0" cellspacing="0" cellpadding="0">';

//can use: {url}, {name} - author, {date}, {comment}, {ip}, {mail}, {newsid}, {comid}, {title}, {ipurl} - check ip link, {editurl} - edit comment link, {ipbanurl} - block ip link, {delete} = delete link {addurl} - add replay link

if($member_db[1] == 1)
    {
        $ctemplate = '<tr valign="top">
        <td width="100" bgcolor={bg}><div style="padding:5px; margin:5px;">{name}
{ipurl}<br/>{date}</div></td>
        <td ><div style="padding:5px; margin:5px;" class=panel>({title}): {comment}<hr>{editurl} + {ipbanurl} + {delete} + {addurl} + {banuser} {mailurl}</div></td>
        </tr>';
    }

elseif($member_db[1] == 2)
    {
        $ctemplate = '<tr valign="top" >
        <td width="100" bgcolor={bg}><br/>{name}
{ipurl}<br/>{date}</td>
        <td width="505"><br/><div style="padding:5px; margin:5px;" class=panel>({title}): {comment}<hr>{editurl} + {ipbanurl} + {delete} + {addurl} {mailurl}</div></td>
        </tr>';
    }

else{
        $ctemplate = '<tr valign="top" >
        <td width="100" bgcolor={bg}><br/>{name}
{ipurl}<br/>{date}</td>
        <td width="505"><br/><div style="padding:5px; margin:5px;" class=panel>({title}): {comment}<hr>{addurl} {mailurl}</div></td>
        </tr>';
    }
   
// end editing


require_once("$cutepath/data/config.php");
require_once("$cutepath/inc/functions.inc.php");
$comm_num = $config_comments_per_page;

if($archive == "" or !$archive){
        $news_file = "$cutepath/data/news.txt";
        $comm_file = "$cutepath/data/comments.txt";
}elseif(is_numeric($archive)){
        $news_file = "$cutepath/data/archives/$archive.news.arch";
        $comm_file = "$cutepath/data/archives/$archive.comments.arch";
}else{
        die("Archive varialbe is invalid");
}

$latest_comments = array_fill(1, $comments_number, array('newsid'=>'0','comid'=>'0','name'=>'','mail'=>'','ip'=>'','comment'=>''));

    function check_latest_comment($comment_line, $newsid){
        global $latest_comments;
        $tmp_latest_comments = $latest_comments;
        $comment_arr = explode("|", $comment_line);
        foreach($latest_comments as $key=>$latest_comment){

            if($latest_comment['comid'] < $comment_arr[0]){

                $previous = $latest_comments[$key];
                foreach($latest_comments as $my_key=>$latest_comment_arr){
                    if($key < $my_key){
                     $current = $latest_comments[$my_key];
                     $latest_comments[$my_key] = $previous;
                     $previous = $current;
                    }
                }

                $latest_comments[$key] = array(
                                       'newsid'    => $newsid,
                                       'comid'    => $comment_arr[0],
                                       'name'    => $comment_arr[1],
                                       'mail'    => $comment_arr[2],
                                       'ip'    => $comment_arr[3],
                                       'comment'=> $comment_arr[4],
                                               );
            }
        }
    }

     $all_comments = file("$comm_file");
    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)
        {
            check_latest_comment($single_comment, $newsid);
        }
    }

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

          if ($comment['name']){
         $i++;
        
$title = get_title($comment['newsid'], $news_file); //make sure path is passed to prevent open errors

        $output = str_replace("{editurl}", "Edit", $output);
        $output = str_replace("{addurl}", "Add reply", $output);
        $output = str_replace("{ipurl}", "[url=]{ip}[/url]", $output);
        $output = str_replace("{ipbanurl}", "[url=]Block ip[/url]", $output);
        $output = str_replace("{delete}", "[url=]Delete[/url]", $output);
        $output = str_replace("{banuser}", "[url=]Ban user[/url]", $output);

        if( $comment['mail'] != "none"){$output = str_replace("{mailurl}", "+ [url=]send e-mail[/url]", $output);}
        else {$output = str_replace("{mailurl}", "", $output);}
       
         $tnum = countComments($comment['newsid'], $archive);
         if($comm_num == 0){
  $tnum = 0;
}
else{
  $tnum = ($tnum / $comm_num);
}
         $tnum = ereg_replace("\.(.*)","",$tnum);
         $tnum = ($tnum * $comm_num);

        $output = str_replace("{start}", $tnum, $output);
        $output = str_replace("{name}", $comment['name'], $output);
        $output = str_replace("{title}", $title, $output);
        $output = str_replace("{mail}", $comment['mail'], $output);
        $output = str_replace("{ip}", $comment['ip'], $output);
        $output = str_replace("{comment}", $comment['comment'], $output);
        $output = str_replace("{date}", date($date_format, $comment['comid']), $output);
        $output = str_replace("{newsid}", $comment['newsid'], $output);
        $output = str_replace("{comid}", $comment['comid'], $output);
       
        if($flag == 1){ $output = str_replace("{bg}",  "#F7F6F4", $output); $flag = 0; }
        else { $output = str_replace("{bg}",  "#ffffff", $output); $flag = 1; }
       
          echo $output . "\n";
          
          }
}

echo '</table>';

/////////////////// cutenews copyrigths        
echofooter();
}

/////////////////////////////////////////////////////
// Delete Comment
////////////////////////////////////////////////////

elseif($action == "doeditcomment")
{
    if($member_db[1] > 2 ){ msg("error", "Access Denied", "You don't have permission for this section"); }
     $news_file = "./data/news.txt";
     $com_file = "./data/comments.txt";
   
    $old_com = file("$com_file");
    $new_com = fopen("$com_file","w");

    foreach($old_com as $line)
    {
        $line_arr = explode("|>|",$line);
        if($line_arr[0] == $newsid)
        {
            fwrite($new_com,"$line_arr[0]|>|");

            $comments = explode("||", $line_arr[1]);
            foreach($comments as $single_comment)
            {
                $single_comment = trim($single_comment);
                $comment_arr = explode("|", $single_comment);
                if($comment_arr[0] == $comid and $comment_arr[0] != "" and $delcomid != "all")
                {
                    fwrite($new_com,"$comment_arr[0]|$poster|$mail|$comment_arr[3]|$comment||");
                }
                elseif($delcomid[$comment_arr[0]] != 1 and $comment_arr[0] != ""  and $delcomid[all] != 1){
                    fwrite($new_com,"$single_comment||");
                }
            }
            fwrite($new_com,"\n");
        }
        else{ fwrite($new_com, "$line"); }
     }

     if(isset($deletecomment) and $delcomid[all] == 1){ msg("info", "Comments Deleted", "All comments were deleted.", "$PHP_SELF?mod=moderator&action=moderator"); }
     elseif(isset($deletecomment) and isset($delcomid)){ msg("info", "Comment Deleted", "The selected comment(s) has been deleted.", "$PHP_SELF?mod=moderator&action=moderator"); }
     else{ echo"



<center>Comment is saved."; }
}

//////////////////////////////////////////
// Add Replay form
//////////////////////////////////////////

if($action == "editcomment")
{
    echo"<html>
    <head>
    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">
    <title>Add comment</title>
    <style type=\"text/css\">
    <!--
       SELECT, option, textarea, input {
       BORDER-RIGHT: #808080 1px dotted;
       BORDER-TOP: #808080 1px dotted;
       BORDER-BOTTOM: #808080 1px dotted;
       BORDER-LEFT: #808080 1px dotted;
       COLOR: #000000;
       FONT-SIZE: 11px;
       FONT-FAMILY: Verdana; BACKGROUND-COLOR: #ffffff }
       TD {text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt;}
       BODY {text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 3pt;}
       .header { font-size : 16px; font-weight: bold; color: #808080; font-family: verdana; text-decoration: none; }
    -->
    </style>
    </head>
    <body bgcolor=\"#FFFFFF\">
    <form method=post action=\"$PHP_SELF\">
    <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
    <td width=\"1108\" height=\"8%\" colspan=\"2\">
    <div class=header>ADD Comment</div>
    <tr>
    <td height=20 valign=middle width=\"102\" bgcolor=\"#F9F8F7\">
    Poster
    <td height=20 valign=middle width=\"1002\" bgcolor=\"#F9F8F7\">
    <input type=hidden name=\"poster\" value=\"$member_db[2]\">$member_db[2]
    </tr>
    <tr>
    <td height=20 valign=middle  width=\"102\" bgcolor=\"#F9F8F7\">
    Comment 
    <td  height=20 valign=middle width=\"1002\" bgcolor=\"#F9F8F7\">
    <textarea rows=\"8\" name=\"comment\" cols=\"45\"></textarea>
    </tr>
    <tr>
    <td  valign=\"top\" width=\"1104\" colspan=\"2\">
    <p align=\"left\">

    <input type=submit value=\"Add Comment\" accesskey=\"s\"> 
    <input type=button value=Cencel onClick=\"window.close();\" accesskey=\"c\">
    <input type=hidden name=mod value=moderator>
    <input type=hidden name=newsid value=$newsid>
    <input type=hidden name=action value=addcomment>
    </tr>
    </table>
    </form>
    </body>
    </html>";
   
}

/////////////////////////////////////////////////       
///////////////////////////////// Save Reply
/////////////////////////////////////////////////

   elseif($action == "addcomment")
   {
   
       $com_file = "./data/comments.txt";
       $comment = str_replace("\r\n","
",$comment);
    $comment = str_replace("|","I",$comment);
   
    $time = time()+($config_date_adjust*60);
   
    if($comment == "" ){ die("comment can not be blank [url=]+ Back[/url]</div>"); }
   
    ////////////////////////// Get IP
        if (getenv("HTTP_CLIENT_IP")) {$ip = getenv("HTTP_CLIENT_IP");}
        elseif(getenv("HTTP_X_FORWARDED_FOR")) {$ip = getenv("HTTP_X_FORWARDED_FOR");}
        elseif(getenv("REMOTE_ADDR")){ $ip = getenv("REMOTE_ADDR");}
        else {$ip = "not detected";}
    ////////////////////////////////
   
    $old_com = file("$com_file");
    $new_com = fopen("$com_file","w");
    @flock ($new_com,2);
    $found = FALSE;
    foreach($old_com as $old_comments_line)
    {
                $old_comments_arr = explode("|>|", $old_comments_line);
                if($old_comments_arr[0] == $newsid)
                {
                        $old_comments_arr[1] = trim($old_comments_arr[1]);
                        fwrite($new_com, "$old_comments_arr[0]|>|$old_comments_arr[1]$time;|$poster|none|$ip|$comment||\n");
                        $found = TRUE;
                        echo"



<center><b>Comment is saved.<br/><input type=button value=Close onClick=\"window.close();\" accesskey=\"c\">";
                }else
                {
                        fwrite($new_com, $old_comments_line);
                }
        }
    if(!$found){/* // do not add comment if News ID is not found \\ fwrite($new_comments, "$id|>|$time|$name|$mail|$ip|$comments||\n");*/ }
    @flock ($new_com,3);
    fclose($new_com);
   
    }

/////////////////////////////////////////////////
//////// functions /////////////////////////

function get_title($id, $mPath){
       $all_news = file("$mPath");
       foreach ($all_news as $news) {
       $news_arr = explode("|", $news);
    if ($news_arr[0] == "$id") {
       $title = $news_arr[2];
       break;
       }
       }
     $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 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;
        }
        }
?></div>

209

(1 replies, posted in Hacks & Tricks / FAQ)

Like said at the top of this page, a good written javascript should be easy to integrate with CuteNews.
Eventhough the above isn't a very good example for this tutorial, i hope it'll give you some idea of how it's done.
1)

What are good javascripts?


other then some parameters for look etc, you shouldn't need to provide additional information to the script.
2) Obviously you want some parts of the news to do something, so this will only be possible if the Javascript requires to put some html (in this case an article) inside a div container.
3) sometimes a javascript requires 1 div container that contains several smaller containers. then put the CN include code inside this Big div container. The div that need to be in this bigger div go inside the template. Note that i'm saying <div> not add a whole javascript.
4) Now you'll be required to give each div container a personal id/name attribute. You'll probably ask yourself,

if i add a id/name won't it be the same for ALL articles?

Wel yes it'll will, unless you look farther then your nose. use something like name="{news-id}" to give each div container a unique id/name for each article. easy huh.
5)

you said no javascript in the templates. Where does it go then?

Simple, you add it to the webpage where you have the CN include code.

210

(0 replies, posted in Hacks & Tricks / FAQ)

Name: Nested comments
Author: FUNimations
CuteNews Compatibility: 1.3.6. - * (no incompatibility reported yet)
Description: Alow people to comment on comments.
Instructions:
before we start let me point you out the following
This forum splits long lines into 2 lines. So

//##############


becomes

//#####
####

It must be 1 line when you paste it so check this.
1. open shows.inc.php
find

$mail = trim($mail);

add below

//Nested Comments//
        if( (string)$_POST['replyID'] == "false" )
        {
            $post_id = (int) $_POST['id'];  // Yes it's stupid how I didn't thought about this :/
        }
        else
            $post_id = (int) $_POST['replyID'];
        //Nested Comments


find

$mail                 = replace_comment("add", preg_replace("/\n/", "",$mail));


add below

//Nested comments//
                                $replyID = $_POST['replyID'];
                                $subID = $_POST['subID'];
                                //Nested comments//


find

//----------------------------------
    // Add The Comment ... Go Go GO!
    //----------------------------------

add above<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>//################################################################################
####################################
//                         Add Nested Comment
//################################################################################
####################################
if(isset($_POST['replyID']) && (string)$_POST['replyID'] !== "false")
{
        // Add Blank Comment In The Active_Comments_File
        $all_comments = file($comm_file);
        $new_com_db = fopen($comm_file, "w");

        foreach($all_comments as $comment_line)
        {
            $comment_line = trim($comment_line);
            $comment_line_arr = explode("|>|", $comment_line);
            if((int)$_POST['subID'] == (int)$comment_line_arr[0])
            {
                $individual_comments = explode("||", $comment_line_arr[1]);
                unset($output);
                $output = $_POST['subID']."|>|";
                foreach($individual_comments as $comment)
                {

                    $comment_arr = explode("|", $comment);
                    if( !empty($comment_arr[0] ) && $comment_arr[5] == "empty" && (int)$comment_arr[0] == (int)$_POST['replyID'])
                    {
                        fwrite($new_com_db, $_POST['replyID']."|>|\n");
                        $comment_arr[5] = $_POST['replyID'];
                        $output .= implode( "|",$comment_arr )."||";
                    }
                    elseif( !empty($comment_arr[0] ) )
                        $output .= $comment."||";
                }
                fwrite($new_com_db, $output."\n");
            }
            else
            {
                fwrite($new_com_db, $comment_line."\n");
            }
        }
        fclose($new_com_db);
}</div>
find

//----------------------------------
    // Add The Comment ... Go Go GO!
    //----------------------------------

    $old_comments = file("$comm_file");
    $new_comments = fopen("$comm_file", "w");
    @flock ($new_comments,2);
    $found = FALSE;
    foreach($old_comments as $old_comments_line)
    {
     $old_comments_arr = explode("|>|", $old_comments_line);
     if($old_comments_arr[0] == $id)
     {
        $old_comments_arr[1] = trim($old_comments_arr[1]);
        fwrite($new_comments, "$old_comments_arr[0]|>|$old_comments_arr[1]$time|$name|$mail|$ip|$comments||\n");
        $found = TRUE;
     }else{
        fwrite($new_comments, $old_comments_line);
        //if we do not have the news ID in the comments.txt we are not doing anything (see comment below) (must make sure the news ID is valid)
     }
    }
    if(!$found){
            /* // do not add comment if News ID is not found \\ fwrite($new_comments, "$id|>|$time|$name|$mail|$ip|$comments||\n");*/

                echo("<div style=\"text-align: center;\">CuteNews did not added your comment because there is some problem with the comments database.
[url=]go back[/url]</div>");
                        $CN_HALT = TRUE;
                        break 1;
    }
    @flock ($new_comments,3);
    fclose($new_comments);

replace with

//----------------------------------
        // Add The Comment ... Go Go GO!
        //----------------------------------

        $old_comments = file("$comm_file");
        $new_comments = fopen("$comm_file", "w");
        @flock ($new_comments,2);
        $found = FALSE;
        foreach($old_comments as $old_comments_line)
        {
         $old_comments_arr = explode("|>|", $old_comments_line);
         //Nested Comments//
         if($old_comments_arr[0] == $post_id)
         {
         //Nested Commetns//
            $old_comments_arr[1] = trim($old_comments_arr[1]);
            //Nested Comments//
            fwrite($new_comments, "$old_comments_arr[0]|>|$old_comments_arr[1]$time|$name|$mail|$ip|$comments|empty||\n");
    //Nested Comments//
            $found = TRUE;
         }else{
            fwrite($new_comments, $old_comments_line);
            //if we do not have the news ID in the comments.txt we are not doing anything (see comment below) (must make sure the news ID is valid)
         }
        }

        if(!$found){
                /* // do not add comment if News ID is not found \\ fwrite($new_comments, "$id|>|$time|$name|$mail|$ip|$comments||\n");*/

                    echo("<div style=\"text-align: center;\">CuteNews did not added your comment because there is some problem with the comments database.
[url=]go back[/url]</div>");
                            $CN_HALT = TRUE;
                            break 1;
        }
        @flock ($new_comments,3);
    fclose($new_comments);

find

<input type=\"hidden\" name=\"ucat\" value=\"$ucat\" />
             $user_post_query
             <input type=\"submit\" /> \n 

replace with

<input type=\"hidden\" name=\"ucat\" value=\"$ucat\" />
             <input type=\"hidden\" name=\"replyID\" value=\"$replyID\" />
             <input type=\"hidden\" name=\"subID\" value=\"$subID\" />
             $user_post_query
             <input type=\"submit\" /> \n 

next find

//################################################################################
####################################
//                 Show Comments
//################################################################################
####################################
if($allow_comments){

and

//----------------------------------
    // Prepare the Comment Pagination
    //----------------------------------


and replace everything in between with

$comm_per_page = $config_comments_per_page;
        $total_comments = CountComments($id);
        $showed_comments = 0;
        $comment_number = 0;
        $showed = 0;
        commentsOutput( $id, $comm_file, $id);


find

echo"<form  $CN_remember_form  method=\"post\" name=\"comment\" id=\"comment\" action=\"\">".$template_form."<div><input type=\"hidden\" name=\"subaction\" value=\"addcomment\" /><input type=\"hidden\" name=\"ucat\" value=\"$ucat\" /><input type=\"hidden\" name=\"show\" value=\"$show\" /><input name=\"id\" type=\"hidden\" value=\"$_GET[id]\" />$user_post_query</div></form>
                    \n $CN_remember_include";

replace with

echo"<form  $CN_remember_form  method=\"post\" name=\"comment\" id=\"comment\" action=\"\">".$template_form."<div><input type=\"hidden\" name=\"subaction\" value=\"addcomment\" /><input type=\"hidden\" name=\"ucat\" value=\"$ucat\" /><input type=\"hidden\" name=\"show\" value=\"$show\" /><input name=\"id\" type=\"hidden\" value=\"$_GET[id]\" /><input type=\"hidden\" name=\"replyID\" id=\"replyID\" value=\"false\" /><input type=\"hidden\" name=\"subID\" id=\"subID\" value=\"false\" />$user_post_query</div></form>
                    \n $CN_remember_include";


That's it for shows.inc.php
2. open functions.inc.php
find the countComments function, and replace that function with this code.
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>////////////////////////////////////////////////////////
// Function:         CountComments
// Description: Count How Many Comments Have a Specific Article
function CountComments($id, $archive = FALSE, $result = 0){

    global $cutepath;

    if($cutepath == ""){ $cutepath = "."; }
    if($archive and ($archive != "postponed" and $archive != "unapproved")){ $all_comments = file("$cutepath/data/archives/${archive}.comments.arch"); }
    else{ $all_comments = file("$cutepath/data/comments.txt"); }

    foreach($all_comments as $comment_line)
    {
        $news_id = explode("|>|", $comment_line);
        if($news_id[0] == $id)
        {
            $all_comments = explode("||", $news_id[1]);
            foreach($all_comments as $comment)
            {
                $arr = explode("|",$comment);
                if( !empty($arr[5]) )
                {
                    $result++;
                    if( $arr[5] != "empty" )
                        $result = CountComments( $arr[5], $archive, $result);
                }
            }

        }
    }

return $result;
}</div>
next find

?>


add above (note that the forum splits the word "javascript" into "java" & "script", this should be 1 word)<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>///////////////////////////////////////////////////////
// Function:         Comments output
// Description:      for nested comments

function commentsOutput( $id, $comm_file, $subID, $margin = 0 )
{
        global $total_comments, $showed_comments, $comment_number, $showed, $comm_per_page, $config_reverse_comments, $template_comment, $config_timestamp_comment, $comm_start_from;
$all_comments = file("$comm_file");
foreach($all_comments as $comment_line)
        {
                $comment_line = trim($comment_line);
                $comment_line_arr = explode("|>|", $comment_line);
                if($id == $comment_line_arr[0])
                {
                        $individual_comments = explode("||", $comment_line_arr[1]);

            //show the page with our new comment, if we just added one
            /* causes some problems, will be updated !!!
                        if($allow_add_comment and true){
                                $comm_start_from = $total_comments-1;
                                if($config_reverse_comments == "yes"){
                                        $comm_start_from = 0;
                                }
                        }
                        */

            $iteration = 0;
            if($config_reverse_comments == "yes"){$iteration = count($individual_comments)+1; $individual_comments = array_reverse($individual_comments); }

            foreach($individual_comments as $comment)
                        {

                                if($config_reverse_comments == "yes") { $iteration --; }
                                else{ $iteration ++; }



                                $comment_arr = explode("|", $comment);
                                if($comment_arr[0] != "")
                                {

                                if(isset($comm_start_from) and $comm_start_from != "")
                                {
                                    if($comment_number < $comm_start_from){ $comment_number++; commentsOutput( $comment_arr[5], $comm_file, $id, $margin + 20 ); continue; }
                                    elseif($showed_comments == $comm_per_page){  break; }
                                }

                                $comment_number ++;
                                if($comm_per_page != 0 and $comm_per_page == $showed_comments){ break; }

                                $comment_arr[4] = stripslashes(rtrim($comment_arr[4]));
                                if($comment_arr[2] != "none")
                                {
                                    if( preg_match("/^[\.A-z0-9_\-\+]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $comment_arr[2])){ $url_target = "";$mail_or_url = "mailto:"; }
                                    else
                                    {
                                        $url_target = "target=\"_blank\"";
                                        $mail_or_url = "";
                                        if(substr($comment_arr[2],0,3) == "www"){ $mail_or_url = "http://"; }
                                    }
                                    $output = str_replace("{author}", "&quot;.stripslashes($comment_arr[1]).&quot;", $template_comment);
                                }
                                else{ $output = str_replace("{author}", $comment_arr[1], $template_comment); }

                                $comment_arr[4] = preg_replace("/\b((http(s?):\/\/)|(www\.))([\w\.]+)([&-~\%\/\w+\.-?]+)\b/i", "[url=]$2$4$5$6[/url]", $comment_arr[4]);
                                $comment_arr[4] = preg_replace("/([\w\.]+)(@)([-\w\.]+)/i", "[url=]$0[/url]", $comment_arr[4]);

                                //Nested Comments//
                                $output = preg_replace("'\[replyButton\](.*?)\[/replyButton\]'si", "<input type=\"button\" value=\"\\1\" id=\"CommentReply_{comment-id}\" name=\"CommentReply_{comment-id}\" onClick=\"java script:setReplyID('{comment-id}', 'CommentReply_{comment-id}', {subID})\">", $output);
                                $output = str_replace("{margin}", $margin, $output);
                                //Nested Comments//
                                $output = str_replace("{mail}", "$comment_arr[2]",$output);
                                $output = str_replace("{date}", date($config_timestamp_comment, $comment_arr[0]),$output);
                                $output = str_replace("{comment-id}", $comment_arr[0],$output);
                                $output = str_replace("{comment}", "<a name=\"".$comment_arr[0]."\"></a>$comment_arr[4]",$output);
                                $output = str_replace("{comment-iteration}", $iteration ,$output);
                                $output = str_replace("{subID}", $id ,$output);

                                $output = replace_comment("show", $output);


                                $showed_comments++;
                                echo $output;

                                //Nested comments//
                                if( $comment_arr[5] != "empty" )
                                    commentsOutput( $comment_arr[5], $comm_file, $id, $margin + 20 );
                                //Nested comments//
                    }
            }
                }
        }

}</div>



3. edit the templates do that the comment sub template contains a button.
use

[replyButton]text of the button[/replyButton]


Next there's also the {margin} tag. With this tag you can make comments on a comment jump in. example

style="margin-left:{margin}";

or use padding if you like that better.

4. now add this javascript to every page that has a CN Include.

<script type="text/javascript">
function setReplyID(id, obj, subid)
{
var subidinput = document.getElementById('subID');
var replyidinput = document.getElementById('replyID');
if( replyidinput.value != 'false' )
{
    var unsetter = document.getElementById('CommentReply_' + replyidinput.value);
    unsetter.value = unsetter.value.replace(/\*/gi, "");
}
if( replyidinput.value == id )
{
    replyidinput.value = 'false';
    subidinput.value = 'false';
}
else
{
    replyidinput.value = id;
    subidinput.value = subid;
    document.getElementById(obj).value = '*' + document.getElementById(obj).value + '*';
}
}
</script>

211

(0 replies, posted in Hacks & Tricks / FAQ)

This seems to become a very popular topic so let's make it into a FAQ.
Be aware that the templates mangager requires JavaScript enabled in your browser.
For some reason even with some it still doesn't work.
then try the following in this order
<ol type='1'> * re-upload an original options.mdu.
* Hacks could cause some problem. For example this forum often splits the word javascript into Java and script. be sure that this is written correctly.
<li>Post in a topic with the following information. Maybe we can find some common link this way.

* your hacks
* your browser
* CuteNews version

</li></ol>

For now you'll have to make templates manually.
In the data folder you'll find some .tpl files. These contain the data for the templates. Open these files (except rss.tpl, don't touch that file)
inside you shouldn't have that much problems writting your html. The following topic will help you using the CuteNews tags you may use in the template.

error:
Warning: preg_replace() [function.preg-replace]: Compilation failed: unmatched parentheses at offset 2 in /home/supah1/domains/just4tuning.nl/public_html/cms/inc/functions.inc.php on line 715

The line number might be a bit off due to some hacks or so.
Anyhow the line this error point to is

$sourse  = preg_replace($find,$replace,$sourse);


in functions.inc.php

Reason:
Please use neither parentheses ("(" and ")") nor square brackets ("[" and "]") as smiley names. They are not escaped properly in CuteNews and will result in a PHP error.
Failing this, please consult this topic.

After the discussion at <strike>topic #31659</strike>, I've decided to start this topic.

This is a locked topic, so other than the forum administrator and moderators, no-one can add replies to this topic, meaning that you won't receive any useless spam.
So every time there's an important message concerning CuteNews (like an updated CuteNews version, a non-integrated security fix and so forth), Flexer or one of the forum moderators will add a meaningful reply here and you'll get notified.

How to register to receive emails for updates.
<ol type='1'> * Notice how at the right top corner of this topic you see a button Options.
* Click on that button.
* Choose Track this topic. No worries, you only subscribed to this topic.
* Choose the way you want to receive updates.
</ol>

214

(1 replies, posted in Hacks & Tricks / FAQ)

Addon By: FUNimations
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Use a form to make user choose the letter/field they want to filter upon.

add this form to your page.

<?php
$letter = '<select name="letter">';
for($t = 65; $t <= 90; $t++)
    $letter  .= '<option value="'.chr($t).'">'.chr($t).'</option>';
$letter .= '</select>';
$field = '<select name="field">';
$array = array("","author","title","short story", "full story");
for($t = 1; $t <= 4; $t++)
    $field  .= '<option value="'.$t.'">'.$array[$t].'</option>';
$field .= '</select>';
echo '<form action="" method="post">';
echo 'Field: '.$field.'
';
echo 'Letter: '.$letter.'
';
echo '<input type="submit" value="Filter"></form>';
?>


and add the following to your CN include code

if(isset($_POST['letter']))
$filter_letter[$_POST['field']] = $_POST['letter'];

215

(0 replies, posted in Hacks & Tricks / FAQ)

Name: Tripcode
Author: FUNimations
Debugging: Stuff
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: the tripcode function is some simple encoding script i found on the web. I could have written my own but the definition of a prgrammer is that he's lazy. So what this hack does is add a tripcode after a persons name in the Comments.
Discussion Topic: here
Instructions:
in functions.inc.php find

?>

add above

///////////////////////////////////////////////////////
// Function:         Tripcode
// Description:      encrypt your personal password. (this is a simple encryption, never use it to secure your website)
function tripcode($plain)
{
    $salt = substr($plain."H.",1,2);
    $salt = ereg_replace("[^\.-z]",".",$salt);
    $salt = strtr($salt,":;<=>?@[\\]^_`","ABCDEFGabcdef");
    return substr(crypt($plain,$salt),-10);
}


next in shows.inc.php find

//----------------------------------
    // Add The Comment ... Go Go GO!
    //----------------------------------

add under

if(!empty($_POST['trip']))
$name = $name."!".tripcode($_POST['trip']);


to add a password in the form
go to your template and in the comments form add

tripcode: <input type="text" name="trip">

Updated by: FUNimations
CuteNews Compatibility: 1.4.5 - * (no incompatibility reported yet)
Instructions:
The only difference is the first code block. The rest of the instructions are the same as post 1

<?php
$active_news = file('news/data/news.txt');
$counts = array();
foreach ($active_news as $newsRaw) {
$newsProperties = explode('|', $newsRaw);
$cat_array = explode(',', $newsProperties[6]);
for($t=0;$t<count($cat_array);$t++)
   $counts[$cat_array[$t]] += 1;
}
<---OUTPUTCODE GOES HERE--->
?>

Updated By: DooSHeK
CuteNews Compatibility: 1.4.5 - * (no incompatibility reported yet)
Instructions:
open ./inc/options.mdu

find:

showRow("Reverse News", "if yes, older news will be shown on the top", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[reverse_active]", "$config_reverse_active"));

add below:

showRow("Prospective Posting", "news in the future does not display until its date", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[prospective_posting]", "$config_prospective_posting"));

open ./data/config.php

find:

$config_reverse_active = "no";

add below:

$config_prospective_posting = "yes";

open ./inc/shows.inc.php

find (twice):

if($requested_cats and $requested_cats[$news_arr[6]] == TRUE){ $is_in_cat=TRUE;}

add above (in two places):

if ($config_prospective_posting == "yes") { $current_date = date("U"); if ($news_arr[0] > $current_date) { continue; } }

open ./inc/addnews.mdu

find:

if($member_db[1] > 3){ msg("error", "Access Denied", "You don't have permission to add news"); }

add under:

$months = array('01'=>'January', '02'=>'February', '03'=>'March', '04'=>'April', '05'=>'May', '06'=>'June', '07'=>'July', '08'=>'August', '09'=>'September', '10'=>'October', '11'=>'November', '12'=>'December');
if ($config_prospective_posting == "yes") { $prospective_message = "<font style=\"font-size:7pt\">(post with future date won't be displayed until seted date)</font>"; } else { $prospective_message = ""; }
$current_time = time()+ ($config_date_adjust*60);

find:

echo "
<script LANGUAGE=\"JavaScript\">
function preview(){

add above:

$month = "<select size=\"1\" name=\"edit_month\">";
for($i=1;$i<=12;$i++){
if( $i < 10 ) $i = '0'.$i;
if( date("m", $current_time) == $i )
$selected = " selected";
else
$selected = "";
$month .= "<option value=\"$i\"$selected>".$months[$i]."</option>";
}
$month .= "</select>";
$day = "<select size=\"1\" name=\"edit_day\">";
for($i=1;$i<=31;$i++){
if( date("j", $current_time) == $i )
$selected = " selected";
else
$selected = "";
$day .= "<option value=\"$i\"$selected>$i</option>";
}
$day .= "</select>";
$year = "<select size=\"1\" name=\"edit_year\">";
for($i=(date("Y")-30);$i<=(date("Y")+30);$i++){
if( date("Y", $current_time) == $i )
$selected = " selected";
else
$selected = "";
$year .= "<option value=\"$i\"$selected>$i</option>";
}
$year .= "</select>";
$hour = "<select size=\"1\" name=\"edit_hour\">";
for($i=0;$i<=23;$i++){
if( date("G", $current_time) == $i )
$selected = " selected";
else
$selected = "";
$hour .= "<option value=\"$i\"$selected>$i</option>";
}
$hour .= "</select>";
$min = "<select size=\"1\" name=\"edit_min\">";
for($i=0;$i<=59;$i++){
if( $i < 10 ) $i = '0'.$i;
if( date("i", $current_time) == $i )
$selected = " selected";
else
$selected = "";
$min .= "<option value=\"$i\"$selected>$i</option>";
}
$min .= "</select>";
$sec = "<select size=\"1\" name=\"edit_sec\">";
for($i=0;$i<=59;$i++){
if( $i < 10 ) $i = '0'.$i;
if( date("s", $current_time) == $i )
$selected = " selected";
else
$selected = "";
$sec .= "<option value=\"$i\"$selected>$i</option>";
}
$sec .= "</select>";

find:

<form onSubmit = \"return submitForm();\"  method=post name=addnews action=\"$PHP_SELF\">
        <table border=0 cellpading=0 cellspacing=0 width=\"654\" >

add below:

<tr>
<td valign=middle width=\"75\">
Date:
<td width=\"571\" colspan=\"7\">
$month$day$year
</tr>
<tr>
<td valign=middle width=\"75\">
Time:
<td width=\"571\" colspan=\"7\">
$hour:$min:$sec $prospective_message
</tr>

find (twice):

$added_time = time()+ ($config_date_adjust*60);

replace with (in two places):

$added_time = strtotime("$edit_day ".$months[$edit_month]." $edit_year $edit_hour:$edit_min:$edit_sec");

find:

$all_db = file("$decide_news_file");

add below:

rsort($all_db); reset($all_db);

find:

$news_file = fopen("$decide_news_file", "w");
fwrite($news_file, "$added_time|$member_db[2]|$title|$short_story|$full_story|$manual_avatar|$nice_category||\n");
foreach ($all_db as $line){ fwrite($news_file, "$line");}
fclose($news_file);

replace with:

$news_file = fopen("$decide_news_file", "w");
$edittime="";
$edituser="";
fwrite($news_file, "$added_time|$member_db[2]|$title|$short_story|$full_story|$manual_avatar|$nice_category||\n");
rsort($all_db); reset($all_db);
foreach ($all_db as $null => $line){ fwrite($news_file, "$line");}
fclose($news_file);

find:

fwrite($new_com_db, "$added_time|>|\n");
foreach ($old_com_db as $line){ fwrite($new_com_db, "$line");}

replace with:

fwrite($new_com_db, "$added_time|>|\n");
rsort($old_com_db); reset($old_com_db);
foreach ($old_com_db as $null => $line){ fwrite($new_com_db, "$line");}

open ./inc/editnews.mdu

find:

if($member_db[1] > 3){ msg("error", "Access Denied", "You don't have permission to edit news"); }

add below:

$months = array('01'=>'January', '02'=>'February', '03'=>'March', '04'=>'April', '05'=>'May', '06'=>'June', '07'=>'July', '08'=>'August', '09'=>'September', '10'=>'October', '11'=>'November', '12'=>'December');
$currenttime   = strtotime(date("D, d F Y H:i:s"));
if ($config_prospective_posting == "yes") { $prospective_message = "<font style=\"font-size:7pt\">(post with future date won't be displayed until seted date)</font>"; } else { $prospective_message = ""; }

find:

echo"
<script LANGUAGE=\"JavaScript\">
function preview(){

add above:

$month = "<select size=\"1\" name=\"edit_month\">";
for($i=1;$i<=12;$i++){
if( $i < 10 ) $i = '0'.$i;
if( date("m", $item_db[0]) == $i )
$selected = " selected";
else
$selected = "";
$month .= "<option value=\"$i\"$selected>".$months[$i]."</option>";
}
$month .= "</select>";
$day = "<select size=\"1\" name=\"edit_day\">";
for($i=1;$i<=31;$i++){
if( date("j", $item_db[0]) == $i )
$selected = " selected";
else
$selected = "";
$day .= "<option value=\"$i\"$selected>$i</option>";
}
$day .= "</select>";
$year = "<select size=\"1\" name=\"edit_year\">";
for($i=(date("Y")-30);$i<=(date("Y")+30);$i++){
if( date("Y", $item_db[0]) == $i )
$selected = " selected";
else
$selected = "";
$year .= "<option value=\"$i\"$selected>$i</option>";
}
$year .= "</select>";
$hour = "<select size=\"1\" name=\"edit_hour\">";
for($i=0;$i<=23;$i++){
if( date("G", $item_db[0]) == $i )
$selected = " selected";
else
$selected = "";
$hour .= "<option value=\"$i\"$selected>$i</option>";
}
$hour .= "</select>";
$min = "<select size=\"1\" name=\"edit_min\">";
for($i=0;$i<=59;$i++){
if( $i < 10 ) $i = '0'.$i;
if( date("i", $item_db[0]) == $i )
$selected = " selected";
else
$selected = "";
$min .= "<option value=\"$i\"$selected>$i</option>";
}
$min .= "</select>";
$sec = "<select size=\"1\" name=\"edit_sec\">";
for($i=0;$i<=59;$i++){
if( $i < 10 ) $i = '0'.$i;
if( date("s", $item_db[0]) == $i )
$selected = " selected";
else
$selected = "";
$sec .= "<option value=\"$i\"$selected>$i</option>";
}
$sec .= "</select>";

find:

<td valign=middle width=\"75\">
Info.
<td width=\"571\" colspan=\"6\">
Posted on $newstime by $item_db[1]

replace with:

<!-- Start ModifyTime v2.0 -->
        <tr>
        <td valign=middle width=\"75\">
        Info.
        <td width=\"571\" colspan=\"6\">
        Posted on $newstime by $item_db[1]
        </tr>
        <tr>
        <td valign=middle width=\"75\">
        Date:
        <td width=\"571\" colspan=\"7\">
        $month$day$year
        </tr>
        <tr>
        <td valign=middle width=\"75\">
        Time:
        <td width=\"571\" colspan=\"7\">
        $hour:$min:$sec $prospective_message
        </tr>
        <input type=hidden name=pass_time value=$item_db[0]>
<!-- End ModifyTime v2.0 -->

find:

fwrite($new_db,"$old_db_arr[0]|$old_db_arr[1]|$title|$short_story|$full_story|$editavatar|$nice_category||\n");

replace with:

//<!-- Start ModifyTime v2.0 -->
$converted_input_date=strtotime("$edit_day ".$months[$edit_month]." $edit_year $edit_hour:$edit_min:$edit_sec");
$all_db = file("./data/news.txt"); rsort($all_db); reset($all_db);
foreach($all_db as $null => $news_line){ $news_arr = explode("|", $news_line); if($news_arr[0] == $converted_input_date){ $converted_input_date++; } }
if ($disable_comments != 1) $disable_comments = 0;
fwrite($new_db,"$converted_input_date|$old_db_arr[1]|$title|$short_story|$full_story|$editavatar|$nice_category||\n");
$ccf=""; $converted_com_file = file($com_file);
for ($c = 0; $c < sizeof($converted_com_file); $c++) {$ccf=$ccf.$converted_com_file[$c];}
$fp = fopen($com_file, "wb"); fwrite($fp, str_replace($pass_time,$converted_input_date,$ccf)); fclose($fp);
//<!-- End ModifyTime v2.0 -->

find:

fclose($new_db);

add below:

$sorted_news = file($news_file); sort($sorted_news); reset($sorted_news);
foreach ($sorted_news as $null => $sorted_news_line) {
$sorted_news_output = str_replace("\n", "", $sorted_news_line)."\n".$sorted_news_output;
}
$fp = fopen($news_file, "wb"); fwrite($fp, $sorted_news_output); fclose($fp);

find:

msg("info","Changes Saved","The changes were successfully saved", "$PHP_SELF?mod=editnews&action=editnews&id=$id&source=$source");

replace with:

msg("info","Changes Saved","The changes were successfully saved", "$PHP_SELF?mod=editnews&action=editnews&id=$converted_input_date&source=$source");

error:
Warning: fopen(./data/users.db.php) [function.fopen]: failed to open stream: Permission denied in /hsphere/local/home/[...]/[...]/cutenews/index.php on line 162
Warning: fwrite(): supplied argument is not a valid stream resource in /hsphere/local/home/[...]/[...]/cutenews/index.php on line 166

Only people with ftp access can fix this.
This error says that a/some file(s) in the data folder are not writable anymore. In other words It's no longer CHMOD&#039;ed to 777.
A reason why this migth happen is that your server has recovered with a backup and gave all recovered files the defauls chmod setting.
Another reason might be that they no longer support 777, but only up to 755 (as explained in this FAQ)

Also, make sure that the file the error refers to exists. AKA the same caps.

Edit by (lKj) [Aug 16 2008]: If you are on a windows server, the CHMOD command will not be understood. Look for a feature called 'permissions' or so in your administration panel or ask for your host to solve this issue.

219

(3 replies, posted in Hacks & Tricks / FAQ)

What is CuteNews
CuteNews by the CutePHP Team.
CuteNews is a powerful and easy to use news management system that uses flat files to
store its database. It supports comments and archives that can be organized by months.
Please read the provided license.txt file to get familiar with the legal usage of this script.
Registered Customers can seek support at our support mail (technical issues are discussed
in our Forums!)

What is UTF-8 CuteNews
This is an unofficial fork based on CuteNews 1.4.6.
The main differences in UTF-8 CuteNews
- Data is saved as HTML entities, meaning it has better support for foreign characters.
- It has a lot more security holes patched, and added new security measures.
More information about UTF-8 CuteNews can be found in the development topic or at the release site.
The support advises using this, rather than the standard CuteNews 1.4.6.

220

(3 replies, posted in Hacks & Tricks / FAQ)

<div align="center">http://users.belgacom.net/bn333252/cutenews/FAQ_Forum/CN_for_Dummies.jpg</div>

About CuteNews For Dummies
      It started out as a PDF for the beginner webmaster. Due to the absence of Mod's on this forum, this PDF was a resource for all common questions asked by newbies. Today I (the original author of the PDF) and some no deposit casino bonus others got moderator rights, so I decided to update the FAQ forum with the topics handled in the original PDF. So that not only me, but also the others, can edit the topics if necessary to explain to you what to do and how it's done in the most simple and detailed way.
      This topic is intended to present you with the links in the order of action and not chronological by title.
     
      CuteNews Setup
     
* What is CuteNews &lt;-&gt; UTF-8 CuteNews?
* I have downloaded the zip file, now what?
* How do I get the CuteNews files on my server?
* Everything is chmod&#039;ed to 777, but I still get errors in index.php
* How do I log in?
* How do I get my news on my site?
* What parameters can I use with my include code?
* Changing the look and feel of your articles


     
      The CuteNews Panel
      This should point out what to do on itself. And there's the internal help so you'll probably won't have any problems understanding the Panel.
     
      RSS Feed
      [WIP]
     
      General Question
        This section was also part of the original PDF, but in this e-version I'll have to refer you to the FAQ forum in general as there's no working order.
        Recommended topics

* Spam protection in CuteNews
* IE8 Compatibility



      The PDF version
I'll keep the original pdf online. Do note that some FAQ's may be incomplete compared to this forum, as only this forum will be updated as of now.

**This Tutorial has nothing to do with the Dummies series**

Advanced Include Codes
If the readme.html file didn't make much sense, read on for more explanations.
Remember that we'll create a PHP code that will only work on web pages with the extension .php and not .htm/.html


Not just showing all news
When showing news/archives you can use $number = x; to limit the showed news on one page (x must be replaced by a number). If you have more than the x number of news, a pagination (<<previous next>>) will appear under your news.
If you want to show news/archives from a certain category you can use $category = "ID"; where ID is the ID (i.e. number) of the category. You can choose more than one category like this:
$category = "ID1,ID2,ID3";
Categories are created and managed in your CuteNews Panel under Options > Edit Categories.

When you want to display the full story of an article and the headlines on one page for example, wanting that when a headline is clicked, the full story of the article is NOT displayed where the headlines are (but at an other place), use $static = TRUE; on your headlines.

These are the most commonly used variables. An extensive list of all variables can be found here.
In this topic you'll see an example of how to use the code that you'll make here.

Some examples
Now we’ll see some examples of include codes (which will show the news on your site).
If you are unsure of where to put this on your page, read this.
Note that you’ll see ‘path/to’ in all examples. This needs to be changed with the real path!
WRONG: include("www.site.com/cutenews/show_news.php);
CORRECT: include("cutenews/show_news.php);
If you use the news integration wizard to make your include code, you’ll notice that the path will be longer than in the manual method (using relative paths). Don’t worry about that, both are correct, but we don’t expect you to know this long path by heart.

Show all the news

<?PHP
include("path/to/show_news.php");
?>

This will show all active (not-archived) news on your page.

Showing with a different template

<?PHP
$template = "YOUR_TEMPLATE_NAME";
include("path/to/show_news.php");
?>

A template will change the default look of your articles on your website. You can make your own template so the news can blend in with the rest of your layout. With the installation you already have the templates: default, headlines, and RSS. You can create and manage templates at Options > Templates in your CuteNews administration panel.

Showing archives

<?PHP
include("path/to/show_archives.php");
?>

To prevent your site lagging, you can make archives of older articles. This way you can keep the news database small and have a fast loading news page.

Showing the latest 5 articles

<?PHP
$number = 5;
include("path/to/show_news.php");
?>

As said before, this will show a maximum of 5 articles on your news page. If there are more articles than the chosen number, a pagination will appear on the bottom of the page.

Showing the latest 5 articles from category 2

<?PHP
$number = 5;
$category = 2;
include("path/to/show_news.php");
?>

You can also have categories. This could be used to show news of various topics on different pages. E.g. page 1 shows the category ‘movies’ and page 2 shows category ‘music’. You can add 2 categories to 1 include code, like so:
$category = '1,2';

Show all headlines and the latest article on one page

<?PHP
$static = TRUE;
$template = "Headlines";
include("path/to/show_news.php");
$number = 1;
include("path/to/show_news.php");
?>

This will show all the article headlines. A headline is basically the same as an articles title. When clicking on a headline, you’ll see the full story, same goes for the latest article that is shown in full. That article will be shown with its short story and a ‘read more’ link to the full story. $static=TRUE; is used so when you click on a headline or ‘read more’, the full story will show for the second include and not the first.

Showing the News on Your Website
With your CuteNews .zip file came 2 files example.php and example2.php.
Try adding a test news with CuteNews and see if it appears on those pages. If it doesn’t, there must be something wrong with your installation.
If you can’t find the problem, ask for help on this forum.

In this post we'll discuss the easy way.
In the next post we'll discuss how to do it manually and possibly using more options.

The Easy Way
This is not possible in all CuteNews versions!
Log in to CuteNews and go to Options > Integration Wizards and follow the instructions.
Remember that this wizard creates a PHP code that will only work on web pages with the extension .php and not  .htm/.html!
In this topic you'll see an example of how to use the code.

Now you might start to freak out about right now. "oh my god, how do i write a site in php!"
Well, if you think this, you got a wrong perception of what php is. php is a programming language which you can use to manipulate/handle data. With php you can not create layouts or anything. To show the handled data onto a browser, php uses HTML.

You take your webpage in .html and rename the extension to .php
On windows you must enable the folder configuration (windows explorer) to show the files extension.
Alternativly, you can add the CuteNews include code inside the source of a htm/html page and save it like that (be sure you add it in source mode or doing this in notepad is recommended). Then when you upload your webpage onto your server space with your favorite ftp manager, you should see the file extensions anyhow, and edit the filename through your ftp manager.
The reason we must give it the extension .php is so the server would know that it must interpret the php code within this file.

I have downloaded the zip file, now what?
Use an extraction software on the zip file (like winzip, winrar,…) and extract them to your hard drive. Make sure you have ‘extracting folders’ enabled before extracting.
After the extraction you should see some files like index.php, show_news.php,… and the
folders data, inc, rte, skins on your hard drive.

Now we need a host which supports PHP where we can upload these files.


* Check if you have the avatar tag is inside the templates
* Check if avatar is enabled under system configurations
* Check if your url to the image is correct
<li>Check you are using {avatar} not [img]{avatar}[/img]

Posts found: 201 to 225 of 286

Pages Previous 1 7 8 9 10 11 12 Next

CutePHP Forums → Posts by FUNimations



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