create_htaccess()

if the new directory is empty, must be that the chmodd didn't work, or that the quoted function doesn't have access to write file. Have you checked with an ftp client if the new made directories do have chmodd value 777? Cause i see you use chmod(foldername, 0777), and the php chmod() doesn't always do what you think it does. Sometimes you need 777 instead of 0777 and sometimes it never does what it's supposed to do. That's the whole reason why when installing Cn you manually need to chmodd files, and it isn't done through coding.


the disappearing images when moving is a result of not having proper permissions on the subfolders.

about the uploading, does the main dir have a .htaccess file? (it's a hidden file)
if yes your subdires should have one as well.
If no, make sure your subdirs have none either.

a few pages back there are instructions for chmod after upload.

might be due to chmod settings not being 777 or a missing .htaccess file

It's the template you're using https://cutephp.com/forum/style_emoticons/default/wink.gif

<div style="float: right;"><!-- no full story-->  0 Comments</div>


and you wonder why this floats right from your image O_o

Hello everyone
https://cutephp.com/forum/index.php?showtop...view=getnewpost
a new bug that was found with fix. Nothing serious though.

CuteNews Compatibility: 1.4.5 - * (no incompatibility reported yet)
Description: This is a bug found by the user afullo. For the postpone news and search you have a dropdown for selecting the year. This option was very poorly coded, You'll only be able to select up to year 2010.
Instructions:
in addnews.mdu and search.php find

for($i=2005;$i<2011;$i++){


and replace by

for($i=2005;$i<(date('Y')+3);$i++){


This code will make sure you'll always will be able to select 2 years into the future.

134

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

For those of you who are not familiar with css, or just the float attribute, create the following html file.
We'll use the same codes and names as in the CuteNews Gallery FAQ, only we keep out the CuteNews part.
And we introduce css for the container div. Something that isn't necessary, but isn't bad to apply as well.
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><html>
<head>
<title>Hello Float</title>
<style>
#container
{
width:400px;
height: 400px;
overflow: auto;
}
.left
{
width: 24%;
float:left;
}
</style>
</head>
<body>
<div class="container">
<div class="left">Hello World</div>
<div class="left">Hello Float</div>
<div class="left">Hello World</div>
<div class="left">Hello Float</div>
<div class="left">Hello World</div>
<div class="left">Hello Float</div>
<div class="left">Hello World</div>
<div class="left">Hello Float</div>
<div class="left">Hello World</div>
<div class="left">Hello Float</div>
<div class="left">Hello World</div>
<div class="left">Hello Float</div>
</div>
</body>
</html></div>
Open the file in your browser and look at it. See how you have columns?
Now we'll edit the file.
In the css change the width value of 'left' from 24% to 99px
See how nothing changes in the browser when you refresh teh page.

Now change the width to 199px
and see how you go from 4 columns to 2 columns.

Float puts elements next to each other starting from the left or the right depending on the float value as long as there's enough space.
When there's no more space on that line, a new line will be started.
You should try and see what happens when you change the float value of 'left' to right. Don't change the css name, just the float value.
The columns should have switched.

Now I hope you understand what the float does and you can follow the above FAQ.

Unable to access

sounds like a permission problem. Try deleting the .htaccess folder from the upimages folder (hidden file)
or if it's missing reupload it.

If the .htaccess thing didn't work, chmodd all images in the folder to 777. But his will alos mean trouble in the future

yeah, i have that problem to. Somewhere in thos 1220 lines there's a } missing.
Eventhough many people don't seem to have a problem with V4, i did, and i'm not going to check 1220 of someones code trying to find where the missing } belongs.

Version 3 works just fine.
And it's not like you're really missing out on the rounded corners thing, as the corners aren't even transparent.

chmod($config_path_image_upload."/thumbs/".$image_name,0644);

find

//Rounded corners

add above

chmod($config_path_image_upload."/".$image_name, $config_path_image_upload."/thumbs/".$image_name,0644);

then you'll have to take this issue with your host.
The reason why it's 600 after upload must be on their end.

the chmod function is a usefull thing, but in my experience it hasn't worked succesfully for me in the past.
Sometimes you need 644 as a value while otehr times 0644.
That's probably also the reason why you need to manually chmod files when installing CN
and why flexer hasn't integrated this function into the CN installer.

either way it's teh second code, but i do hope you don't use that space in your variable names. $ config != $config

add your code after

@copy($image, $config_path_image_upload.'/'.$image_name) or $img_result = "<font color=red>Not able to upload image.</font>
Make sure that file upload is enabled or contact your server administrator.";

first Question, i believe the hack has various versions. Are you using the latest one? Or an older.

143

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

Hack name: Hidden input fields
Description: This hack was based on an article posted here.
It's an attempt to fool spambots into thinking there is no spam protection and giving input fields random obscure names so there isn't a real pattern to input fields names. Visitors will notice nothing about the spam protection; No captchas or anything they need to fill out.
Auhtor:  FUNimations
Instrtuctions:
For the most part we need editing in shows.inc.php so let's open this file
find

$user_query = cute_query_string($QUERY_STRING, array( "comm_start_from","start_from", "archive", "subaction", "id", "ucat"));

add above or below

$priv_salt="somestring";

CHANGE the word somestring with some sort of securitycode you make up. And leave the quotes!

find

$name = trim($name);
        $mail = trim($mail);
    $id = (int) $id;  // Yes it's stupid how I didn't thought about this :/

and replace with

$salt_name = md5($priv_salt.date('z'));
        $salt = $_POST[$salt_name];
        if(empty($salt))
        {

            $salt_name = md5($priv_salt.(date('z')-1));
            $salt = $_POST[$salt_name];
        }
        $obsc_name = sha1('name'.$salt );
        $obsc_mail = sha1( 'mail'.$salt );
        $obsc_comment = sha1('comment'.$salt );
        $true_name = sha1('tname'.$salt );
        $true_mail = sha1('tmail'.$salt);
        $true_comment = sha1('tcomment'.$salt);
        $name = trim($_POST[$true_name]);
        $mail = trim($_POST[$true_mail]);
        $submit = trim($_POST['submit']);
        $comments = trim($_POST[$true_comment]);
    $id = (int) $id;  // Yes it's stupid how I didn't thought about this :/

find

if( strlen($comments) > $config_comment_max_long and $config_comment_max_long != "" and $config_comment_max_long != "0"){
               echo"<div style=\"text-align: center;\">Your comment is too long!</div>";
                $CN_HALT = TRUE;
                break 1;
        }

and add below

if( $submit == "Add My Spam"){
                       echo"<div style=\"text-align: center;\">Spambot detected. Don't worry if you're not!</div>";
                        $CN_HALT = TRUE;
                        break 1;
        }
        //SPAMPROT
        if(strlen(trim($_POST[$obsc_name])) >0 || strlen(trim($_POST[$obsc_mail])) >0 || strlen(trim($_POST[$obsc_comment])) >0)
        {
            echo"<div style=\"text-align: center;\">Spambot detected. Don't worry if you're not!</div>";
                        $CN_HALT = TRUE;
                break 1;
        }

find

echo"<div style=\"text-align: center;\">This name is owned by a registered user and you must enter password to use it

             <form name=passwordForm id=passwordForm method=\"post\" action=\"\">
             Password: <input type=\"password\" name=\"password\" />
             <input type=\"hidden\" name=\"name\" value=\"$name\" />
             <input type=\"hidden\" name=\"comments\" value=\"$comments\" />
             <input type=\"hidden\" name=\"mail\" value=\"$mail\" />
             <input type=\"hidden\" name=\"ip\" value=\"$ip\" />
             <input type=\"hidden\" name=\"subaction\" value=\"addcomment\" />
             <input type=\"hidden\" name=\"show\" value=\"$show\" />
             <input type=\"hidden\" name=\"ucat\" value=\"$ucat\" />
             $user_post_query
             <input type=\"submit\" /> \n 

             <input type=\"checkbox\" name=\"CNrememberPass\" value=1 /> Remember password in cookie (md5 format)
             </form>
              </div>";
                         $CN_HALT = TRUE;
             break 2;

                }

replace with

 //SPAMPROT
                            $salt_name = md5($priv_salt.date('z'));
                            $salt = $_POST[$salt_name];
                            if(empty($salt))
                            {

                                $salt_name = md5($priv_salt.(date('z')-1));
                            }
                            $obsc_name = sha1('name'.$salt );
                            $obsc_mail = sha1( 'mail'.$salt );
                            $obsc_comment = sha1('comment'.$salt );
                            $true_name = sha1('tname'.$salt );
                            $true_mail = sha1('tmail'.$salt);
                            $true_comment = sha1('tcomment'.$salt);
             echo"<div style=\"text-align: center;\">This name is owned by a registered user and you must enter password to use it

             <form name=passwordForm id=passwordForm method=\"post\" action=\"\">
             Password: <input type=\"password\" name=\"password\" />
             <input type=\"hidden\" name=\"$true_name\" value=\"$name\" />
             <input type=\"hidden\" name=\"$true_comment\" value=\"$comments\" />
             <input type=\"hidden\" name=\"$true_mail\" value=\"$mail\" />
             <input type=\"hidden\" name=\"ip\" value=\"$ip\" />
             <input type=\"hidden\" name=\"subaction\" value=\"addcomment\" />
             <input type=\"hidden\" name=\"show\" value=\"$show\" />
             <input type=\"hidden\" name=\"ucat\" value=\"$ucat\" />
             <input type=\"hidden\" name=\"$salt_name\" value=\"$salt\" />
             <input type=\"hidden\" name=\"$obsc_name\" value=\"$_POST[$obsc_name]\" />
             <input type=\"hidden\" name=\"$obsc_mail\" value=\"$_POST[$obsc_mail]\" />
             <input type=\"hidden\" name=\"$obsc_comment\" value=\"$_POST[$obsc_comment]\" />
             $user_post_query
             <input type=\"submit\" /> \n 

             <input type=\"checkbox\" name=\"CNrememberPass\" value=1 /> Remember password in cookie (md5 format)
             </form>
              </div>";
                         $CN_HALT = TRUE;
             break 2;

                }

