News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Hide Tag Special

Started by enik, April 11, 2005, 03:41:07 PM

Previous topic - Next topic

Stirred

Thanks for the answer. =)

But it didn´t work for me, i just came from testing it and it didn´t work. I have SMF 1.1 RC2

And here is the package HideTagMod1.1rc2.mod code i use on my site:

<id>
din1031:HideTag
</id>

<version>
1.18 MUI
</version>
<edit file>
$sourcedir/ModSettings.php
</edit file>

<search for>
array('check', 'approveAccountDeletion'),
</search for>

<add after>
'',
array('check', 'hide_adminshouldsee'),
</add after>

<edit file>
$sourcedir/Display.php
</edit file>

<search for>
// Find the previous or next topic.  Make a fuss if there are no more.
</search for>

<add before>

// Find if there a post from you in this thread :) (For the hide tag)
if (($user_info['is_admin'] || $user_settings['ID_GROUP'] == '11' || $user_settings['ID_GROUP'] == '2' || $user_settings['ID_GROUP'] == '10') && !empty($modSettings['hide_adminshouldsee']))
$context['user_post_avaible'] = 1;
elseif (!$user_info['is_guest']) {
$request = db_query("
SELECT ID_MSG, ID_MEMBER
FROM {$db_prefix}messages
WHERE ID_TOPIC = $topic AND ID_MEMBER = $ID_MEMBER
LIMIT 1", __FILE__, __LINE__);

if (mysql_num_rows($request)) $context['user_post_avaible'] = 1;
else $context['user_post_avaible'] = 0;
mysql_free_result($request);
}
else $context['user_post_avaible'] = 0; //Anyway no way you should see it!
</add before>

<edit file>
$sourcedir/Post.php
</edit file>

<search for>
$form_message = preg_replace('~<br(?: /)?' . '>~i', "\n", $form_message);
</search for>

<add before>
            if (!isset($txt['hide_hiddentext'])) $txt['hide_hiddentext'] = '&nbsp;'; //A tiny little space =)
$form_message = preg_replace("~\[hide\](.+?)\[\/hide\]~i", $txt['hide_hiddentext'], $form_message);
$form_message = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), $txt['hide_hiddentext'], $form_message);
</add before>

<search for>
$row['body'] = preg_replace('~<br(?: /)?' . '>~i', "\n", $row['body']);
</search for>

<add after>
//Lets change the HideTag ;) this is a secret and should be a secret :)
if (!isset($txt['hide_hiddentext'])) $txt['hide_hiddentext'] = ' '; //A tiny little space =)
$row['body'] = preg_replace("/\[hide\](.+?)\[\/hide\]/i", $txt['hide_hiddentext'], $row['body']);
$row['body'] = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), $txt['hide_hiddentext'], $row['body']);
</add after>

<edit file>
$sourcedir/Search.php
</edit file>

<search for>
// Do the censor thang...
censorText($message['body']);
</search for>

<add after>
//Remove Hidden Text :x
$message['body'] = preg_replace("/\[hide\](.+?)\[\/hide\]/i", $txt['hide_hiddentext'], $message['body']);
$message['body'] = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), $txt['hide_hiddentext'], $message['body']);
</add after>

<edit file>
$sourcedir/Subs.php
</edit file>

<search for>
global $txt, $scripturl, $context, $modSettings, $user_info;
static $bbc_codes = array(), $itemcodes = array(), $no_autolink_tags = array();
static $disabled;
</search for>

<add after>

//Hide Mod.. i remove the code before i do anything...
if(empty($context['user_post_avaible']) || !isset($context['user_post_avaible'])) {
$message = preg_replace("/\[hide\](.+?)\[\/hide\]/i", (!empty($txt['hide_hiddentext']) ? $txt['hide_hiddentext'] : '&nbsp;'), $message);
$message = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), (!empty($txt['hide_hiddentext']) ? $txt['hide_hiddentext'] : '&nbsp;'), $message);
}
</add after>

<search for>
array(
'tag' => 'white',
'before' => '<span style="color: white;">',
'after' => '</span>',
),
</search for>

<add after>
array(
'tag' => 'hide',
'before' => '',
'after' => '<br><br><img src="http://www.hentai-portugal.com/Themes/default/images/bbc/hide_show.gif" border="0" alt="Conteúdo Disponível: Obrigado por ter respondido." title="Conteúdo Disponível: Obrigado por ter respondido."><br><br>',
),
</add after>

<edit file>
$languagedir/ModSettings.english.php
</edit file>

<search for>
?>
</search for>

<add before>
$txt['hide_adminshouldsee'] = 'Admin should see the hide without post?';
</add before>

