bbcode request

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Ideas Centre
Post Reply
huddy
Registered User
Posts: 163
Joined: Fri Feb 21, 2014 12:21 pm
Location: Chelmsford UK
Contact:

bbcode request

Post by huddy » Wed Nov 12, 2014 9:22 am

We currently have a bbcode that's content is shown to registered members only. This is part of the advance editor function - hidden tag

I would also like a similar bb code that shows content for registered members but with a certain criteria.. Registered for at least 30 days and with a post count of 50 for example.


Thanks

huddy
Registered User
Posts: 163
Joined: Fri Feb 21, 2014 12:21 pm
Location: Chelmsford UK
Contact:

Re: bbcode request

Post by huddy » Wed Nov 12, 2014 10:02 am

My guess is that it would be a copy of this section in /includes/abbcode.php

Code: Select all

	/**
	* Parsing the hidden tag - Second pass.
	* @param string		$in		post text between [hidden] & [/hidden]
	* @version 3.0.6
	*/
	function hidden_pass($in)
	{
		global $user;

		if ($user->data['user_id'] == ANONYMOUS || $user->data['is_bot'])
		{
			return str_replace(array('{HIDDEN_ON}', '{HIDDEN_TEXT}'), array($user->lang['HIDDEN_ON'], $user->lang['HIDDEN_EXPLAIN']), $this->bbcode_tpl('hidden'));
		}
		else
		{
		//	$in	= make_clickable(trim(str_replace('\"', '',preg_replace('#<!-- ([lmwe]) --><a class=(.*?) href=(.*?)>(.*?)</a><!-- ([lmwe]) -->#si','$3',$in))));
			$in	= make_clickable(trim(preg_replace('#<!-- ([lmwe]) --><a class=(.*?) href=(.*?)>(.*?)</a><!-- ([lmwe]) -->#si','$3', $in)));
			$in	= str_replace(array("\r\n", '\"', '\'', '(', ')'), array("\n", '"', ''', '&#40;', '&#41;'), trim($in));
			return str_replace(array('{HIDDEN_OFF}', '{UNHIDDEN_TEXT}'), array($user->lang['HIDDEN_OFF'], $in), $this->bbcode_tpl('unhidden'));
		}
	}

Pony99CA
Registered User
Posts: 4783
Joined: Thu Sep 30, 2004 3:13 pm
Location: Hollister, CA
Name: Steve
Contact:

Re: bbcode request

Post by Pony99CA » Thu Nov 13, 2014 3:20 am

Standard BBCodes can't access the phpBB database, so they can't do things like check if a user is registered or not.

To do that, you'll probably need an extension, too, not just a BBCode (which is probably why your topic was moved to Extension Requests instead of Custom BBCodes).

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4991
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: bbcode request

Post by VSE » Thu Nov 13, 2014 8:09 am

Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.

Post Reply

Return to “Extension Requests”