[ABD] Easy Hide BBCode (Reply-to-see functionality)

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
ScarerSulley
Registered User
Posts: 10
Joined: Mon Oct 27, 2008 8:57 am

[ABD] Easy Hide BBCode (Reply-to-see functionality)

Post by ScarerSulley » Mon Oct 27, 2008 9:18 am

MOD Title: bbSpoiler, bbHide and Reply Required Add-on
MOD Description: This a Hide BBCode Suite that allows you to hide a portion of a forum post. The hidden message is revealed when the user clicks on a 'Show' button. Alternately, you can keep hiding it until they respond to the thread.
MOD Version: 0.9 Beta 1
Target Version: phpBB 3.0.0
Supported Languages: English only
Supported Styles: proSilver

Features:
  • [spoilder][/spoilder]: for text materials.
  • [hide][/hide]: for any materials.
  • Registered Required Add-on: must be a registered user to see. (unimplemented)
  • Reply Required Add-on: must post a reply to see.
  • Payment Required Add-on: must pay points to see. (unimplemented)
  • Membership Required Add-on: only viewable for the members of a particular group. (unimplemented)
[bbSpoiler]
<BBCode usage>
[Spoiler]{TEXT}[/Spoiler]
<HTML replacement>

Code: Select all

<div style="margin-top: 5px;">
<p style="margin: 0px; font-size: 0.8em;">
		<span style="font-weight: bold; text-transform: uppercase; color: #808000;"><!-- {L_BBSPOILER} -->Spoiler:</span>&nbsp;
		<a href="javascript: void(0);" onClick="spoilerToggle(this, '<!-- {L_BBSPOILER_CONCEAL} -->Conceal', '<!-- {L_BBSPOILER_REVEAL} -->Reveal', '<!-- {L_BBSPOILER_GLANCE} -->Mouseover for a glance');"><!-- {L_BBSPOILER_REVEAL} -->Reveal</a>&nbsp;
		<span style="color: #808080;"><!-- {L_BBSPOILER_GLANCE} -->Mouseover for a glance</span>
	</p>
	<div style="padding: 3px; border: 1px solid #d8d8d8; background-color: #FFFFFF; color: #FFFFFF;" onMouseOver="spoilerGlance(this, true);" onMouseOut="spoilerGlance(this, false);">{TEXT}</div>
</div>
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------


[bbHide]
<BBCode usage>
[Hide]{TEXT}[/Hide]
<HTML replacement>

Code: Select all

<div style="margin-top: 5px;">
	<p style="margin: 0px; font-size: 0.8em;">
		<span style="font-weight: bold; text-transform: uppercase; color: #808000;"><!-- {L_BBHIDE} -->Hidden Message:</span>&nbsp;
		<input type="button" value="Show" onclick="hideToggle(this, 'Show', 'Hide');" />
	</p>
	<div style="padding: 3px; border: 1px solid #cccccc; background-color: #F0F0F0; display: none;">{TEXT}</div>
</div>
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------


[bbHide Reply Required Add-on]
MOD Description: Make all of the contents wrapped by Hide bbcode become 'replying-to-see'.
Requiements: bbHide (scarersulley)

<open>
includes/bbcode.php
<find>

Code: Select all

						$bbcode_tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $bbcode_tpl);
<after-add>

Code: Select all

						//-- MOD BEGIN: Hide BBCode Reply Required Add-on --
						if ($bbcode_id == 22) // replace the id number with your own
						{
							global $hide_open, $hide_close;
							$needle = '${1}';
							$hide_open = substr($bbcode_tpl, 0, strpos($bbcode_tpl, $needle));
							$hide_close = substr($bbcode_tpl, strpos($bbcode_tpl, $needle) + strlen($needle));
							$this->bbcode_cache[$bbcode_id] = array
							(
								'preg' => array
									(
										'#\[hide:$uid\](.*?)\[/hide:$uid\]#ise'	=> "\$this->bbcode_second_pass_hide('\$1')",
									)	
							);
							return;
						}
						//-- MOD END: Hide BBCode Reply Required Add-on --
