Log in

View Full Version : Parse BBCode In Member.php


noonespecial
11-26-2005, 06:04 AM
Parse BBCode in Member.php! HELP!

I've tried this tutorial (https://vborg.vbsupport.ru/showthread.php?t=82693&page=1&pp=15) to no avail, please help!

This (https://vborg.vbsupport.ru/showpost.php?p=818838&postcount=25) is what I've tried.

I have a custom field that I want parsed .. that's it! Thanks to anyone that can help me.

merk
11-26-2005, 09:54 AM
<i>corrected</i> You should be passing arguments to the function.

noonespecial
11-26-2005, 05:31 PM
Corrected?? Where???

merk
11-26-2005, 09:46 PM
i rewrote my post, sorry.

there are multiple arguments that need to be passed to do_parse to make sure it does what you want. its all said on the first page of the thread you use.

noonespecial
11-26-2005, 11:23 PM
i rewrote my post, sorry.

there are multiple arguments that need to be passed to do_parse to make sure it does what you want. its all said on the first page of the thread you use.

And it said.. "All parameters except $text can be omitted and will use the defaults then."

Andreas
11-26-2005, 11:25 PM
Correct.

noonespecial
11-26-2005, 11:58 PM
I am so confused, I think it's just a matter of communication and I can't for the life of me figure out what to do to get it right.

Andreas
11-27-2005, 12:13 AM
Honestly, I don't understand your problem - the code you posted works fine.
I would just split it into two Plugins for performance reasons, see attached XML.

merk
11-27-2005, 12:21 AM
Sorry, i read the users post wrong (in andreas' thread) :(

noonespecial
11-27-2005, 01:39 AM
Honestly, I don't understand your problem - the code you posted works fine.
I would just split it into two Plugins for performance reasons, see attached XML.

I did, and it just doesn't work. I have a custom profile field (27) that I want to parse BBCode, and using the code I posted (trying to use your plugin after this post; will report back) I just can't get it to work! Haha.. I think I'm just being stupid.

Still doesn't work (installed your plugin):

http://www.absolutepunk.net/member.php?username=jason%20tate

See?

Is it because I'm trying to pull the data via: $userinfo[field27] ?

Andreas
11-27-2005, 02:10 AM
Yep. With this code, $vbulletin->userinfo['fieldx'] is not parsed - only visible fields ($customfields in the template) are parsed.

noonespecial
11-27-2005, 04:00 AM
Yep. With this code, $vbulletin->userinfo['fieldx'] is not parsed - only visible fields ($customfields in the template) are parsed.

that's what i thought, crap, how can i fix it to parse userinfo[fieldx]???

Andreas
11-27-2005, 04:18 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=82693" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=82693</a>
This explains how to parse BBCode

Boofo
11-27-2005, 04:35 AM
Couldn't you just add this (changing the 7 to what field you need):

$vbulletin->userinfo['field7'] = $parser->do_parse($vbulletin->userinfo['field7']);

under this (in Andreas's xml file above)?

$profilefield['value'] = $parser->do_parse($profilefield['value']);

Or am I way off, Andreas? ;)

merk
11-27-2005, 08:28 AM
The issue with that is you'll parse the viewing users profile field, which is not what the original request is about. They want to parse the viewed users profile field. :) (ps i havent forgotten about you :()

Boofo
11-27-2005, 11:04 AM
How would you do it to include ALL fieldx variables or would you have to do them one by one on each line?

But is the idea right and in the right spot anyway? ;)

(hehe np on the not forgetting. I understand. ;))

Andreas
11-27-2005, 11:08 AM
Wrong location, wrong array :)
If it's only a few, I'd use member_complete and list them one by one.

noonespecial
11-28-2005, 03:15 AM
So is there anyway to do this? I don't care if every userinfo[fieldx] is parsed right now .. I just need something that works. Haha.

Andreas
11-28-2005, 06:43 AM
You can find a tutorial for parsing bbcode here: https://vborg.vbsupport.ru/showthread.php?t=82693

noonespecial
11-28-2005, 08:43 AM
You can find a tutorial for parsing bbcode here: https://vborg.vbsupport.ru/showthread.php?t=82693

And I've posted this question in that thread already as well (with no real answer).

https://vborg.vbsupport.ru/showpost.php?p=818838&postcount=25
https://vborg.vbsupport.ru/showpost.php?p=826785&postcount=30

I obviously don't know the right variable to pass or something ($userinfo[field27] is what I need parsed); that's why I came to this forum to ask for some help.

Please? can you just help me figure out what the right code?

$userinfo[field27] = $parser->do_parse($userinfo[field27]);

Doesn't work. So I don't know what to do.

Andreas
11-28-2005, 08:46 AM
$userinfo[field27] is what I need parsed
So ... have you tried to parse that?

noonespecial
11-28-2005, 08:47 AM
So ... have you tried to parse that?

Yah, and I get this on the profile page...

