How to get PHP to pass colored text to RTF text in Revolution?

Brian Yennie briany at qldlearning.com
Tue Nov 27 16:50:01 EST 2007


Rob,

Instead of importing actual html table tags, could you use tabs in  
your text? Rev supports a small subset of HTML, but field objects  
should respect the tabStops property.

A quick way to apply this to a simple table already formatted into  
rows and columns using td and tr tags would be something like:

// translate the rows and columns to returns and tabs on our own
replace "</tr>" with cr in myText
replace "</td><td>" with tab in myText

// zap away the rest of the basic table tags
replace "<table>" with empty in myText
replace "</table>" with empty in myText
replace "<tr>" with empty in myText
replace "</tr>" with empty in myText
replace "<td>" with empty in myText
replace "</td>" with empty in myText

If you can control the source html entirely, I would suggest  
formatting a Rev field to look how you want it, then *get* the  
htmlText property of that field and see how Rev encodes it.

HTH,
- Brian
>
>  The problem I'm seeing when I use this technique is that  
> Revolution no longer pays attention to the "hard column stops" in  
> the table field object when I start using the HTMLTEXT method.?
>
> When I just use the native Revolution table-field object, I can set  
> the tab-stops to a certain width, and my data in each column never  
> runs into the other columns.? The minute I start using the HTMLTEXT  
> method, it appears that Revolution stops paying attention to it's  
> native tab-stops, and data that over-runs a column no longer gets  
> "cropped", but bleeds into the columns to it's right.
>
> I suppose I could start heading in the direction of embedding a  
> browser into Rev to get this text-field functionality, but at that  
> point, I might as well just do the whole thing as a web-site.
>
> - Rob
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Jim Ault <JimAultWins at yahoo.com>
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Sent: Mon, 26 Nov 2007 12:54 am
> Subject: Re: How to get PHP to pass colored text to RTF text in  
> Revolution?
>
>
>
>
>
>
>
>
>
>
> you want the
>
> HTMLText property,  in the dictionary.
>
>  Important!  The HTMLText property uses a tag structure that is  
> HTML-like,
> but is not completely standard HTML, in order to accommodate the  
> full range
> of text styling available in Revolution.
>
> thus
> set the htmltext of fld "dataTbl" to theStringSentFromPhp
>
> Jim Ault
> Las Vegas
>
> On 11/25/07 8:05 PM, "rgould8 at aol.com" <rgould8 at aol.com> wrote:
>
>> I have php code from my server passing data into a rich-text field  
>> in a
>> standalone Revolution stack.? Presently, it does it something like  
>> this:
>>
>> put URL "http://urltomyserver/getdata.php" into field "rtfoutput"
>>
>> This is a text field which is set up as a table with columns.
>> So far, this works well for me, but now I need the text field to have
>> different colored text data for some of the columns in this text  
>> field.
>>
>> The only way I can think to do this is to do something like has  
>> the PHP code
>> pass data to revolution for the field like:
>>
>> <?php
>> echo "<rtfcode for green>This text is green<rtfcode for red>and  
>> this text is
>> red in the same column.";
>> ?>
>> but I have no idea what would need to get passed to do such a thing.?
>>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
>
>
>
>
> ______________________________________________________________________ 
> __
> More new features than ever.  Check out the new AOL Mail ! - http:// 
> o.aolcdn.com/cdn.webmail.aol.com/mailtour/aol/en-us/text.htm? 
> ncid=aolcmp00050000000003
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

---
Brian Yennie
QLD Learning
(310)-367-7364





More information about the use-livecode mailing list