how to replace symbols in style for any field

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

how to replace symbols in style for any field

Postby web » Sun Nov 27, 2005 5:32 pm

Here was discussion, but it was deleted. so i try to put only solution.

the problem was that i needed to replace some symbols for use in RSS.
these were:

" to "
' to '
< to &lt;
> to &gt;

and removing <br> tag.


Parahead suggested to use Search and Replace. It was great but only fi i hadn't remove <br> tag? 'cause it could remove it in all categories an profiled that should affect on posting on the site/

bozoka45 provide me with a link to a resource with perl script teaching (think, bozoka45 will provide with it once more for others) to teach me fishing rather than give a solution.
so from this page with bozoka45 's help was written a code (solution)

Code: Select all
 <PerlCode>
$string1 = $Text;
$string1 =~ s/<br>/ /g;
$string1 =~ s/"/&quot;/g;
$string1 =~ s/</&lt;/g;
$string1 =~ s/>/&gt;/g;
$string1 =~ s/'/&apos;/g;
$string2 = $Subject;
$string2 =~s/"/&quot;/g;
</PerlCode>


then using in the style <Field: string1> instead of <Field: Text> and <Field: string2> instead of <Field: Subject>


That's was my first fish (deleted :cry: )
great thanks to bozoka45 and Parahead
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby SrNupsen » Sun Nov 27, 2005 6:09 pm

Great that you found a solution and shared it with us. I can assure you that your post(s) were not deleted intenionally - one of our moderators placed a wrong mouseclick somewhere and they were lost. Such things happen every now and then, inevitably...

SrNupsen
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway


Return to Customization

Who is online

Users browsing this forum: No registered users and 1 guest

cron