Author: chopper » Tue May 13, 2008 1:41 pm
Ok this code works for left right and center.
It's not very clean but it works.
Find this:
- Code: Select all
var Prompt2 = showPrompt("Enter image position.nLEFT = Position to left of text.nRIGHT = Position to right of text.nCENTER = Center in line.nLeave blank for no positioning.","",0,"",/(left|right|center)/i,"Valid options are 'left', 'right', 'center', or leave blank."); if (Prompt2 == "^pcncl-1") { Result2 = 1; } else if (Prompt2 != "^perr-1") { if (Prompt2.toLowerCase() == 'left') { if (imgType == "img") { Prompt2 = "=left"; } else { Prompt2 = "l"; } } if (Prompt2.toLowerCase() == 'right') { if (imgType == "img") { Prompt2 = "=right"; } else { Prompt2 = "r"; } } if (Prompt2.toLowerCase() == 'center') { if (imgType == "img") { Prompt2 = "=center"; } else { Prompt2 = "c"; } } ToAdd = "["+imgType; if (Prompt2 != '') { ToAdd += ""+Prompt2.toLowerCase(); } if (imgType == "img") { ToAdd += "]"+Prompt1+"[/"+imgType+"]"; } else { ToAdd += "]"+Prompt1+"[/"+imgType+""+Prompt2+"]"; } } Result2 = 1;
and replace with this] var Prompt2 = showPrompt("Enter image position.nLEFT = Position to left of text.nRIGHT = Position to right of text.nCENTER = Center in line.nLeave blank for no positioning.","",0,"",/(left|right|center)/i,"Valid options are 'left', 'right', 'center', or leave blank."); if (Prompt2 == "^pcncl-1") { Result2 = 1; } else if (Prompt2 != "^perr-1") { if (Prompt2.toLowerCase() == 'left') { if (imgType == "img") { Prompt2 = "=left"; } else { Prompt2 = "=left"; } } if (Prompt2.toLowerCase() == 'right') { if (imgType == "img") { Prompt2 = "=right"; } else { Prompt2 = "=right"; } } if (Prompt2.toLowerCase() == 'center') { if (imgType == "img") { Prompt2 = "=center"; } else { Prompt2 = "=center"; } } ToAdd = ""; if (Prompt2 != '') { if (imgType == "img") { ToAdd += "[align"+Prompt2.toLowerCase()+"]["+imgType+"]"+Prompt1+"[/"+imgType+"][/align]"; } else { ToAdd += "[align"+Prompt2.toLowerCase()+"]["+imgType+"]"+Prompt1+"[/"+imgType+"][/align]"; } } else { ToAdd += "["+imgType+"]"+Prompt1+"[/"+imgType+"]"; } } Result2 = 1; [/code]
Last edited by chopper on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http][img=left]http://chopncrop.com/forum_images/album/albums/userpics/10002/banner.jpg[/img][/url]
[url=http]Homestead Country[/url]