PDA

View Full Version : HTML image code convert to BBCode?


RedKnight
09-06-2009, 02:59 PM
I'm just beginning to understand the ins and outs of BBCoding, but I do believe that this should be relatively easy, but I just cannot get it to work. Essentially I'm looking tryong to covert an HTML image code to multi-option BBCODE (a couple of different ones actually).

This it a sample of the easier HTML, the :

<img src="http://www.imageurlhere.gif" align=left hspace=10 alt="image description">

As it is the code it likely very recognizable by most of you (and if this question is posted elsewhere, I do apologize for the duplication. I looked and did not find it.)

Now, I know that it is the {param} and {option} items that I need to use in the BBCode manager, but I simply cannot figure it out for some reason. The items in blue are of primary interest, the items in red are "wishful thinking" options.

Lynne
09-06-2009, 03:28 PM
Have you read the manual on this? Custom BB Codes (http://www.vbulletin.com/docs/html/bb_code) Basically, you may have two 'options' for your bbcode - a param and an option. That should do for your two blue items.

RedKnight
09-06-2009, 03:32 PM
Have you read the manual on this? Custom BB Codes (http://www.vbulletin.com/docs/html/bb_code) Basically, you may have two 'options' for your bbcode - a param and an option. That should do for your two blue items.

Yes, I have done exactly that, replacing the URL with {param} and the image description with {option}, but I cannot get the option portion to work, but I think I'm not sure what to expect from the option code either. Is that supposed to provide a pop-up to type text into?

This is what I have entered into the Replacement section <img src="{param}" align left hspace=10 alt="{option}"> and I have option turned on.

All I get in return is the image url between the BBCode options.

Lynne
09-06-2009, 04:19 PM
Use [option] is set to Yes? And how are you 'calling' your bbcode? param ? Let's see an example.

(and you need a / at the end of your image code.... /> )

RedKnight
09-06-2009, 06:53 PM
Use [option] is set to Yes? And how are you 'calling' your bbcode? param ? Let's see an example.

(and you need a / at the end of your image code.... /> )

You are awesome, Lynn, it was the placement of the =option in the posting that I could not understand, but I understand now. I was trying to put that into the BBCode manager for some odd reason. As I originally assumed, easy. :o

It is possible to have multiple options in a single code to cover my "wish list items"?

James Birkett
09-06-2009, 06:57 PM
Wouldn't it make more sense to have:
<img src="{option}" align=left hspace=10 alt="{param}" />
This way it works by doing:
https://vborg.vbsupport.ru/
much like the URL BBCode works.

Also, I am not understanding your question. Multiple options meaning multiple uses of the {option} tag?
{option} tag can be used as many times as you like, but remember you can only have 1 option so it has to be the same value.

RedKnight
09-06-2009, 07:11 PM
Wouldn't it make more sense to have:
<img src="{option}" align=left hspace=10 alt="{param}" />
This way it works by doing:
Alt
much like the URL BBCode works.

Also, I am not understanding your question. Multiple options meaning multiple uses of the {option} tag?
{option} tag can be used as many times as you like, but remember you can only have 1 option so it has to be the same value.

I was hoping to be able to use more that one option in a single code to indicate left or right justification, but if I leave out the align I think I can to so with the basic alignment commands. Additionally, I was considering allowing the image border to be an option, the gutter size to be adjustable, but it this is not possible then I'll have to figure something else out. Thanks James :)

Oh, the swapping the param and option codes is a good idea, thanks again

James Birkett
09-06-2009, 07:17 PM
You can only have 1 value of {option} and 1 value of {param}
(for the purpose of this discussion, {option} is image.jpg)
<img src="{option}" align="{option)" alt="{param}" />
would result in:
<img src="image.jpg" align="image.jpg" alt="Some text" />

RedKnight
09-06-2009, 09:16 PM
Can I step this code up to have two paramaters if two options cannot work?

For example, I would like to display a thumbnail with mouse-over text, but have it link to a full sized image. The HTML i have in place is:

<img src="thumbnait URL" hspace=3 align=top align=left alt="image description" border="0"> (full image URL)

Sorry to flip the suggestion back (URL and description), but in this case the two URLs would be param1 and param2, then the description text would be the option.

This looks logical to me, but is it a possibility or so I need to place a code in a code?

Lynne
09-06-2009, 09:29 PM
The way the bbcode is, you may only pass two thingiemabobs - one of them is called {param} and the other is called {option}. And when you place them in your code, they get called this way - {param} So, two is the magic number. You may call them both parameters or both options, but you only get to pass two of these thingiemabobs to the code.

RedKnight
09-07-2009, 09:33 PM
The way the bbcode is, you may only pass two thingiemabobs - one of them is called {param} and the other is called {option}. And when you place them in your code, they get called this way - {param} So, two is the magic number. You may call them both parameters or both options, but you only get to pass two of these thingiemabobs to the code.

Oh well, limitations are limitations :) I'll work with placing a code within a code then.

Thanks Lynn.