Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Links as Index page

(Page 1 of 2)
> >
Quote Reply
Links as Index page
(Eliot wrote the post below my questions)

Questions:

1. This would also created all of my directories in my root directory like... root/cars, root/houses, etc, etc. Right ?

2. What if I want only the index in my root directory and the "links' directories" in... let's say "...root/pages/ " I just want to keep my links directories from crowding my root... Can this be done ?

Eliots post regarding this:
Quote:
1) You need to change the following variables in your links.cfg:

code:
--------------------------------------------------------------------------------

# PATH and URL of Pages to be built. No Trailing Slash.$build_root_path = "/path/to/root";$build_root_url = "http://www.mydomain.com";

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

Change /path/to/root to the ABSOLUTE PATH to your root directory. Change http://www.mydomain.com/ to whatever your web site address (URL) is.

2) Then you will have to delete all pages in the links/pages directory.

3) Create a blank index.shtml or index.html (based on the extension you specified in the links.cfg file) and upload it to your root directory. Change the permission of this file to 777 (rwxrwxrwx).

4) Create the new, cool, and ratings directory off your ROOT directory. Change the permission of these directories to 777 (rwxrwxrwx).

5) Rebuild your directory.

Voila...Now you have your LINKS pages generated off your root directory.



[This message has been edited by Patricio (edited February 27, 2000).]
Quote Reply
Re: Links as Index page In reply to
Thanks for posting this message. But the better place to post this information would be in the Resource Center in the FAQ section for LINKS 2.0.

Wink

I don't mind you posting the instructions I gave you.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Links as Index page In reply to
Uhmmmm... you're welcome, but did you see my questions ? there is no info on this in the faq ? ?? is there ? ?

Quote:
Questions:


2. What if I want only the index in my root directory and the "links' directories" in... let's say "...root/pages/ " I just want to keep my links directories from crowding my root... Can this be done ?

Do you know what I mean ?

I want my links directory at:
www.mysite.com/index.htm

and my link's directories...
like "Arts" at:
www.mysite.com/pages/arts/

Can this be done ?




[This message has been edited by Patricio (edited February 27, 2000).]
Quote Reply
Re: Links as Index page In reply to
Yes...It can...

All you have to do is the following:

1) Create the following variables in your links.cfg file:

Code:
$build_cat_path = "/path/to/links";
$build_cat_url = "http://www.yourdomain.com/links";

2) Add a new sub routine in the db_utils.pl file called sub build_cat_dir, like the following:

Code:
sub build_cat_dir {
# --------------------------------------------------------
# Verifies that all neccessary directories have been created
# before we create the category file. Takes as input, the category
# to verify, and returns the full directory path.

my $input = shift;
my ($dir, $path) = '';
my @dirs = split /\//, $input;

foreach $dir (@dirs) {
$path .= "/$dir";
&build_check_dir ($build_cat_path, $path);
if (! (-e "$build_cat_path$path")) {
print "\tMaking Directory ($build_dir_per): '$build_cat_path$path' ...";
if (mkdir ("$build_cat_path$path", "$build_dir_per")) {;
print "Made. CHMOD ($build_dir_per) ...";
if (chmod ($build_dir_per, "$build_cat_path$path")) {;
print "Done.";
}
else { print "CHMOD ($build_dir_per) failed! Reason: $!."; }
}
else { print "mkdir failed! Reason: $!."; }
print "\n";
}
}
return "$build_cat_path$path";
}

3) Then in the sub build_category_pages in the nph-build.cgi file, replace the following line of codes:

Code:
$url = "$build_root_url/" . &urlencode($cat) . "/";

with the following:

Code:
$url = "$build_cat_url/" . &urlencode($cat) . "/";

And then replace the following codes:

Code:
$dir = &build_dir ($cat);

with the following:

Code:
$dir = &build_cat_dir ($cat);

Then replace the following codes:

Code:
$related .= qq|<li><a href="$build_root_url/|;

with the following:

Code:
$related .= qq|<li><a href="$build_cat_url/|;

That should do it.

Regards,


------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Links as Index page In reply to
Cool Smile I'll give it a shot, thank you//
Quote Reply
Re: Links as Index page In reply to
You're welcome.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Links as Index page In reply to
Hi Eliot,

finally just getting around to folo your advise and move my links to my index page while leaving the rest else where.

Question:

On your directions (above) there is no mention to modifying the root path

Do I change this:
# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/www/qdice/qbusca/links/pages";
$build_root_url = "http://www.qdice.com/qbusca/links/pages";

To this ?

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/www/qdice/";
$build_root_url = "http://www.qdice.com/";

and then add:

# PATH and URL mod to built categories
$build_cat_path = "/path/to/links";
$build_cat_url = "http://www.yourdomain.com/links";

plus the rest of the your above mods ?
I'm going to give this a shot, hope I'm right

Thank you in advance for your feedback//

Pat

[This message has been edited by Patricio (edited March 19, 2000).]
Quote Reply
Re: Links as Index page In reply to
Uhmmmmm?? is not working. I'm getting a server error ??

Quote Reply
Re: Links as Index page In reply to
Look at my instructions again...You change the $build_root_path and $build_root_url to your ROOT directory. Then you follow the rest of my instructions.

And please learn about looking at your Perl Log and checking the syntax of your files via telnet...I have posted instructions on how to do this about a half dozen times in this Forum, the Installation Forum (UNIX), and in the Modification Forum for checking the syntax of your files.

