[RC] Hide BBcode

Any abandoned Extensions will be moved to this forum.

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

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
tofino
Registered User
Posts: 55
Joined: Fri Nov 06, 2015 1:55 pm

Re: [RC] Hide BBcode

Post by tofino »

Edited as was not working correctly.

Sorry
tripflex
Registered User
Posts: 8
Joined: Tue May 04, 2010 8:14 pm

Re: [RC] Hide BBcode

Post by tripflex »

It would be great if there was an option to hide for anonymous users ... something that says you have to be logged in to view this content :)
User avatar
salvocortesiano
Registered User
Posts: 190
Joined: Mon Mar 22, 2010 1:49 pm
Location: Florence (Italy)
Name: Salvo Cortesiano
Contact:

Re: [RC] Hide BBcode

Post by salvocortesiano »

Hi marcovo,
first thanks for this ext, it is really useful on my forum :D I would like to integrate this ext with this [DEV] Thanks for posts!
I made a change to "listener.php" file of your ext. Basically if the user replies to the topic, or would like to thanks for the topic, the topic will be visible. But don't work :(
Maybe I have to make some other changes? Enclose a piece of code to file "listener.php":


Ok, I solved ;)
If anyone can optimize the code are welcome!
OPEN:
/includes/constants.php
Find:

Code: Select all

// Additional tables
Add. after

Code: Select all

define('THANKS_TABLE',				$table_prefix . 'thanks');
Note: This because if I add:

Code: Select all

/** @var string table_prefix */
protected $table_prefix;

/** @var string THANKS_TABLE */
protected $thanks_table;
returns an error MySQL syntax!!

OPEN:
ext/marcovo/hideBBcode/event/listener.php
Find:

Code: Select all

private function check_user_posted_by_topicId($topic_id)
	{
		$b_hide = true;
		global $auth;
		
		$sql = "SELECT forum_id 
				FROM " . TOPICS_TABLE . "
				WHERE topic_id = ".$topic_id." "; 
		$result = $this->db->sql_query($sql);
		$forum_id = $this->db->sql_fetchrow($result);
		$forum_id = $forum_id['forum_id'];
		$this->db->sql_freeresult($result);
		
		if ($auth->acl_get('m_', $forum_id))
		{
			// If moderator or admin, skip reply check, auto unhide
			$b_hide = false;
		}
		else if ($this->user->data['user_id'] != ANONYMOUS)
		{
			// Check if the topic viewer has posted in the topic
			$sql = "SELECT poster_id, topic_id 
				FROM " . POSTS_TABLE . "
				WHERE topic_id = $topic_id 
				AND poster_id = " . $this->user->data['user_id']; 

			$result = $this->db->sql_query($sql);
			$b_hide = $this->db->sql_affectedrows($result) ? false : true;
			$this->db->sql_freeresult($result);
		}
		
		$this->b_hide = $b_hide;
		
		$this->template->assign_var('S_HIDE_DOHIDE', $b_hide);
	}
Replace with:

Code: Select all

private function check_user_posted_by_topicId($topic_id)
	{
		$b_hide = true;
		global $auth;
		
		$sql = "SELECT forum_id 
				FROM " . TOPICS_TABLE . "
				WHERE topic_id = ".$topic_id." "; 
		$result = $this->db->sql_query($sql);
		$forum_id = $this->db->sql_fetchrow($result);
		$forum_id = $forum_id['forum_id'];
		$this->db->sql_freeresult($result);
		
		// If moderator or admin, skip reply check, auto unhide
		if ($auth->acl_get('m_', $forum_id))
		{
			$b_hide = false;
		}
		else
		{
		// Check if the topic viewer has said thanks in that topic
		$sql = "SELECT topic_id, user_id
			FROM " . THANKS_TABLE. "
			WHERE topic_id = $topic_id
			AND user_id = " . $this->user->data['user_id'];
		$result = $this->db->sql_query($sql);
		$b_hide = (int) $this->db->sql_affectedrows($result) ? false : true;
		$this->db->sql_freeresult($result);
		
      // Check if the topic viewer has posted in that topic
      if ($b_hide == true) 
      {
        $sql = "SELECT poster_id, topic_id 
				FROM " . POSTS_TABLE . "
				WHERE topic_id = $topic_id 
				AND poster_id = " . $this->user->data['user_id']; 
		$result = $this->db->sql_query($sql);
		$b_hide = $this->db->sql_affectedrows($result) ? false : true;
		$this->db->sql_freeresult($result);
       }
   }
		
		$this->b_hide = $b_hide;
		
		$this->template->assign_var('S_HIDE_DOHIDE', $b_hide);
	}
