Jump to content

(DB30) Hide CODE Content


Spanner

Recommended Posts

File Name: (DB30) Hide CODE Content

File Submitter: Spanner

File Submitted: 15 Feb 2010

File Category: Performance

Supported Versions: IP.Board 3.1.x



Author: Spanner (IPSBeyond.pl)

Modyfikacja umożliwia ukrywanie zawartości tagu CODE przed wybranymi grupami.

Modification enables hiding the CODE tag content in selected groups.



here to download this file

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
  • 3 weeks later...

a question, the modification of topics.php...

I add the code in this way... is correctly?


		/*  AGREGADO PARA ESCONDER CODE  */


        if($this->settings['hcc_enable'])

        {

            $groups = explode(',', $this->settings['hcc_groups']);


            foreach($post_data as $k => $postData)

            {

                foreach($postData as $key => $post)

                {

                    if(in_array($this->memberData['member_group_id'], $groups))

                    {

                        $post_data[$k][$key]['post'] = preg_replace('#<pre class=\'prettyprint\'>(.*?)</pre>#', '<pre class="prettyprint">'.$this->settings['hcc_text'].'</pre>',  $post['post']);

                    }

                }

            }

        }



		//-----------------------------------------

		// Fix post order if linear+ and ordering

		// posts DESC (rare, I know): 16221

		//-----------------------------------------


		if( $this->topic_view_mode == 'linearplus' AND $this->settings['post_order_sort'] == 'desc' )

		{

			$newPosts	= array();


			foreach( $post_data as $pid => $data )

			{

				if( $pid == $this->topic['topic_firstpost'] )

				{

					array_unshift( $newPosts, $data );

				}

				else

				{

					$newPosts[] = $data;

				}

			}

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Hi,

I am new to IPB and hence know almost nothing about the various structures.

I have downloaded this mod. The attached file says, "Included with these instructions is a folder called upload. Upload the contents of this folder to your forums corresponding folders."

I could not understand what is meant by "forums corresponding folders" and where I can find them. My forum is hosted by IPB itself.

Looking eagerly for your help.

Thanks in advance,
Traveller

Link to comment
Share on other sites

  • 4 weeks later...
  • 6 months later...

Does not work with the following contents:


[*code]first row


second row[*/code*]



but works well:


[*code]blablabla[*/code*]



Only works if you have a line, but if you have more than one line does not work.




Find:

$post_data[$k][$key]['post'] = preg_replace('#<pre class=\'prettyprint\'>(.*?)</pre>#', '<pre class="prettyprint">'.$this->settings['hcc_text'].'</pre>',  $post['post']);

Replace with:

$post_data[$k][$key]['post'] = preg_replace('#<pre class=\'prettyprint\'>(?:[^\]]+?)</pre>#', '<pre class="prettyprint">'.$this->settings['hcc_text'].'</pre>',  $post['post']);

Link to comment
Share on other sites

i installed this mod and it's not working for me. When i use the hide hack, it doesn't hide the content but only shows the code like this:

[hide_me] [/hide_me] or [hide][/hide]



The members and I can still see the content even though i use the hide hack to hide it. Instead of the content being hidden, it shows the code instead. I put an image instead of text and my image isn't showing up either.

Can you please help me fix this? Thank You

Link to comment
Share on other sites

  • 1 month later...

i installed this mod and it's not working for me. When i use the hide hack, it doesn't hide the content but only shows the code like this:



[hide_me] [/hide_me] or [hide][/hide]

The members and I can still see the content even though i use the hide hack to hide it. Instead of the content being hidden, it shows the code instead. I put an image instead of text and my image isn't showing up either. Can you please help me fix this? Thank You

even I need to work it out the solution is we need to create BBC code alias for code ... hide will be alias of code code... Hope some one can add how to do i

Find:

$post_data[$k][$key]['post'] = preg_replace('#<pre class=\'prettyprint\'>(.*?)</pre>#', '<pre class="prettyprint">'.$this->settings['hcc_text'].'</pre>',  $post['post']);

Replace with:

$post_data[$k][$key]['post'] = preg_replace('#<pre class=\'prettyprint\'>(?:[^\]]+?)</pre>#', '<pre class="prettyprint">'.$this->settings['hcc_text'].'</pre>',  $post['post']);




please can u tell where to find this?
Link to comment
Share on other sites

  • 11 months later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...