vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   HTML image code convert to BBCode? (https://vborg.vbsupport.ru/showthread.php?t=222585)

RedKnight 09-06-2009 02:59 PM

HTML image code convert to BBCode?
 
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 :

Code:

<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 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

Quote:

Originally Posted by Lynne (Post 1880602)
Have you read the manual on this? Custom BB Codes 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
Code:

<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? [code=option]param[/code] ? Let's see an example.

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

RedKnight 09-06-2009 06:53 PM

Quote:

Originally Posted by Lynne (Post 1880636)
Use [option] is set to Yes? And how are you 'calling' your bbcode? [code=option]param[/code] ? 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

Quote:

Originally Posted by James Birkett (Post 1880712)
Wouldn't it make more sense to have:
<img src="{option}" align=left hspace=10 alt="{param}" />
This way it works by doing:
[img={URL TO IMAGE}]Alt[/img]
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:

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 - [code={option}]{param}[/code] 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.


All times are GMT. The time now is 02:17 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01061 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete