TinyPortal

Development => Support => Topic started by: pcw on September 12, 2005, 10:30:07 AM

Title: call smf-functions in blocks?
Post by: pcw on September 12, 2005, 10:30:07 AM
i want to create a php-block with some smf-functions like db_query() etc.

but everytime i call a function like db_query() or allowedTo() all i get is like
QuoteWarning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/host/dir/dir/htdocs/smf/TPpreview.php(18) : eval()'d code on line 1

Parse error: parse error, unexpected $ in /home/host/dir/dir/htdocs/smf/TPpreview.php(18) : eval()'d code on line 1

is there a way to use these functions inside php-blocks?
Title: Re: call smf-functions in blocks?
Post by: bloc on September 12, 2005, 11:56:52 AM
yes..but not in the preview window.

Could you post the code/line with the call?
Title: Re: call smf-functions in blocks?
Post by: pcw on September 12, 2005, 12:06:26 PM
i get this error even when the block just contains a global $db_prefix;
db_query("SELECT ID_MEMBER FROM {$db_prefix}members",__FILE__,__LINE__);


something like loadLanguage('Calendar'); causes exactly the same error.