Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

is it possible to diplay link "description" start from line $A -$Z

Quote Reply
is it possible to diplay link "description" start from line $A -$Z
on link's description
------------

for example in description filed for link has about 7 lines
but i want just to display descriotion only start from line 2 to line 5

is it possible to do this ?

line 1
line 2start to display from this line
line 3
line 4
line 5 end of display
line 6
line 7

----------
for display just the line i want
Do i have to do something with MYSQL query or I just do someting PHP code ?

any suggestion ?


if can be done by PHP
can some one show me the code please..
Quote Reply
Re: [websnow] is it possible to diplay link "description" start from line $A -$Z In reply to
If I am not wrong you can do this by updating link sort order from "build options".

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] is it possible to diplay link "description" start from line $A -$Z In reply to
assuming your descriptions have literal lines (split with \n) and you want lines 2 through 5, you can do this:

create a new template global, name it whatever you want (ie, "desc"):

Code:
sub {
my $vars = shift;
my $desc = $vars->{Description};

return join "\n", (split /\n/, $desc)[1..4];
}

then call your new description in your templates with <%desc%>

I have not tested this to work with Links (not sure how line breaks are handled...) but the method works.

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] is it possible to diplay link "description" start from line $A -$Z In reply to
Thank you and i will try this code