Jump to content

Recommended Posts

  • 1 month later...
  • Administrators
Posted

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 B)

  • 2 weeks later...
Posted

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 ?

  • Administrators
Posted

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

  • 2 weeks later...
Posted

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.

  • Administrators
Posted

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

Posted

Did you try the updated files up about 5 posts? Let me know how you make out. B)

Oh I see, didn't notice those - was just downloading the one from the first post.

Thanks

  • 4 weeks later...
  • Administrators
Posted

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.

  • 2 weeks later...
Posted

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!

  • Administrators
Posted

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...
  • 2 weeks later...
Posted

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?

  • 3 weeks later...
Posted

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

  • Administrators
Posted

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.

  • 2 months later...
Posted

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

  • 3 weeks later...
Posted

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

  • Administrators
Posted

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).'...'; ?>

  • Administrators
Posted

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.

  • 1 month later...
Posted

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

Posted

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.

  • Administrators
Posted

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.

  • Administrators
Posted

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.

  • Like 1
Posted

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!

Posted

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?

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