<edit file>
$languagedir/ModSettings.portuguese.php
</edit file>

<search for>
?>
</search for>

<add before>
$txt['hide_adminshouldsee'] = 'O Admin pode ver o conteudo escondido?';
</add before>

<edit file>
$languagedir/index.english.php
</edit file>

<search for>
?>
</search for>

<add before>
$txt['hide_hiddentext'] = 'Some secrets are here!';
</add before>

<edit file>
$languagedir/index.portuguese.php
</edit file>

<search for>
?>
</search for>

<add before>
$txt['hide_hiddentext'] = '<br><br><img src="http://www.hentai-portugal.com/Themes/default/images/bbc/hide.gif" border="0" alt="Conteúdo Escondido: Precisa responder para ler o conteúdo." title="Conteúdo Escondido: Precisa responder para ler o conteúdo."><br><br>';
</add before>


I made some changes to show images instead of text. But i don´t see any mistake that can make those lines don´t work :/
- eighteen seconds before sunrise -

Vinspire

I've gotten this error in my forum error log.

8: Undefined index: hide_hiddentext
File: /home/korobox/public_html/forum/Sources/Search.php
Line: 1438

How to fix this ?  :o

minnik

Hi Everybody!

Admin's can see all hide posts. But i want to show post every member who have 50 message in forum.

How can I do it? Please help.

Giriş Ücretsiz, Kayıt Ücretsiz Buyrun...10 saniyede üyemizsiniz...
www.genismekan.com




minnik


Giriş Ücretsiz, Kayıt Ücretsiz Buyrun...10 saniyede üyemizsiniz...
www.genismekan.com




mforum

#264
Quote from: minnik on August 07, 2006, 11:04:54 AM
Hi Everybody!

Admins can see all hide posts. But i want to show post every member who have 50 message in forum.

How can I do it? Please help.

I think you need permsions on member groups allowing certain groups to see hiden content.
Maybe the creator of this mod can add this option.  8)

Or take a look at this post http://www.simplemachines.org/community/index.php?topic=32954.msg634866#msg634866

minnik

it didnt work?
I replaced;

// Find if there a post from you in this thread :) (For the hide tag)
   if ($user_info['is_admin'] && !empty($modSettings['hide_adminshouldsee']))
with;

// Find if there a post from you in this thread :) (For the hide tag)
   if (($user_info['is_admin'] || $user_settings['ID_GROUP'] == '11' || $user_info['is_mod'] || $user_settings['ID_GROUP'] == '3' || $user_settings['ID_GROUP'] == '2') && !empty($modSettings['hide_adminshouldsee']))


i writed the groups but it didnt worked.?

Giriş Ücretsiz, Kayıt Ücretsiz Buyrun...10 saniyede üyemizsiniz...
www.genismekan.com




mforum

#266
Quote from: minnik on August 08, 2006, 11:43:52 AM
it didn't work?
I replaced;

// Find if there a post from you in this thread :) (For the hide tag)
   if ($user_info['is_admin'] && !empty($modSettings['hide_adminshouldsee']))
with;

// Find if there a post from you in this thread :) (For the hide tag)
   if (($user_info['is_admin'] || $user_settings['ID_GROUP'] == '11' || $user_info['is_mod'] || $user_settings['ID_GROUP'] == '3' || $user_settings['ID_GROUP'] == '2') && !empty($modSettings['hide_adminshouldsee']))


i writed the groups but it didnt worked.?

