Jump to content

Recommended Posts

Posted

You'll need to edit popupnews_list.tpl first:

<?php
//simpilotgroup addon module for phpVMS virtual airline system
//
//simpilotgroup addon modules are licenced under the following license:
//Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)
//To view full icense text visit http://creativecommons.org/licenses/by-nc-sa/3.0/
//
//@author David Clark (simpilot)
//@copyright Copyright (c) 2009-2010, David Clark
//@license http://creativecommons.org/licenses/by-nc-sa/3.0/
?>

<a href="<?php echo SITE_URL ?>/index.php/PopUpNews/popupnewsitem/?itemid=<?php echo $id;?>"><?php echo $subject;?></a> |


Then Get the HTML Marquee code:

<MARQUEE></MARQUEE>

Then combine the two:

<MARQUEE>
<?php PopUpNews::PopUpNewsList(5); ?>
</MARQUEE>

Was that so difficult? :rolleyes:

Jon

  • Like 1
  • Administrators
Posted

To seperate it you can do something like this;

PopUpNews.data.class add:

       function get_latest_news()  {
       $query = "SELECT * FROM ".TABLE_PREFIX."news ORDER BY postdate DESC";

       return DB::get_row($query);

Add a limit to the sql call and change the return method to get more than one news story returned.

in your controller function for the page you want to view it on set the variable;

       $this->set('news', PopUpNewsData::get_latest_news());

The in your view use;

      <marquee>
           <?php
               echo '......'.strip_tags($news->subject).'......'.strip_tags($news->body);
           ?>
       </marquee>

You can remove the php strip_tags function but it will then include the html tags from the news editor which I usually find undesireable in a maquee situation.

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...