Gossamer Forum
Home : Products : Links 2.0 : Customization :

isLinked Problem

(Page 1 of 2)
> >
Quote Reply
isLinked Problem
Hi All,

I installed the Enable/Disable Hyperlink Mod from http://www.isee-multimedia.co.uk/scripts/linksv2.htm and now when someone tries to add a link they get:

isLinked (Can not be left blank)

There is no option on the add a link page for the link owner to choose weather or not they have a link.

Thanks In Advance!

Mike


Quote Reply
Re: isLinked Problem In reply to
Do one or both of the following:

1) Set the isLinked field to be NOT REQUIRED (NULL) by changing the 1 to 0 in that field definition.

Example:

Code:

isLinked => [16, 'alpha', 0, 5, 0, 'No', 'No|Yes'],


Look at the bold 1.

2) Add a hidden field in all your add forms in the add template files:

Code:

<input type="hidden" name="isLinked" value="Yes">


Regards,


Eliot Lee
Quote Reply
Re: isLinked Problem In reply to
Ok, but is there a way to give this option to a link owner when they are adding and modifying their link? Some of the smaller town halls don't have their own webpage yet but would still like to be listed for info reasons.

Thanks!

Mike

Quote Reply
Re: isLinked Problem In reply to
Duh...yea...add radio button fields in your add and modify forms...

Code:

<input type="radio" name="isLinked" value="Yes" CHECKED> Yes
<input type="radio" name="isLinked" value="No"> No


Wink

Regards,

Eliot Lee
Quote Reply
Re: isLinked Problem In reply to
Thanks! For all your help and your patience!

Mike

Quote Reply
Re: isLinked Problem In reply to
You're welcome. Wink

Regards,

Eliot Lee
Quote Reply
Re: isLinked Problem In reply to
Ok, I promise, last question for the night. It still requires you to input a url. I looked around for it, but guess I haven't gotten that savey with this yet. Can you Please point me in the right direction?

Take Care!

Mike

Quote Reply
Re: isLinked Problem In reply to
Uh...change the 1 in the field definition for URL to 0 as clearly stated in the Mod instructions.

Wink

Regards,

Eliot Lee
Quote Reply
Re: isLinked Problem In reply to
Hi Anthro,

Ok, when I add a link that doesn't have a url and then click on that link it should send me to the detailed page, instead it forces me to download jump.cgi, when I open it and view it I find the following error:

Error: Can't find link id: 2

Any ideas?

Thanks!

Mike

Quote Reply
Re: isLinked Problem In reply to
You need to add the following codes in your sub site_html_link routine (as I believe similar codes ARE posted in the Mod instruction page...):

Code:

if ($rec{'isLinked'} eq 'Yes') {
$linkurl = "$build_jump_url?ID=$rec{'ID'}";
}
else {
$linkurl = "$build_detail_url/$rec{'ID'}$build_extension";
}


Then define this tag as follows:

Code:

linkurl => $linkurl


Then in your link.html file, add the following codes:

Code:

<a href="<%linkurl%>"><%Title%></a>


Regards,

Eliot Lee
Quote Reply
Re: isLinked Problem In reply to
Thanks for helping ou eliot, I've been manicly busy!!!



Regards

Mark Priest
Quote Reply
Re: isLinked Problem In reply to
Oops...bad message...

Regards,

Eliot Lee
Quote Reply
Re: isLinked Problem In reply to
Hi Anthro,

Ok, I'm in the home stretch on these mods, got most of them installed ok. Anyway, on this one I'm still having problems.

------------------------------------------------------------

You need to add the following codes in your sub site_html_link routine (as I believe similar codes ARE posted in the Mod instruction page...):

------------------------------------------------------------

I looked all over at http://www.isee-multimedia.co.uk/scripts/linksv2.htm and couldn't find any refferences to that. But anyway, this is where it stands.

I tried the code you gave me for the links.html:

------------------------------------------------------------

<a href="<%linkurl%>"><%Title%></a>

------------------------------------------------------------

But this just reloads the the link page again.
So I have the following code:

<ul><li><a class="link" href="<Û_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a>

which should take the user to the detailed page using the code for jump.cgi you gave me in this message:http://gossamer-threads.com/...ust&Number=86979. Now this all works fine IF the link has it's own url, if isLinked is turned off and the url is blank it forces you to download jump.cgi which has Error: Can't find link id: 1 in it.

Also, (sorry) if you manually go to the detailed page for the link that doesn't have a url and click "Visit This Link" (which shouldn't display at all if there is no url to go to) it tries to take you to the links/detailed directory. Of course there is no index there so you get the "You are not authorized..." error. Here's what I have in the detailed.html template:

<%if isLinked%><a href="<%URL%>" target="_Blank">Visit this link</a><%endif%>

Whew, that was a killer to get out....

Thanks for any help!

Mike

Quote Reply
Re: isLinked Problem In reply to
Looks to me like you have not used the codes I provided, because the codes I provided will do the following:

1) IF there is a URL for the link in your directory, then the jump.cgi file will be used to "jump" to the web site.

2) IF there is NO URL for the link in your directory, then the detailed page will be used!

