Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: nitair on January 22, 2018, 05:56:31 AM

Title: PHP at creating category / thread
Post by: nitair on January 22, 2018, 05:56:31 AM
Hi all,

I would like to add a PHP script into title / description (as showed in screenshot). How I can do that?


Also if <?php echo 'Test'; ?> is possible, can I add something like that? : <?php echo '<p style="color: #000">Test</p>';  ?>
Title: Re: PHP at creating category / thread
Post by: Aleksi "Lex" Kilpinen on January 22, 2018, 06:05:59 AM
Perhaps you could explain a bit further - What are you trying to achieve, where exactly, and what have you done already?
Title: Re: PHP at creating category / thread
Post by: nitair on January 22, 2018, 06:11:32 AM
I'm trying to add a PHP-Script which checks if a port is open or closed (like an online status in title).

What I'm already done: Notice Screenshot. I'm just asking if there is possibility, but didn't edit template that much (just wanted to be sure).
Title: Re: PHP at creating category / thread
Post by: Illori on January 22, 2018, 06:12:04 AM
php is not parsed as a board title.
Title: Re: PHP at creating category / thread
Post by: nitair on January 22, 2018, 06:14:32 AM
I did noticed that (thats why Im posting here...), but is there no possibility to enable this parsing?
Title: Re: PHP at creating category / thread
Post by: Illori on January 22, 2018, 06:20:55 AM
i dont think so. it would be easier to add the code directly in one of the templates and let it be parsed that way. you could add it in index.template.php into the header and it would show up on all pages.
Title: Re: PHP at creating category / thread
Post by: nitair on January 22, 2018, 06:24:30 AM
Yeah that's already done, but I don't like it on this way. Okay then... thanks for your help. I'll use the index.template.php way...