Internal Server Errors do nothing for me...check the syntax of your nph-build.cgi file.

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Links as Index page In reply to
Ok, There were not Sintax erros. It is working now... (ith small problem... but first here is what I did wrong...)

1. Needed to update permissions to 777 and 775 (I had created new ones because I save originals as bkups) Once I did this Links is building the pages no problem, NO ERRORS.

Links is building everything in the right place... home.html ->in my root/index.htm and links in-> mysite.com/qbusca/links/pages (which is where I want them)

*But... (here is the small problem) I use templates and my home page is getting build with links linking to my root directory rather than .../links/pages

Here is what that part of home.htm Perl looks like:

<div align="CENTER"><font size="-2" face="geneva, arial"> Gracias a tu apoyo.. Ya van <b><%grand_total%></b> pedacitos de Tu Tierra... <a class="menulink" href="<%db_cgi_url%>/add.cgi">¡Añade el Tuyo!</a></font><br><br>

<%category%></div>

I'll keep looking at this ?? On my way to nph-build.cgi and site_html_templates. Smile
Quote Reply
Re: Links as Index page In reply to
Uh...that is one thing I did not mention in my instructions...(but with the large number of Topics related to changing layout of the categories, I thought you might've picked up what you need to do)...But I guess I was wrong.

Wink

You need to replace the following line:

Code:
$url = "$build_root_url/" . &urlencode($subcat) . "/";

in the sub site_html_print_cat routine in the site_html_templates.pl file with the following codes:

Code:
$url = "$build_cat_url/" . &urlencode($subcat) . "/";

Replace all other occurences of these codes as I have posted in that sub...I do not know if you are using other Mods, like the Yahoo! Subcategories Mod.

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Links as Index page In reply to
Got it Smile Smile Smile !!!

I was on the right track, thanks for the last minute direction.

Is all working (my licks.css gave me a bit of trouble... but I figured it out Smile )

That's all for now, hope this changes help others in need.

Thank you Eliot, Patricio//

[This message has been edited by Patricio (edited March 29, 2000).]
Quote Reply
Re: Links as Index page In reply to
You're welcome....

I will add this as a FAQ/Tutorial to help people find this information...and include the suggestions you've given.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Links as Index page In reply to
I have uploaded instructions in an easy to read web page:

http://www.anthrotech.com/...inks/faqs/rootbuild/

I will be submitting this FAQ in the Resource Center soon.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Links as Index page In reply to
Hey that tutorial is great. Glad I was a tiny part of it Smile

Thank you again for your help.
Patricio//
Quote Reply
Re: Links as Index page In reply to
Glad you like it...And you were actually a large part of it in terms of getting the kinks out to make it easy for NOVICE users to grasp the instructions.

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Links as Index page In reply to
Hi Eliot...

I noticed a small glitch with the "Links as Index page mod" we did.

The "New" and "Cool" pages are getting built at the root directory -which is what we want-however the category links in the New and Cool pages are pointing to the wrong URL... for example:

it reads:
www.qdice.com/new/whatever.index.htm

it should be instead:
www.qdice.com/new/links/pages/index.htm

I now this is an easy fix where the new and cool pages fix, but before messing with it I wanted to please ask for your feedback.

Thank you in advance, Pat/

[This message has been edited by Patricio (edited March 29, 2000).]
Quote Reply
Re: Links as Index page In reply to
Uh...that is a matter of editing the category.html template file or if you have header/footer files inserted, then you need to edit the header and footer files.

Wink

EDIT the links!

Regards,
Quote Reply
Re: Links as Index page In reply to
On my way to check them out...

However I was just going over the nph-build.cgi.... I though the fix was at the:

sub build_new_page {
and sub build_cool_page .... ?

I guess i'll find out in a minute,
Pat//
Quote Reply
Re: Links as Index page In reply to
No...that would not be a good fix unless you want those pages built in the same directory as the Category pages.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Links as Index page In reply to
Hello Eliot,

May be I didn't get it, or I didn't explain the problem right but I couldn't see a fix in the category.htm template.

See... there is nothing wrong with the way the links are display they are pointing to the right URL.

What happens is that the new page will show:
categories pointing to the wrong URL.

For example a category name:

Computers>Internet
is pointing to:
root/computers/internet/index.htm

It should be instead: root/links/pages/computers/internet/index.htm

I guess somewhere in those sub-routines we need to change from build_url_ to build_cat ??

What do you think ?
Pat//
Quote Reply
Re: Links as Index page In reply to
Ah...Now I see...and you were NOT clear before.

Okay...in the sub build_new_page and build_cool_page routines in the nph-build.cgi file...change the following codes:

Code:
<A HREF="$build_root_url/$category/$build_index">$category_clean</A>

to the following:

Code:
<A HREF="$build_cat_url/$category/$build_index">$category_clean</A>

Regards.

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Links as Index page In reply to
I have updated the FAQ/Tutorial page to reflect this change.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Links as Index page In reply to
Yeaph !! Smile that did it !

At least I was on the right track... but I guess working late on the "for the love of it " project and getting up early to the real job... is getting to me !!

Thanks for the feedback Eliot Smile

Patricio
Quote Reply
Re: Links as Index page In reply to
You're welcome...glad you figured it out...

And I am glad that even with my medicine and clogged head, that I can still be somewhat effective in these forums.

Smile

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
> >