Regards,

Eliot Lee
Quote Reply
Re: isLinked Problem In reply to
This is cut right out of my jump.cgi:

# This was changed to allow link to the detailed page
# Now let's send the user to the url..
$goto ?
print "Location: $build_detail_url/$id$build_extension\n\n" :
&error ("Record not found ($in{$db_key})");
}

I cut it right out of the message you posted. Any ideas?

Thanks!

Mike


Quote Reply
Re: isLinked Problem In reply to
*sigh*

Listen...have you even TRIED the exact codes I've posted! Because they will work!! TRUST ME!

You have to use $rec{'ID'} NOT $id, because $id is NOT defined in the sub site_html_link routine!

NOW...if you want hits calculated even for the "links" that do not have URL..READ the Detailed pages Hits Thread located in this Forum.

Regards,

Eliot Lee
Quote Reply
Re: isLinked Problem In reply to
------------------------------------------------------------

Listen...have you even TRIED the exact codes I've posted! Because they will work!! TRUST ME!

------------------------------------------------------------

I have used the exact codes you posted, at least I'm pretty sure I have, and I do Trust You.

------------------------------------------------------------

You have to use $rec{'ID'} NOT $id, because $id is NOT defined in the sub site_html_link routine!

------------------------------------------------------------

I don't understand where this is from. I'm NOT trying to give you a hard time, I just don't understand what your telling me to do, I can find no reference to $rec{'ID'} in anything you've sent me except the sub site_html_link routine. Below is the code you gave me to put in the jump.cgi:

------------------------------------------------------------

You can use the jump.cgi script and change the following lines in that file:

# Now let's send the user to the url..
$goto ?
print "Location: $goto\n\n" :
&error ("Record not found ($in{$db_key})");
}

to the following:

# Now let's send the user to the url..
$goto ?
print "Location: $build_detail_url/$id$build_extension\n\n" :
&error ("Record not found ($in{$db_key})");
}

This will record hits and also redirect to the detail page.

------------------------------------------------------------

And from this thread you gave me this:

------------------------------------------------------------

You need to add the following codes in your sub site_html_link routine (as I believe similar codes ARE posted in the Mod instruction page...):

if ($rec{'isLinked'} eq 'Yes') {
$linkurl = "$build_jump_url?ID=$rec{'ID'}";
}
else {
$linkurl = "$build_detail_url/$rec{'ID'}$build_extension";
}

Then define this tag as follows:

linkurl => $linkurl

Then in your link.html file, add the following codes:

<a href="<%linkurl%>"><%Title%></a>

------------------------------------------------------------

Am I just missing something? I have also taken the jump.cgi, link.html, detailed.html, and the site_html_templates.pl files, renamed them to .txt and put them at:

http://www.yourmaine.com/links2/text

Thanks for your help, I do appreciate it!

Mike

Quote Reply
Re: isLinked Problem In reply to
Help, PLEASE.

Mike

Quote Reply
Re: isLinked Problem In reply to
YEA..you did NOT use all the codes I gave you! The linkurl tag needs to be defined in the tag definition section of the sub site_html_link routine NOT as a GLOBAL VARIABLE!!!!!!!!

Replace the following codes in the sub site_html_link routine:

Code:

# Added the following for the 3 new and updated mod
return &load_template ('link.html', {
new_mod_img => $new_mod_img,
detailed_url => "$build_detail_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}


WITH the following codes:

Code:

# Added the following for the 3 new and updated mod
return &load_template ('link.html', {
new_mod_img => $new_mod_img,
detailed_url => "$build_detail_url/$rec{'ID'}$build_extension",
linkurl => $linkurl,
%rec,
%globals
});
}


DO you see the error now???!??!!?

Tongue

Also, you have hacked your link.html file to shreds!

You need to delete the following codes:

Code:


<ul><li><a class="link" href="<Û_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a>


<%if isLinked%><a href="<%URL%>" target="_Blank"><%Title%></a><%endif%><%ifnot isLinked%><%Title%><%endif%>


AND ONLY use the following codes!

Code:

<ul><li><a class="link" href="<%linkurl%>"><%Title%></a>


Do you understand now?

I really thought I was QUITE clear in my previous postings about what you should do! Guess not! Mad

Regards,

Eliot Lee
Quote Reply
Re: isLinked Problem In reply to
------------------------------------------------------------

YEA..you did NOT use all the codes I gave you! The linkurl tag needs to be defined in the tag definition section of the sub site_html_link routine NOT as a GLOBAL VARIABLE!!!!!!!!

------------------------------------------------------------

I think I misunderstood this. I don't know Perl, so when you wrote this:

------------------------------------------------------------

You need to add the following codes in your sub site_html_link routine (as I believe similar codes ARE posted in the Mod instruction page...):



if ($rec{'isLinked'} eq 'Yes') { $linkurl = "$build_jump_url?ID=$rec{'ID'}";} else { $linkurl = "$build_detail_url/$rec{'ID'}$build_extension";}


Then define this tag as follows:



linkurl => $linkurl

------------------------------------------------------------

I didn't know what to do with linkurl => $linkurl, so I put it where there were other tags like it.

------------------------------------------------------------

Also, you have hacked your link.html file to shreds!

You need to delete the following codes:

<ul><li><a class="link" href="<Û_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a><%if isLinked%><a href="<%URL%>" target="_Blank"><%Title%></a><%endif%><%ifnot isLinked%><%Title%><%endif%>

------------------------------------------------------------

Blush I knew this, but was just trying the different tags to see what would work.

------------------------------------------------------------

Do you understand now?

I really thought I was QUITE clear in my previous postings about what you should do! Guess not! Mad

------------------------------------------------------------

I'm sure it was clear, I just misunderstood it, Sorry!

Everything you gave me works just fine now, Thank You. The only problem I have is once on the detailed page of the linkless resource there is a link to take you to the resource. But since there is no resource it takes you to the detailed directory, which has no index of course. This is what I have there:

<%if isLinked%><a href="<%URL%>" target="_Blank">Visit this link</a><%endif%>

Any ideas? And of course once again, Thanks For Your Help!

Mike


Quote Reply
Re: isLinked Problem In reply to
Okay...for the Detailed Pages, you need to do the following (and I will use the KISS method so that you WILL understand what to do!):

1) Add the following codes at the top of the sub site_html_detailed routine (after the my %rec = @_; codes):