OPEN:
ext/marcovo/hideBBcode/language/eng/hide_bbcode.php
Find:

Code: Select all

'HIDEBB_MESSAGE_HIDDEN_DESCRIPTION'	=>	'You need to reply to this topic before you can view the hidden message',
Replace with:

Code: Select all

'HIDEBB_MESSAGE_HIDDEN_DESCRIPTION'	=>	'You need to reply or thank to this topic before you can view the hidden message',
Save all and upload. Then refresh the cache! Tested on 3.1.9

Best Regards

Salvo
The best way to predict the future is to invent it!
Image
User avatar
eunaumtenhoid
Registered User
Posts: 1007
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [RC] Hide BBcode

Post by eunaumtenhoid »

I downloaded now and the addon with etx tks is already included ? OR q do the procedure ?
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
justoncetime
Registered User
Posts: 11
Joined: Sat Sep 10, 2016 8:12 pm

Re: [RC] Hide BBcode

Post by justoncetime »

Its already included, i had the same "issue", but its included and it works.
But it doesnt works with SEO urls, you need to turn this off to regular/default urls.
User avatar
eunaumtenhoid
Registered User
Posts: 1007
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [RC] Hide BBcode

Post by eunaumtenhoid »

idea :
add optin on acp setting for enable/desable adm/mod see on hide bbcode

how change text for image on hide?
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
User avatar
salvocortesiano
Registered User
Posts: 190
Joined: Mon Mar 22, 2010 1:49 pm
Location: Florence (Italy)
Name: Salvo Cortesiano
Contact:

Re: [RC] Hide BBcode

Post by salvocortesiano »

eunaumtenhoid wrote:idea :
how change text for image on hide?
Try to editing the language file.

EDIT:
/ext/marcovo/hideBBcode/language/en/hide_bbcode.php

Code: Select all

'HIDEBB_MESSAGE_HIDDEN_DESCRIPTION'	=>	'You need to reply or thank to this topic before you can view the hidden message',
TO:

Code: Select all

'HIDEBB_MESSAGE_HIDDEN_DESCRIPTION'	=>	'In order to view the hidden content, you must respond of this topic or thank the Author of the post! <br />Click on the icon <img src="http://PATH OF THE IMAGE/thank.png" alt="*" title="Thank the Author of the post" /> that are at the top of the post',
Regards
Salvo
The best way to predict the future is to invent it!
Image
User avatar
eunaumtenhoid
Registered User
Posts: 1007
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [RC] Hide BBcode

Post by eunaumtenhoid »

TKS DUDE I DO:

EDIT:
/ext/marcovo/hideBBcode/styles/all/template/hide_bbcode.html

Code: Select all

<!-- BEGIN unhide_open --><dl class="hidebox unhide"><dt>{L_HIDEBB_MESSAGE_UNHIDE}</dt><dd><!-- END unhide_open -->
<!-- BEGIN unhide_close --></dd></dl><!-- END unhide_close -->
<!-- BEGIN hide --><dl class="hidebox hide"><dt>{L_HIDEBB_MESSAGE_HIDDEN}</dt><dd>{L_HIDEBB_MESSAGE_HIDDEN_DESCRIPTION}</dd></dl><!-- END hide -->

to:

Code: Select all

