Notice:
This tip has been in some way ported over to be a modification package located on the SMF modsite. Please note, the mod package may not do the exact same function and may not even use any of the code originally written for the tip, but should still hold the same basic functionality of the tip posted here. With the mod package for this tip, you can now let the SMF package manager make the code changes for you without you having to look at the code and edit it manually.
For documentation on using the SMF package manager, view this document (http://docs.simplemachines.org/index.php?board=49.0).
http://mods.simplemachines.org/index.php?mod=118
http://mods.simplemachines.org/index.php?mod=228
This is a "port" of Big P's [hide] mod from YaBB SE. Text inside the hide tag is not displayed to guests or users who have not replied to the topic. Admins are immune; they can see it no matter what :P
Open: Subs.php
Look for:
global $modSettings, $scripturl, $txt, $settings, $context;
Add after:
global $ID_MEMBER, $db_prefix, $user_info;
Look for:
// Moving text... [move]stuff[/move]
Add before:
// [hide]Guests cannot see this! Mwahaha![/hide]
$codefromcache[] = '~\[hide\](.+?)\[/hide\]~i';
if (isset($disabled['hide']) || $user_info['is_admin'])
$codetocache[] = '$1';
else
{
if (!empty($context['current_topic']) && !$user_info['is_guest'])
{
$request = mysql_query("
SELECT ID_MSG FROM {$db_prefix}messages
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $context[current_topic]
LIMIT 1");
if (mysql_num_rows($request))
$codetocache[] = '<b>$1</b>';
else
$codetocache[] = $txt['hide_tag_a'];
mysql_free_result($request);
}
else
$codetocache[] = $txt['hide_tag_b'];
}
Open: Themes/default/languages/Modifications.english.php (or whatever your modifications language file is)
Look for:
?>
Add before:
$txt['hide_tag_a'] = '<i>This message is hidden from users who have not posted in this topic. To get rid of this and see the actual message, you must reply to the topic.</i>';
$txt['hide_tag_b'] = '<i>This message is hidden from guests. To get rid of this and see the actual message, you must register or login, and then reply to the topic.</i>';
Enjoy :D
Coming soon for this mod:
optional BBC button
.mod format/package server
i have to say thx for all of us.
Edt: not working for me...
i placed the txt inside hide tag but text is readable by all... it look like
[hide]mytextinhidetaghere[/hide]
hmmm...dont know what to do
It can be readable by admins no matter what...
well. i tested with 2 basic account:
created post with test1 and log after with test 2 ...
test 2 see all text more the hide tag...
ah, i surely missed something ... but what ?
do i have to say the first line change is after:
global $modSettings, $scripturl, $txt, $settings, $context;
but my subs.php have only that:
global $modSettings, $scripturl, $txt;
so, i added $settings, $context; was wrong?
If you can see [hide]mytextinhidetaghere[/hide] that's mean the parser is not working .. please double check that you have done the exact steps.
What version of SMF are you using?
well, rc1 upgraded to rc2
work perfectly for me
can i uninstall parser mod and reinstall it ?
Oh; no wonder. Then just add the line after the one you found.
i had to desinstall fastparser code and now its working good...thx.
works very well
I have made a small mod package for RC2 out of it if anyone is interested
glad to hear its working :P
ill be releasing a .mod/package manager version soon too...
i waiting your bbc button and correction about QUOTE
thx kirby best work
doesn't work fer me :(
I got:
Parse error: parse error, unexpected T_STRING, expecting ')' in /home/srecka/public_html/forums/Sources/Subs.php on line 1882
Oh! Thank you.
I have need that the message within the code [hide] is not quotable...
where it is the code of the quotas ?
FaSan
doesnt work....all i got is the [hide]textishere[/hide]
also viewed as a guest and a normal member and its the same ::)
used on SMF 1.1..........
nevermind it works :D
For not quotable code ... open Post.php:
<search>
// Add a quote string on the front and end.
</search>
<add before>
$form_message = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), '', $form_message);
</add before>
;)
FaSan
For quote from quick reply, change this (in Post.php) :
<search>
// Add a quote string on the fron and end.
</search>
<add before>
$row['body'] = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), '', $row['body']);
</add before>
FaSan ;)
is possible add or show other imagen in Message Index ( icon )
You mean a button for it?
no, one imagen like (http://www.simplemachines.org/community/Themes/simple/images/topic/normal_post.gif) Different.
Separating normal post .VS. Post whit HIDE bbc code.
ah... i think i understand what your saying
shouldnt be TOO hard to do, but I'd rather make the image a user-choosable icon
Quote from: edi67 on December 04, 2004, 08:41:57 AM
i waiting your bbc button and correction about QUOTE
thx kirby best work
Me too, thanks Kirby...
hi, have problem:
8: Undefined variable: disabled
file: /home/#####/public_html/forum/Sources/Subs.php
line: 973
Line 971: // [hide]Guests cannot see this! Mwahaha![/hide]
Line 972: $codefromcache[] = '~\[hide\](.+?)\[/hide\]~i';
Line 973: if ($disabled['hide'] || $user_info['is_admin'])
Line 974: $codetocache[] = '$1';
some solution?
Quote from: FaSan on January 31, 2005, 12:04:38 PM
For quote from quick reply, change this (in Post.php) :
<search>
// Add a quote string on the fron and end.
</search>
<add before>
$row['body'] = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), '', $row['body']);
</add before>
FaSan ;)
This code does not work for quick reply.
change $disabled['hide'] to isset($disabled['hide'])
Quote from: Kirby on February 26, 2005, 11:57:52 PM
change $disabled['hide'] to isset($disabled['hide'])
My bad, Fasan didn't mention that there was a duplicate of this line near the end of the Post.php
// Add a quote string on the fron and end.Everything works like a charm now, great mod!
See the spaces before ;)
Quote from: Kirby on February 26, 2005, 11:57:52 PM
change $disabled['hide'] to isset($disabled['hide'])
Thanks Kirby
no problemo ;)
hey guys, terrific mod! However, even as guest im still able to view the code [hide]TEST[/hide], any ideas of why this may be? Im using smf 1.0.2. I assume it has sumthin with the parsing not working, but ive checked my steps 5 times.
My Boards: www.xenez.com
Quote from: Xtasy on March 07, 2005, 01:34:38 AM
hey guys, terrific mod! However, even as guest im still able to view the code [hide]TEST[/hide], any ideas of why this may be? Im using smf 1.0.2. I assume it has sumthin with the parsing not working, but ive checked my steps 5 times.
My Boards: www.xenez.com
that shouldn't be the case, guest can't see anything but the message on my board, and I'm running 1.0.2.
You want to sextuple check your code.
Quote from: anibal on February 26, 2005, 01:35:52 PM
hi, have problem:
8: Undefined variable: disabled
file: /home/#####/public_html/forum/Sources/Subs.php
line: 973
Line 971: // [hide]Guests cannot see this! Mwahaha![/hide]
Line 972: $codefromcache[] = '~\[hide\](.+?)\[/hide\]~i';
Line 973: if ($disabled['hide'] || $user_info['is_admin'])
Line 974: $codetocache[] = '$1';
some solution?
I have this same problems
Quote from: Kirby on February 26, 2005, 11:57:52 PM
change $disabled['hide'] to isset($disabled['hide'])
This does not work :( please help
There's a problem with mine aswell :-\
It just shows as blank .. No words ..
So if I went : [hide] TEXT [/hide]
it shows as:
What is the problem of this ?
thanks
Huuu i never saw this thread... (how can i oversee thatthread)
Somehow i made a [hide][/hide] mod (Without knowing about this thread).
http://mods.simplemachines.org/index.php?mod=118
I hope i'm allowed to make this advertising. :)
It works ;)
But can Google & Co see this hiden messages?
Quote from: olti on May 07, 2005, 11:18:52 AM
It works ;)
But can Google & Co see this hiden messages?
Only if they can magically log in ;D
what shoul i do i want this mod only works for guest only. They can't see the post but members yes?
Links for registered members only
Thanks!
I am looking for something similar.
I would like to have the same functionality except I dont want the users to have to reply, in order to see the content. Instead, the content should be automatically hidden from users who have not yet posted x amount of posts.
This would allow me to provide special rewards to my members who actually participate in discussions etc. But not promote just posting for the sake of viewing or accessing the material.
The tag could look like
[hide=22]Special goodie here for anyone with twenty to posts or more[/hide]
or
[hide=50]You've posted 50 or more posts, you deserve to access this bit...[/hide]
Quote from: Elijah Bliss on June 25, 2005, 11:30:45 PM
Is an Beta 3 update possible?
Beta 3 is a lot easier. If you can tell me:
- what parameters, if any, it takes and how they effect things.
- what code should be used before the content of the tag, and after the content.
- whether the content should be parsed by other tags.
For any tag, I can tell you how to add it. It's much easier than in 1.0.
-[Unknown]
Quote from: [Unknown] on June 25, 2005, 11:33:48 PM
Quote from: Elijah Bliss on June 25, 2005, 11:30:45 PM
Is an Beta 3 update possible?
Beta 3 is a lot easier. If you can tell me:
- what parameters, if any, it takes and how they effect things.
- what code should be used before the content of the tag, and after the content.
- whether the content should be parsed by other tags.
For any tag, I can tell you how to add it. It's much easier than in 1.0.
-[Unknown]
Well here's the original code...
http://www.simplemachines.org/community/index.php?topic=20652.msg165353#msg165353
I was poking around at it, but this block:
// [hide]Guests cannot see this! Mwahaha![/hide]
$codefromcache[] = '~\[hide\](.+?)\[/hide\]~i';
if ($disabled['hide'] || $user_info['is_admin'])
$codetocache[] = '$1';
else
{
if (!empty($context['current_topic']) && !$user_info['is_guest'])
{
$request = mysql_query("
SELECT ID_MSG FROM {$db_prefix}messages
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $context[current_topic]
LIMIT 1");
if (mysql_num_rows($request))
$codetocache[] = '<b>$1</b>';
else
$codetocache[] = $txt['hide_tag_a'];
mysql_free_result($request);
}
else
$codetocache[] = $txt['hide_tag_b'];
}
has me a bit stumped, I no longer see the "$codefromcache[] and $codetocache[]" variables.
Essentially, you put this:
if (!empty($context['current_topic']) && !$context['user']['is_guest'])
{
$request = db_query("
SELECT ID_MSG
FROM {$db_prefix}messages
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $context[current_topic]
LIMIT 1");
if (mysql_num_rows($request))
$hide_text = false;
else
$hide_text = $txt['hide_tag_a'];
mysql_free_result($request);
}
else
$hide_text = $txt['hide_tag_b'];
$cache_id = '';
Above this:
// Shall we take the time to cache this?
Use this for the tag:
array(
'tag' => 'hide',
'validate' => '
if ($hide_text !== false)
$data = $hide_text;'
'before' => '<b>',
'after' => '</b>',
),
-[Unknown]
Can't get it to hide. The hidden DIVs don't render to hide the content, just the bold tags.
Actually, that won't work exactly as described. It would require a few more modifications, unfortunately.
-[Unknown]
Quote from: [Unknown] on June 26, 2005, 01:20:05 AM
Actually, that won't work exactly as described. It would require a few more modifications, unfortunately.
-[Unknown]
oh, ok, but thanks for putting us on the right track.
wow this works great. thank you very very much. now to find out how to use an image ;D
Quote from: FaSan on January 31, 2005, 12:04:38 PM
For quote from quick reply, change this (in Post.php) :
<search>
// Add a quote string on the fron and end.
</search>
<add before>
$row['body'] = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), '', $row['body']);
</add before>
FaSan ;)
i'm sorry i'm really new at this...where do i add this in post? and i did not do it correct it still shows so i go back to original post i had. thank you.
When will this mod support SMF 1.1 Beta 3 Public???
SMF 1.1 Beta 3 Public uses a completely different BBcode parsing engine. I have very limited time so I can't say I can work on it now (to be honest I haven't worked much with the new engine) :(
Quote from: ??? on July 25, 2005, 07:24:21 PM
SMF 1.1 Beta 3 Public uses a completely different BBcode parsing engine. I have very limited time so I can't say I can work on it now (to be honest I haven't worked much with the new engine) :(
I took a stab at it but couldn't get it to work.
doesn't work for 1.1 beta
Quote from: abdelyou on August 08, 2005, 05:00:43 PM
doesn't work for 1.1 beta
I wish I had time to tinker with this, or get some help on it, I really liked this mod, but I can't get it to work with the new BBC engine, it's probably something simple I am missing.
ok thinks for ur help
but how can i change the new parser engine by the old one if it's possible...
and thinks twice ;D
waaah this is the best!! thank you so much kirby and fasan! oooh i have one question? is there a way to add [hide] as a button? i know there's a hide mod that i could install that would do it but i'm afraid it would change the current image that i have on it. :(
I have this working in 1.1 Beta 3:
Find
$codes = array(
add after
array(
'tag' => 'hide',
'type' => 'unparsed_content',
'content' => '<b>$1</b>',
'validate' => 'if ($hide_text !== false)
$data = $hide_text;',
),
Find
// Shall we take the time to cache this?
add before
// [hide]Guests cannot see this! Mwahaha![/hide]
global $ID_MEMBER, $db_prefix, $user_info;
if (!empty($context['current_topic']) && !$user_info['is_guest'])
{
$request = mysql_query("
SELECT ID_MSG FROM {$db_prefix}messages
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $context[current_topic]
LIMIT 1");
if (mysql_num_rows($request))
$hide_text = false;
else
$hide_text = $txt['hide_tag_a'];
mysql_free_result($request);
}
else
$hide_text = $txt['hide_tag_b'];
$cache_id = '';
For SMF 1.1 RC 1 only
Find in Sources/Subs.php
$codes = array(
add after
array(
'tag' => 'hide',
'type' => 'unparsed_content',
'content' => '<b>$1</b>',
'validate' => create_function('&$tag, &$data, $disabled', '
global $context, $ID_MEMBER, $db_prefix, $user_info, $txt;
if (!empty($context[\'current_topic\']) && !$user_info[\'is_guest\'])
{
$request = mysql_query("
SELECT ID_MSG FROM {$db_prefix}messages
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $context[current_topic]
LIMIT 1");
if (mysql_num_rows($request))
$data;
else
$data = $txt[\'hide_tag_a\'];
mysql_free_result($request);
}
elseif ($user_info[\'is_guest\'])
{
$data = $txt[\'hide_tag_b\'];
}
$cache_id = "";
'),
),
Don't forget to apply Fasan's mods as well:
http://www.simplemachines.org/community/index.php?topic=20652.msg204774#msg204774
http://www.simplemachines.org/community/index.php?topic=20652.msg205896#msg205896
Big Ups!
Don't forget modifications.template.php :P
Open: Themes/default/languages/Modifications.english.php (or whatever your modifications language file is)
Look for:
?>
Add before:
$txt['hide_tag_a'] = '<i>This message is hidden from users who have not posted in this topic. To get rid of this and see the actual message, you must reply to the topic.</i>';
$txt['hide_tag_b'] = '<i>This message is hidden from guests. To get rid of this and see the actual message, you must register or login, and then reply to the topic.</i>';
;D
Quote from: Elijah Bliss on September 25, 2005, 05:51:07 AM
For SMF 1.1 RC 1 only
Find in Sources/Subs.php
$codes = array(
add after
array(
'tag' => 'hide',
'type' => 'unparsed_content',
'content' => '<b>$1</b>',
'validate' => create_function('&$tag, &$data, $disabled', '
global $context, $ID_MEMBER, $db_prefix, $user_info, $txt;
if (!empty($context[\'current_topic\']) && !$user_info[\'is_guest\'])
{
$request = mysql_query("
SELECT ID_MSG FROM {$db_prefix}messages
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $context[current_topic]
LIMIT 1");
if (mysql_num_rows($request))
$data;
else
$data = $txt[\'hide_tag_a\'];
mysql_free_result($request);
}
elseif ($user_info[\'is_guest\'])
{
$data = $txt[\'hide_tag_b\'];
}
$cache_id = "";
'),
),
this part of the code:
if (mysql_num_rows($request))
$data;
Data is the actual stuff behind[hide] right?
So can you edit it so it says something like:
if (mysql_num_rows($request))
[color=red]Hidden Text:[/color] '.$data.';
Is that possible?
Quote from: Snickers on September 26, 2005, 11:07:45 AM
Don't forget modifications.template.php :P
Open: Themes/default/languages/Modifications.english.php (or whatever your modifications language file is)
Look for:
?>
Add before:
$txt['hide_tag_a'] = '<i>This message is hidden from users who have not posted in this topic. To get rid of this and see the actual message, you must reply to the topic.</i>';
$txt['hide_tag_b'] = '<i>This message is hidden from guests. To get rid of this and see the actual message, you must register or login, and then reply to the topic.</i>';
;D
I thought that went without saying.
Quote from: Snickers on September 26, 2005, 11:38:45 AM
Quote from: Elijah Bliss on September 25, 2005, 05:51:07 AM
For SMF 1.1 RC 1 only
Find in Sources/Subs.php
$codes = array(
add after
array(
'tag' => 'hide',
'type' => 'unparsed_content',
'content' => '<b>$1</b>',
'validate' => create_function('&$tag, &$data, $disabled', '
global $context, $ID_MEMBER, $db_prefix, $user_info, $txt;
if (!empty($context[\'current_topic\']) && !$user_info[\'is_guest\'])
{
$request = mysql_query("
SELECT ID_MSG FROM {$db_prefix}messages
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $context[current_topic]
LIMIT 1");
if (mysql_num_rows($request))
$data;
else
$data = $txt[\'hide_tag_a\'];
mysql_free_result($request);
}
elseif ($user_info[\'is_guest\'])
{
$data = $txt[\'hide_tag_b\'];
}
$cache_id = "";
'),
),
this part of the code:
if (mysql_num_rows($request))
$data;
Data is the actual stuff behind[hide] right?
So can you edit it so it says something like:
if (mysql_num_rows($request))
[color=red]Hidden Text:[/color] '.$data.';
Is that possible?
You would change this line instead:
'content' => '<b>$1</b>',
to
'content' => '<span style="color: red;">Hidden text:</span> <b>$1</b>',
(Doesn't feel stupid at all) :P
(Thanks ;D )
if you want only admins and mods to see hidden text without replying:
For SMF 1.1 RC 1 only
Find in Sources/Subs.php
$codes = array(
add after
array(
'tag' => 'hide',
'type' => 'unparsed_content',
'content' => '<b>$1</b>',
'validate' => create_function('&$tag, &$data, $disabled', '
global $context, $ID_MEMBER, $db_prefix, $user_info, $txt;
if (!empty($context[\'current_topic\']) && !$user_info[\'is_guest\'])
{
$request = mysql_query("
SELECT ID_MSG FROM {$db_prefix}messages
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $context[current_topic]
LIMIT 1");
if (mysql_num_rows($request) || allowedTo(\'moderate_forum\'))
$data;
else
$data = $txt[\'hide_tag_a\'];
mysql_free_result($request);
}
elseif ($user_info[\'is_guest\'])
{
$data = $txt[\'hide_tag_b\'];
}
$cache_id = "";
'),
),
note that the only drawback to this is that to admins and mods, the content between the hidden tags will display as unparsed.
Elijah thanx all work good but one little problem, i DISABLE function Admin -> Posts and Topics -> Bulletin Board Code
Un-check the box next to "Automatically link posted URLs"
if this function is DISABLE all work good
all words inside HIDE TAG appear so:
Reg Info [img]http://img26.echo.cx/img26/7083/cura1dg.gif[/img]
Email: [b][email protected][/ b]
Password: [b]Forumzone[/b]
License Key: [b]8ZGD7HX7-9TXR87WY-4BACYB6G-3J7F6DYM[/b]
Credit Card: [b]8345[/b]
with TAG BBC all bold and not functionaly
some solution for solve?
Quote from: edi67 on October 04, 2005, 01:50:35 AM
Elijah thanx all work good but one little problem, i DISABLE function Admin -> Posts and Topics -> Bulletin Board Code
Un-check the box next to "Automatically link posted URLs"
if this function is DISABLE all work good
all words inside HIDE TAG appear so:
Reg Info [img]http://img26.echo.cx/img26/7083/cura1dg.gif[/img]
Email: [b][email protected][/ b]
Password: [b]Forumzone[/b]
License Key: [b]8ZGD7HX7-9TXR87WY-4BACYB6G-3J7F6DYM[/b]
Credit Card: [b]8345[/b]
with TAG BBC all bold and not functionaly
some solution for solve?
As I stated before, the content between the hide tag is unparsed. Following [Unknown]'s comments on how to make BBC tags with the new BBC engine in place, this is the only combination I could get to work:
array(
'tag' => 'hide',
'type' => 'unparsed_content',
'content' => '<b>$1</b>',
'validate' => 'if ($hide_text !== false)...
),
omit "type" or change "type" to anything but "unparsed" then the hidden content will become visible regardless of validation.
If there is a solution it is currently beyond the scope of my PHP knowledge.
i tryed you code:
array(
'tag' => 'hide',
'type' => 'unparsed_content',
'content' => '<b>$1</b>',
'validate' => 'if ($hide_text !== false)...
),
but pity the results is the same... :-[ if i omit TYPE TAG HIDE have not effect, as you told me.
i hope somebody find one solution
Quote from: FaSan on January 29, 2005, 01:05:00 PM
For not quotable code ... open Post.php:
<search>
// Add a quote string on the front and end.
</search>
<add before>
$form_message = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), '', $form_message);
</add before>
;)
FaSan
[/quote]
[quote author=FaSan link=topic=20652.msg205896#msg205896 date=1107191078]
For quote from quick reply, change this (in Post.php) :
[code]
<search>
// Add a quote string on the fron and end.
</search>
<add before>
$row['body'] = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), '', $row['body']);
</add before>
FaSan ;)
These seems to be causing a line screw up when pressing preview in the "post panel"..
HeLP![/code]
OK I know there was a code to help me in the above posts, but I didn't quite get it.
I'm looking for a way to show images after replying?
Is there any news on how to show images in reply?
Also also the URLs posted in the hide do not link.
I also have another question, can I somehow make it so the 'you have to reply' text is an image? I have tried adding (http://link) to the modification.english.php file but that did not help
Tip work good but one bug, looking List of recent Topics, i can see the content of post with TAG HIDE without asnwer to post.
some solution ?
Quote from: edi67 on October 21, 2005, 01:14:28 PM
Tip work good but one bug, looking List of recent Topics, i can see the content of post with TAG HIDE without asnwer to post.
some solution ?
Hehe i've updated today my small mod version :X and this problem don't come there :).
Use it on your own risk *runs* (http://mods.simplemachines.org/index.php?mod=118)
Bye
DIN1031
The mod is exactly what I need since there isn't a download mod. But I'm wondering what I must edit to make members see the hidden text without having to post in the topic. Anyone can help me out?
Is there any one here at aall that can help me with my problem?
Quote from: edi67 on October 04, 2005, 01:50:35 AM
Elijah thanx all work good but one little problem, i DISABLE function Admin -> Posts and Topics -> Bulletin Board Code
Un-check the box next to "Automatically link posted URLs"
if this function is DISABLE all work good
all words inside HIDE TAG appear so:
Reg Info [img]http://img26.echo.cx/img26/7083/cura1dg.gif[/img]
Email: [b][email protected][/ b]
Password: [b]Forumzone[/b]
License Key: [b]8ZGD7HX7-9TXR87WY-4BACYB6G-3J7F6DYM[/b]
Credit Card: [b]8345[/b]
with TAG BBC all bold and not functionaly
some solution for solve?
Try this:
array(
'tag' => 'hide',
'type' => 'unparsed_content',
'content' => '<b>$1</b>',
'validate' => create_function('&$tag, &$data, $disabled', '
global $context, $ID_MEMBER, $db_prefix, $user_info, $txt;
if (!empty($context[\'current_topic\']) && !$user_info[\'is_guest\'])
{
$request = mysql_query("
SELECT ID_MSG FROM {$db_prefix}messages
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $context[current_topic]
LIMIT 1");
if (mysql_num_rows($request) || allowedTo(\'moderate_forum\'))
$data = doUBBC($data);
else
$data = $txt[\'hide_tag_a\'];
mysql_free_result($request);
}
elseif ($user_info[\'is_guest\'])
{
$data = $txt[\'hide_tag_b\'];
}
$cache_id = "";
'),
),
Quote from: edi67 on October 21, 2005, 01:14:28 PM
Tip work good but one bug, looking List of recent Topics, i can see the content of post with TAG HIDE without asnwer to post.
some solution ?
$row['body'] = parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']);
if ($context['user']['is_guest'])
{
$row['body'] = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), $txt['hide_tag_b'], $row['body']);
}
else
{
$row['body'] = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), $txt['hide_tag_a'], $row['body']);
}
^ yes you should be able to but that is because you are admin. other users will see [HIDE] or your image for [HIDE] hope this helps
Quote from: diane_tt on December 07, 2005, 02:18:37 PM
^ yes you should be able to but that is because you are admin. other users will see [HIDE] or your image for [HIDE] hope this helps
I don't quite follow, are you saying the code doesn't work? It works when I tested it with regular users and guests.
Quote from: src on December 30, 2004, 09:53:01 AM
doesn't work fer me :(
I got:
Parse error: parse error, unexpected T_STRING, expecting ')' in /home/srecka/public_html/forums/Sources/Subs.php on line 1882
Also running with parse erros in smf 1.1 rc1
Quote from: Elijah Bliss on December 07, 2005, 10:12:13 PM
Quote from: diane_tt on December 07, 2005, 02:18:37 PM
^ yes you should be able to but that is because you are admin. other users will see [HIDE] or your image for [HIDE] hope this helps
I don't quite follow, are you saying the code doesn't work? It works when I tested it with regular users and guests.
the code works but for guests and for regular members or any moderators it will not show the hidden content in your recent topics. if you are the person that has already replied, or person that has started the topic, or have admin status and you're viewing recent topics - it will show the hidden content. hope my english is clear ???
This code Works in RC2? :P
Quote from: Unnamed~ on January 11, 2006, 08:41:44 PM
This code Works in RC2? :P
Try the attached package
RC2 Only!
I installed that, but get no option in admin and everyone can see it :(
Hm, I need to look into an updated version of this sometime.
Quote from: The Outsider on January 12, 2006, 12:31:15 PM
I installed that, but get no option in admin and everyone can see it :(
Sorry about that, I forgot 2 language strings. Download the package again and reinstall.
Where i change the permision of the HIDE tag?
When a user use this tag appear a mesege whit this "You do not have permission to hide text" or similar.
Quote from: Unnamed~ on January 12, 2006, 10:34:13 PM
Where i change the permision of the HIDE tag?
In the permissions area, but you'll probably have to uninstall and reinstall the latest mod because I forgot the language strings for the persmissions.
Quote
When a user use this tag appear a mesege whit this "You do not have permission to hide text" or similar.
"You do not have permission to hide text."
Works perfectly, thanks.
Thanks for the code, works fine at first attempt. [for me] This is great for leechers, although there comes spammers. Is there a code where it forces members to post more than one liners. XD
http://mods.simplemachines.org/index.php?mod=290
Am I right in thinking this works like [hide]Text[/hide]? If so, it doesn't work (RC2) :(
I like the new hide feature, although I have a problem. Members are still allowed to download without posting. They can easily quote the
hide message and it will show up like "[hide]link here[/hide]" and they can get away without posting.
Example:
QuoteMusic Video
[hide]Download (http://www.yousendit.com/download)[/hide]
Is there a function where I can disable quoting in one section, or how cand I fix this?
Thanks!
That fix is on the 2nd or 3rd page of this thread
Quote from: Elijah Bliss on January 11, 2006, 09:57:17 PM
Try the attached package RC2 Only!
This mod doesn't work for me, I keep getting text in bold between hide tags
I tried 3 times to apply it, is there any pre-requisite ?
That's what the hack does, hide the text then makes it show bold upon reply
But when I disconnect, I can still see the text in bold, it is not hidden :'( :'( :'(
So, i need to edit the files like post #1 instruction ? No mod available for this yet right or i've missed it ? :o :o :o
There are 3 mods made
http://mods.simplemachines.org/?action=search;basic_search=hide
Quote from: L.G.S on May 20, 2006, 06:54:21 AM
There are 3 mods made
http://mods.simplemachines.org/?action=search;basic_search=hide
So, which do you recommend ?
Tried
Hide Post but its not working. Dont know why but didn't bother checking it.
Tried
Hide Tag Special but i wanted to have a working BBC button for it.
Tried
Hide Tag but there is an error when installing it.
1. Execute Modification ./Sources/Subs.php Test failed
Well on my SMF 1.1RC2 forum the HIDE POST mod worked great.
Maybe it didn't work because you did it wrong.
You do not use hide tags, instead you click additional options and then choose your hide from there
Hi
Im using smf1.1rc2........
Tried Hide Post but its not working. Dont know why but didn't bother checking it.
Tried Hide Tag Special but i wanted to have a working BBC button for it.
Tried Hide Tag but there is an error when installing it.
1. Execute Modification ./Sources/Subs.php Test failed
Any suggestion.....
i read a the posts here, but there is no solution for my problem.
i get this error every time a user want to view the (hidden) post:
Notice: Undefined index: hide_tag_b in /www/.../.../celebrana/forum/Sources/Subs.php on line 1047
im using 1.0.8 and this is the code in the subs.php
// [hide]Guests cannot see this! Mwahaha![/hide]
$codefromcache[] = '~\[hide\](.+?)\[/hide\]~i';
if (isset($disabled['hide']) || $user_info['is_admin'])
$codetocache[] = '$1';
else
{
if (!empty($context['current_topic']) && !$user_info['is_guest'])
{
$request = mysql_query("
SELECT ID_MSG FROM {$db_prefix}messages
WHERE ID_MEMBER = $ID_MEMBER
AND ID_TOPIC = $context[current_topic]
LIMIT 1");
if (mysql_num_rows($request))
$codetocache[] = '<b>$1</b>';
else
$codetocache[] = $txt['hide_tag_a'];
mysql_free_result($request);
}
else
$codetocache[] = $txt['hide_tag_b'];
}
what can i do?
hide tag bbc mod done for my:
http://custom.simplemachines.org/mods/index.php?mod=704
regards ;)
smf 1.1.2 with dilber mc theme mod and many mod installed.
Hide tag work great! :)
But i think there's some weak point in this mod.
That's i install mouse over...to preview message at the topic (something like that, i can't remember mod name)
When i do this it's show every message that hide but in short message. ( i log in as regular member not admin)
No one mention this before.
Ok.. have a question..
I have installed HIDE mod.. by Leaf..
but have no clue how to use it.. it is not working as [hide] ... [/hide]
how to have HIDE POST working..
so I can have guest either reply or register to reply and see the post..?
what the heck does the hide mod have to do with the visual warning mod?
Please post mod questions in the thread dedicated to that mod.
Quote from: desimatrix on April 18, 2007, 06:00:14 PM
Ok.. have a question..
I have installed HIDE mod.. by Leaf..
but have no clue how to use it.. it is not working as [hide] ... [/hide]
how to have HIDE POST working..
so I can have guest either reply or register to reply and see the post..?
It work with options of the post, there you can set what kind of hiding you use for the complete post. For bbc [hide] you must use the hide tag special.
Bye
DIN1031
Any chance for SMF 2 RC2.0?
Quote from: Vyache on February 01, 2010, 01:26:11 AM
Any chance for SMF 2 RC2.0?
Look at the first post... there are descriptions to the modifications which do this kind of things...
No hide do not wirks.
Quote from: grigori on June 29, 2010, 11:54:53 AM
No hide do not wirks.
And what should tell us this?
thank you ^_^