find

$template_form = str_replace("{smilies}", $smilies_form, $template_form);

    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\" />$user_post_query</div></form>
                    \n $CN_remember_include";

replace with

//SPAMPROT
    $salt = md5(time()+$_GET['id']+$_SERVER['REMOTE_ADDR']);
    $salt_name = md5($priv_salt.date('z'));
    $obsc_name = sha1('name'.$salt );
    $obsc_mail = sha1( 'mail'.$salt );
    $obsc_comment = sha1('comment'.$salt );
    $true_name = sha1('tname'.$salt );
    $true_mail = sha1('tmail'.$salt);
    $true_comment = sha1('tcomment'.$salt);
    $show = t.sha1( 'show'.$salt );//css classname my never start with a number
    $hide = t.sha1( 'hide'.$salt );//css classname my never start with a number

    $template_form = str_replace("{smilies}", $smilies_form, $template_form);
    $template_form = str_replace("{spam-input-name}", $obsc_name, $template_form);
    $template_form = str_replace("{spam-input-mail}", $obsc_mail, $template_form);
    $template_form = str_replace("{spam-input-comment}", $obsc_comment, $template_form);
    $template_form = str_replace("{real-input-name}", $true_name, $template_form);
    $template_form = str_replace("{real-input-mail}", $true_mail, $template_form);
    $template_form = str_replace("{real-input-comment}", $true_comment, $template_form);
    $template_form = str_replace("{show}", $show, $template_form);
    $template_form = str_replace("{hide}", $hide, $template_form);

    echo"<style type=\"text/css\">.".$show."{display:inline;} .".$hide."{display:none;}</style><form  $CN_remember_form  method=\"post\" name=\"comment\" id=\"comment\" action=\"\"><input type=\"hidden\" name=\"".$salt_name."\" value=\"".$salt."\" />".$template_form."<div><input type=\"hidden\" name=\"subaction\" value=\"addcomment\" /><input type=\"hidden\" name=\"ucat\" value=\"$ucat\" /><input type=\"hidden\" name=\"show\" value=\"$show\" />$user_post_query</div></form>
                    \n $CN_remember_include";
                    //SPAMPROT

close shows.inc.php, save changes and upload the modified file.

Next change ALL your templates (the comments form part) like following.
First find (based on the default template)

<input type="submit" name="submit" value="Add My Comment">

and repalce it with

<span class="{hide}"><input type="submit" name="submit" value="Add My Spam"></span><span class="{show}"> <input type="submit" name="submit" value="Add My Comment"> </span>


Next we are going to replace all input fields:

<input type="text" name="name">

to

<span class="{show}"><input type="text" name="{real-input-name}"></span><span class="{hide}"><input type="text" name="{spam-input-name}"></span>


<input type="text" name="mail">

to

<span class="{show}"><input type="text" name="{real-input-mail}"></span><span class="{hide}"><input type="text" name="{spam-input-mail}"> </span>


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

to

<span class="{show}"><textarea cols="40" rows="6" id=commentsbox name="{real-input-comment}"></textarea></span><span class="{hide}"><textarea cols="40" rows="6" id=commentsbox name="{spam-input-comment}"></textarea></span>


And save the new template. That is all. Now it may be good for you to understand what the change in the template does. For each field we create a dummy field. The dummy fields will be invisible, so users won't notice them and won't be able to fill anything in. Bots however won't notice them as being invisible, so they will submit values for those fields. When CN detects the dummy fields as being filled in, it'll know it's a bot.
Now what you should know is that around every input field there is a span. You are free to swith the dummy field and the REAL field but don't forget to switch the span aswell so you don't accidently make the dummy fields visible and the rela fields invisible. It's a good idea to do some random ordering with these fields, so we don't have a standard

real dummy, real, dummy, real, dummy

order but you get something like

dummy real, dummy, dummy, real, real

Still no Version update, but you may want to 'hack' your Cutenews with this unofficial fix.
[BUG][EXPLOIT] Users.db.php in search