<!-- BEGIN unhide_open --><dl class="hidebox unhide"><dt>{L_HIDEBB_MESSAGE_UNHIDE}</dt><dd><!-- END unhide_open -->
<!-- BEGIN unhide_close --></dd></dl><!-- END unhide_close -->
<!-- BEGIN hide --><dl><dd><img src="./images/thankshide.png" alt="*" title="{L_HIDEBB_MESSAGE_HIDDEN_DESCRIPTION}" /> </dd></dl><!-- END hide -->

upload ur image for ftp/www/images
name of image thankshide.png


Man is possible add this ext addon for hide too >>> viewtopic.php?f=456&t=2259666
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
User avatar
salvocortesiano
Registered User
Posts: 190
Joined: Mon Mar 22, 2010 1:49 pm
Location: Florence (Italy)
Name: Salvo Cortesiano
Contact:

Re: [RC] Hide BBcode

Post by salvocortesiano »

eunaumtenhoid wrote:Man is possible add this ext addon for hide too >>> viewtopic.php?f=456&t=2259666
It does not work with the extension hide because the page not reloaded!
The best way to predict the future is to invent it!
Image
User avatar
eunaumtenhoid
Registered User
Posts: 1007
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [RC] Hide BBcode

Post by eunaumtenhoid »

is possible add premiss for group viem hide like adm?
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
User avatar
uruguayito
Registered User
Posts: 266
Joined: Mon Dec 13, 2010 2:46 pm
Location: Montevideo - Uruguay

Re: [RC] Hide BBcode

Post by uruguayito »

eunaumtenhoid wrote:is possible add premiss for group viem hide like adm?
I'll like see these too :roll:
I speak spanish
Sorry for my bad english
User avatar
salvocortesiano
Registered User
Posts: 190
Joined: Mon Mar 22, 2010 1:49 pm
Location: Florence (Italy)
Name: Salvo Cortesiano
Contact:

Re: [RC] Hide BBcode

Post by salvocortesiano »

Hi marcovo,
finally a compatible extension with "Thanks for post", greet extension :)
Question 1: I have to uninstall the previous version of the extension before to install the new version? (I think yes :D )
Question 2: I already have a bbcode with the tag [hide], in the previous version of your extension I made changes to the file listener.php, I changed [hide] in [hhide] and renamed the bbcode hide in hhide. I have many posts and topics inside the tag [hhide], if I install this new version I have to edit the file listener.php and make the same changes of the previous version? You think that the text will be hidden, or will be made clear together with the bbcode tags? For example: [hhide]bla bla bla[/hhide]
Thanks for any suggestions and help :)

Best Regards
Salvo Cortesiano
The best way to predict the future is to invent it!
Image
User avatar
Leinad4Mind
Translator
Posts: 863
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: [RC] Hide BBcode

Post by Leinad4Mind »

uruguayito wrote:
eunaumtenhoid wrote:is possible add premiss for group viem hide like adm?
I'll like see these too :roll:
So you want to add group permission to view the hide like administrators? In other words you want to disable the hide bbcode for specific groups?
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
eunaumtenhoid
Registered User
Posts: 1007
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [RC] Hide BBcode

Post by eunaumtenhoid »

Leinad4Mind wrote:
uruguayito wrote:
eunaumtenhoid wrote:is possible add premiss for group viem hide like adm?
I'll like see these too :roll:
So you want to add group permission to view the hide like administrators? In other words you want to disable the hide bbcode for specific groups?
YEAH
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
mark5228
Registered User
Posts: 58
Joined: Thu May 14, 2015 1:07 pm

Re: [RC] Hide BBcode

Post by mark5228 »

Is there any way yet to use board3 portal extension with this. While hide bbcode is enabled i get this error.

Unable to find template "portal/portal_body.html" (looked into: ./styles/prosilver_se/template, ./styles/prosilver_se/theme, ./styles/prosilver/template, ./styles/prosilver/theme, ./ext/marcovo/hideBBcode/styles/all/template, ./ext/marcovo/hideBBcode/styles/all/theme).
Locked

Return to “Abandoned Extensions”