Categories > TinyButStrong general >

Running functions on a query

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Radeon
Date: 2004-09-01
Time: 20:38

Running functions on a query

Hi,

Im having some touble. I have made a little bb code function that works. But i would like to do so that what i fetch from the database with:

$TBS->MergeBlock('nws',$db,$query);

gets parsed trough the bbcode function first.
By: Skrol29
Date: 2004-09-01
Time: 21:36

Re: Running functions on a query

What is a bb function?

Can't you use parameter 'onsection'?

Otherwise, you have to retrieve your data into an array, then work it throuth the bb function and then merge it.
By: Radeon
Date: 2004-09-01
Time: 22:33

Re: Running functions on a query

BB Code = Bulletin Board Code, it's these like the code tags you have but it replaces html code.
By: Radeon
Date: 2004-09-02
Time: 00:49

Re: Running functions on a query

Ok, i've got it woking like i want to now. But it seams like TBS won't let me use html in my input? How can i change this?
By: Maxwel
Date: 2004-09-02
Time: 11:09

Re: Running functions on a query

By: Radeon
Date: 2004-09-02
Time: 12:26

Re: Running functions on a query

Hi, thx for the help but i can't seam to get it working. I have done:

[nws.content;htmlconv=yes:]

I have tried all of the different settings but none of them work. Maby i'm entering it all wrong?
By: Pirjo Posio
Date: 2004-09-03
Time: 00:30

Re: Running functions on a query

Try using
[nws.content;htmlconv=no]
if the contents is already html chars. This should work, since by default values are converted into html chars, and this 'no' tells that this conversion should not be done.
By: Skrol29
Date: 2004-09-03
Time: 09:59

Re: Running functions on a query

When you merge data containing '[', they are automatically protected by remplacing them with the Html conversion '['. Maybe that's what stops your bb functions.
This protection is very important for security, otherwise message posted by users can have active TBS tags.

What I suggest is to not disable the protection, but to arrange your bb functions to look for '[' instead of '['.
By: Radeon
Date: 2004-09-03
Time: 12:51

Re: Running functions on a query

Doesn't work. I'll just give you a link to the page so that u can see what i mean. And i won't have to do what you said skrol since i have already converted everything to html chars before TBS gets a hand on it.

http://www.amicore.mine.nu/testing/malin/

If you look at the news topic named "BB Code testing news" you will se that there is html content printed out, i would like it to be html instead :P
By: Radeon
Date: 2004-09-03
Time: 12:52

Re: Running functions on a query

Ops, sory were a little fast to reply there, uploaded the wrong file. Pirjo Posio's  solution worked :)