Gossamer Forum
Home : Products : Links 2.0 : Customization :

open link in new window and going to new page in old (help)

Quote Reply
open link in new window and going to new page in old (help)
Hi guys,
I just got a new idea for using Links. Would it be possible to make the links open in a new window, and at the same time go to a page on the old page, where the user can rate/review the page.
For example. User goes to a category.. finds a link and clicks on it. The link open in a new window and the user browse through it. When (s)he closes that window, my link page is still there, but with a page where (s)he is able to rate/review it - or go back to the search/category.
Did it make sense and do you think it is possible to do?

Oh yeah - one other thing. Sometimes I've accidently added a new link, with the same link id as an exsiting one. Is it possible to block for new links if the link ID already is found?

Thanks in advance,

Jesper
Quote Reply
Re: open link in new window and going to new page in old (help) In reply to
Good idea! I did it already! Smile

It's for using with templates and goes like this:

For every page using this feature add following in the head-section
Code:
<script language="JavaScript">
function createWin(sidu)
{
var name = "path/to/rate-win.cgi?ID=";
name = name+sidu;
newWin = window.open(name,'',
'toolbar=no,location=no,directories=no,status=yrd,menubar=no,resizable=yes,width=480,height=220');
newWin.creator = self;
}
</script>


The links have to look like this:

Code:
<a class="link" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%> onClick="createWin(<%ID%> )"><%Title%></a>


add in site_html_template.pl behind

########################################################################################
# THE FOLLOWING ARE CGI GENERATED PAGES AND THE TEMPLATE MUST BE PRINTED, NOT RETURNED!#
########################################################################################

Code:
sub site_win_rate_form {
# --------------------------------------------------------
# This routine determines how the rate form page will look like.
#
my %rec = @_;

&html_print_headers;
print &load_template ('rate-win.html', {
%rec,
%globals
});
}


sub site_win_rate_success {
# --------------------------------------------------------
# This routine determines how the rate success page will look like.

my %rec = @_;


&html_print_headers;
print &load_template ('rate-win_success.html', {
%rec,
%in,
%globals
});
}


add two templates rate-win.html and rate-win_success.html


change in rate.cgi
&site_html_rate_form (%rec) :
in
&site_win_rate_form (%rec) :
and
&site_html_rate_success;
in
&site_win_rate_success;
and save the new file as rate-win.cgi!

Upload everything, chmod it and that's all! Smile

Hope to get everything!

BTW: You can see a live page at http://www.juhukatzen.de/topsites1999.html

Best wishes
Stefan





------------------
visit Juhu!Katzen!
http://www.juhukatzen.de/


[This message has been edited by stefang (edited January 06, 2000).]
Quote Reply
Re: open link in new window and going to new page in old (help) In reply to
Hi Stefan!

Thank you for your tip - I haven't really thought about using java Smile I modified it a bit, so the link opens in a new window, and then the original window goes to the rate it form.

I'll just have to create a new html page for rating it.

Thanks for your help,

Jesper
www.cops.dk