<find>

Code: Select all

}

?>
<before-add>

Code: Select all

	//-- MOD BEGIN: Hide BBCode Reply Required Add-on --
	function bbcode_second_pass_hide($message)
	{
		global $user, $db;
		global $hide_open, $hide_close;

		$open = $hide_open;
		$close = $hide_close;
		$allowDisplay = false;
		$topic_id	= request_var('t', 0);
		if ($user->data['user_id'] != ANONYMOUS)
		{
			$sql = "SELECT poster_id, topic_id 
				FROM " . POSTS_TABLE . " 
				WHERE topic_id = $topic_id 
				AND poster_id = " . $user->data['user_id']; 

			$result = $db->sql_query($sql);
			$allowDisplay = $db->sql_affectedrows($result) ? true : false;
			$db->sql_freeresult($result);
		}
	
		$message = str_replace('\"', '"', $message);
		if ($message == "\n")
		{
			$message = '';
		}
		if ($allowDisplay == false)
		{
			$message = "You need to reply in this topic to see the message.";
		}
		else
		{
		}
		$message = $open . $message . $close;

		return $message;
	}
	//-- MOD END: Hide BBCode Reply Required Add-on --
<open>
posting.php
<find>

Code: Select all

	$message_parser->message = &$post_data['post_text'];
<after-add>

Code: Select all

	//-- MOD BEGIN: Hide BBCode Reply Required Add-on --
	if ($mode == 'quote')
	{
		$uid = $post_data['bbcode_uid'];
		$messageParserHidden  = preg_replace("#\[hide:$uid\].*?\[/hide:$uid\]#ise", "", $message_parser->message);
		$message_parser->message = $messageParserHidden;
	}
	//-- MOD END: Hide BBCode Reply Required Add-on --
<end-of-mod>
Last edited by Sam on Fri Jun 18, 2010 10:17 pm, edited 1 time in total.
Reason: Marked mod as abandoned, if the original poster wishes to continue this, please PM any MOD team member to have it unlocked.

tomy91
Registered User
Posts: 41
Joined: Wed Apr 16, 2008 11:13 am

Re: [BETA] Easy Hide BBCode (Reply-to-see functionality)

Post by tomy91 » Thu May 21, 2009 7:05 pm

This is what I'm searching for, but when i click "Show button", nothing happens.

2ls2dance
Registered User
Posts: 35
Joined: Tue Mar 25, 2008 4:53 pm

Re: [BETA] Easy Hide BBCode (Reply-to-see functionality)

Post by 2ls2dance » Sun May 30, 2010 12:22 pm

ScarerSulley wrote:Reply Required Add-on: must post a reply to see.
Great! So this is the only functionality of this MOD so far, right?

What I want is to install only the "hide" (until reply) code and not the others "spoilder".

Please advise!

pororo
Registered User
Posts: 25
Joined: Tue Apr 20, 2010 3:04 pm

Re: [BETA] Easy Hide BBCode (Reply-to-see functionality)

Post by pororo » Mon May 31, 2010 1:47 am

1. If someone quotes the hidden part, will it disclose the contencts before the person clicks "Submit" button?

2. If someone used the search function, will the hidden part be disclosed in the the search results?

3. If someone used View Recent Topics or View Post by Author functions, will the hidden part be disclosed?

Just curious because these need to be looked into when making something hidden before someone replies mod.

2ls2dance
Registered User
Posts: 35
Joined: Tue Mar 25, 2008 4:53 pm

Re: [BETA] Easy Hide BBCode (Reply-to-see functionality)

Post by 2ls2dance » Wed Jun 02, 2010 1:29 pm

Tested that one and it's not working in 3.0.4 or 3.0.7 ~ looking forward to your updates!

