Jump to content

PopUpNewsModule


simpilot

Recommended Posts

ok got that...so "body" is a good variable? And this line is placed directly beneath the orginal call?

Thanks

I have been trying to figure this one out on how to get the first so many characters of the body to appear with a read more link. I did get the read more link to appear and work, I just can not get the body to show. I know how to limit the characters too.

Not sure what I am doing wrong.

Link to comment
Share on other sites

  • Administrators

I have been trying to figure this one out on how to get the first so many characters of the body to appear with a read more link. I did get the read more link to appear and work, I just can not get the body to show. I know how to limit the characters too.

Not sure what I am doing wrong.

Did you add the "body" field to the call within the module? I think that you are probably not getting the data to the template.

Link to comment
Share on other sites

Did you add the "body" field to the call within the module? I think that you are probably not getting the data to the template.

I attempted to. I am more than sure that is where my problem is. I tried to follow what you instructed me to do a few posts up with another little thing I was working on. I think I just simply jacked up the needed code for the module.

Ray

Link to comment
Share on other sites

  • 3 weeks later...

Hi Dave. I just recently upgraded to the latest beta and I get this once clicking a link with the news module.

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'PopUpNews::popupnewsitem' was given in /home/xxxxxx/public_html/xxxxxx/core/classes/MainController.class.php on line 218

I have tinkered with it some but no luck with it. I hate to mess with it to much for fear of really messing something up. Prior to the upgrade to beta, I replaced all the popup news files with the standard files from the download from this thread. So they are bone stock files. No Ray interference involved. ;)

Any ideas you could throw at a guy?

Link to comment
Share on other sites

  • 4 weeks later...

hi simpilot i have a little query for you regarding PopUpNews i wanted to place a table on my front page where my PopupNews will show or either i can put it in Pilot center but the problem is it wont allowing me to place an table with header when i try to put an table this happens

IMAGE REMOVED

Now you can notice in Pic that table is all messed up and most importantly it was showing Title for every news item in every Row it was appearing i only want normal title on the Header Area and than my news items under the table box..........

this code i was using currently

<?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/
?>
<style type="text/css">
#customers
{
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
width:100%;
border-collapse:collapse;
}
#customers td, #customers th 
{
font-size:1em;
border:1px solid #98bf21;
padding:3px 7px 2px 7px;
}
#customers th 
{
font-size:1.1em;
text-align:left;
padding-top:5px;
padding-bottom:4px;
background-color:#A7C942;
color:#ffffff;
}
#customers tr.alt td 
{
color:#000000;
background-color:#EAF2D3;
}
</style>
<table id="customers" class="tablesorter">
<th>Important Updates & News</th>
<tbody>
<tr class="alt">
<td align="center">
<a href="<?php echo SITE_URL ?>/index.php/PopUpNews/popupnewsitem/?itemid=<?php echo $id;?>"><b><u><?php echo $subject;?></b></u></a><br>
<?php echo $postdate;?>
</tbody>

</table>

Awaiting you....... :)

Link to comment
Share on other sites

  • Administrators

The popupnews_list template is called through a foreach loop in the module so you need to do one of two things,

1- open and close the table in the module and just have row commands in the template

or

2 - create a table for each line in the template

example template

<table> 
   <tr> 
     <td> 
         <a href="<?php echo SITE_URL ?>/index.php/PopUpNews/popupnewsitem/?itemid=<?php echo $id;?>"><b><u><?php echo $subject;?></b></u></a><br /> 
         <?php echo $postdate;?>
     </td>
   </tr> 
</table>


Link to comment
Share on other sites

  • Administrators

The popupnews_list.tpl file repeats however many times you have it set to, so anything you have in it is going to show that many times. Move the title into the main page you are using prior to calling the popupnews function.

Link to comment
Share on other sites

  • 2 weeks later...

Error for me,

some thing comes like this -

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'PopUpNews::popupnewsitem' was given in /home1/akariyou/public_html/aivirtual/core/classes/MainController.class.php on line 218

PLEASE HELP ME, I DONT HAVE ANY IDEA!

Link to comment
Share on other sites

  • 3 weeks later...

How about this?

<table width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td>Title</td>
 </tr>
<?php 
foreach($res as $row)
{ ?>
 <tr>
   <td><?php echo $row->subject;?></td>
 </tr>
 <?php 
 }
 ?>
</table>

How would i make that work, without having an invalid foreach?

Thank you.

Link to comment
Share on other sites

<?php
$res = SiteData::GetAllNews($row->id);
?>

 <?php 
$i = ( int )1; 
foreach($res as $row){ 
?>

  <?php
 if ( $i == ( int )5 ) 
   { 
       break; 
   } 
   else 
   { 
       $i++; 
   } 
}  
 ?>

Now remember when you call the class on your front page leave it as (1) not 5.

Good Luck

Link to comment
Share on other sites

This is the entire code for that tpl just copy and paste! This is only to show the news on a table!

<?php
$res = SiteData::GetAllNews($row->id);
?>
<table width="100%" cellspacing="0" cellpadding="4">
 <tr align="center" class="row1">
   <td><strong>News Title</strong></td>
   <td><strong>Date Submitted</strong></td>
   <td><strong>Written by</strong></td>
   <td><strong>News ID</strong></td>
 </tr>
<?php 
$i = ( int )1; 
foreach($res as $row){ 
?>
 <tr  align="center">
   <td><a href="<?php echo SITE_URL ?>/index.php/PopUpNews/popupnewsitem/?itemid=<?php echo $row->id;?>"><?php echo $row->subject;?></a>
</td>
   <td><?php echo date("D, d M Y ", $row->postdate);?></td>
   <td><?php echo $row->postedby;?></td>
   <td><?php echo $row->id;?></td>
 </tr>
 <?php 
 if ( $i == ( int )5 ) 
   { 
       break; 
   } 
   else 
   { 
       $i++; 
   } 
}  
 ?>
</table>

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Hi all,

getting this error since I moved my website to fivedev any help would be great.

I should say that I have uploaded the 1.1 version and I am still getting the same error.

here is the error...

Fatal error: Class 'PopUpNews' not found in /home/********/public_html/lib/skins/detachable/layout.tpl on line 237

or you can see it on my website just click my signature.

Thanks

Scott

Link to comment
Share on other sites

I am not sure if anyone else has had this problem but this is the reason why mine did not work.

After looking at what simpilot suggested I noticed that the folder was incorrectly named it should be PopUpNews instead mine was popupnews so it could not find the file but all fixed now. thanks simpilot.

Scott

Link to comment
Share on other sites

  • 3 months later...

G'day Simpilot,

I have an idea for this module.

I wanted to know if it was possible to add a flashing gif image to display on all the unread news items in my list, this will make pilots more aware of the new posts as the news list is rather discrete on my website.

is it possible to be able to determine if a newsitem is read by a pilot ?

Regards

Tylor

Link to comment
Share on other sites

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...