Thread subject: pHpFusion Nederlands (BE|NL) » Ondersteuning, Themas, Infusies, Modificaties en Installatie :: Autonews Infusion

Posted by afoster on 02 March 2019, 19:58
#1

Quote

douwe_yntema schreef:

I Got your infusion working and sending mail.

In file autonews_include.php line 393 must be changed to:

Code

$rtn = dbrows($result);


Furthermore to send mail, it is file autonews_cronjob.php that says:

// To activate this file, set $locale['AN042'] to TRUE and insert a password below
// Use 'http://wwww.mysite.com/infusion/autonews/autonews_cronjob.php?pw=mypassword' from cronjob

But, $locale['AN042'] does not exist. You need to change in file autonews_param.php, line 30 to:
Code

$autonews_params['cronjob'] = TRUE;    // TRUE if cronjob is used - FALSE otherwise


and enter a password in file autonews_cronjob.php in line 24.

Then call the cronjob as state as:
http://wwww.mysite.com/infusion/autonews/autonews_cronjob.php?pw=mypassword

where the password is from autonews_cronjob.php line 24.

of course you need to set up PHP-Fusion correctly for sending mail.

There are some warnings about shoutbox, I infused the shoutbox, but not set it up. Don't know if this need to be digged out deeper.


I forgot to ask if you actually sent the email from the screenshot you posted. I got that far in the infusion as well, but the email was never sent.

Posted by douwe_yntema on 02 March 2019, 20:08
#2

The screen shot is from my mail program.

I was confused also when clicking the test link, you get an preview of the mail in your browser, but the mail is not sent.
To send the mail, you need to execute the autonews() function, which is actually done from the cronjob.

Or you must make a call to the autonews() function from somewhere else. e.g. from the footer of your site.
Or make a panel whitout content and call it cronjob.
Every time a visitor comes on your site, the code is executed.

Posted by afoster on 02 March 2019, 20:19
#3

Quote

douwe_yntema schreef:

The screen shot is from my mail program.

I was confused also when clicking the test link, you get an preview of the mail in your browser, but the mail is not sent.
To send the mail, you need to execute the autonews() function, which is actually done from the cronjob.

Or you must make a call to the autonews() function from somewhere else. e.g. from the footer of your site.
Or make a panel whitout content and call it cronjob.
Every time a visitor comes on your site, the code is executed.


Do you mean the autonews() function in autonews_cronjob.php or somewhere else? As you can tell, I am not very well versed in php.

BTW, how can I respond to your posts without having to quote the message? I can't seem to find the link that will let me do that.

Posted by douwe_yntema on 02 March 2019, 20:28
#4

The function autonews() is located in autonews_include.php:

Code

// Does what has to be done at all times - returns TRUE if something has happened
function autonews()
{
  $autonews_settings = autonews_readdb();
  if ($rtn = autonews_check($autonews_settings))
  {
    autonews_send($autonews_settings);
  }
  return $rtn;
}


This function is calling autonews_check and if there is something to send, autonews_send is called (see below autonews function in te file)

Button explained in attachment :)

Posted by afoster on 02 March 2019, 20:41
#5

Thanks, I will see if I can get the cronjob to work. I would still like the infusion to work (send emails) without using a cron job...I know it is possible because it is working on two different php-fusion 7.02.07 sites.

Posted by douwe_yntema on 02 March 2019, 21:02
#6

Oh no I forgot:

For the infusion to infuse, in infusion.php search for Type=MyISAM;
and replace with ENGINE=MyISAM; (twice)

I checked again, but the autonews function is also called from the autonews panel, if the cronjob parameter is set to false. It was in the readme. But then then the mails are only sent if the panel is executed, so if a visitor enters your site.


Sorry not to mention this before.

I just tested and it works also

Posted by afoster on 02 March 2019, 22:02
#7

I was aware of the Type=MyISAM issue as that is the reason why it did not infuse correctly originally.

When you say "I just tested and it works also", do you mean it is working without using cron job? If so, I would love it if you could zip up your whole infusion (changing db connection details) and add it to a post here. Perhaps when comparing the files I could figure out where the problem lies for me.

Posted by afoster on 03 March 2019, 03:57
#8

I defused and re-infused the autonews and it now seems to be working without the cronjob. Don't really know what I did but I am happy that it is working.

Again, it is on a site running php-fusion 8.00.21, with php version 5.6.3

Thanks again for your help on this.

Posted by douwe_yntema on 03 March 2019, 07:57
#9

Quote

afoster schreef:

I was aware of the Type=MyISAM issue as that is the reason why it did not infuse correctly originally.

When you say "I just tested and it works also", do you mean it is working without using cron job? If so, I would love it if you could zip up your whole infusion (changing db connection details) and add it to a post here. Perhaps when comparing the files I could figure out where the problem lies for me.


Yes it is working whitout the cron job if you make the setting in the file autonews_param.php, line 30 to:
Code


$autonews_params['cronjob'] = FALSE;   

Edited by douwe_yntema on 01 January 1970, 00:00

Posted by douwe_yntema on 03 March 2019, 08:00
#10

Quote

afoster schreef:

I defused and re-infused the autonews and it now seems to be working without the cronjob. Don't really know what I did but I am happy that it is working.

Again, it is on a site running php-fusion 8.00.21, with php version 5.6.3

Thanks again for your help on this.



Glad it is working. Maybe a setting that was set to default again after infusion

Posted by afoster on 10 June 2019, 20:43
#11

douwe_yntema schreef:

Quote

afoster schreef:

I defused and re-infused the autonews and it now seems to be working without the cronjob. Don't really know what I did but I am happy that it is working.

Again, it is on a site running php-fusion 8.00.21, with php version 5.6.3

Thanks again for your help on this.



Glad it is working. Maybe a setting that was set to default again after infusion


I am trying to get this infusion to work on another 8.00.21 site (different domain from the one mentioned here) and am having problem getting it to send the email. In reading this thread, it does not say what caused it to work. Do you by chance remember? Thanks.

Posted by afoster on 11 June 2019, 02:13
#12

Never mind, it is now working.