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

Add_Date location for admin

Quote Reply
Add_Date location for admin
I'm trying to find what code in what .pm is generating the Add_Date in the admin/add link sections.

Having real hard time pinning this down so if anyone knows please help!

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] Add_Date location for admin In reply to
Hi,

You want to edit the way its shown on detailed pages / link.html ? If so, its held in Setup > Date Options > date_user_format

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] Add_Date location for admin In reply to
Not quit as simple as that I'm afraid.

I have a time field in the Links table and can generate the current time, but need to add this code into the main link codes so when adding a link via the admin, the field is filled out.

Code:
my $timenow = GT::Date::date_get(time, '%HH%:%MM%:%ss%');
$link->{Add_Time} = $timenow;

So I'm looking at the .pm moduls but its difficult to know which module to add this code to.

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] Add_Date location for admin In reply to
Hi,

Ok, well just had a quick look - and looks like admin/Links/Table/Link.pm is the job.

Find:

Code:
sub _plg_add {
# -------------------------------------------------------------------
# Add a link.
#
my ($self, $p) = @_;

# Check to see if we can add a link, all errors get cascaded back.
$p->{'CatLinks.CategoryID'} or return $self->warn('NOCATEGORY');
$p->{'CatLinks.CategoryID'} = $self->clean_category_ids($p->{'CatLinks.CategoryID'}) or return;

..and add something like this below:

Code:
$DB->table('Links')->update( { Add_Time => GT::Date::date_get(time, '%HH%:%MM%:%ss%') }, { ID => $p->{ID} ) || die $GT::SQL::error;

Something like that should do the trick =)

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!