Html or MyCode in Custom Profile Fields
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #11
RE: Html or MyCode in Custom Profile Fields
*TO OP*

Open inc/functions_post.php, find:

PHP Code:
	    $post[$post_field] = htmlspecialchars_uni($field_value);


Replace:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
		// EDITING...
		//Comma separated list of groups ALLOWED to use bbcode, html, etc...
		$groups = '3,4,6'; // Empty to disable.

		$groupss = explode(',', $groups);
		if(empty($groups) || !in_array($post['usergroup'], $groupss))
		{
			// 0 = NO, 1 = YES
			$parseroptions = array(
				'allow_html' => 0,
				'allow_mycode' => 1,
				'allow_smilies' => 1,
				'allow_imgcode' => 0,
				'allow_videocode' => 0,
				'filter_badwords' => 1
			);
			$post[$post_field] = $parser->parse_message($field_value, $parseroptions);
		}
		else
		{
			$post[$post_field] = htmlspecialchars_uni($field_value);
		}
		// EDITING...


Open member.php, find:

PHP Code:
$customfield['name'] = htmlspecialchars_uni($customfield['name']);


Replace:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
		// EDITING...
		//Comma separated list of groups id ALLOWED to use bbcode, html, etc...
		$groups = '3,4,6'; // Empty to disable.

		$groupss = explode(',', $groups);
		if(empty($groups) || !in_array($post['usergroup'], $groupss))
		{
			// 0 = NO, 1 = YES
			$parseroptions = array(
				'allow_html' => 0,
				'allow_mycode' => 1,
				'allow_smilies' => 1,
				'allow_imgcode' => 0,
				'allow_videocode' => 0,
				'filter_badwords' => 1
			);
			$customfieldval = $parser->parse_message($customfieldval, $parseroptions);
		}
		else
		{
			$customfield['name'] = htmlspecialchars_uni($customfield['name']);
		}
		// EDITING...


Comments are self explanatory. I din't tested BTW, that will be your job Tongue


Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
(This post was last modified: 04-02-2012 01:00 PM by Sama34.)
03-27-2012 01:41 PM
Visit this user's website Find all posts by this user Quote this message in a reply
lilah Offline
Junior Member
**
Posts: 18
Joined: Mar 2012
Post: #12
RE: Html or MyCode in Custom Profile Fields
thanks a million for your help Smile

I changed the files and got the error message:
Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\mybb\inc\functions_post.php on line 122

line 122 would be

Code:
if(empty($groups) || !in_array($post['usergroup'], $groupss);)

04-01-2012 04:48 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #13
RE: Html or MyCode in Custom Profile Fields

PHP Code:
if(empty($groups) || !in_array($post['usergroup'], $groupss);)


PHP Code:
if(empty($groups) || !in_array($memprofile['usergroup'], $groupss);)


Try to remove temove the last bracket from the above codes.


04-01-2012 07:32 AM
Find all posts by this user Quote this message in a reply
lilah Offline
Junior Member
**
Posts: 18
Joined: Mar 2012
Post: #14
RE: Html or MyCode in Custom Profile Fields
I already tried that, but the error message stays the same, even without the last brackets Frown
04-01-2012 09:44 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #15
RE: Html or MyCode in Custom Profile Fields
Oh, sorry. Try replacing the code above with:

PHP Code:
if(empty($groups) || !in_array($post['usergroup'], $groupss))


PHP Code:
if(empty($groups) || !in_array($memprofile['usergroup'], $groupss))


04-01-2012 09:52 AM
Find all posts by this user Quote this message in a reply
lilah Offline
Junior Member
**
Posts: 18
Joined: Mar 2012
Post: #16
RE: Html or MyCode in Custom Profile Fields
removing the semicolons changes the error message to
Parse error: syntax error, unexpected '=', expecting ')' in C:\xampp\htdocs\mybb\inc\functions_post.php on line 126

line 126 is

Code:
'allow_html' = 0;

04-01-2012 11:12 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #17
RE: Html or MyCode in Custom Profile Fields
God, my code is full of errors, please replace any ; after the 1/0 to , (comma).

PD: Fxed my code above.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
(This post was last modified: 04-01-2012 02:04 PM by Sama34.)
04-01-2012 02:02 PM
Visit this user's website Find all posts by this user Quote this message in a reply
lilah Offline
Junior Member
**
Posts: 18
Joined: Mar 2012
Post: #18
RE: Html or MyCode in Custom Profile Fields
no problem, thanks for your time Wink

i replaced the codes but the Parse error: syntax error, unexpected '=', expecting ')' in C:\xampp\htdocs\mybb\inc\functions_post.php on line 126 error message stays
04-01-2012 08:14 PM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #19
RE: Html or MyCode in Custom Profile Fields
There it is again, sorry about that, try it again (too much issues for something this simple).

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
04-02-2012 01:01 PM
Visit this user's website Find all posts by this user Quote this message in a reply
lilah Offline
Junior Member
**
Posts: 18
Joined: Mar 2012
Post: #20
RE: Html or MyCode in Custom Profile Fields
now it works fine, thanks a lot for your help! Smile
04-11-2012 10:12 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: