Dec 11, 2003, 4:31 PM
Veteran / Moderator (6956 posts)
Dec 11, 2003, 4:31 PM
Post #2 of 7
Views: 2771
The global.txt file is a hash dump, that includes keys and references to subroutines.
The code is all PERL for subroutines, but the file itself is just a hash key/value pairing of data.
Using the admin->templates->global editor is the best way to edit it. Otherwise, you can do some _massive_ damage.
One caveat is that the first line of a subroutine needs to be only five characters "sub {"
I'm not sure if this has changed in the most current release, but it's safest to make sure for backwards compatibility.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
The code is all PERL for subroutines, but the file itself is just a hash key/value pairing of data.
Using the admin->templates->global editor is the best way to edit it. Otherwise, you can do some _massive_ damage.
One caveat is that the first line of a subroutine needs to be only five characters "sub {"
I'm not sure if this has changed in the most current release, but it's safest to make sure for backwards compatibility.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
Dec 11, 2003, 4:34 PM
Novice (37 posts)
Dec 11, 2003, 4:34 PM
Post #3 of 7
Views: 2787
so if i want to write any custom global variables i need to write it in perl and start it with a "sub {"
-simon
http://www.fatscripts.com
-simon
http://www.fatscripts.com
Dec 11, 2003, 4:58 PM
Veteran / Moderator (6956 posts)
Dec 11, 2003, 4:58 PM
Post #4 of 7
Views: 2759
Yes.
You have automatic access to the links internal variables $DB, $CFG and $USER.
They work as expected -- $USER is the current logged in user, for example.
You might want to look at some of the posted globals here for specific examples of how to pass parameters in from the templates, to access the current template data set, and to pass data back.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
You have automatic access to the links internal variables $DB, $CFG and $USER.
They work as expected -- $USER is the current logged in user, for example.
You might want to look at some of the posted globals here for specific examples of how to pass parameters in from the templates, to access the current template data set, and to pass data back.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
Dec 11, 2003, 5:08 PM
Novice (37 posts)
Dec 11, 2003, 5:08 PM
Post #5 of 7
Views: 2759
i'm assuming $DB is the info to connect to the database?
what is $CFG?
-simon
http://www.fatscripts.com
what is $CFG?
-simon
http://www.fatscripts.com
Dec 12, 2003, 12:20 AM
Veteran / Moderator (6956 posts)
Dec 12, 2003, 12:20 AM
Post #6 of 7
Views: 2734
Dec 12, 2003, 1:37 AM
Veteran / Moderator (18436 posts)
Dec 12, 2003, 1:37 AM
Post #7 of 7
Views: 2758
Example;
$CFG->{build_root_url}
$CFG->{admin_email}
$CFG->{debug}
...etc
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!
$CFG->{build_root_url}
$CFG->{admin_email}
$CFG->{debug}
...etc
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!