Gossamer Forum
Home : Products : Links 2.0 : Customization :

I might sound stupid but i cant figure this out

Quote Reply
I might sound stupid but i cant figure this out
How would you go about having links make its directories and files in a specified directory instead of the root directory. But still make the index file in the root directory.

eg.

I want it to build the main index.html file in the root directory which would be /

but i want it to build all other pages and directories in another directory which would be /dir

How would i go about doing that?
Quote Reply
Re: I might sound stupid but i cant figure this out In reply to
Also in this routine:
sub build_linked_title {
#-------------------------------------------------------
# Returns a string of the current category broken up
# by section, with each part linked to the respective section.

my ($input) = $_[0];
my (@dirs, $dir, $output, $path, $last);

@dirs = split (/\//, $input);
$last = &build_clean(pop @dirs);

$output = qq| <A HREF="$build_root_url/">Top</A> :|;

Change $built_root_url to the real path of your homepage
Quote Reply
Re: I might sound stupid but i cant figure this out In reply to
Good catch! forgot about that one!

--Mark

------------------
You can reach my by ICQ at UID# 8602162

Quote Reply
Re: I might sound stupid but i cant figure this out In reply to
Thanks

Now i got it working ... FINALLY Smile
Quote Reply
Re: I might sound stupid but i cant figure this out In reply to
in nph_build.cgi, find this routine:

sub build_home_page {
# --------------------------------------------------------
my ($subcat, @rootcat);
local ($total);

# Check to see which categories are off of the root.
foreach $subcat (sort keys %category) {
if ($subcat =~ m,^([^/]*)$,) {
push (@rootcat, $subcat);
}
}
print "Subcategories: "; print $#rootcat+1; print "\n";
print "Total Links: $grand_total\n";
print "\tOpening page: $build_root_path/$build_index\n";

open (HOME, ">$build_root_path/$build_index") or &cgierr ("unable to open home page: $build_root_path/$build_index. Reason: $!");
$category = &site_html_print_cat (@rootcat) if ($#rootcat >= 0);
$total = $grand_total;
print HOME &site_html_home;
close HOME;
print "\tClosing page.\n";
}

and change:
open (HOME, ">$build_root_path/$build_index") or &cgierr ("unable to open home page: $build_root_path/$build_index. Reason: $!");

point to wherever you want it, instead of $build_root_path

--Mark


------------------
You can reach my by ICQ at UID# 8602162

Quote Reply
Re: I might sound stupid but i cant figure this out In reply to
Hello,

Hi,

Kaptin Kirk and evrybody else,
I am a beginner to CGI, so could you please explain the above mentioned solutions in detail, please?

I want to place my main index (links)file to the root directory and the rest under (/links) directory..

1). How do I point it to the root instead of $build_root_path
(Is it like /home/user/pub ?)

2). How do I Change $built_root_url to the real path of my homepage


Sorry if the questions seem silly..

Regds
Joe Louis
(latexx@iname.com)
Quote Reply
Re: I might sound stupid but i cant figure this out In reply to
1) Yes

2) Just change $built_root_url to the url corresponding to /home/user/pub (eg. http://www.yourdomain.com )
Quote Reply
Re: I might sound stupid but i cant figure this out In reply to
Ack, you shouldn't have to change the code in nph-build.cgi, that's what the config file is for! I'd start with a clean copy and try again. This time, just edit the config file with the proper paths and URL's.

Hope this helps,

Alex
Quote Reply
Re: I might sound stupid but i cant figure this out In reply to
o.K. but I got a different error this time.
--------------------------------------------
heres what I did -
1. I changed this line to :
----------------------------------
open (HOME, ">/usr/home/joe/pub/$build_index") or &cgierr ("unable to open home page:
/usr/home/joe/pub/$build_index. Reason: $!");


2. Next I changed:
------------------------------------
$output = qq| <A HREF="www.myhomepage.com/">Top</A> :|;

I put the file up, chmoded and tried building it, but I get this error..

CGI Error: Permission denied
Message: unable to open home page: /usr/home/joe/pub/

I tried chmoding the pub file to 777 but it's no help..

Any ideas..?
Quote Reply
Re: I might sound stupid but i cant figure this out In reply to
o.K. but I got a different error this time.
--------------------------------------------
heres what I did -
1. I changed this line to :
----------------------------------
open (HOME, ">/usr/home/joe/pub/$build_index") or &cgierr ("unable to open home page:
/usr/home/joe/pub/$build_index. Reason: $!");


2. Next I changed:
------------------------------------
$output = qq| <A HREF="www.myhomepage.com/">Top</A> :|;

I put the file up, chmoded and tried building it, but I get this error..

CGI Error: Permission denied
Message: unable to open home page: /usr/home/joe/pub/

I tried chmoding the pub file to 777 but it's no help..

Any ideas..?