Gossamer Forum
Home : Products : Links 2.0 : Customization :

">" instead of ":" -- should be simple.. but ...

Quote Reply
">" instead of ":" -- should be simple.. but ...
Hello,

I am becoming crazy !!! I cannot find the part in the source to change the Sign ":" with an ">".

I am trying to modify the catogories-output in the pages "what is new" & "what is hot", so that I will have this result:
Computers > Hardware
instead of:
Computers: Hardware.

But I cannot find the part in the sourcecode where this has to be done !
I managed it already for the categories-output (using category.html template).. there it works fine.. but I have still problems with the news & cool pages..

Pleas help and tell me the part of the source.. thanks... I must be idiot !

// Guenther


[This message has been edited by superdino (edited May 25, 1999).]
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
superdino, think you need to be looking in nph-build.cgi for build_linked_title. There are two lines that begin $output = qq | and then towards the end they have a colon.

Think these are the two colons you'll want to change.



------------------
---------
For humor on-line check out jokesplus
www.jokesplus.com
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
Check http://www.gossamer-threads.com/...um8/HTML/000417.html and see if that helps.
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
hm.. thanks for your fast answer bobsie. But I am afraid that the solution for my problem is not found there !

I just would like the script to output me a simple ">" instead of a ":" so that I will have:
Category > subcategory
instead of
Category : subcategory...

should be sooo easy.. but I do not find the solution (-:
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
superdino,

In the first message from me in the thread I posted, I mention two subroutines, one in nph-build.cgi, and one in db_utils.pl. The one in db_utils.pl is the one I modified to replace the : with > in the variable $category_clean (<%category_clean%> ). If you modify your copy of the subroutine to match what I did, then you will have what you want. So, your solution _is_ found there. Would I lead you astray? Wink

My mod will do it for all pages that use $category_clean.

Of course, if you want to do it the hard way, you can modify sub build_new_page and sub build_cool_page in nph-build.cgi to do character substitution on $build_clean like this:

$build_clean =~ s/:/>/g;

Using my method eliminates the need to do substitution.

I hope this helps.

[This message has been edited by Bobsie (edited May 25, 1999).]
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
greenscreen:

Your tip is correct.. I have found that out already before Wink
With that mod only a part of the categories output is beeing modified.

What I still need is the way to modify the same for the "what is new & hot" pages.

Bobsie:
I still have not fixed it (-:
I send u a personal mail now *g*
with a .zip file Wink

CIAO
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
Well, it is nearly 9 hours since your message here and I have not received any email from you.
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
I received your message in my mailbox this morning at about 08:24 Pacific Time but just picked it up about an hour ago.

I will look it over and let you know if I find anything.
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
Bob,

I sent you an email 1 day ago to: bobsie@orphanage.com !

Did u check that account ?
My email is guenther@italynet.net - maybe u tell me where to send the zip file . Wink

Thanks again !

// Guenther
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
Hi

Hi

I managed it for this (beta) site:

http://www.childrenfirst.org.uk/links/

If you have not found it yet I can try to remember wher it was and let you know (I think it was in nph-build.cgi)

Chris

Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
I too am having similar problems. It looks fine on the category page, but when I go to what's new and when I search for things, It still displays the ":" but this time with no space. My site is still in the developing process, but I'm hoping to get it up in a week or so.

http://www.linkondemand.com/

------------------
- Jonathan Gamble


[This message has been edited by jdgamble (edited September 26, 1999).]

[This message has been edited by jdgamble (edited September 26, 1999).]
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
umm.. first you edit

Code:
sub build_clean {
# --------------------------------------------------------
# Formats a category name for displaying.
#
my ($input) = shift;
$input =~ s/_/ /g; # Change '_' to spaces.
$input =~ s,/, : ,g; # Change '/' to ' : '.
return $input;
}

in db_utils.pl to:

Code:
sub build_clean {
# --------------------------------------------------------
# Formats a category name for displaying.
#
my ($input) = shift;
$input =~ s/_/ /g; # Change '_' to spaces.
$input =~ s,/, > ,g; # Change '/' to ' : '.
return $input;
}

then in nph-build.cgi

in sub build_linked_title

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

to

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

and then

Code:
$output .= qq| <A HREF="$build_root_url$path/">$dir</A> :|;

to

Code:
$output .= qq| <A HREF="$build_root_url$path/">$dir</A> >|;

jerry
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
Yeah, and if you want it in the search results for the categories that are displayed and you don't want this
Computers >
Computers and Internet > WWW >

With the last one after the last word, in search.cgi find this in sub linked_title

$output .= qq|<A HREF="$build_root_url$path/">$dir</A> > |;
}
chop ($output);
return $output;

And right after the bolded word put these two
chop ($output);
chop ($output);
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
bmxer.. alex made it so that it got the last one.. then saved it in the scalar $last.. then it popped it (meaning destroyed the last one in the array) and the it print all the categories in the array..

and then when that is done. added the $last in.. so it doesn't have the & gt; after it..

soo.....

jerry
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
It may have destroyed the last space since it goes > with the extra space after the last one, so it destroys the space, but if you put two more it will destroy the the space, the last > and the space before that so its clean. I don't know, All i know is that when i changed it to > for me it printed a > after the last category and i chopped the scalar 2wice more and it stopped.
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
oh you're right.. i forgot there is one in search.cgi also.. though you were talking about nph-build.cgi's..
sorry

jerry
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
I made the mods above but they didn't quite work out. I don't have the "Regional > Cananda > " problem. I just want some consistency between the way things are displayed when people search and when they go into the categories. When you go into the categories you get "Regional > Canada > Alberta > Calgary" and when you search you get "Regional>Canada>Alberta>Calgary". I tried adding "chop ($output)" to nph-build to get rid of space before and after the greaterthan but I got "Regional > Canada > Alberta > Calgar". How can I get rid of the spaces before and after the greaterthan?
Quote Reply
Re: ">" instead of ":" -- should be simple.. but ... In reply to
Well, since they are parsed differently chop wouldn't work, there are not spaces in the categories after the >'s. Why don't you just put spaces before and after the one in search.cgi, then use the chop method i suggested the make it look like nph-build.cgi