Log in

View Full Version : Using array in vbcode


brandondrury
05-29-2007, 09:52 PM
I same to be having trouble displaying an array value within my vbcode. My searches didn't seam to come up with anything.

I want to send a PM to a user with a link that I'm dynamically creating.

I tried using this, but I think all of the brackets " [ " and " ] " are causing confusion, but it could be the fact that one of keys of my array is [URL].

[URL=www.domain.com/page_product.php?ID=$B[LinkID] ] $B

Well, even the code isn't displaying correctly on this thread.

Well, does anyone know the protocal for using assoc array values with VbCode?

Brandon

harmor19
05-29-2007, 09:58 PM
Why do you need to dynamically create the link?

Eikinskjaldi
05-29-2007, 10:02 PM
I same to be having trouble displaying an array value within my vbcode. My searches didn't seam to come up with anything.

I want to send a PM to a user with a link that I'm dynamically creating.

I tried using this, but I think all of the brackets " [ " and " ] " are causing confusion, but it could be the fact that one of keys of my array is [URL].



[URL=www.textlinkcenter.com/page_product.php?ID=$B[LinkID] ] $B

Well, even the code isn't displaying correctly on this thread.


Well, does anyone know the protocal for using assoc array values with VbCode?


Brandon

You cannot. bbcode is not a mini-php language The system cannot see some tags as bbcode and others as php items.

What you will have to do is code up a custom tag which does what you want it to do. I'd offer help here, but it is not clear to me where $B is coming from.

brandondrury
05-30-2007, 06:22 AM
Why do you need to dynamically create the link?
Are you serious?

I guess I should have given more info. I'm sending a PM from an external page (outside of vBulletin). The $B is an assoc array that I snagged out of a MySQL database. It holds most of the data that I want to send to the user.

It turns out that I had no trouble putting various array values into my private messages once I understood that bracket URL bracket was off limits. The bracket QUOTE bracket was a little funny, too. I'm not sure why.

So it's all under control now.

Thanks for taking the time to help.
Brandon