Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Split RSS text between the Title and the Summary

  • 08-04-2010 12:56AM
    #1
    Registered Users, Registered Users 2 Posts: 941 ✭✭✭


    I have managed to get my Facebook Status updates RSS feed on a site I'm working on. However, the title and the summary are currently displaying as the same thing.

    What I want to do is edit the PHP file (used to generate the feed) below, so each RSS item title is cropped after a certain number of words and the summary text then begins from where the title has ended. In other words, split the Facebook post displayed in the feed between the Title and the Summary.

    Is this possible? Thanks

    [PHP]<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>

    <div id="rssSummaryList<?php echo intval($bID)?>" class="rssSummaryList">

    <?php if( strlen($title)>0 ){ ?>
    <div class="rssSummaryListTitle"><?php echo $title?></div>
    <?php } ?>

    <?php
    $rssObj=$controller;
    $textHelper = Loader::helper("text");

    if (!$dateFormat) {
    $dateFormat = t('l, F jS, o');
    }

    if( strlen($errorMsg)>0 ){
    echo $errorMsg;
    }else{

    foreach($posts as $itemNumber=>$item) {

    if( intval($itemNumber) >= intval($rssObj->itemsToDisplay) ) break;
    ?>

    <div class="rssItem">
    <div class="rssItemTitle">
    <a href="<?php echo $item->get_permalink(); ?>" <?php if($rssObj->launchInNewWindow) echo 'target="_blank"' ?> >
    <?php echo $item->get_title(); ?>
    </a>
    </div>
    <div class="rssItemDate"><?php echo $item->get_date($dateFormat); ?></div>
    <div class="rssItemSummary">
    <?php
    if( $rssObj->showSummary ){
    echo $textHelper->shortText( strip_tags($item->get_description()) );
    }
    ?>
    </div>
    </div>

    <?php }
    }
    ?>
    </div>[/PHP]


Advertisement