TennShadow Posted April 16, 2010 Report Share Posted April 16, 2010 That worked...thank you so much. Keith Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted June 10, 2010 Moderators Report Share Posted June 10, 2010 Nevermind, I got it working! Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted June 10, 2010 Author Administrators Report Share Posted June 10, 2010 hey dave, i got this error when i am veiwing a news 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/highva/public_html/core/classes/MainController.class.php on line 218 go up two posts Quote Link to comment Share on other sites More sharing options...
dimitris Posted June 20, 2010 Report Share Posted June 20, 2010 thank you simpilot! i got it working fine ! Now my question, when i add news the news display both on front page and on the sidebar how i can make it to display only on sidebar and configure a brand new front page without the news ? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted June 28, 2010 Author Administrators Report Share Posted June 28, 2010 thank you simpilot! i got it working fine ! Now my question, when i add news the news display both on front page and on the sidebar how i can make it to display only on sidebar and configure a brand new front page without the news ? Remove the MainController::Run('News', newsfront, 5) From the template Quote Link to comment Share on other sites More sharing options...
Tom Posted July 10, 2010 Report Share Posted July 10, 2010 Getting an error: Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'PopUpNews::index' was given in /core/classes/MainController.class.php on line 218 Tried reuploading the files which didn't help. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted July 10, 2010 Author Administrators Report Share Posted July 10, 2010 Getting an error:Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'PopUpNews::index' was given in /core/classes/MainController.class.php on line 218 Tried reuploading the files which didn't help. Did you try the updated files up about 5 posts? Let me know how you make out. Quote Link to comment Share on other sites More sharing options...
Tom Posted July 10, 2010 Report Share Posted July 10, 2010 Did you try the updated files up about 5 posts? Let me know how you make out. Oh I see, didn't notice those - was just downloading the one from the first post. Thanks Quote Link to comment Share on other sites More sharing options...
skymx Posted July 10, 2010 Report Share Posted July 10, 2010 Thanks for the addon. I will install later on today. Quote Link to comment Share on other sites More sharing options...
Bradpl6 Posted August 5, 2010 Report Share Posted August 5, 2010 Great addon, works perfectly for what I need. Just one question what would the correct code be to diplay the first few sentences of the news item? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted August 8, 2010 Author Administrators Report Share Posted August 8, 2010 Great addon, works perfectly for what I need. Just one question what would the correct code be to diplay the first few sentences of the news item? you can use the substr function from php <?php echo substr($yourvariable, 0, 50); ?> Will output the first 50, well actually 51 characters of your variable. you are telling it to start at character 0 and end at character 50. you can start and stop it where ever you would like. Hope this helps. Quote Link to comment Share on other sites More sharing options...
Bradpl6 Posted August 8, 2010 Report Share Posted August 8, 2010 It seems great minds think alike as I already had that code I was looking for the $variable to display the news item. Thanks Quote Link to comment Share on other sites More sharing options...
MrAmsterdam Posted August 19, 2010 Report Share Posted August 19, 2010 you can use the substr function from php <?php echo substr($yourvariable, 0, 50); ?> Will output the first 50, well actually 51 characters of your variable. you are telling it to start at character 0 and end at character 50. you can start and stop it where ever you would like. Hope this helps. Hi Simpilot, i found this website... http://php.net/manual/en/function.substr.php but i cannot find out which variable i should use. I am not really into PHP, but learning. Could you give me a hint? :-) I am trying to find the logic behind php but i am not getting it clear yet... my bad. Thanks in advance, Lucas oh, by the way! Excellent module! KUDO'S! Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted August 19, 2010 Author Administrators Report Share Posted August 19, 2010 Hi Simpilot, i found this website... http://php.net/manual/en/function.substr.php but i cannot find out which variable i should use. I am not really into PHP, but learning. Could you give me a hint? :-) I am trying to find the logic behind php but i am not getting it clear yet... my bad. Thanks in advance, Lucas oh, by the way! Excellent module! KUDO'S! It will depend on what you are working on as to what to use for a variable. In the popupnews module if you are trying to limit the characters of the subject line the data is presented in the template using the $subject variable. If you wanted to limit the subject to just say 10 characters you could do something like this in the template. <?php echo substr($subject, 0 , 9).'...'; ?> Which would give you something like: Breaking N... Quote Link to comment Share on other sites More sharing options...
Bradpl6 Posted August 27, 2010 Report Share Posted August 27, 2010 I follow the method you are using but im unable to find the correct variable to diplay the body of the news item in the popupnews_list, I can get the subject quite easily but not the main message itself. Any suggestions? Quote Link to comment Share on other sites More sharing options...
Connor1994 Posted September 17, 2010 Report Share Posted September 17, 2010 Just installed the news module, looks great, although, my news is displayed on this page of my site - http://euroscotva.co.uk/index.php/pages/news so it doesnt appear on my main site, and when i click an item from the module i get presented with this - http://euroscotva.co.uk/index.php/PopUpNews/popupnewsitem/?itemid=9 my main site - http://www.euroscotva.co.uk, Hope you can help, Connor Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted September 17, 2010 Author Administrators Report Share Posted September 17, 2010 Just installed the news module, looks great, although, my news is displayed on this page of my site - http://euroscotva.co.uk/index.php/pages/news so it doesnt appear on my main site, and when i click an item from the module i get presented with this - http://euroscotva.co.uk/index.php/PopUpNews/popupnewsitem/?itemid=9 my main site - http://www.euroscotva.co.uk, Hope you can help, Connor Post number 30 in this thread has the fix for your issue. Quote Link to comment Share on other sites More sharing options...
kbohme Posted November 26, 2010 Report Share Posted November 26, 2010 I get this error Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'PopUpNews::popupnewsitem' was given in *********core/classes/MainController.class.php on line 218 I cant seem to figure it out.. (it happens when I click the link in the list box) Sorry, didn't see the updated version, I downloaded version 1.1 and now have it working good. Thanks Quote Link to comment Share on other sites More sharing options...
ACVA_CEO Posted December 15, 2010 Report Share Posted December 15, 2010 Hi simpilot, the code you mentioned at the top: <?php echo substr($yourvariable, 0, 50); ?> could you tell me where to put it and if any changes need to be made? Thanks Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted December 16, 2010 Author Administrators Report Share Posted December 16, 2010 Hi simpilot, the code you mentioned at the top: <?php echo substr($yourvariable, 0, 50); ?> could you tell me where to put it and if any changes need to be made? Thanks It will depend on what you are working on as to what to use for a variable. In the popupnews module if you are trying to limit the characters of the subject line the data is presented in the template using the $subject variable. If you wanted to limit the subject to just say 10 characters you could do something like this in the template. <?php echo substr($subject, 0 , 9).'...'; ?> Quote Link to comment Share on other sites More sharing options...
ACVA_CEO Posted December 16, 2010 Report Share Posted December 16, 2010 ok got that...so "body" is a good variable? And this line is placed directly beneath the orginal call? Thanks Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted December 17, 2010 Author Administrators Report Share Posted December 17, 2010 I believe body is a good variable throughout the module. You would replace the "echo $body" verbage with the new code in order to limit the characters output to the display. Quote Link to comment Share on other sites More sharing options...
ACVA_CEO Posted January 26, 2011 Report Share Posted January 26, 2011 Hi Simpilot I put the code <?php echo substr($subject, 0 , 99); ?> in my popupnews tpl file to no avail. I still can't get the headline to show fully. Do you have any suggestions. Thanks Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted January 26, 2011 Report Share Posted January 26, 2011 I have a quick one too. I added the news module to my home page not in the side bar, but in the center. I would like to get rid of the posted on date and add the posted by author. I borrowed code from the news item tpl file and it didn't work out so smooth. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted January 26, 2011 Author Administrators Report Share Posted January 26, 2011 Hi Simpilot I put the code <?php echo substr($subject, 0 , 99); ?> in my popupnews tpl file to no avail. I still can't get the headline to show fully. Do you have any suggestions. Thanks The title field is limited to 30 characters in the database. If your title is longer than that, anything past the 30 characters is not being saved in the database. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted January 26, 2011 Author Administrators Report Share Posted January 26, 2011 I have a quick one too. I added the news module to my home page not in the side bar, but in the center. I would like to get rid of the posted on date and add the posted by author. I borrowed code from the news item tpl file and it didn't work out so smooth. You will need to add a couple lines in the PopUpNews.php controller after line 40 add; Template::Set('subject', $row->subject); Template::Set('postedby', $row->postedby); then in the popupnews_list.tpl you will have $subject and $postedby available to you. The $posted by will only be the db id # for the poster that you will have to convert to a pilot number in the template. 1 Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted January 26, 2011 Report Share Posted January 26, 2011 You will need to add a couple lines in the PopUpNews.php controller after line 40 add; Template::Set('subject', $row->subject); Template::Set('postedby', $row->postedby); then in the popupnews_list.tpl you will have $subject and $postedby available to you. The $posted by will only be the db id # for the poster that you will have to convert to a pilot number in the template. Thank you very much! I really appreciate it. +1 for you. **EDIT** Worked like a charm. Thanks again! Quote Link to comment Share on other sites More sharing options...
ACVA_CEO Posted January 26, 2011 Report Share Posted January 26, 2011 The title field is limited to 30 characters in the database. If your title is longer than that, anything past the 30 characters is not being saved in the database. is there any way to change the character limit? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted January 27, 2011 Author Administrators Report Share Posted January 27, 2011 You can use phpMyAdmin or the command line to change the size limit of the field in your database. 1 Quote Link to comment Share on other sites More sharing options...
ACVA_CEO Posted January 27, 2011 Report Share Posted January 27, 2011 You can use phpMyAdmin or the command line to change the size limit of the field in your database. Worked great. Thanks Simpilot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.