is there a way to hardcode a bbcode ?

Discussion forum for MOD Writers regarding MOD Development.
Locked
hameedhudeen
Registered User
Posts: 41
Joined: Fri Sep 04, 2009 3:27 pm

is there a way to hardcode a bbcode ?

Post by hameedhudeen »

hi..

is is there a way to hardcode a bbcode in such a way that PHPBB CODERS had coded the bbcode like [img],[url] etc,

i think they are not in the mysql database..

so..is there a way to hardcode bbcodes like how phpbb coders did?

User avatar
R4g
Registered User
Posts: 14
Joined: Thu Mar 04, 2010 2:27 am

Re: is there a way to hardcode a bbcode ?

Post by R4g »

There always is, but I wouldn't recommend it. And only the custom BBCodes are stored in a MySQL table.

Have a look at includes/message_parser.php and includes/bbcode.php.

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: is there a way to hardcode a bbcode ?

Post by ric323 »

hameedhudeen wrote:...
so..is there a way to hardcode bbcodes like how phpbb coders did?
What is your aim?
Do you want to replace one if the existing "hard coded" ones?
If not, why can't you use the "custom bbcode" feature?
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

hameedhudeen
Registered User
Posts: 41
Joined: Fri Sep 04, 2009 3:27 pm

Re: is there a way to hardcode a bbcode ?

Post by hameedhudeen »

no..it is just for testing..

i am going to try to add the codes in hardcoded mode..

so how can i do it..

User avatar
R4g
Registered User
Posts: 14
Joined: Thu Mar 04, 2010 2:27 am

Re: is there a way to hardcode a bbcode ?

Post by R4g »

hameedhudeen wrote:no..it is just for testing..

i am going to try to add the codes in hardcoded mode..

so how can i do it..
Learn to understand the 2 files I mentioned earlier and you'll be able to do it.

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: is there a way to hardcode a bbcode ?

Post by ric323 »

hameedhudeen wrote:no..it is just for testing..

i am going to try to add the codes in hardcoded mode..

so how can i do it..
This is not a support issue then. If you were asking how to use the custom bbcode feature it would be.

Would you like me to move this topic to the "MOD Writers" forum, which is a more suitable area for discussing writing your own code?
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

hameedhudeen
Registered User
Posts: 41
Joined: Fri Sep 04, 2009 3:27 pm

Re: is there a way to hardcode a bbcode ?

Post by hameedhudeen »

yeah..please move..ric323

thanks

hameedhudeen
Registered User
Posts: 41
Joined: Fri Sep 04, 2009 3:27 pm

Re: is there a way to hardcode a bbcode ?

Post by hameedhudeen »

why no reply?

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: is there a way to hardcode a bbcode ?

Post by ric323 »

Just a guess, but I'd say noone can see any good reason for your request, or that you've made any effort to have a look in the files suggested by R4g to see how the built in bbcodes work.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

hameedhudeen
Registered User
Posts: 41
Joined: Fri Sep 04, 2009 3:27 pm

Re: is there a way to hardcode a bbcode ?

Post by hameedhudeen »

ok..thanks

User avatar
tumba25
Former Team Member
Posts: 4430
Joined: Wed Jun 06, 2007 6:42 am
Location: Kokkola, Finland.
Name: Jari Kanerva
Contact:

Re: is there a way to hardcode a bbcode ?

Post by tumba25 »

Start with includes/message_parser.php and includes/bbcode.php. Search for "img" and you'll see how it works.
Note that each bbcode has its own id. If you don't have any custom bbcodes you can continue with 13, otherwise 13 might be occupied. I would prefer to set it high, starting at 100 or something like that.
If you start with 13 for your own you also need to open includes/functions_display.php and change $num_predefined_bbcodes in display_custom_bbcodes().

Then open styles/your_style/bbcode.html and styles/your_style/posting_buttons.html and add your bbcode to them.

IIRC that's all.
Need a mod/extension created/installed, other custom-coded solution or a server admin? https://tumba25.net

hameedhudeen
Registered User
Posts: 41
Joined: Fri Sep 04, 2009 3:27 pm

Re: is there a way to hardcode a bbcode ?

Post by hameedhudeen »

Thanks A LOT man..u r rocking

Locked

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