Gossamer Forum
Home : Products : Links 2.0 : Customization :

Non-Template Users

Quote Reply
Non-Template Users
I was just curious if there was a mod for non-template users to add the 5-star image rating (like amazon.com) to there Links?

Also curious about a secure modify.cgi script for non-template users.

I've found both these scripts for use with templates, it's just I'm no perl expert and I have no clue about editing the perl to work with site_html.pl in stead of site_html_templates.pl

I am using non-templates in the first place so I can create headers and footers since SSI doesn't work.


reflex Crazy

Last edited by:

reflex: Nov 4, 2002, 2:51 PM
Quote Reply
Re: [reflex] Non-Template Users In reply to
Of course, template-based links does have header and footer text files... are you wanting different header/footers for different pages? Or are you including dynamic content in them?

For the first situation, just create additional templates (text files) for various header/footers, calling them like <%header2%>.

I have not tried with Links, can it not call SSI? Just put the proper code in the header/footer files, then it seems like it should work?

Look at this thread: http://www.gossamer-threads.com/...g=using%20SSI;#19610

Search forums using the terms "using SSI" for more info...


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Nov 4, 2002, 4:41 PM
Quote Reply
Re: [PerlFlunkie] Non-Template Users In reply to
Hey man, yea my questions werent really about using headers and footers.. I like it just fine the way I got them set up with site_html.pl and the variables I set. The real question was about converting the template based modes into code that would work for the non-template users. I used to use the templates - but found them too sloppy. I like how all the html is in one big file (site_html.pl).

So once again all i really need to know if some super guru perl coder can switch up the codes for those 2 mods (5 star image rating and modify.cgi security) or if there is all ready a non-template mod for the 2.

Thanks a million

reflex Crazy
Quote Reply
5 Star Image Rating Code In reply to
I found the following in the resource center. The mod was created by the one, the only, Widgetz!!!

The only problem is that it's for template users. I need to know what lines to fix up so It will work for me in my non-templates.






Re: ratings amazon-image-style mod problems [In reply to]


you should use my code..

i didn't feel like adding it to the resource center.. it's much shorter..

add this to the end of site_html_templates.pl

Code:
sub get_rating_image {
my ($rating) = @_;
my ($i, $image);

for ($i = 0; $i <= 20; $i++) {
$image = qq~<img src="$rating_images_url/rate$i.gif" width="94" height="20" alt="$rating" border="0">~ and last if ($rating <= $i/2);
}

return $image | | $rating;
}

delete the space between the "| |".. the message board screws it up

in links.cfg add this:

Code:
$rating_images_url = $build_root_url . "/images/ratings";

under:

Code:
$build_ratings_url = "$build_root_url/Ratings";

and change it to the proper location of where your images will be.. also.. change the width and the height to the size yours is going to be..

umm... now in site_html_link.. you would put something like this (i think you should know where)..

Code:
rate_img => &get_rating_image($rec{'Rating'}),



you will need to rename your images to.. rate0-rate20.. instead of rate00-rate20.. if you get what that means.. (ie: rate1, rate2, rate3.. instead of rate01, rate02, rate03..)

ok.. that's all..

jerry

[This message has been edited by widgetz (edited September 06, 1999).]




If somebody could help me out it would be very appritiated.

reflex Crazy