Edit the mod hidden [code] and url

A place to suggest possible new mods or to suggest abandoned mods to take over.
Post Reply
Gelmo88
New member
New member
Posts: 5
Joined: 04 Dec 2011, 12:33

Edit the mod hidden [code] and url

Post by Gelmo88 »

hello everybody.. I'm looking for a mod that does this:

do not see these links or the content of the tag code, unregistered users. a way to view the content should be to register at, or log in or you can view your content by sharing this post on google + or Fb or twitter.

therefore more than a new model would be the integration of mod that already use that is:

Hidden code and Url
share topic mod 1.0.2

I've tried to find such a functioning for a long time but have not found anything. This is the changing of the first mod. I hope you can help me.


open includes/bbcode.php

search:

Code: Select all

               $this->bbcode_cache[$bbcode_id] = array(
                  'preg' => array(
                     '#\[url:$uid\]((.*?))\[/url:$uid\]#s'         => $this->bbcode_tpl('url', $bbcode_id),
                     '#\[url=([^\[]+?):$uid\](.*?)\[/url:$uid\]#s'   => $this->bbcode_tpl('url', $bbcode_id),
                  )
               );


add before:

Code: Select all

               if ($user->data['user_id'] != ANONYMOUS && $user->data['group_id'] != 6)
               {

add after:

Code: Select all

               }
               else
               {
                  $this->bbcode_cache[$bbcode_id] = array(
                     'preg' => array(
                        '#\[url:$uid\].*?\[/url:$uid\]#s'         => $this->bbcode_tpl('url_hidden', $bbcode_id),
                        '#\[url=[^\[]+?:$uid\].*?\[/url:$uid\]#s'   => $this->bbcode_tpl('url_hidden', $bbcode_id),
                     )
                  );
               }


Search :

Code: Select all

                    case 8:
                       $this->bbcode_cache[$bbcode_id] = array(
                          'preg' => array(
                             '#\[code(?:=([a-z]+))?:$uid\](.*?)\[/code:$uid\]#ise'   => "\$this->bbcode_second_pass_code('\$1', '\$2')",
                          )
                       );
                    break;


Replace with:

Code: Select all

                    case 8:
                       if ($user->data['user_id'] != ANONYMOUS)
                       {
                          $this->bbcode_cache[$bbcode_id] = array(
                             'preg' => array(
                                '#\[code(?:=([a-z]+))?:$uid\](.*?)\[/code:$uid\]#ise'   => "\$this->bbcode_second_pass_code('\$1', '\$2')",
                             )
                          );
                       }
                       else
                       {
                          $this->bbcode_cache[$bbcode_id] = array(
                             'preg' => array(
                                '#\[code(?:=([a-z]+))?:$uid\](.*?)\[/code:$uid\]#ise'   => "\$this->bbcode_second_pass_code_hidden('\$1', '\$2')",
                             )
                          );
                       }
                    break;


search:

Code: Select all

              $code = $this->bbcode_tpl('code_open') . $code . $this->bbcode_tpl('code_close');

              return $code;
           }


Add after:

Code: Select all

           function bbcode_second_pass_code_hidden($type, $code)
           {
              // when using the /e modifier, preg_replace slashes double-quotes but does not
              // seem to slash anything else
              $code = str_replace('\"', '"', $code);

              switch ($type)
              {
                 case 'php':
                    // Not the english way, but valid because of hardcoded syntax highlighting
                    if (strpos($code, '<span class="syntaxdefault"><br /></span>') === 0)
                    {
                       $code = substr($code, 41);
                    }

                 // no break;

                 default:
                    $code = str_replace("\t", '&nbsp; &nbsp;', $code);
                    $code = str_replace('  ', '&nbsp; ', $code);
                    $code = str_replace('  ', ' &nbsp;', $code);

                    // remove newline at the beginning
                    if (!empty($code) && $code[0] == "\n")
                    {
                       $code = substr($code, 1);
                    }
                 break;
              }

              $code = $this->bbcode_tpl('code_open') . $code = $this->bbcode_tpl('code_hidden') . $this->bbcode_tpl('code_close');

              return $code;
           }


Open file: language/it/viewtopic.php

search:

Code: Select all

));

?>


Add before:

Code: Select all

       'URL_HIDDEN'            => 'I link sono visibili solamente agli utenti registrati, per favore <a href=http://tuosito.org/ucp.php?mode=register>Registrati</a> o <a href=http://tuosito.org/ucp.php?mode=login>effettua il login</a> per visualizzare il link',
       'CODE_HIDDEN'            => 'I link sono visibili solamente agli utenti registrati, per favore <a href=http://tuosito.org/ucp.php?mode=register>Registrati</a> o <a href=http://tuosito.org/ucp.php?mode=login>effettua il login</a> per visualizzare il link',



Open: styles/prosilver/template/bbcode.html

search:

Code: Select all

<!-- BEGIN url --><a href="{URL}" class="postlink">{DESCRIPTION}</a><!-- END url -->


add after:

Code: Select all

    <!-- BEGIN url_hidden --><span style="background-color:#e1ebf2; border:#e1ebf2 solid 1px; color:#f90723;">&nbsp;{L_URL_HIDDEN}&nbsp;</span><!-- END url_hidden -->


search:

Code: Select all

        <!-- BEGIN code_open --><dl class="codebox"><dt>{L_CODE}: <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></dt><dd><code><!-- END code_open -->
        <!-- BEGIN code_close --></code></dd></dl><!-- END code_close -->


add after:

Code: Select all

<!-- BEGIN code_hidden --><span style="background-color:#e1ebf2; border:#e1ebf2 solid 1px; color:#f90723;">&nbsp;{L_CODE_HIDDEN}&nbsp;</span><!-- END code_hidden -->
Post Reply