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 2 of 2 FirstFirst 12
Results 11 to 11 of 11
  1. #11
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    796
    Tokens
    0

    Default

    Its easy

    This is remote headlines
    PHP Code:
    <?PHP
    // ********************************************************************************
    // Remote Show Headlines by Georgi Avramov
    // ----------------------------------------
    // How to use this module:
    // | put this code: <SCRIPT language=javascript src="http://mysite.com/cutenews/remote_headlines"></SCRIPT>
    // | on the page where you want to display the headlines
    // | you can use and http://mysite.com/cutenews/remote_headlines.php?number=NUMBER_OF_NEWS
    // | you can use and http://mysite.com/cutenews/remote_headlines.php?number=NUMBER_OF_NEWS&category=CAT_ID
    // | to show exact number of news
    // ********************************************************************************
    //----------------------
    //    CONFIGURATION
    //----------------------
    $template      "[link]{title}[/link]<br>Posted On: {date}<br>";   //: you can use {date}, {title}, {author} and 
    $date_format     "d M Y";   //: for help on date format go here: http://www.php.net/manual/en/function.date.php
    $local_news_page "http://simplyhabbo.com/news/show_news.php";   //: URL to page where you include your news eg. http://mysite.com/index.php
    $remote_target     "_self";   //: _blank = open in new window; _top = open in same window;
    //----------------------
    //  END CONFIGURATION
    //----------------------
    if(!$PHP_SELF){
        if(
    $HTTP_POST_VARS)     {extract($HTTP_POST_VARSEXTR_PREFIX_SAME"post_");}
        if(
    $HTTP_GET_VARS)      {extract($HTTP_GET_VARSEXTR_PREFIX_SAME"get_");}
        if(
    $HTTP_COOKIE_VARS)    {extract($HTTP_COOKIE_VARSEXTR_PREFIX_SAME"cookie_");}
        if(
    $HTTP_ENV_VARS)         {extract($HTTP_ENV_VARSEXTR_PREFIX_SAME"env_");}
        }
    if(
    $PHP_SELF == ""){ $PHP_SELF $HTTP_SERVER_VARS[PHP_SELF]; }

    $all_news file("./data/news.txt");
    $i 0;

    echo
    "<!-----\n";
    echo
    "//News powered by CuteNews: http://cutephp.com\n";
    foreach(
    $all_news as $single_news){
        
    $news_arr explode("|"$single_news);
        if(
    $category != "" and $category != $news_arr[6]){ continue; }
        
    $output $template;
        
    $output str_replace("{title}""$news_arr[2]"$output);
        
    $output str_replace("[link]""<a href='http://www.simplyhabbo.com/news/show_news.php?subaction=showfull&id=$news_arr[0]' target='$remote_target'>"$output);
        
    $output str_replace("[/link]""</a>"$output);
        
    $output str_replace("{author}""$news_arr[1]"$output);
        
    $output str_replace("{date}"date($date_format ,"$news_arr[0]"), $output);
        echo
    "document.write(\"$output\");\n";
        
    $i++;
        if(
    $number != "" and $i == $number){ break; }
    }
    echo
    "//----->\n";

    ?>
    Now see were
    PHP Code:
    $output str_replace("[link]""<a href='http://www.simplyhabbo.com/news/show_news.php?subaction=showfull&id=$news_arr[0]
    I replaced that to
    PHP Code:
    $output str_replace("[link]""<a href='http://www.simplyhabbo.com/MYPHPFILENAME.php?subaction=showfull&id=$news_arr[0]
    and in myphpfilename.php i have:

    PHP Code:
    "Template"
    <?
    include("news/show_news.php");
    ?>
    So basicly just make a Habbo template and put that include in where u want the news to show xd


    Then we end up with (myphpfilename.php)
    PHP Code:
    <table width="552" height="50" border="0" cellspacing="1" bgcolor="#000000">
            <tr> 
              <td height="14" background="head.gif"><div align="center">
                <font color="#FFFFFF" face="Verdana" size="1">News</font></div></td>
            </tr>
            <tr>           
        <td bgcolor="#598CC5"><div align="center"><?
    include("news/show_news.php");
    ?></div></td>
            </tr>
                </table>
    Last edited by chrisgocrazyH; 31-05-2008 at 12:18 PM.
    Thanks,
    Chris
    Free Image Uploading

    __________________


    [/url]

    [/FONT]

Page 2 of 2 FirstFirst 12

Posting Permissions

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