Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-06-2009, 02:59 PM
RedKnight RedKnight is offline
 
Join Date: Sep 2009
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 09-06-2009, 03:28 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 09-06-2009, 03:32 PM
RedKnight RedKnight is offline
 
Join Date: Sep 2009
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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.
Reply With Quote
  #4  
Old 09-06-2009, 04:19 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.... /> )
Reply With Quote
  #5  
Old 09-06-2009, 06:53 PM
RedKnight RedKnight is offline
 
Join Date: Sep 2009
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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.

It is possible to have multiple options in a single code to cover my "wish list items"?
Reply With Quote
  #6  
Old 09-06-2009, 06:57 PM
James Birkett James Birkett is offline
 
Join Date: Jun 2009
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wouldn't it make more sense to have:
<img src="{option}" align=left hspace=10 alt="{param}" />
This way it works by doing:

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.
Reply With Quote
  #7  
Old 09-06-2009, 07:11 PM
RedKnight RedKnight is offline
 
Join Date: Sep 2009
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by James Birkett View Post
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
Reply With Quote
  #8  
Old 09-06-2009, 07:17 PM
James Birkett James Birkett is offline
 
Join Date: Jun 2009
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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" />
Reply With Quote
  #9  
Old 09-06-2009, 09:16 PM
RedKnight RedKnight is offline
 
Join Date: Sep 2009
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #10  
Old 09-06-2009, 09:29 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:26 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04102 seconds
  • Memory Usage 2,260KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete