align Images in posts

Support for IntegraMOD 141

Moderator: Integra Moderator

align Images in posts

PostAuthor: chopper » Wed Apr 02, 2008 6:26 am

When trying to use an image from the album in a post, The popup window asks for what alignment you want. If you try to use any of them the image does not display. Only the code. does not matter if you try full album image or thumbnail.
this is the code that displays:

[albumimgl]1[/albumimgl]

I have changed the language file to tell members not to use this function for "security reasons" but it is still possible to attempt it. Is this a setting problem, host problem or IM141 problem.
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]
User avatar
chopper
Members
Members
 
Posts: 39
Likes: 0 post
Liked in: 0 post
Joined: Wed Jan 23, 2008 9:53 am
Cash on hand: 0.00

Re: align Images in posts

PostAuthor: Helter » Wed Apr 02, 2008 2:38 pm

I think this is a advanced bbcode box problem. We had a dev working on it quite awhile ago, but he has not been seen in several months
Last edited by Helter on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
"Success is getting what you want. Happiness is wanting what you get." - Dale Carnegie
User avatar
Helter
Administrator
Administrator
 
Posts: 4554
Likes: 40 posts
Liked in: 116 posts
Images: 0
Joined: Sat Mar 11, 2006 4:46 pm
Cash on hand: 1,959.15
Location: Seattle Wa
IntegraMOD version: phpBB2x

Re: align Images in posts

PostAuthor: chopper » Wed Apr 02, 2008 9:00 pm

OK thanks. I have edited a fix that works. I'm sure the .script can be cleaned up but this does work.
In IM141/mods/bbcode_box/bbcode_box.js
find this code
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

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 = "=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 += "[img"+Prompt2.toLowerCase()+"]"+Prompt1+"[/"+imgType+"]";                      }                     else                      {                         ToAdd += "[align"+Prompt2.toLowerCase()+"]["+imgType+"]"+Prompt1+"[/"+imgType+"][/align]";                      }                                           }                     else                     {                     ToAdd += "["+imgType+"]"+Prompt1+"[/"+imgType+"]";                 }                 }                 Result2 = 1;

That .script needs to be rewritten because some of the variables do not work and I only changed them so they would. They arent even needed.

Edited on 04/29/2008 and the above code now works correctly.
Last edited by chopper on Wed Apr 30, 2008 6:12 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]
User avatar
chopper
Members
Members
 
Posts: 39
Likes: 0 post
Liked in: 0 post
Joined: Wed Jan 23, 2008 9:53 am
Cash on hand: 0.00

Re: align Images in posts

PostAuthor: Helter » Wed Apr 02, 2008 9:25 pm

thx...Ive bookmarked this so I can look at it when im a little less sleep deprived...lol
Last edited by Helter on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
"Success is getting what you want. Happiness is wanting what you get." - Dale Carnegie
User avatar
Helter
Administrator
Administrator
 
Posts: 4554
Likes: 40 posts
Liked in: 116 posts
Images: 0
Joined: Sat Mar 11, 2006 4:46 pm
Cash on hand: 1,959.15
Location: Seattle Wa
IntegraMOD version: phpBB2x

PostAuthor: sanji » Mon May 12, 2008 6:44 am

This fix is, indeed, fixing the problem with the [albumimg] tag - which can now be centered. Unfortunately, the [img=center] is not working...

sanji
Last edited by sanji on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[img]http://www.secret-japan.com/forum/images/banners/fuji%20secret-japan%2088x31.gif[/img] [url=http]Secret Japan[/url] : discover Japan off the beaten tracks

sanji
Sr Integra Member
Sr Integra Member
 
Posts: 291
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 12, 2006 9:18 pm
Cash on hand: 0.00

Re: align Images in posts

PostAuthor: chopper » Mon May 12, 2008 2:18 pm

I will check it out and see if i can find what's wrong because left and right alignment are working correctly
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]
User avatar
chopper
Members
Members
 
Posts: 39
Likes: 0 post
Liked in: 0 post
Joined: Wed Jan 23, 2008 9:53 am
Cash on hand: 0.00

Re: align Images in posts

PostAuthor: 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]
User avatar
chopper
Members
Members
 
Posts: 39
Likes: 0 post
Liked in: 0 post
Joined: Wed Jan 23, 2008 9:53 am
Cash on hand: 0.00

Re: align Images in posts

PostAuthor: Allen » Wed May 14, 2008 1:08 am

Nice job, Thank you. This worked to solve the center issue
Last edited by Allen on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Allen
Integra Member
Integra Member
 
Posts: 100
Likes: 0 post
Liked in: 0 post
Joined: Tue Apr 22, 2008 10:08 pm
Cash on hand: 0.00


Return to IntegraMOD 141

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot]