Gossamer Forum
Home : Products : Links 2.0 : Customization :

single column catergorys

Quote Reply
single column catergorys
I am trying to have a single column catergory list. I originally thought that simply commenting out the build new column lines would suffice, I was wrong. So, I found a post by Junko dated 19 Aug 00 and edited the site_html_template.pl as per his instructions:



# First let's get the name, number of links, and last modified date...
$url = "$build_root_url/" . &urlencode($subcat) . "/";
if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
$numlinks = $stats{"$subcat"}[0];
$mod = $stats{"$subcat"}[1];

# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).

# if ($i == $half) {

# $output .= qq|</td><td class="catlist" valign="top" nowrap>\n|;
# }
# $i++;

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<dl><dt><font face="Verdana, Arial, Helvetica, sans-serif, Trebuchet MS" size="2"><b><a class="link" href="$url">$category_name</a></b></font>|;

$output .= qq|</dt>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl>|;
}

# Don't forget to end the unordered list..
$output .= "</td></tr></table></div>\n";
return $output;
}

1;

I recieve the following error message:

Error including libraries: syntax error at /data/web/64012/cgi-bin/pibcgi/admin/site_html_templates.pl line 372, near "$url :"
syntax error at /data/web/64012/cgi-bin/pibcgi/admin/site_html_templates.pl line 381, near "2)"
(Might be a runaway multi-line // string starting on line 373)
syntax error at /data/web/64012/cgi-bin/pibcgi/admin/site_html_templates.pl line 415, near "}"
Compilation failed in require at nph-build.cgi line 33.

I little to nothing about pearl but have been sucessful at hacking away at this script with some help from this forum and a lot of help from my ISP. I am now officially stumped. Obviously there is something that I am missing. Can someone point out the errors of my ways?

P.S. while I'm asking, I would also like to do away with the order listing of the catergories as well, a tip or a redirect would be appreciated.

Thank you

Quote Reply
Re: single column catergorys In reply to
Personally, I'd restore my originall code and install the following mod from the FAQ section

http://www.findinghim.com/links_mods/num_columns/

and set the number of columns to 1. If late on you decide to go back to 2 or change to 3 columns, the fix is easy. This is much more flexible code. I installed it and it works like a charm.

The error occurs at line 372. You didn't tell us what line 372 looks like.

Gene
Quote Reply
Re: single column catergorys In reply to
thank you for responding, I will look over what you have suggested. Also, I didn't know which line is 372, when I look at the code in the editor that I use, the lines don't always line up just quite right. Oh well.

Quote Reply
Re: single column catergorys In reply to
well, you could count the lines manually. Unless you know where the error is, it might be hard to correct it.

I recommend.

EditPlus - Shareware at http://www.editplus.com/

or

ConText - Free at http://www.fixedsys.com/context/

or

EditPad - Free at http://www.jgsoft.com/


A great free html editor is

1st Page - Free at http://www.evrsoft.com/

Gene
Quote Reply
Re: single column catergorys In reply to
line 372 $url : The URL to go to that category

There have been no other changes to the original script other than the ones described above.

Quote Reply
Re: single column catergorys In reply to
Line 372 needs to look like ( notice the # )
Code:
# $url : The URL to go to that category
if it looks likes ( without the # )
Code:
$url : The URL to go to that category
you will get an error message since this is really a "remarks" line and not perl code to be interpreted as part of the program.

Gene