Is this hide until reply BBcode so hard to make?

User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: [BETA] Easy Hide BBCode (Reply-to-see functionality)

Post by 4_seven » Wed Jun 02, 2010 1:52 pm

One technical Question about what is needed:

Should no user see the hidden content if he/she not response to the topic? (but logical the topic-starter)
So if any user have no response in this topic so any user don't see the hidden content?
Current Mods | Mod Base | php(BB) programming | No help via PM

twarrenh
Registered User
Posts: 10
Joined: Mon May 31, 2010 4:10 pm

Re: [BETA] Easy Hide BBCode (Reply-to-see functionality)

Post by twarrenh » Mon Jun 14, 2010 6:27 pm

Can somebody please answer these questions in the above posts? I really need this feature. There seems to be, virtually, only this modification and one other, which nobody responds to questions either.

We,ve tried everything. Manual modifying the root .phps, and trying to install this with automod doesn't work.

My PHPbb3 needs a 'must reply to see hidden links' feature. Please anybody?


I am so desperate that I am not afraid to give somebody access to our forum to install this :oops: .

pororo
Registered User
Posts: 25
Joined: Tue Apr 20, 2010 3:04 pm

Re: [BETA] Easy Hide BBCode (Reply-to-see functionality)

Post by pororo » Wed Jun 16, 2010 12:45 am

twarrenh wrote:Can somebody please answer these questions in the above posts? I really need this feature. There seems to be, virtually, only this modification and one other, which nobody responds to questions either.

We,ve tried everything. Manual modifying the root .phps, and trying to install this with automod doesn't work.

My PHPbb3 needs a 'must reply to see hidden links' feature. Please anybody?


I am so desperate that I am not afraid to give somebody access to our forum to install this :oops: .
As replied earlier (look above for my reply), reveal if replied thingy can only be achieved through modifying core phpbb files and NOT through some simple bbcoding stuffs.

I've had this feature on my invisionboard a few years back and to achieve this I had to tweak alot of core php files.

Just don't get your hopes high to achieve this through some simple bbcodes.

twarrenh
Registered User
Posts: 10
Joined: Mon May 31, 2010 4:10 pm

Re: [BETA] Easy Hide BBCode (Reply-to-see functionality)

Post by twarrenh » Fri Jun 18, 2010 2:51 pm

pororo wrote:
twarrenh wrote:Can somebody please answer these questions in the above posts? I really need this feature. There seems to be, virtually, only this modification and one other, which nobody responds to questions either.

We,ve tried everything. Manual modifying the root .phps, and trying to install this with automod doesn't work.

My PHPbb3 needs a 'must reply to see hidden links' feature. Please anybody?


I am so desperate that I am not afraid to give somebody access to our forum to install this :oops: .
As replied earlier (look above for my reply), reveal if replied thingy can only be achieved through modifying core phpbb files and NOT through some simple bbcoding stuffs.

I've had this feature on my invisionboard a few years back and to achieve this I had to tweak alot of core php files.

Just don't get your hopes high to achieve this through some simple bbcodes.
Yes thank you Pororo. We have made modifications to our core phpbb files. All the tweaks that you recommend above (to the letter/character). The feature shows that it is installed but it has no functionality.
Can we approach you with some more details? Off thread. We really need your help. ANYBODY

twarrenh
Registered User
Posts: 10
Joined: Mon May 31, 2010 4:10 pm

Re: [BETA] Easy Hide BBCode (Reply-to-see functionality)

Post by twarrenh » Fri Jun 18, 2010 2:55 pm

I'd like to add to my recent above reply: When we take the measures and steps and mofification to our core phpbb files, the spoiler feature does work. And well, I might add. But the Hidden Message feature just provides a non-functional 'SHOW' button in place of the hidden message (that is; clicking the 'SHOW' button' does nothing). Further help?

Locked

Return to “[3.0.x] Abandoned MODs”