Advertisement:

Author Topic: Random BBCode Fix to SMF 2  (Read 802 times)

Offline kesulin

  • Semi-Newbie
  • *
  • Posts: 37
Random BBCode Fix to SMF 2
« on: May 21, 2019, 06:49:53 AM »
I am new to SMF and of course new to this comunity. Please excuse me if I broke any rule posting here and for my english too.

I try to install this mod in my SMF installation:
https://custom.simplemachines.org/mods/index.php?mod=1247

but is broken. I fix the mod for my installation and now is running. Please some admin can upload it and share with the comunity.
Thanks in advance.
« Last Edit: May 22, 2019, 07:48:30 PM by Illori »

Online Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 2,924
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Random BBCode Fix to SMF 2
« Reply #1 on: May 21, 2019, 07:08:25 PM »
Broken in what way? also you can not redistribute a modification for the rights has the same. In addition you simply have to see this: How can I install a mod that doesn't work in my SMF version?.


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!


Ayudame via PayPal

Offline kesulin

  • Semi-Newbie
  • *
  • Posts: 37
Re: Random BBCode Fix to SMF 2
« Reply #2 on: May 22, 2019, 02:28:19 AM »
When install the old versión, some problem occurrs in file Subs.php. The code was added to start of the file, out of the php tag. This text is visible in index page always.
Also, the code used a trigger.
I change all this code and use one similar than dice mod.

Quote
<file name="$sourcedir/Subs.php">
      <operation>
         <search position="after"><![CDATA[         array(
            'tag' => 'blue',
   ]]></search>
         <add><![CDATA[         array(
            'tag' => 'randomquote',
            'before' => '<div style="font-size:x-small; background-color:#ffffff; margin:5px 20px; border:1px dashed black; filter:alpha(opacity=50); opacity:0.5;">',
            'after' => '</div>',
         ),
   ]]></add>
      </operation>
   </file>   

In Subs-Post.php I added new code for check someone is editing the result. This code was copied from dice mod too.

Quote
<file name="$sourcedir/Subs-Post.php">
   <operation>
         <search position="before"><![CDATA[// Now let's quickly clean up things that will slow our parser (which are common in posted code.)
   $message = strtr($message, array('[]' => '&#91;]', '[&#039;' => '&#91;&#039;'));]]></search>
         <add><![CDATA[

   // remove anyone who posted with the [randomquote] tag, bah, ye cheating riffraff
   global $txt, $settings;
   $message = preg_replace('~\[/randomquote\]~i', '', $message);
   $message = preg_replace('~\[randomquote[^\]]*\]~i', " {$txt['random_cheat']}\n", $message);
   // random them values!
   $message = preg_replace_callback('~\[random\]([^\[]*)\[/random\]~i', 'random_bbcode', $message);]]></add>
      </operation>

I also changed the function random_bbcode, move funcion from file Subs.php to Subs-Post.php.

Offline kesulin

  • Semi-Newbie
  • *
  • Posts: 37
Re: Random BBCode Fix to SMF 2
« Reply #3 on: May 22, 2019, 03:10:51 AM »
Broken in what way? also you can not redistribute a modification for the rights has the same. In addition you simply have to see this: How can I install a mod that doesn't work in my SMF version?.


Regards!
I didn't know this option. But I try it with Tabbed Smileys mod
http://custom.simplemachines.org/mods/index.php?mod=2782

And don't work, there are a problem with step 4 in ManageSmileys.php file. I solved this editing manually after force install mod.

Online Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 2,924
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Random BBCode Fix to SMF 2
« Reply #4 on: May 23, 2019, 12:33:03 PM »
@kesulin You can not distribute a modification for the subject of the copyright of the author, unless you have an explicit authorization on it. If you mention the solution in the topic of the modification is something else and can help others to modify it manually being under their responsibility.

I didn't know this option. But I try it with Tabbed Smileys mod
http://custom.simplemachines.org/mods/index.php?mod=2782

And don't work, there are a problem with step 4 in ManageSmileys.php file. I solved this editing manually after force install mod.

Each modification is different and some may require an update by the author, in new versions it improves faults that are found and therefore can change the code that some modification uses. If after installing manually generates error you have to see the error log which may give you an indication that it is failing but I think you will receive better support in the corresponding forum.


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!


Ayudame via PayPal