Page 1 of 1

is there a way to hardcode a bbcode ?

Posted: Fri Mar 05, 2010 3:10 am
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?

Re: is there a way to hardcode a bbcode ?

Posted: Fri Mar 05, 2010 4:39 am
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.

Re: is there a way to hardcode a bbcode ?

Posted: Fri Mar 05, 2010 5:41 am
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?

Re: is there a way to hardcode a bbcode ?

Posted: Fri Mar 05, 2010 6:17 am
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..

Re: is there a way to hardcode a bbcode ?

Posted: Fri Mar 05, 2010 6:29 am
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.

Re: is there a way to hardcode a bbcode ?

Posted: Fri Mar 05, 2010 8:12 am
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?

Re: is there a way to hardcode a bbcode ?

Posted: Fri Mar 05, 2010 1:28 pm
by hameedhudeen
yeah..please move..ric323

thanks

Re: is there a way to hardcode a bbcode ?

Posted: Sat Mar 06, 2010 2:54 am
by hameedhudeen
why no reply?

Re: is there a way to hardcode a bbcode ?

Posted: Sat Mar 06, 2010 4:05 am
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.

Re: is there a way to hardcode a bbcode ?

Posted: Sat Mar 06, 2010 7:42 am
by hameedhudeen
ok..thanks

Re: is there a way to hardcode a bbcode ?

Posted: Sat Mar 06, 2010 10:20 am
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.

Re: is there a way to hardcode a bbcode ?

Posted: Sat Mar 06, 2010 12:20 pm
by hameedhudeen
Thanks A LOT man..u r rocking