Gossamer Forum
Quote Reply
Removing s
I know this has been discussed before, but I'll be darned if I can find it.

I want to remove the plural s if only one category ot link has been fornd. Call me picky, but having "Your search returned 1 categories and 1 Listings" instead of "Your search returned 1 categorie and 1 Listing" bothers me. Pirate
Quote Reply
Re: [jgkiefer] Removing s In reply to
Why not have something like;

Your search returned 1 category(s) and 1 Listing

Unsure

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [jgkiefer] Removing s In reply to
Try something like this:
Code:
<p>Your search returned <%if cat_hits%><b><%cat_hits%></b> categorie<%if cat_hits > 1%>s<%endif%> and<%endif%> <b><%link_hits%></b> links<%if link_hits != 1%>s<%endif%>.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Removing s In reply to
In your statement above I'm trying to get

if category = 1 then category
if category is not =1 then categories

The links statement is fine.

I just can't seem to get it right, Unsure
Quote Reply
Re: [jgkiefer] Removing s In reply to
Quote:
<p>Your search returned <%if cat_hits%><b><%cat_hits%></b> <%if cat_hits == 1%>category<%else%>categories<%endif%> and<%endif%> <b><%link_hits%></b> link<%if link_hits != 1%>s<%endif%>.

Last edited by:

Paul: Jan 15, 2003, 9:19 AM
Quote Reply
Re: [Paul] Removing s In reply to
Works great! That did it!

Here is the code snippet I ended with:

Code:
Your search for <b><%query%></b> returned <%if cat_hits%><b><%cat_hits%></b> <%if cat_hits == 1%>category
<%else%>categories<%endif%> and<%endif%> <b><%link_hits%></b> listing<%if link_hits != 1%>s<%endif%>.