BBCode Hash

Discussion forum for MOD Writers regarding MOD Development.
Locked
SavSin
Registered User
Posts: 3
Joined: Mon Apr 08, 2013 11:05 pm

BBCode Hash

Post by SavSin »

I am a developer for the Sourcemod Community and have recently released a plugin in which alters the database tables to insert a generated forum post. It supports various boards including phpBB. The plugin can be found https://forums.alliedmods.net/showthread.php?t=211126.

While testing against phpBB I've noticed that when formatting the testing using [ b ] bbcode tags it doesn't work by simply submitting them into the message. However they do take effect when i edit the message from within the forums and press submit..

The problem I am having has to do with the BBCode Hash that is required for bbcode to be displayed inside of the message on this specific board. Is there a way to generate this from outside of the forum software?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53463
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: BBCode Hash

Post by Brf »

SavSin
Registered User
Posts: 3
Joined: Mon Apr 08, 2013 11:05 pm

Re: BBCode Hash

Post by SavSin »

I am not able to call the 'generate_text_for_storage' function from within the plugin..

Setting the 'enable_bbcode' column to 1 and leaving 'bbcode_bitfield' empty no bbcode is parsed. If i then edit the page and click submit it is displayed fine.

Code: Select all

INSERT INTO %sposts (topic_id, forum_id, poster_id, poster_ip, post_time, post_approved, enable_bbcode, post_subject, post_text, post_postcount) VALUES ('2', '2', '2', '66.239.58.27', '1366018327', '1', '1', '=NcB= SavSin - TKing', 'Lots of Text Here Formatted with bb CODE', '1');
The above query gives me this:
Image

Edit -> Submit (This is what i get)
Image

When looking at the table after the bbcode_uid has been added.... i see this as the bbcode

Code: Select all

[b:d1e1i318]
So is there anyway to generate that without having to use the php code you provided? It would be very difficult for me to implement that simply for the looks of a post but it was a request from a few members of the community to enable bbcode on phpBB


And as a Side note.... I am only able to send SQL queries no php interaction... (possible with sourcemod using sockets but beyond my scope of knowledge at this time)
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53463
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: BBCode Hash

Post by Brf »

SavSin wrote:I am not able to call the 'generate_text_for_storage' function from within the plugin..
Then we cannot help you.
User avatar
DionDesigns
Registered User
Posts: 515
Joined: Sun Feb 26, 2012 11:22 pm
Location: Uncertain due to momentum.
Contact:

Re: BBCode Hash

Post by DionDesigns »

To generate the BBcode bitfield, take a look at this:

https://www.phpbb.com/kb/article/how-to ... d-bbcodes/

As you noticed, you'll also need to add BBcode IDs to each BBcode. They consist of a colon followed by an 8-byte alphanumeric string, and they must be added to both the open and close tags. The ID must be the same for every BBcode tag within a post, but each post should have a unique BBcode ID. (Actually I don't think each post requires a unique ID, but better safe than sorry!)

Make sure to include the BBcode ID and bitfield in your INSERT query since these values are stored in the _posts table and are used to parse the post for display.
SavSin
Registered User
Posts: 3
Joined: Mon Apr 08, 2013 11:05 pm

Re: BBCode Hash

Post by SavSin »

Brf wrote:
SavSin wrote:I am not able to call the 'generate_text_for_storage' function from within the plugin..
Then we cannot help you.
Thank you.. All i wanted was something from you guys explaining this so when people ask me i can refer them to this discussion so they wont keep asking something that is impossible to do.

What is the reasoning behind the bbcode id btw just curious?
Locked

Return to “[3.0.x] MOD Writers Discussion”