![]() |
Getting some BBCode to properly work
Hello again everyone,
This -I know for a fact- is a quite simple question, yet I'm not sure why I haven't been able to get it to properly work. It is about some BBCodes I am trying to implement but haven't been able to do so successfully. The first one would be for tables; currently it is way too complex to create a table, I've tried to simplify it, yet it didn't properly work; what I want is for this to be as easy as just put up [table] [ /table] and separate data by using the "|" symbol, with the variable of a head, by using [table=head] [/ table]; would anyone be able to let me know the exact code I'd need to paste in order to get this to properly work? I've done the common HTML code for it but when I create a table, instead of add the data the user types, it puts what I posted in the "Example".... Second one would be a "pack" of codes, which are to make images be posted to the right or left of text, but the common align (HTML) didn't work for me....and I want to use it as [IMGLEFT/RIGHT] [/ IMG]. Any help with these codes would be highly appreciated! |
There are already [TABLE] and [TR] and [TD] tags in vB4. If you add another, you will mess things up.
|
That is exactly what I don't want the need to; on other vb boards I can create a table by simply using
[table ] data1 | data2 data1.1 | data 2.2 [ /table] or [table=head ] title1 | title2 data1 | data2 [ / table] without the use of [TR/TD] as this makes it more complicated |
Are you talking about creating a shorthand notation using a BBCODE in creating a new table? Sorry, I am having a hard time understanding your question, but I am trying to :)
|
That would be the idea, eliminate the way in which you currently have to use [TR][TD] so that users won't need to, and they can create a table simply by adding the symbol "|" to separate data; as well as the use of the [table=head] which would make the first line of the table be marked as a "header" for the table
|
Post what you have and see the private message I sent you.
|
Well, currently, what I've done is go to the AdminCP under Custom BB Codes, and add a new one, which shows as follows:
Name: Table BB Code: [table]row 1, cell 1 | row 1, cell 2[/table] HTML: <table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table> Replacement: basically the output of that HTML code When a user enters something, anything into [table] tags, the output is always the same output of this specific HTML...that's my issue on this case. Not to mention the [IMGLEFT/RIGHT] which I need to use in order to enter images that will be placed to the right or left of text, as this is highly beneficial on different news and reviews. |
Okay I am guessing you are not seeing any output?
Make sure you have set remove tag if empty = no, or put something between the tags. Code:
[TABLE]anything here[/TABLE] One more thing: You are using tag "TABLE" even though this is working you are better calling it something like "QTABLE" for "quicktable". So it doesn't interfer with some weird mod that parses the BBCODE's. |
The output is there, the thing is that, whatever data gets inserted in the table isn't shown, instead it shows "row 1, cell 1", "row 1, cell 2" and so on
|
Okay now lets make sure we are on the same page...
Where are you inserting any data? You must pass the data via {param} and {option}. Am I missing something? For Example: Code:
[QTABLE="{option}"]{param}[/QTABLE] I will pass you some back-end code when your ready. :) --------------- Added [DATE]1366942645[/DATE] at [TIME]1366942645[/TIME] --------------- If your not familiar with what I am talking about. This is a nice little MOD that I have referred many people to by Cellarius. It is easy enough to write your own backend for bbcodes, but this is pretty useful for a structured setup. https://vborg.vbsupport.ru/showthread.php?t=264896 |
Basically, if you check over the HTML code, it is inserting the "row 1, cell 1" "row 1, cell 2" as data; what I am trying to accomplish here is that, using this statement:
[table (=head if needs title)] Data 1 | Data 2 [press enter to go to the next line or terminate this row] Data 1.1 | Data 2.1 [press enter again] Data 1.2 | Data 2.2[/ table] Gets to print this: https://vborg.vbsupport.ru/external/2013/04/7.png With the data the user has entered, obviously; therefore, I don't see a need to use php whatsoever if this is some simple HTML code that should work, as, basically, the HTML code for the table above is: Code:
<table border="1"> |
I am not sure where our communication problem is. I do not understand how you can use your construct under vBulletins BBCODE system without some custom coding.
vBulletin default bbcode only accepts two parameters {param} and {option}. It is a simple two input system that is parsed. I have not spent two much time pouring over the vbulletins BBCODE system, I do not use it all that much: since it is limited for safety. So if I am incorrect, please correct me, and refer me to an example using the method you are talking about. In order to pass complex data I have always written back-end code and used the vB_bbcode_parser class. (may have spelled the class incorrectly). ---- Maybe what you are referring to is creating an HTML form. I see from this example you are using simple user prompts? |
Well, I guess this was more complicated than I thought.
I got a question though, taking what you said "bbcode accepts two parameters" how does the "common" or bult-in table tags work? it needs, obviously, to be built like on HTML by using table, tr and td, but this isn't taking just 2 parameters; I see like going up to php code and everything is a bit excessive just to be able to create simple table tags, I might be mistaken though, in which case, I don't see how it is worth putting so much work into this. |
Quote:
/includes/class_bbcode.php /packages/vbform/bbcodehelper/table.php. 'class_bbcpde.php' class vB_BbCodeParserThen look at 'table.php' ...method 'parseTableTag'function 'fetch_tag_list' It will help you gain a little insight. :) --------------- Added [DATE]1366961088[/DATE] at [TIME]1366961088[/TIME] --------------- It occurred to me last night that you might not know that if you double click on an image in the editor you can align it left or right, change the image size and target. It is not a complete fix for image alignment in posts, but it does help. We have altered vbulletin so that it is adaptive especially for tablets. So I did some modifications how photos are shown in the posts, depending on the number of photos. Thus extending vbulletins image positioning. Essentially creating a auto-formatted output. |
All times are GMT. The time now is 08:06 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|