Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Join Date
    Jul 2004
    Location
    Webby Forums!
    Posts
    1,879
    Tokens
    0

    Latest Awards:

    Default Removing info from a flat file?

    Ok do you know how to remove info from a flat file and display it on a webpage (like cutenews).


    Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
    [Thybag.co.uk - Vive la revolutione]

  2. #2
    Join Date
    Nov 2004
    Location
    HabboWeb FM Offices
    Posts
    3,019
    Tokens
    0

    Latest Awards:

    Default

    Like show news on cutenews or i dont know what ya mean

  3. #3
    Join Date
    Jul 2004
    Location
    Webby Forums!
    Posts
    1,879
    Tokens
    0

    Latest Awards:

    Default

    yup. I have written some stuff from a form through to a flat file txt database all I need to know is how to display it on a page..


    Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
    [Thybag.co.uk - Vive la revolutione]

  4. #4
    Join Date
    Nov 2004
    Location
    HabboWeb FM Offices
    Posts
    3,019
    Tokens
    0

    Latest Awards:

    Default

    Hmm

    If you have a news.txt file, i think you might have to make it point to that

  5. #5
    Join Date
    Mar 2005
    Location
    Dog House
    Posts
    1,000
    Tokens
    0

    Latest Awards:

    Default

    Why not view the cutenews file? and see if you find the correct code?

  6. #6
    Join Date
    Nov 2004
    Location
    HabboWeb FM Offices
    Posts
    3,019
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by :Woof
    Why not view the cutenews file? and see if you find the correct code?
    Tried it and it only comes up with the news entered in text...

  7. #7
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    no u have to use the file on your computer it wont work if u try and view the sorce

  8. #8
    Join Date
    Nov 2004
    Location
    HabboWeb FM Offices
    Posts
    3,019
    Tokens
    0

    Latest Awards:

    Default

    Ok then

    Quite a long code


    PHP Code:
    <?PHP

    error_reporting 
    (E_ALL E_NOTICE);

    $cutepath =  __FILE__;
    $cutepath preg_replace"'\\\show_news\.php'"""$cutepath);
    $cutepath preg_replace"'/show_news\.php'"""$cutepath);

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

    //----------------------------------
    // Check if we are included by PATH
    //----------------------------------
    if($HTTP_SERVER_VARS["HTTP_ACCEPT"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_CHARSET"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"] or $HTTP_SERVER_VARS["HTTP_CONNECTION"]){ /* do nothing */ }
    elseif(
    eregi("show_news.php"$PHP_SELF)){
    die(
    "<h4>CuteNews has detected that you are including show_news.php using the URL to this file.<br>
    This is incorrect and you must include it using the PATH to show_news.php</h4><br>Example:<br>
    this is <font color=red>WRONG</font> :&nbsp;&nbsp; &lt;?PHP include(\"http://yoursite.com/cutenews/show_news.php\"); ?&gt;<br>
    this is <font color=green>CORRECT</font>:&nbsp;&nbsp; &lt;?PHP include(\"cutenews/show_news.php\"); ?&gt;<br>
    <br><BR>// <font size=2>if you think this message shouldn't be shown, open show_news.php and delete it from there</font>"
    );
    }
    //----------------------------------
    // End of the check
    //----------------------------------

    if(!isset($subaction) or $subaction == ""){ $subaction $POST["subaction"]; }

    if(!isset(
    $template) or $template == "" or strtolower($template) == "default"){ require_once("$cutepath/data/Default.tpl"); }
    else{
            if(
    file_exists("$cutepath/data/${template}.tpl")){ require_once("$cutepath/data/${template}.tpl"); }
        else{ die(
    "Error!<br>the template <b>".htmlspecialchars($template)."</b> does not exists, note that templates are case sensetive and you must write the name exactly as it is"); }
    }

    // Prepare requested categories
    if(eregi("[a-z]"$category)){
            die(
    "<b>Error</b>!<br>CuteNews has detected that you use \$category = \"$category\"; but you can call the categories only with their <b>ID</b> numbers and not with names<br>
        example:<br><blockquote>&lt;?PHP<br>\$category = \"1\";<br>include(\"path/to/show_news.php\");<br>?&gt;</blockquote>"
    );
    }
    $category preg_replace("/ /"""$category);
    $tmp_cats_arr explode(","$category);
    foreach(
    $tmp_cats_arr as $key=>$value){
        if(
    $value != ""){ $requested_cats[$value] = TRUE; }
    }

    if(
    $archive == ""){
            
    $news_file "$cutepath/data/news.txt";
            
    $comm_file "$cutepath/data/comments.txt";
    }else{
            
    $news_file "$cutepath/data/archives/$archive.news.arch";
            
    $comm_file "$cutepath/data/archives/$archive.comments.arch";
    }

    $allow_add_comment                        FALSE;
    $allow_full_story                        FALSE;
    $allow_active_news                         FALSE;
    $allow_comments                         FALSE;

    //<<<------------ Detarime what user want to do
    if( $CN_HALT != TRUE and $static != TRUE and ($subaction == "showcomments" or $subaction == "showfull" or $subaction == "addcomment") and ((!isset($category) or $category == "") or $requested_cats[$ucat] == TRUE) ){
        if(
    $subaction == "addcomment"){ $allow_add_comment        TRUE$allow_comments TRUE; }
        if(
    $subaction == "showcomments"$allow_comments TRUE;
            if((
    $subaction == "showcomments" or $allow_comments == TRUE) and $config_show_full_with_comments == "yes"$allow_full_story TRUE;
            if(
    $subaction == "showfull"$allow_full_story TRUE;
            if(
    $subaction == "showfull" and $config_show_comments_with_full == "yes"$allow_comments TRUE;

    }
    else{
        if(
    $config_reverse_active == "yes"){ $reverse TRUE; }
            
    $allow_active_news TRUE;
    }
    //----------->>> Detarime what user want to do

    require("$cutepath/inc/shows.inc.php");
        if(
    $_GET['archive'] and $_GET['archive'] != ''){ $archive $_GET['archive']; } // stupid fix ?
    unset($static$template$requested_cats$category$catid$cat,$reverse$in_use$archives_arr$number$no_prev$no_next$i$showed$prev$used_archives);
    ?>
    <!-- News Powered by CuteNews: http://cutephp.com/ -->

    Edit that

  9. #9
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    lol i think this is one for mentor

  10. #10
    Join Date
    Nov 2004
    Location
    HabboWeb FM Offices
    Posts
    3,019
    Tokens
    0

    Latest Awards:

    Default

    Me to

    *Opens mentors door and waits*

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •