Outbreaker Posted May 29, 2013 Share Posted May 29, 2013 (edited) HI,I try to do a little script for Joomla (CMS) that would add a HTML "<div></div>" tag line based on the first category page (entry page) and the browser user-agent.But the problem i have is to only run the script on the first category page (entry page).This is the working PHP Script that would outputting a different "<div></div>" tag if a user-agent.is detected.if (preg_match('/(Test1-Bot|Test2-bot)/i', $_SERVER['HTTP_USER_AGENT'])){ echo '<div class="cloud1">';}else{ echo '<div class="cloud2">'; }<p>Some HTML Output</p></div>So now the problem is that i want to run the above PHP Script only on the first category page (entry page) but i have problems to code this (Beginner).This script would show it on all Blog pages:if ( $option == 'com_content' and $view == 'category' and $id == '8' and $Itemid == '101' and $jinput->get('layout') == 'blog' /*!*/ ) return XXX;And this script would show it only on the Blog page 2.if ( $option == 'com_content' and $view == 'category' and $id == '8' and $Itemid == '101' and $jinput->get('layout') == 'blog' /*!*/ and $jinput->get('limitstart') == '4' /*!*/ and $jinput->get('start') == '4' ) return XXX;How could i code a script that would run the above user-agent script only on Blog Page 1 (enter page)? Edited May 29, 2013 by Outbreaker Link to comment Share on other sites More sharing options...
mark32 Posted June 11, 2013 Share Posted June 11, 2013 Can able to find an error in your script. I have seen it completely but failed to locate error. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now