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

enable / disable page from script suggestion

Quote Reply
enable / disable page from script suggestion
Hi,

I didn“t find a way how to do disable / enable the page quickly, so I started using that:

Code:
#disable
$command= `sed "s/'disabled' => '0',/'disabled' => '1',/g" /path/to/admin/Links/Config/Data.pm > /path/to/admin/Links/Config/tmp`;
$command= `mv /path/to/admin/Links/Config/tmp /path/to/admin/Links/Config/Data.pm`;
#enable
$command= `sed "s/'disabled' => '1',/'disabled' => '0',/g" /path/to/admin/Links/Config/Data.pm > /path/to/admin/Links/Config/tmp`;
$command= `mv /path/to/admin/Links/Config/tmp /path/to/admin/Links/Config/Data.pm`;

It would be probably easier to approach this with a code snippet from the Links System itself, but this was quick and dirty and maybe useful for somebody.

Regards

N || I || K || O
Quote Reply
Re: [el noe] enable / disable page from script suggestion In reply to
Hi,

You're trying to disable the site?

This should do it in a global/plugin/.cgi script:

Code:
$CFG->{disabled} = 0;
$CFG->save();

...and:

Code:
$CFG->{disabled} = 1;
$CFG->save();

Muich safer than editing the way you are doing it Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] enable / disable page from script suggestion In reply to
Hi Andy,

Hats off! That was exaxtly what I was looking for.

Thanks

N || I || K || O

Last edited by:

el noe: May 7, 2010, 12:41 AM
Quote Reply
Re: [el noe] enable / disable page from script suggestion In reply to
Np - I've used that on a few custom jobs (so thanks should actually goto Alex for telling me about that function <G>)

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates