Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Problem with Links::language

Quote Reply
Problem with Links::language
Hi,

I make an update of my installation 2.1.2 to 3.0.
All seems to function correctly.
But, a plugin does not work correctly.
It does not use the value of Links::language ('AD_RENEWAL_NOTIFICATION_SUBJECT').

require GT::Mail;
$GT::Mail::error ||= ''; # Silence -w
GT::Mail->send (
smtp => $CFG->{db_smtp_server},
sendmail => $CFG->{db_mail_path},
from => $CFG->{db_admin_email},
subject => Links::language('AD_RENEWAL_NOTIFICATION_SUBJECT'),
to => $link->{Email},
msg => $msg,
debug => $Links::DEBUG
) or Links::fatal ("Unable to send mail: $GT::Mail::error");

However, this value is well declared in Buil and User Language (language.txt).

An idea?
Thanks!

Mick

Quote Reply
Re: [MJ_] Problem with Links::language In reply to
You're sure that AD_RENEWAL_NOTIFICATION_SUBJECT exists in your language.txt file for the active template set? (not an old template set) . I don't see any reason why that code wouldn't work

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Problem with Links::language In reply to
Hi Andy,

Yes, it is well recorded in the language.txt file.

In Fact, that functions well with :
return { error => Links::language('REVIEW_INVALIDID' };
or
print Links::SiteHTML::display ('error', { error => Links::language('SENDMAIL_DISABLED') });

But not on the Subject :
subject => Links::language('AD_EXPIRED_NOTIFICATION_SUBJECT'),

Is It perhaps a limit of the email function ?

Thanks!

Mick

Quote Reply
Re: [MJ_] Problem with Links::language In reply to
Mmm, it shouldn't be a limitation. Maybe try:

Code:
my $subject = Links::language('AD_EXPIRED_NOTIFICATION_SUBJECT');

...and then this:

Code:
subject => $subject

?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Problem with Links::language In reply to
In Fact, your remark was judicious!
It uses the language.txt of the folder admin!

Don't I understand, it should use the Luna folder (the templates use the Luna folder!)?

Thanks! :)

Mick
Quote Reply
Re: [MJ_] Problem with Links::language In reply to
No problem :) I think it takes the template set name from where the template is being called from (so if the template is in "admin", it will use the language.txt file in that folder too)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Problem with Links::language In reply to
I think that I corrected the plugin.
But, I have a last problem.

It uses this code to recover the list of the categories on a template :

use Links::User::Modify;

my $category = Links::User::Modify::_category_list();
$link->{Category} = $category;

But, that causes an error :

A fatal error has occured:
Undefined subroutine &Links::User::Modify::_category_list called at Plugins

Is There a possible correction?
Thanks again!

Mick
Quote Reply
Re: [MJ_] Problem with Links::language In reply to
You may be better using my ULTRAGlobals plugin, with Load_Category_Dropdown (I think thats the function name)

The new version of GLinks is a little more complex to create those loops.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!