Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Seperating News Posts (Help Needed)

    Hi,
    Well after a day of searching and trying all sorts of random stuff I can't seem to get this to work... (PHP Noob alert) <--

    What I want is the news section on my site to display each news item in it's own content box (Like most sites have it setup).

    Here is the code I have that displays the news (From the MySQL database).

    PHP Code:
    <?php

    include("common.php");
        
    $mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
        
    $seoname = isset($_REQUEST['seoname']) ? $_REQUEST['seoname'] : '';

    if( !empty(
    $seoname) ){
        
    $seoname explode("-",$seoname);
        
    $seoname end($seoname);
    }

    $leftMenu getPages('parent','0');
        foreach(
    $leftMenu as $id=>$page){
        echo 
    "| <a href='{$page['seoname']}.html'>{$page['title']}</a> |";
    }

    if( !empty(
    $seoname) ){
        
    $page getPage('seoname',$seoname);
        }else{
        
    $page getPage('id','1');
    }
    ?>

    <div class="titlebar-blank">
        <div class="icon-arrow-down-accent" style="margin-top:8px"></div>
        <div class = "title-news"><?=$page['title']?></div>
    </div>
    <div class="newsbg">
        <div class="news-space"><?=nl2br($page['body'])?></div>
    </div>
    <br />
    <?php

    // Here is the "list" of news posts
    $kids getPages('parent',$page['id']);
        if( 
    count($kids) > ){
        foreach(
    $kids as $id=>$kid){
            echo 
    "<div class='titlebar-blank'>";
            echo 
    "<div class='icon-arrow-down-accent' style='margin-top:8px'></div>";
            echo 
    "<div class = 'title-news'><a href='{$page['seoname']}-{$kid['seoname']}.html'>{$kid['title']}</a></div>";
            echo 
    "</div>";
            echo 
    "<div class='newsbg'>";
            echo 
    "<div class='news-space'>{$kid['summary']}</div>";
            echo 
    "</div";
        }
    }

    ?>
    Any help would be much appreciated.

    TIA
    BoNfiRe

  • #2
    Regular Coder dswimboy's Avatar
    Join Date
    Nov 2003
    Location
    mostly in Ann Arbor
    Posts
    458
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what is a "it's own content box"? where is the link to your site? where are the links to "most sites" that you want yours to look like?
    "There is more than one way to do it."


  •  

    Posting Permissions

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