Code:

if ($rec{'isLinked'} eq 'Yes') {
$linkurl = qq|<a href="$rec{'URL'}" target="newwin">Visit this Link</a>|;
}
else {
$linkurl = qq|No Web Site|;
}


Note: I used target="newwwin", because using target="_blank will open multiple windows, which will crash some computer systems and it does not work in earlier versions of AOL.

2) Then add the following codes (AFTER title_linked => $title_linked in this same sub):

Code:

linkurl => $linkurl,


3) Then in your detailed.html file, simply add the following tag:

Code:

<%linkurl%>


Nothing else, nothing more!

Is this clear enough for ya! Wink

Regards,

Eliot Lee
Quote Reply
Re: isLinked Problem In reply to
Just for piece of mind I want to make sure that I did it correctly, after adding your code the sub should look like so?


sub site_html_detailed {
# --------------------------------------------------------
# This routine will build a single page per link. It's only
# really useful if you have a long review for each link --
# or more information then can be displayed in a summary.
#
my %rec = @_;
return &load_template ('detailed.html', {
total => $total,
grand_total => $grand_total,
title_linked => $title_linked,
linkurl => $linkurl,
%rec,
%globals
} );
}

if ($rec{'isLinked'} eq 'Yes') {
$linkurl = "<a href="$rec{'URL'}" target="newwin">Visit this Link</a>;
}
else {
$linkurl = "No Web Site";
}


Hope I got it right this time

Thanks for your time!

Mike

Quote Reply
Re: isLinked Problem In reply to
Nope...close, but NO cigar!

When I said "add codes AFTER the my %rec = @_; codes"...I meant RIGHT after the codes!

Replace the codes you hacked with the following:

Code:

sub site_html_detailed {
# --------------------------------------------------------
# This routine will build a single page per link. It's only
# really useful if you have a long review for each link --
# or more information then can be displayed in a summary.
#
my %rec = @_;
if ($rec{'isLinked'} eq 'Yes') {
$linkurl = qq|<a href="$rec{'URL'}" target="newwin">Visit this Link</a>|;
}
else {
$linkurl = qq|No Web Site|;
}
return &load_template ('detailed.html', {
total => $total,
grand_total => $grand_total,
title_linked => $title_linked,
linkurl => $linkurl,
%rec,
%globals
} );
}



Eliot Lee
Quote Reply
Re: isLinked Problem In reply to
Ok, added the code and now I get this when trying to build:

Error including libraries: syntax error at d:/www/yourmaine/cgi-bin/links2/admin/site_html_templates.pl line 155, near ""<a href="$rec" syntax error at d:/www/yourmaine/cgi-bin/links2/admin/site_html_templates.pl line 155, near "" target="newwin" syntax error at d:/www/yourmaine/cgi-bin/links2/admin/site_html_templates.pl line 264, near "($in{'Category'} = qq~<input type=hidden name="Category" Make sure they exist, permissions are set properly, and paths are set correctly.

Why is it that when I'm almost done I have all these problems..... All I have left to do is to finish this mod, fix the Altcategories Mod, and add the Yahoo Like Subs, Span Pages, and Altavista search mods (out of 16 mods/hacks) and I'm done.

If it helps any:

http://www.yourmaine.com/...e_html_templates.txt

I'm sorry about all this.....

Mike

Quote Reply
Re: isLinked Problem In reply to
Sorry about that...I neglected to add the correct operators for the variable configurations in the new set of codes I gave you....Try the edited codes I posted in my previous post.


In Reply To:
Why is it that when I'm almost done I have all these problems..... All I have left to do is to finish this mod, fix the Altcategories Mod, and add the Yahoo Like Subs, Span Pages, and Altavista search mods (out of 16 mods/hacks) and I'm done.
You have a long way to go if you ask me! Wink Those are not easy Mods for novice programmers/code hackers.

Good luck!

Regards,

Eliot Lee
> >