MyBB Community Forums

Full Version: template conditionals add condition startswith
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have the plugin template conditionals
and i have the piece to add a link on conditions for the header template
                <if $_SERVER['REQUEST_URI'] != "/index.php" then>
                <a href="#bottom">Bottom Page</a><br>
                </if>


 What i would like to do is if the url starts with 
Thread

to do this instead of != /index.php
so something like 
                <if startswith($_SERVER['REQUEST_URI'], "Thread") then>
                <a href="#bottom">Bottom Page</a><br>
                </if>


but im not sure what the proper php would be to use in this plugin?
can be like any of below
<if THIS_SCRIPT == 'index.php' then>
--- execute some code ---
</if>

<if THIS_SCRIPT == 'index.php' then>
--- execute some code ---
<else>
--- execute some other code ---
</if> 

<if THIS_SCRIPT == 'showthread.php' then>
--- execute some code ---
</if> 

<if THIS_SCRIPT == 'showthread.php' then>
--- execute some code ---
<else>
--- execute some other code ---
</if> 

Note: THIS_SCRIPT is defined in MyBB source files
i was looking more for a regex, like
if THIS_SCRIPT starts with "//Thread*"
since i am uising hte google SEO plugin i want to only match those with threads and not forums or the index, or sub pages, etc.
staring with 'Thread' means all pages of showthread.php file. hence its related code should work.
oh ok. Im dumb....lol... I forgot it was still using showthread.php after seeing Google SEO titles for so long. I was trying to match the title.

Thank you.