Gossamer Forum
Home : Products : Gossamer Links : Discussions :

customising add.cgi

Quote Reply
customising add.cgi
Ok I'm blind...I can't see how to get the add.cgi to take onboard the design of the rest of the site.

I have changed add.html to new design but it's still using the default gossamer template design when viewing the web page....is there something I have to switch on/off to get it to take effect?

Many Thanks

Martin

Quote Reply
Re: customising add.cgi In reply to
Hi Martin,

Hmm, no nothing special. I would try clicking on Dynamic in the admin to make sure you are not seeing a cached html page, also double check that you are editing the right file.

You can go to

add.cgi?t=directory

where directory is a directory in your templates folder to display that template set. Make sure you are editing the right file.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: customising add.cgi In reply to
cheers Alex.

Starting to work through templates and stuff...i think maybe i'm getting confused.

The first thing I noticed is the login page, before the actual adding bit. I starting to presume these are different templates, but for the life of me can't find what controls each state (not logged in / logged in for adding)

Martin

Quote Reply
Re: customising add.cgi In reply to
$USER does, so if you look at the templates, if there is a <%Username%> the user is logged in, otherwise it's <%LinkOwner%> or <%Contact_Name%>

In the script, it uses the auth routines to determine and set cookies, but the templates know based on the passed tags from the Users table -- mainly Username.

You'll see this piece of code a lot, which is what is used to make the determination of whether a user is logged in, and which template a script should display -- login or the expected action.

Code:
if ($CFG->{user_required} and ! $USER) {
print $IN->redirect( Links::redirect_login_url ('add') );
return;
}
The 'add' portion is what is used to determine what script the user should be sent back to, in this case, I took this code from the add.cgi.

modify.cgi has:

Code:
if ($CFG->{user_required} and ! $USER) {
print $IN->redirect( Links::redirect_login_url ('modify') );
return;
}
PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Plugins:http://LinkSQL.com/plugin
Quote Reply
Re: customising add.cgi In reply to
Hi,

Or if you don't want to go into the code ;), you can go to User Options and check:

Require users to signup before they can add or modify links?
user_required Yes No

If this is set to Yes, then when you click on Add or Modify, you will be sent to the login page (login.html template) first to login.

Hope this helps,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: customising add.cgi In reply to
Thanks Alex....your advice did the trick....everything seems to be in order concerning this problem.....now boldly on to the next idea :) always the way eh!!