Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Split RSS text between the Title and the Summary

  • 07-04-2010 11:56PM
    #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