This line of code is enabling a feature on my site which is good for the most part. What I need to do is display this string on index.php and news.php BUT not on url extensions of news.php like news.php?xxx ( Sorry I don't know the correct name so I will call them url extensions... ) Could anyone please tell me how to make this line strictly only serve news.php and not news.php?xxx $CUSTOMPAGES['feature'] = " index.php news.php " PHP:
So $CUSTOMPAGES['feature'] = " index.php /news.php " ? Edit - Just tried it, didn't work could you clarify?
What is $CUSTOMPAGES['feature'] for? Use: <?php if ($_SERVER['SCRIPT_NAME'] == "/news.php") { //do stuff } else { //other stuff. } ?> PHP: or <?php if (in_array(array("/index.php", "/news.php"), $_SERVER['SCRIPT_NAME'])) { //do stuff } else { // do other stuff } ?> PHP:
What should be the value of $CUSTOMPAGES['feature']? You mean like this: $CUSTOMPAGES['feature'] = (in_array(array("/index.php", "/news.php"), $_SERVER['SCRIPT_NAME'])) ? true : false; PHP:
$CUSTOMPAGES['feature'] = " index.php news.php " .$tp->toFORM( $pref['bn_layout1']). ""; This is the full line.
Try this: $CUSTOMPAGES['feature'] = (in_array(array("/index.php", "/news.php"), $_SERVER['SCRIPT_NAME'])) ? $tp->toFORM( $pref['bn_layout1']) : ''; PHP: I'm still not sure really what your trying to do.....
After applying your code it didn't work at all on news.php :\ All I want to do is have the featurebox play on news.php but not on pages like news.php?1
Just do this then: echo (in_array(array("/index.php", "/news.php"), $_SERVER['SCRIPT_NAME'])) ? $CUSTOMPAGES['feature'] . $tp->toFORM( $pref['bn_layout1']) : ''; PHP:
Sorry my bad, just tested. echo (in_array(basename($_SERVER['SCRIPT_NAME']), array("index.php", "news.php"))) ? $CUSTOMPAGES['feature'] . $tp->toFORM( $pref['bn_layout1']) : ''; PHP:
Well considering i don't no what $CUSTOMPAGES['feature'] is for nor $tp->toFORM( $pref['bn_layout1']) this is getting really hard to help you and it's 3:35 am in the UK, so i'm going hopefully someone else will sort it out for you...