Moderator: Spunkmeyer
<PerlCode>
$MP_FieldName = "CustomField_Text_image1";
$Text =~ s!\[img1\]!'<IMG SRC="' . $fieldDB{$MP_FieldName}->{http} . '/' . ${$MP_FieldName} . '">'!ge;
</PerlCode><IMG SRC="/imgdata/news/article_images/conic.gif">Actually I started to play around with a little addon that basically is very similar to Anne Rice but it does the substitution on the fly (I was playing around with calling the addon Flying Rice). It would do the very same substitution thing you do above, but you define this substitute in an Anne Rice approach, that is on a page of it's own. The reason for creating the addon is just as you mention, Anne Rice has a tendensy of messing up things at the Edit News page...Esstee wrote:is this good?
you darned right it is! because with these tags and the quicktag addon
I can create simple [img1] [img2] [img3] and so on... buttons to
place wherever I want in my article..
AND... to make things evern sweeter, when I return to edit the document
I always have [img] tags to manipulate so its not all messy
I was playing around with calling the addon Flying Rice
<PerlCode>
$MP_FieldName = "CustomField_Text_image1";
$Text =~ s!\[img1\]!'<IMG SRC="' . $fieldDB{$MP_FieldName}->{http} . '/' . ${$MP_FieldName} . '">'!ge;
</PerlCode><PerlCode>
$MP_FieldName = "CustomField_Text_image";
$Text =~ s!\[img(\d+) align=([^\]]+)\]!'<IMG SRC="' . $fieldDB{"$MP_FieldName$1"}->{http} . '/' . ${"$MP_FieldName$1"} . '" align="$2">'!ge;
</PerlCode>[img1 align=left]
[img2 align=center]
[b]Title:[/b] Image placement tag test no. 3
[b]Text:[/b]
[img1 align=left]
asd asd asd asd a
<a name="newsitemEEEAEFylAZACGbJsXW"></a>
Image placement tag test no. 3
<IMG SRC="/imgdata/news/article_images/conic.gif" align="$2">
<br><br>asd asd asd asd as!\[img(\d+) align=(\w+)\]!s!\[img(\d+)( align=(\w+))?\]!<PerlCode>
$MP_FieldName = "CustomField_Text_image";
$Text =~ s!\[img(\d+)( align=([^\]]+))?\]!'<IMG SRC="' . $fieldDB{"$MP_FieldName$1"}->{http} . '/' . ${"$MP_FieldName$1"} . '"' . ($2?qq~ align="$3">~:'>')!ge;
</PerlCode>
<PerlCode>
$MP_FieldName1 = "CustomField_Text_image";
$MP_FieldName2 = "CustomField_img_caption";
$Text =~ s!\[img(\d+)( align=([^\]]+))?\]!'<IMG SRC="' . $fieldDB{"$MP_FieldName1$1"}->{http} . '/' . ${"$MP_FieldName1$1"} . '"' . ($2?qq~ align="$3">~:'>'). ${"$MP_FieldName2$1"}!ge;
</PerlCode>Users browsing this forum: No registered users and 0 guests