Error: Fatal error: Maximum execution time of 30 seconds exceeded in /home/**linux*/u/********.co.uk/user/htdocs/cutenews/inc/functions.inc.php on line 111

Reason: In other words, Cutenews needs more time to load news than you're allowed to (server restrictions). The server setting says you have to complete loading the page within 30 seconds. If not, the server will halt. This is done to protect the server against heavy loads.
The reason as to why it might take so long to load a page could be due to a very big news.txt. In that case, make sure to make regular backups. As this error could cause you to LOSE all existing news when editing an article. Another reason could be excessive spam.

Solution:
IF your news.txt is very big, archiving could be a solution.
If you receive masses of spam, get spam protection The FAQ contains a list of different spam protection hacks.

Error: Deprecated: Function eregi() is deprecated in xxx\news\inc\functions.inc.php on line 289
and/or
Deprecated: Function split() is deprecated in xxx\news\inc\main.mdu on line 139

reason:your host has upgraded it's php version or has very sensitive error reporting.
First thing you have to know, everything still works as it should. These messages are NOT errors, just notices.

solution:
This is a list of what you can do, ergo don't do them all, just 1 of them.
<ol type='1'> * use UTF-8 CN instead. These things have been fixed.
* look at the error messages. At the end you see a file name and a line number. Go to those lines in the named file and replace accordingly.
eregi -> preg_match
next you'll probably saw something like this. you'll also need to add /

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


split -> explode
</ol>

147

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

Name: FCKeditor
Author: FUNimations
CuteNews Compatibility: Utf-8 (1) - Utf-8 (8b)
Description: This forum does not support third party software! The default wysiwyg and FCKeditor are third party software and got nothing to do with cutephp. So don't ask about it! The sole reason this post has been added to the faq is because the defaults wysiwyg hasn't got a support forum and is incompatible with some new browsers like google chrome. Also note that this editor/wysiwyg has it's own image module thus you won't be able to use the image module from CuteNews.
Requirements: A copy of UTF-8 CN.
Instructions:
Make sure the regular CN installation notes have been added.
Next ina editnews.mdu find

$oFCKeditor->Value = $item_db[3];

and

$oFCKeditor->Value = $item_db[4];

Notice the small change in number, and change it to

html_entity_decode( $item_db[3], ENT_QUOTES, 'UTF-8' );

and

html_entity_decode( $item_db[4], ENT_QUOTES, 'UTF-8' );

250?
Isn't there a setting (inside images.mdu) to limit the amount of images per page? I believe there is.
And the hack doesn't limit to just 250. it limits to the set number, or it stops loading when the server says it doesn't want to continue anymore.
250 pictures are alot, and do take some time to load. Server have a max execution time meaning, if the requested page isn't loaded within that time, it just stops loading the rest.

UTF-8 CuteNews
an unofficial version of CuteNews.
The same as the original Cutenews 1.4.6 though containing lots of bugfixes, removal of unused code and added security.
Has great support for foreign characters. Check out the topic for more info.

Name: Mod-Rewrite by Ifa
Author: FUNimations
CuteNews Compatibility: 1.4.5 - * (no incompatibilty reported yet)
Description: Since the coming of articles in multiple categories, this hack has a flaw when an article is posted in multiple categories. If you're not aware of this yet, please have a look at the bug list at the start of the faq forum. Multiple categories is buggy in all known CuteNews versions that have the 'multiple category' option. Now this fix is ONLY for Ifa's mod_rewrite. FI-DD's versions (see another FAQ for his list) doesn't have this problem.
Instructions:
install the above hack by Ifa

In step 4 you'll need to add this line of code as part of a function. find

foreach ($all_cats as $cats_line)
                {
                    $cats_arr = explode("|", $cats_line);
                    if ($cats_arr[0] == $news_arr[6]) $category = ereg_replace("[^[:alnum:] ]", "-", $cats_arr[1]);
                }


replace it with

    if( $cat_news_arr = explode( ',', $news_arr[6] ) )
    {
        $category = array();
        foreach ($all_cats as $cats_line)
                {
                    $cats_arr = explode("|", $cats_line);
                    if ( in_array( $cats_arr[0], $cat_news_arr )) $category[] = ereg_replace("[^[:alnum:] ]", "-", $cats_arr[1]);
                }
        $category = implode( '_', $category );
    }
    else
    {
        foreach ($all_cats as $cats_line)
                {
                    $cats_arr = explode("|", $cats_line);
                    if ($cats_arr[0] == $news_arr[6]) $category = ereg_replace("[^[:alnum:] ]", "-", $cats_arr[1]);
                }
    }

And don't forget to do the bugfix posted at the start of the FAQ forum.

Posts found: 126 to 150 of 286

Pages Previous 1 4 5 6 7 8 12 Next

CutePHP Forums → Posts by FUNimations



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