News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Creating a custom BBCode

Started by Threshold, July 24, 2013, 09:42:08 PM

Previous topic - Next topic

Threshold

Greetings,

Recently, I have been researching vigorously, ways to create my own custom BBCodes, but all I get is some technical answers that lead me to more questions. First of all, I would like to know what I must do to create my own BBCode. I have given what I am requesting at the bottom of this thread so the details do not interfere with my actual questions.

Firstly, I need to know where I must go to edit the files such as Subs.php which are apparently what I need to 'add' my BBCode. Then I must find out how to name the codes and actually make the code work.

1) Where must I go to edit/add to files?
2) What files must I edit to make my BBCode work?
3) What must I add to these files that will help me resolve my questions?
4) How must I use the code in a post ro message?
5) Will this method work for all BBCodes or any BBCodes related to it's content?

--

What I am trying to do at the moment is to add 3 kinds of things:

1) A tag that will add an 'Admin Message', much like a 'quote' but on a light red background and a header 'Administrator Message', much like many other forums that have [admin][/admin] for example.
2) A tag that will insert an image or message in a simple tag, like [accepted][/accepted] that will insert an image, that saves me having to do [img]myimagehere[/img], which is basically the IMG tags without the parameters, and inserts a compulsary image.
3) A tag that will do the same as [accepted] but another image that is also compulsary, basically the same as the above request, just a different image.

If anyone could help me resolve this, I would be extremely grateful.

Regards,
Threshold.

Threshold

Oh and by the way, if this is in the wrong section, please let me know. I am new to this forum, and I'm not quite sure where this thread exactly belongs.

Neo_TE

Yes, this is the wrong section. You should have posted it in the SMF Coding Discussion in this link, http://www.simplemachines.org/community/index.php?board=60.0.

For the admin tag, a mod already exists. Check this link, http://custom.simplemachines.org/mods/index.php?mod=2104.

And you'll have to edit

  • "~/Sources/Subs.php" - to add a new BBC
  • "~/Sources/Subs-Editor.php" - to make that BBC icon appear on the post editor along with other BBC, smileys etc.

You can check the mods in this link, http://custom.simplemachines.org/mods/index.php?action=search;type=6, to get an idea about making a new BBC. :)

And please mark this thread as solved and make a new thread in the SMF Coding Discussion board so that you'll get better response. Thanks.

MrPhil

Quote from: xPandax on July 26, 2013, 04:00:08 AM
And please mark this thread as solved and make a new thread in the SMF Coding Discussion board so that you'll get better response. Thanks.
Even better, click "Report to moderator" and ask that the topic (thread) be moved to the Coding Discussion board. That way you don't have two copies of the thread floating around, both being added to.

Neo_TE

Quote from: MrPhil on July 26, 2013, 10:43:00 AM
Quote from: xPandax on July 26, 2013, 04:00:08 AM
And please mark this thread as solved and make a new thread in the SMF Coding Discussion board so that you'll get better response. Thanks.
Even better, click "Report to moderator" and ask that the topic (thread) be moved to the Coding Discussion board. That way you don't have two copies of the thread floating around, both being added to.

Done.

PS: Well, always browsing my forum as the admin made me forget about the report to mod feature. :P

NanoSector

Moved. I agree with looking at other mods to get an idea.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Threshold

Thank you, I will look into it. Just one question, how do I access Subs.php, I've been looking through everywhere. Yes I have full access to the site, but I just don't know where to go to edit Subs.php or any other files.

NanoSector

My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Neo_TE

Quote from: Threshold on July 27, 2013, 09:43:17 AM
Thank you, I will look into it. Just one question, how do I access Subs.php, I've been looking through everywhere. Yes I have full access to the site, but I just don't know where to go to edit Subs.php or any other files.

Don't you have some control panel like Cpanel or similar?

This link might help, http://www.siteground.com/tutorials/cpanel/file_manager.htm.

emanuele

Quote from: Threshold on July 24, 2013, 09:42:08 PM
1) A tag that will add an 'Admin Message', much like a 'quote' but on a light red background and a header 'Administrator Message', much like many other forums that have [admin][/admin] for example.
http://custom.simplemachines.org/mods/index.php?mod=2104


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Threshold

QuoteInstallations actions for "Moderator and Administrator Comment Tags"

The package you are trying to download or install is either corrupt or not compatible with this version of SMF.

I am using SMF 2.0.4. Is there any compatible versions of this mod? :(

I'm sure I will figure the FTP part out for myself eventually, I've downloaded FileZilla and I know all the details like the username and password, I just need to know what to put into the files to actually make my BBC codes work, but I will ask that later. For now, I just need to find a compatible version of this admin and moderator tag comments mod.

emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Threshold

Awesome thanks so much for your support so far guys. I appreciate it.

Although recently I tried to change the password for my database, by going into the Admin panel > database and changing the password and pressing 'save', but since I pressed 'save', my database is giving me an error, see for yourself:

hxxp:www.prodriftsamp.net78.net [nonactive]

Any ideas on how to fix this? I've tried searching but it requires me to upload files to my database, but I can't do that if I don't know the password :S

Neo_TE

Quote from: Threshold on August 01, 2013, 11:06:03 PM
Awesome thanks so much for your support so far guys. I appreciate it.

Although recently I tried to change the password for my database, by going into the Admin panel > database and changing the password and pressing 'save', but since I pressed 'save', my database is giving me an error, see for yourself:

http://www.prodriftsamp.net78.net

Any ideas on how to fix this? I've tried searching but it requires me to upload files to my database, but I can't do that if I don't know the password :S

First go to the server control panel, change the database password.

Then use repair_settings.php to fix the issue. You can read about it in the wiki, http://wiki.simplemachines.org/smf/Repair_settings.php.

Threshold

I couldn't get the database information and/or fix the forum. Nonetheless, this topic is solved.

dand

Quote from: xPandax on July 26, 2013, 04:00:08 AM
And you'll have to edit

  • "~/Sources/Subs.php" - to add a new BBC
  • "~/Sources/Subs-Editor.php" - to make that BBC icon appear on the post editor along with other BBC, smileys etc.

There is no Subs-Editor.php in SMF 1.1.19. Which file(s) I need to edit then for SMF 1.x?

Arantor


Advertisement: