I know, everybody hates ads. But you dislike to pay for something too. I would like to give everything for free, but it's impossible because costs are too much. If you know how Google ads work, you know how to help. It's on you. I can detect income by country, so... Australia rocks now! Thanks

spoiler plugin: change bbCode tagword


sanslash332 » 1 year ago
Hello guys,

I have a small question a about this plugin:
https://www.e107sk.com/download/18/spoiler-plugin

I downloaded it yesterday, and works fine for my purposes, but have a little problem.
Instead of sp / sp (put the brackets) I want to use spoiler /spoiler like the classic VBulletin forums.

I tried changed it modifying the e-bb.php file, but didn't works and the old sp / sp tag continuous working.

So, I have admit to I don't re-install the plugin after made the changes, but I made other changes in sp.bb and they works fine without re-install the plugin.

But well, the question is simple. Where I have to change (and how to) the sintax of the tag to be spoiler instead sp?

Thanks!


sanslash332
Level 1

Jimako » 1 year ago
Do you mean to change words (shortcodes) from "sp" to "spoiler" after click on spoiler bbcode?


If yes, then:
- rename file sp.bb to spoiler.bb
- in file e_bb.php change all "sp" to "spoiler"

You should run Plugin Scan (or reinstall plugin), because list of available bbcodes is saved in core prefs (at least I think).
Plugin Scan: Tools / Database / Scan Plugin directories

If it doesn't help, you need to reinstall plugin.

I did those things before installation and it worked. Tested with php 7.2.

$bb['name']        = 'spoiler';
      $bb['onclick_var'] = "<span class='bbcode-spoiler' style='color:#ff00ff;background-color:#ff00ff'></span>";
      $bb['icon']        = e_PLUGIN_ABS."spoiler/images/spoiler.png";
      $bb['helptext']        = "Spoiler: <span class='bbcode-spoiler' style='color:#ff00ff;background-color:#ff00ff'>Text to be hidden</span>";
      $BBCODE_TEMPLATE .= "{BB=spoiler}";
      $BBCODE_TEMPLATE_SUBMITNEWS .= "{BB=spoiler}";
      $BBCODE_TEMPLATE_NEWSPOST .= "{BB=spoiler}";
      $BBCODE_TEMPLATE_ADMIN .= "{BB=spoiler}";
      $BBCODE_TEMPLATE_CPAGE .= "{BB=spoiler}";
      $eplug_bb[] = $bb;


JMadmin

Jimako
Main Admin
JMadmin

Jimako » 1 year ago
@sanslash332 don't forget rename that bb file. It has be the same as bbcode "shortcode"


JMadmin

Jimako
Main Admin
JMadmin

sanslash332 » 1 year ago
thanks @Jimako for your answer!
So, the only missing step was re-install the plugin.

¡thanks alot!


sanslash332
Level 1

Moderator(s): Jimako