SMFHacks.com

SMF Store => Support => Topic started by: shuban on January 10, 2017, 06:29:01 pm

Title: How do I make the product description PHP ready?
Post by: shuban on January 10, 2017, 06:29:01 pm
Instead of using bbcode, I'd like to use PHP instead, is that possible?
Title: Re: How do I make the product description PHP ready?
Post by: SMFHacks on January 10, 2017, 06:36:42 pm
Harder to do.
Would have to use the php eval() statement
Title: Re: How do I make the product description PHP ready?
Post by: shuban on January 10, 2017, 06:57:08 pm
Could you elaborate on this?
Title: Re: How do I make the product description PHP ready?
Post by: SMFHacks on January 10, 2017, 07:05:21 pm
It's a lot of steps actually. Since you have to change the template from parse_bbc to eval then also remove the security checks/changes made in Store2.php for descriptions for adding/editing products.
Title: Re: How do I make the product description PHP ready?
Post by: shuban on January 10, 2017, 07:14:39 pm
I noticed that

Code: [Select]
'.parse_bbc(stripslashes($context['store_item']['description'])).'
Needs to be changed.

I'd like to do a test run where I manually added php code into the database of a product. But I'm not sure how to use:

Code: [Select]
ob_start();
eval("echo "Some awesome output. "");
$this_string = ob_get_contents();
ob_end_flush();

as suggested here: https://cgd.io/2008/how-to-execute-php-code-in-a-php-string/