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

How to obtain the value of paylogs_time.

Quote Reply
How to obtain the value of paylogs_time.
Hi,

I use a global to obtain the value of <%paiement_id($ID)%> on link_modify_select.html.

sub {
my $table = $DB->table('Payments');
my $cond = GT::SQL::Condition->new(payments_linkid => 'LIKE' => $_[0]);
$table->select_options("ORDER BY payments_last DESC");
return $table->select('payments_id' => $cond)->fetchrow;
}
 
Now, I would like to obtain the value of paylogs_time.

I tested : <%paylogs_time($paiement_id($ID)%>

with :

sub {
my $table = $DB->table('PaymentLogs');
my $cond = GT::SQL::Condition->new(paylogs_payments_id => 'LIKE' => $_[0]);
$table->select_options("ORDER BY payments_last DESC");
return $table->select('paylogs_time' => $cond)->fetchrow;
}

But, that does not function. :(

You have an idea ?

Thanks for your assistance.

MJ

Quote Reply
Re: [MJ_] How to obtain the value of paylogs_time. In reply to
Mmm, that should work. Try it like:

Code:
return $table->select( ['paylogs_time'] , $cond)->fetchrow || die $GT::SQL::error;

..and see what that returns

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] How to obtain the value of paylogs_time. In reply to
Thanks Andy, Smile

I always obtain the error :

Error: Variable “paylogs_time” is not has code refers

sub {
my $table = $DB->table('PaymentLogs');
my $cond = GT::SQL::Condition->new(paylogs_payments_id => 'LIKE' => $_[0]);
$table->select_options("ORDER BY paylogs_time DESC");
return $table->select( ['paylogs_time'] , $cond)->fetchrow || die $GT::SQL::error;
}


<%paylogs_time($paiement_id($ID)%>

An idea ?

Thanks, MJ

Last edited by:

MJ_: May 25, 2009, 12:17 PM
Quote Reply
Re: [Andy] How to obtain the value of paylogs_time. In reply to
Hi Andy,

I have the error message now :

Stack Trace
======================================
Links (1348): Links::environment called at ../admin/Links.pm line 786 with no arguments.
Links (1348): Links::fatal called at (eval 63) line 5 with arguments
(Died at (eval 63) line 5.
).
Links (1348): Links::__ANON__ called at GT::Template::_call_func line 810 with arguments
(paiement_id($ID).
Links (1348): GT::Template::_call_func called at ../modify_select.html.compiled line 1214 with arguments
(GT::Template=HASH(0x8914070), paylog_id, 1, 0, paiement_id($ID).
Links (1348): GT::Template::parsed_template called at ../admin/GT/Template.pm line 580 with arguments
(GT::Template=HASH(0x8914070)).
Links (1348): GT::Template::_parse called at ../admin/GT/Template.pm line 163 with arguments
(GT::Template=HASH(0x8914070), modify_select.html, HASH(0x87aa328)).
Links (1348): GT::Template::parse called at ../admin/Links.pm line 480 with arguments
(GT::Template, modify_select.html, ARRAY(0x8a259a0), HASH(0x87aa328)).
Links (1348): Links::user_page called at ../admin/Links/SiteHTML.pm line 308 with arguments
(modify_select.html, HASH(0x87aa154), HASH(0x87aa328)).
Links (1348): Links::SiteHTML::__ANON__ called at ../admin/GT/Plugins.pm line 133 with arguments
(HASH(0x87aa154), [undef]).
Links (1348): GT::Plugins::dispatch called at ../admin/Links/SiteHTML.pm line 27 with arguments
(GT::Plugins=HASH(0x83af7b8), site_html_modify_select, CODE(0x87aa0c4), HASH(0x87aa154), [undef]).
Links (1348): Links::SiteHTML::display called at ../admin/Links/User/Modify.pm line 246 with arguments
(modify_select, HASH(0x87aa154)).
Links (1348): Links::User::Modify::_list_owned_links called at ../admin/Links/User/Modify.pm line 41 with no arguments.
Links (1348): Links::User::Modify::handle called at ../admin/GT/Plugins.pm line 127 with no arguments.
Links (1348): GT::Plugins::dispatch called at modify.cgi line 26 with arguments
(GT::Plugins=HASH(0x83af7b8), handle_modify, CODE(0x817f30c)).

----------------------------------------
I do not find my error.

MJ.
Quote Reply
Re: [MJ_] How to obtain the value of paylogs_time. In reply to
Give this a go:

Code:
<%paylogs_time($ID)%>

Tongue

..not:

Code:
<%paylogs_time($paiement_id($ID)%>

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] How to obtain the value of paylogs_time. In reply to
Hi Andy and Thanks,

I also tested, but that does not function. :(
There is no error message, but no value is given.
 
Doesn't the PaymentLogs table directly use the identifier of the link, it is perhaps the origin of the problem ?
The reference identical to the two tables is : payments_id and paylogs_payments_id
 
Thanks for your assistance and your patience !

M.

Quote Reply
Re: [MJ_] How to obtain the value of paylogs_time. In reply to
Hi,

Try this:

paiement_id
Code:
sub {
my $table = $DB->table('Payments');
my $cond = GT::SQL::Condition->new(payments_linkid => 'LIKE' => $_[0]);
$table->select_options("ORDER BY payments_last DESC");
return $table->select('payments_id' => $cond)->fetchrow;
}

..and call with:

<%set paiement_id = paiement_id($ID)%>

..then add a new global:

get_payment_time
Code:
sub {
return $DB->table('PaymentLogs')->select( ['paylogs_time'] , { payments_id => $_[0] } )->fetchrow || die $GT::SQL::error;
}


..and call with:

<%set payment_id = get_payment_time($paiement_id)%>

That should hopefully 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] How to obtain the value of paylogs_time. In reply to
Hi Andy,

I tested but, I always obtain the error : Can't call method "fetchrow" on an undefined value at (eval 59) line 2.

Another idea ?

Thanks, M.
Quote Reply
Re: [MJ_] How to obtain the value of paylogs_time. In reply to
Ah sorry, I think it should be:

Code:
sub {
return $DB->table('PaymentLogs')->select( ['paylogs_time'] , { paylogs_payments_id => $_[0] } )->fetchrow || die $GT::SQL::error;
}

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] How to obtain the value of paylogs_time. In reply to
I obtain the error : Died at (eval 59) line 2.

Does that inspire something to you ?

Thanks, M.
Quote Reply
Re: [MJ_] How to obtain the value of paylogs_time. In reply to
Mmm, where are you actually testing this? If its ok, please send over GLinks details + the template you are calling it from - and I'll have a look for you. Not sure why its giving that error without doing some tests.

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] How to obtain the value of paylogs_time. In reply to
Thanks Andy,

In fact, I would like to inform the owner of the link if the payment is made or not.

For example :
Your payment must be checked.
or
Your payment is validated.

I would like to also use the value of paylogs_viewed to inform the owner.

For example:

<%if paylogs_viewed == '1'%>Your payment is checked, but must be confirmed.<%endif%>

You think that it is possible ?

Mick

Quote Reply
Re: [MJ_] How to obtain the value of paylogs_time. In reply to
..and where are you wanting to show this to them? I've not really played around that much with the payment system (appart from the basics)

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] How to obtain the value of paylogs_time. In reply to
I would like to obtain these messages on the modify_select.html page.

Mick
Quote Reply
Re: [MJ_] How to obtain the value of paylogs_time. In reply to
Ok, could you email me over a test user I can try, and GLinks details? I don't have any data in my Payments or PaymentLog tables, so have nothing to work with really :(

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] How to obtain the value of paylogs_time. In reply to
Thanks Andy,

I also tried to block the use of the form of payment if a payment is not validated yet.
But, it is very difficult to realize.

I do not manage to understand operation. :(

The owner can use several times the function (manual payment for example), whereas a first paiment must be checked.

Mick
Quote Reply
Re: [Andy] BUG ? or How to obtain the value of paylogs_time. In reply to
Hi Andy,

Thanks for your intervention, you are always very effective ! Smile

I have a problem which resembles a bug of GL.

When a payment is deleted by the administrator, it is deleted in the PaymentLogs table but not in the Payments table.

That poses problems for the messages in direction of the owner of the link.

For example, if I use a condition on paiement_id the condition is always true, but it should be false by what the payment was removed by the administrator via the option delete.

You have an idea ? You think that it is a bug ?

Thanks for your feedback.

Mick

Quote Reply
Re: [MJ_] BUG ? or How to obtain the value of paylogs_time. In reply to
Hi,

Mmm, sounds like a bug - may be worth email GT about it , to see if they can come up with a fix :)

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] BUG ? or How to obtain the value of paylogs_time. In reply to
Hi,

I have just sent an email to GT.

I will inform you of the answer.

Thanks, Mick