&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;l t;b&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; amp;amp; amp;amp; amp;amp; amp;amp; amp;amp; amp;gt;S pread the AbsolutePunk.net Banner!&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;lt ;/b&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; amp;amp; amp;amp; amp;amp; amp;amp; amp;amp; amp;lt;b r /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;g t;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;g t;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;g t;&amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;g t;&amp;amp;amp;amp;amp;amp;amp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;a mp;a mp;g t;&amp;amp;amp;amp;amp;amp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;a mp;g t;&amp;amp;amp;amp;amp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;g t;&amp;amp;amp;amp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;g t;&amp;amp;amp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;g t;&amp;amp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;g t;&amp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;g t;&amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;a mp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;a mp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;a mp;amp;l t;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;l t;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br />
&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;l t;di v align=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp ;amp ;amp ;amp ;amp ;amp ;amp ;amp ;amp ;amp ;amp ;amp ;quo t;ri ght&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;am p;am p;am p; amp;amp; amp;amp; amp;amp; amp;amp; quot;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; amp; amp; amp; amp; amp; amp; amp; amp; am p;amp;amp;gt ;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; lt;a href=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; quot ;htt p://&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;q uot; http : //www.absolutepunk.net/index.php?sub=banners&amp;amp;amp;amp;amp;amp;amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; quot ;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; amp; amp; amp; amp; amp; amp; amp; am p;amp;am p;quot; target=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;qu ot;_ blan k&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; amp; amp; amp; am p;amp;am p;amp;am p;amp;am p;quot;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;am p;am p;am p;am p;am p;am p;am p;am p;am p; amp;amp;amp; gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;lt ;i mg src=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;q uot; http ://images.absolutepunk.net/images/banners/125x125.gif&amp;amp;amp;amp;amp;amp;amp;amp;amp;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;qu ot; border=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;qu ot;0 &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a m p ;amp;amp ;amp;amp ;amp;amp ;amp;quo t; alt=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;q uot; &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a m p ;amp;amp ;amp;amp ;amp;amp ;amp;amp ;quot; /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;a mp;g t;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;amp;a mp;lt ;/a&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; amp;amp; amp;amp; amp;amp; amp;amp; amp;amp; amp;lt ;/div&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;am p;gt ;

using: $userinfo[field27] = $parser->do_parse($userinfo[field27]);

Andreas
11-28-2005, 08:49 AM
Lot's of entities ;)

What's the content of field27?

noonespecial
11-28-2005, 08:52 AM
Lot's of entities ;)

What's the content of field27?

this:

[.b]Spread the AbsolutePunk.net Banner![./b]
[.right][.url="http://www.absolutepunk.net/index.php?sub=banners"][.img]http://images.absolutepunk.net/images/banners/125x125.gif[./img][./url][./right]

Is what I have in there to test the BBCode.

You can see it not working in action here: http://www.absolutepunk.net/member.php?u=1083

However:

$userinfo[field27] = $parser->do_parse($userinfo[field27], 1, 1, 1, 1, 0, 0);

Works because it allows HTML (right?) (fixing those weird errors above); however, I really don't want to allow HTML on the profile pages - only BBCode.

Edit: It appears that code (above) doesn't allow HTML ...

Andreas
11-28-2005, 09:06 AM
I've attached a small script that should give you an idea of what you did wrong ;)

Boofo
11-28-2005, 09:34 AM
this:

[.b]Spread the AbsolutePunk.net Banner![./b]
[.right][.url="http://www.absolutepunk.net/index.php?sub=banners"][.img]http://images.absolutepunk.net/images/banners/125x125.gif[./img][./url][./right]

Is what I have in there to test the BBCode.

You can see it not working in action here: http://www.absolutepunk.net/member.php?u=1083

However:

$userinfo[field27] = $parser->do_parse($userinfo[field27], 1, 1, 1, 1, 0, 0);

Works because it allows HTML (right?) (fixing those weird errors above); however, I really don't want to allow HTML on the profile pages - only BBCode.

Edit: It appears that code (above) doesn't allow HTML ...

Shouldn't html be off by default?

Boofo
11-28-2005, 09:36 AM
I've attached a small script that should give you an idea of what you did wrong ;)

Does this look better, Andreas? ;)

Andreas
11-28-2005, 10:04 AM
The XML looks strange (how did you manage to export this? doesn't import ...), but yeah - that's the way to go :)

Boofo
11-28-2005, 10:11 AM
The XML looks strange (how did you manage to export this? doesn't import ...), but yeah - that's the way to go :)

hehe I actually edited the xml you posted earlier. I guess my editor must have done something screwy. You know it couldn't be me messing up, right? ;)

HTML is turned off by default, isn't it?

Andreas
11-28-2005, 10:20 AM
Yes, HTML is off be default.

I thought you manually edited it and somehow managed to screw it up :D

Boofo
11-28-2005, 10:28 AM
Well, I did. But I managed to redeem myself now and made it into a product which IS correct now. ;)