ok, lets start again.
you want all your member groups  over 50 post to see the hidden content without replying.
first of all you must find out the IDs of those groups.
an easy way to do that is to go in admin panel , member group permissions  and click on the member group to change permissions, at your address bar you`ll see something like
/forum/index.php?action=permissions;sa=modify;group=2
the ID of this group is 2.
after you find all IDs you will change the code according to them.   $user_settings['ID_GROUP'] == '11'

minnik

I tried it but it didnt work.
Now I am trying another.
// Find if there a post from you in this thread Gülümseme (For the hide tag)
   if ($user_info['is_admin'] && !empty($modSettings['hide_adminshouldsee']))

  changed;

// Find if there a post from you in this thread :) (For the hide tag)
   if ($user_info['is_admin'] || $message['member']['posts'] > 50)

but it didnt worked again
How can ı do?


Giriş Ücretsiz, Kayıt Ücretsiz Buyrun...10 saniyede üyemizsiniz...
www.genismekan.com




ivo2296

#268
Hello,

How can I make the admin custom message to appear in red and bold over the hidden content?
And is there why the hidden text to be shown after user uses "Thank you" button only, on replay still not to be able to see the hidden content?
Thank you!



P.S. And one more thing:
Is it possible on replay the hidden text not be shown? - i need users to see the hidden text when they click on "Thank you" button only.

minnik

Quote from: minnik on August 09, 2006, 12:29:26 PM
I tried it but it didnt work.
Now I am trying another.
// Find if there a post from you in this thread Gülümseme (For the hide tag)
   if ($user_info['is_admin'] && !empty($modSettings['hide_adminshouldsee']))

  changed;

// Find if there a post from you in this thread :) (For the hide tag)
   if ($user_info['is_admin'] || $message['member']['posts'] > 50)

but it didnt worked again
How can ı do?



Did you know it?

Giriş Ücretsiz, Kayıt Ücretsiz Buyrun...10 saniyede üyemizsiniz...
www.genismekan.com




Assistance

1.1RC2

Enabled BBC tags: the list is now gone
~playing poker~

desistyle

OK it does work and anything but the code [\hide] is still visible do u know why i mean the links does get hide only thing is that code is visible

Loverboy

I downloaded the package.. But i don't know how to install it? Could anyone help?

GuilleGon

The text appears me blank.

Salu2

winrules

#274
ディン1031, this is a good mod but there is one small problem. In the parse_bbc function you add this:

    //Hide Mod.. i remove the code before i do anything...
    if(empty($context['user_post_avaible']) || !isset($context['user_post_avaible'])) {
        //Lets change the HideTag ;) this is a secret and should be a secret :)
        if (empty($modSettings['hide_hiddentext'])) $modSettings['hide_hiddentext'] = '&nbsp;'; //A tiny little space =)
        // The MUI Switch ;D
        if (!empty($modSettings['hide_MUIswitch'])) $modSettings['hide_hiddentext'] = &$txt['hide_hiddentext'];
        //Remove it ;D
        $message = preg_replace("/\[hide\](.+?)\[\/hide\]/i", $modSettings['hide_hiddentext'], $message);
        $message = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), $modSettings['hide_hiddentext'], $message);
    }

before anything else. In the BBC manager, it calls parse_bbc(false). The function will return an array of the codes if $message is false. But you're mod performs preg_replaces on $message before the function checks if $message is false. So $message will no longer be false and a list of BBC tags won't be returned. You can fix this by only performing you're code if $message isn't false, by replacing this (in Subs.php):

    if(empty($context['user_post_avaible']) || !isset($context['user_post_avaible'])) {

with this:

    if((empty($context['user_post_avaible']) || !isset($context['user_post_avaible'])) && $message !==false) {


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


desistyle

where do i add this

//Hide Mod.. i remove the code before i do anything...
    if(empty($context['user_post_avaible']) || !isset($context['user_post_avaible'])) {
        //Lets change the HideTag ;) this is a secret and should be a secret :)
        if (empty($modSettings['hide_hiddentext'])) $modSettings['hide_hiddentext'] = '&nbsp;'; //A tiny little space =)
        // The MUI Switch ;D
        if (!empty($modSettings['hide_MUIswitch'])) $modSettings['hide_hiddentext'] = &$txt['hide_hiddentext'];
        //Remove it ;D
        $message = preg_replace("/\[hide\](.+?)\[\/hide\]/i", $modSettings['hide_hiddentext'], $message);
        $message = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), $modSettings['hide_hiddentext'], $message);
    }

winrules

Quote from: desistyle on September 01, 2006, 05:29:08 PM
where do i add this

//Hide Mod.. i remove the code before i do anything...
    if(empty($context['user_post_avaible']) || !isset($context['user_post_avaible'])) {
        //Lets change the HideTag ;) this is a secret and should be a secret :)
        if (empty($modSettings['hide_hiddentext'])) $modSettings['hide_hiddentext'] = '&nbsp;'; //A tiny little space =)
        // The MUI Switch ;D
        if (!empty($modSettings['hide_MUIswitch'])) $modSettings['hide_hiddentext'] = &$txt['hide_hiddentext'];
        //Remove it ;D
        $message = preg_replace("/\[hide\](.+?)\[\/hide\]/i", $modSettings['hide_hiddentext'], $message);
        $message = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), $modSettings['hide_hiddentext'], $message);
    }
If you want to fix the bug right now, just find and replace the last 2 things in Subs.php.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


desistyle

i did it still shows that text

winrules

Quote from: desistyle on September 01, 2006, 10:00:08 PM
i did it still shows that text
Thats a completly unrelated problem from this.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


desistyle

can u tell me how can i fix that bug than ? cause when we reply to the post eveyrthing shows alrite but the bbc code is left too how to fix that ?

Advertisement: