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

Link owner Header and footer

Quote Reply
Link owner Header and footer
Hi

That was discussed a while back with no solution..

What I am trying to do is to allow the link owner to have their owneheader and footer for the (recommend our site, review a site, View reviews, rate our site, Site detailes, ..)

I know that we can add link_header and link_footer and return those in the templetes through if statements but that has two bad sides:

- The owner of 10 links will have to a;ter all 10 of them.

- the load on the links table will be huge due to the size of the header and footer contents..

So I thought about adding a user_footer and user_header.. then anytime the link belongs to a user that had specified a header and footer it will return them.... this way we can avoid both problem by having one entry and not storing it on the links table..

THE PROBLEM is I have not been able to find a way to return the header and footer in those pages...

Can any one suggest a way..? I know it is there just need some help pinting it out..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Link owner Header and footer In reply to
I would create two upload columns in the user table which allow the user to upload their header and footer, and then do a global to get them using $USER->{Username}.
Quote Reply
Re: [giovanni] Link owner Header and footer In reply to
Thnaks

The problem is creating that global cus of the conflict between the owners username and the usersname (if we have a logged on user trying to access those pages)..

Also creating that global was a problem itself..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Link owner Header and footer In reply to
Can't you create a global which joins the Links and Users tables

my $db = $DB->table ('Links','Users');

I think you can do this because there is a foreign key relation set up between LinkOwner in the Links table and Username in the Users table. You can then perform select statements on $db and you should have access to all the fields in the Links table and the Users table for the associated user.

Hope this helps.

Laura.
The UK High Street
Quote Reply
Re: [afinlr] Link owner Header and footer In reply to
Yes we can

But that global will not recognize each link and pull the corresponding header,footer..

That will be best achieved through IF statement, I think, ..

Thanks for the suggestion..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Link owner Header and footer In reply to
Try this global - called has_header

sub {

my $tags = shift;

my $db = $DB->table ('Links','Users');

my $header = $db->select ({ID=>$tags->{ID}},['Header'])->fetchrow_array;

if ($header) {return $header;}

else {return;}

}

Then in your if statement would be

<%if has_header%><%has_header%><%else%><%include header.html%><%endif%>

and similarly for the footer (you'll need another global has_footer.
The UK High Street
Quote Reply
Re: [katabd] Link owner Header and footer In reply to
I can see how this could be very resource intensive for sure.

Under normal circumtances a template could be called (dynamically)for each user/owner. But you are trying to tie it to the link rather than the owner (I am gathering).

Have you thought about creating another level in the template?

Header
Nav
Link Header
Body
Nav
Footer

Since there is only one section rather than two being called it would be much less intense on the resources and much faster to boot. You could also add fields in the link signup for a graphic (for the link header) and body color. Then it would look very different and be more in tune with their site but not kill the resources on your server.



Just a thought!Cool
Quote Reply
Re: [afinlr] Link owner Header and footer In reply to
Thanks Laura

Your solution seems to work...

when this mod is ready I will let you know..

That will very much allow all my users - if they want to - to have their rating, reccomend us, review, details customized the way they want it to be.....

We can basically serve as a web master tools provider in the back ground...
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory