TinyPortal

Development => Support => Topic started by: Blue Steel on April 20, 2010, 05:59:19 AM

Title: [TP1.0 Beta5] suspected bug in php block editor
Post by: Blue Steel on April 20, 2010, 05:59:19 AM
I think i've just found a bug in the php block editor (and maybe in the php articke editor .. not sure havn't tried it)

if i put in this code

// link to us php block
// for Tinyportal
// by BlueSteel
$ltu_text = "To link to us use this code/button on your site";
$ltu_site_url = "http://www.codingmonkeys.com/";
$ltu_img_src = "http://www.codingmonkeys.com/images/cm_link.gif";
$ltu_textarea_rows = 6;     // numbewr of lines in text selection box
$ltu_textarea_colums = 22; // number of characters accross in text selection box
$ltu_line_align = "center";
$ltu_img_align = "top";
$ltu_p_align = "center";
$ltu_onclick = "this.select()";
//------------------------------
// Dont Edit anything below here
//------------------------------
echo '<p align=',$ltu_p_align,'><B>',$ltu_text,'</B></p>
<p align=',$ltu_p_align,'><a href="',$ltu_site_url,'"><img src="',$ltu_img_src,'" border="0"alt="',$ltu_img_src,'"></a></p>
<p align=',$ltu_p_align,'><textarea onclick=',$ltu_onclick,' rows=',$ltu_textarea_rows,' cols=',$ltu_textarea_colums,' name=link1>
<a href="',$ltu_site_url,'"><img src="',$ltu_img_src,'" border="0"alt="',$ltu_img_src,'"></a></textarea></p>';


the next time i edit it , its getting truncated to (in the edit box)

// link to us php block
// for Tinyportal
// by BlueSteel
$ltu_text = "To link to us use this code/button on your site";
$ltu_site_url = "http://www.codingmonkeys.com/";
$ltu_img_src = "http://www.codingmonkeys.com/images/cm_link.gif";
$ltu_textarea_rows = 6;     // numbewr of lines in text selection box
$ltu_textarea_colums = 22; // number of characters accross in text selection box
$ltu_line_align = "center";
$ltu_img_align = "top";
$ltu_p_align = "center";
$ltu_onclick = "this.select()";
//------------------------------
// Dont Edit anything below here
//------------------------------
echo '<p align=',$ltu_p_align,'><B>',$ltu_text,'</B></p>
<p align=',$ltu_p_align,'><a href="',$ltu_site_url,'"><img src="',$ltu_img_src,'" border="0"alt="',$ltu_img_src,'"></a></p>
<p align=',$ltu_p_align,'><textarea onclick=',$ltu_onclick,' rows=',$ltu_textarea_rows,' cols=',$ltu_textarea_colums,' name=link1>
<a href="',$ltu_site_url,'"><img src="',$ltu_img_src,'" border="0"alt="',$ltu_img_src,'"></a>


it apears to be dropping </textarea> and anything after it ..
stuffing up the block and anyrthing after it if you have any format closing arguments eg: </div> </td> </tr> </tbody> </table> </p> etc.. etc..

It took me ages to figure out what was going on
so you need to save a copy of the block elsewhere or you've lost some of your block/article (untill a solution is found.. you have been warned ;) )
Title: Re: [TP1.0 Beta5] suspected bug in php block editor
Post by: lurkalot on April 20, 2010, 09:30:03 AM
Quote from: BlueSteel on April 20, 2010, 05:59:19 AM

I think i've just found a bug in the php block editor (and maybe in the php articke editor .. not sure havn't tried it)


BlueSteel,

Just tested this on my test site, and it does the same.  Works well until you Revisit the block to edit it and even clicking save again without actually changing the code results in a mess.

Tried it in an article, and all worked fine until I moved it to another category, then messes up the same as as a php block.
Title: Re: [TP1.0 Beta5] suspected bug in php block editor
Post by: IchBin on April 20, 2010, 03:55:51 PM
Put it in the bug tracker please.