Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2014-02-06 04:54:31

Different55
Member
Registered: 2011-11-18
Posts: 173

Hide From Guests

This mod adds a [hide] BBCode tag that hides anything inside from the leering eyes of guests.

http://fluxbb.org/resources/mods/hide-f … ses/1.0.0/

##
##
##        Mod title:  [Hide] From Guests
##
##      Mod version:  1.0
##  Works on FluxBB:  1.5.6, 1.5.5
##     Release date:  02-05-2014
##           Author:  Jarom Ort (jdiff55@gmail.com) (http://tewin.ml)
##
##      Description:  Adds a [hide] BBCode tag that allows users to hide text from guests.
##
##
##   Affected files:  include/parser.php
##                    lang/English/topic.php
##                    
##       Affects DB:  No
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    FluxBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
#
#---------[ 1. BACKUP! ]------------------------------------------
#

	Always back up affected files before editing anything.

#
#---------[ 2. OPEN ]---------------------------------------------
#

	parser.php

#
#---------[ 3. FIND ]---------------------------------------------
#

$tags = array('quote', 'code', 'b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email', 'img', 'list', '*', 'h', 'topic', 'post', 'forum', 'user');

#
#---------[ 4. AFTER, ADD ]---------------------------------------
#

$tags[] = 'hide';

#
#---------[ 5. FIND ]---------------------------------------------
#

//
// Convert BBCodes to their HTML equivalent
//
function do_bbcode($text, $is_signature = false)
{
	global $lang_common, $pun_user, $pun_config, $re_list;

#
#---------[ 6. AFTER, ADD ]---------------------------------------
#

	require PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';
	
#
#---------[ 7. FIND ]---------------------------------------------
#

	$pattern[] = '%\[b\](.*?)\[/b\]%ms';

#
#---------[ 8. BEFORE, ADD ]--------------------------------------
#

	$pattern[] = '%\[hide\](.*?)\[/hide\]%ms';
	
#
#---------[ 9. FIND ]---------------------------------------------
#

	$replace[] = '<strong>$1</strong>';

#
#---------[ 10. BEFORE, ADD ]-------------------------------------
#

	if ($pun_user['is_guest']) {
		$replace[] = $lang_topic['Hidden text guest'];
	}
	else {
		$replace[] = '$1';
	}

#
#---------[ 4. OPEN ]---------------------------------------------
#

lang/English/topic.php

#
#---------[ 4. FIND ]---------------------------------------------
#

'Post reply'		=>	'Post reply',

#
#---------[ 4. BEFORE, ADD ]--------------------------------------
#

'Hidden text guest'			=>	'You must login to view hidden text.',

#
#---------[ 4. SAVE, UPLOAD ]-------------------------------------
#

Offline

Board footer

Powered by FluxBB 1.5.8