11
sailjapan
Re: Help request: Mx-directory, error in email sending to business owners

@ zyspec

As reported in this thread, I have the same email problem (button activates 'tell a friend' instead of email to advertiser). If your hack works for Alan, can I have a copy too, or can you post it here for everyone to try?
Thanks.

12
zyspec
Re: Help request: Mx-directory, error in email sending to business owners
  • 2010/4/6 17:07

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


sailjapan,
I'm working through this with alan2006. One of us will post back here as we make progress. Unfortunately I haven't worked on this module in some time and don't currently have it installed anywhere. I'll look at the problem from the other thread at the same time...

13
zyspec
Re: Help request: Mx-directory, error in email sending to business owners
  • 2010/4/9 23:54

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Alan2006 and I were able to fix his website's problem. He has his XOOPS language set to Italian however there was not an Italian translation for mx-directory installed. Unfortunately the contact.php file does not check for the existance of the email template file so it fails. There are 2 easy ways around this problem:
1) If you are using XOOPS in a language other than English then create mx-directory language files to match the selected XOOPS language.
OR
2) modify contact.php to change line 220 from:
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/language/'.$xoopsConfig['language'].'/mail_template/');


to:
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/language/english/mail_template/');


You only need to do either 1 OR 2 above, not both.

14
ghia
Re: Help request: Mx-directory, error in email sending to business owners
  • 2010/4/10 6:16

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


For 2 it should use a fallback with testing if the file exists:
if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/language/'.$xoopsConfig['language'].'/mail_template/category_linksubmit_notify.tpl')) {                $xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/language/'.$xoopsConfig['language'].'/mail_template/');
            } else {               
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/language/english/mail_template/'); 
            }
This is always safe, wether the language directory exists or not.

15
zyspec
Re: Help request: Mx-directory, error in email sending to business owners
  • 2010/4/10 13:05

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


ghia,

True it should actually check for the particular file, not just the directory. I just took the 'easy' (aka lazy) way for the patch.

Although the section of code where this is placed isn't actually looking for the Quote:
category_linksubmit_notify.tpl
file in your code snippet above. The way it should 'ultimately' be patched is:

if (!is_readable($templdir.$thistemplate)) {
   
$templdir XOOPS_ROOT_PATH DIRECTORY_SEPARATOR 'modules' DIRECTORY_SEPARATOR $mydirname DIRECTORY_SEPARATOR 'language' DIRECTORY_SEPARATOR 'english' DIRECTORY_SEPARATOR 'mail_template' DIRECTORY_SEPARATOR;
}
    if (!
is_readable($templdir.$thistemplate)) {
        exit(
"System Error: '{$thistemplate}' email template could not be found.");
        }


As a side note I would rather use 'is_readable' instead of 'file_exists' since the file may exist but security settings could prevent the file from being read by the script so the script would fail without any error message...

16
Alan2006
Re: Help request: Mx-directory, error in email sending to business owners
  • 2010/4/10 13:31

  • Alan2006

  • Just popping in

  • Posts: 6

  • Since: 2006/1/17


Zyspec,
many thanks for your great work helping me to fix problem email sending in mx-directory module. Now I'm able build my new portal with a business directory full functionally!
I will post link here when my website will be completed.
Bye, CIAO A TUTTI !

17
Mamba
Re: Help request: Mx-directory, error in email sending to business owners
  • 2010/4/10 21:32

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Is there a chance to update the Mx-directory download file, so we can use in the repository?

Also, could somebody add all the changes to the SVN Repository? I just added the code from 3.01 that was published by Evucan

Thanks to all involved for making this changes and improving this module!

Login

Who's Online

277 user(s) are online (148 user(s) are browsing Support Forums)


Members: 0


Guests: 277


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits