Gossamer Forum
Home : Products : Links 2.0 : Customization :

Renaming detailed page

Quote Reply
Renaming detailed page
Hello, thanx for reading. I have searched as crazy for postings
answering to my question therefore here i am.

I want to have the "detailed page" saved but with a specific name.

I have added a field: HOMEPAGEURL in the .def and this works fine.

I have tried to modify nph-build.cgi as follows, but without success:


sub build_detailed_view {
# ---------------------------------------------------
# This routine build a single page for every link.
#
my (@values, $homepageurl, %rec, $count);
if ($build_detail_path =~ m,^$build_root_path/(.*)$,) {
&build_dir ($1);
}
print "\t";
open (DB, "<$db_file_name") or &cgierr("unable to open database: $db_file_name. Reason: $!");
LINE: while (<DB> ) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp;
@values = &split_decode ($_);
$homepageurl = $values[$homepageurl];
%rec = &array_to_hash (0, @values);
$title_linked = &build_linked_title ("$rec{'Category'}/$rec{'Title'}");
open (DETAIL, ">$build_detail_path/$rec{'HOMEPAGEURL'}$build_extension") or &cgierr ("Unable to build detail page: $build_detail_path/$rec{'HOMEPAGEURL'}build_extension. Reason: $!");
print DETAIL &site_html_detailed (%rec);
close DETAIL;
$use_html ?
print qq~<a href="$build_detail_url/$homepageurl$build_extension" target="_blank">$homepageurl</a> ~ :
print qq~$homepageurl ~;
(++$count % 10) or print "\n\t";
}
close DB;
print "\n";
}


What is wrong? Can you help? is it further possibile to create a "homepageurl"
directory with a standard index.html inside, instead of having /homepageurl.html?

Thanx indeed!!!
Quote Reply
Re: Renaming detailed page In reply to
Sorry for not using the right tag for the code!!! ;-)
Quote Reply
Re: Renaming detailed page In reply to
You are on the right track. However, why do you want to name the file by the URL of the record in your database. That would not make much sense.

The detailed page link would look like:

Code:
http://www.yourdomain.com/detailed/http://www.theirdomain.com/dir/page.shtml.shtml

Also, if you have other fields like Title, you would have to add in regular expression codes to decipher spaces in Titles to an appropriate file name.

Netscape would have a problem deciphering the following URL:

Code:
http://www.yourdomain.com/detailed/My Title.shtml

It would show up in MIE as the following example:

Code:
http://www.yourdomain.com/detailed/My%20Title.shtml

ID is used for a purpose...and that purpose being that it is the easiest to format.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. Smile
----------------------










[This message has been edited by Eliot (edited January 29, 2000).]

[This message has been edited by Eliot (edited January 29, 2000).]
Quote Reply
Re: Renaming detailed page In reply to
Thanx a lot Eliot for your fast responce! Well I have to rename the detailed page, coz I am going to use Links not as a search engine Wink I do not want to annoy you!

HOMEPAGEURL is set by the user and this contains only one (!) word and not an entire Url. Sorry, the field does realy not reflect the real meaning Wink Therefore, HOMEPAGEURL would f.eg. contain the word "aHappyHippo".

Could you please (a bold please Wink correct my code that the detailed page will be saved as:


http://mydomain.com/something/aHappyHippo.html


or even better would be something like


http://mydomain.com/aHappyHippo/index.htm



I don't know if this means a lot of work (creating the directory)...

I would be a very HappyHippo if you could check that out for me!! Thanx a lot!! )
Quote Reply
Re: Renaming detailed page In reply to
I am assuming you are trying to make something like a HomePage Builder, right?

Then if so, there is a Mod in the Resource Center that does this.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------








Quote Reply
Re: Renaming detailed page In reply to
Hello Eliot, you are quite right... I have already seen Homepage Builder script... but thisone does not allow user to choose the filename or directory name... as I want it...

I would realy be happy for your helP!
Quote Reply
Re: Renaming detailed page In reply to
Hello again Eliot ) I hope will help me
with the stuff mentioned above....

but (something else, before I forget), I
have seen a posting talking about "secret
emails"... I'd like to let users be able to
send an email to 'Contact Email' by filling
out a form. The email adress is not going to
be revield inside the source code of the
page... You also said that you are "not sure"
if you are going to release that... I think..


Could you pls tell me how to make that as well?

Eliot, if you come to Austria one day I will offer you a huuuge Beer! )

THanx again!
Quote Reply
Re: Renaming detailed page In reply to
Look more closely at the HomePage Builder. It does what you are asking for...it creates directories, then adds information from the database.

Uh...as mentioned in the other Thread...I am leary about releasing the Mod (for improved Recommend It that could be modified to be a Private Mailer script) and other Mods due to the many problems novice users encounter when adding Mods. Also, since there is already a Recommend It! Mod in the Resource Center, I do not want to compete with Bobsie.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------