In Joomla you should not (at least I don’t recommend) add any custom codes directly index.php file. Instead you should develop simple extension (possibly a system plugin for your purpose I guess, or a module) so that your code does not overwritten when you upgrade Joomla later on. Otherwise though I am not sure what exactly the function does, you can even place it on the template file as well. If it displays something then develop a simple module and install it to a position in the current template.
In fact it is worse than that, you’d also have to have previously checked each of those $_GET keys was set to stop loads of warnings appearing in your log files and potentially on your site if one or more of them was not set.
if( isset($_GET['option'] ) && // and so on
You are best off getting as close as you can to the template which governs the behaviour of this particular set of pages (articles?) and just check for the existence of say, id : 48
f( isset($_GET['id'] ) && $_GET['id'] == 48 ){
// do something special
}
There may well be a Jommla-esque way of doing what you want, you could seek out Joomla users to ask them.
In my joomla website I need to create some funny custom “prize-image designed with links to different pages” where the prizes are…very silly but its what the client wants…all people have to log in first…
What I need is that once a certain user is on the main page and clicks to the next page, he IS NOT ALLOWED to go back to the main page…so I need some sort of code that will be inserted into the article, not allowing the user to go back to the page…
Please can anyone of the gurus help. Thank you Cups
I think you are developer you must know that you cannot insert any codes in the articles. So that has to be done via code and possibly with your controllable component or module/plugin. The idea would be to store the visited page numbers (I would assign numbers to each step or page) in session/cookie and check if he/she current page is less than the maximum reached page number then always redirect or give some warning/error message to the user.
When they navigate AWAY from this page they wont be allowed to view that page again, therefore each user is restricted to only view the page ONCE -make more sense?
This is exactly what I need. Please can someone help???
I think you are developer you must know that you cannot insert any codes in the articles. So that has to be done via code and possibly with your controllable component or module/plugin.
You are quite right, I have found a plugin thank you
What is your page? A file having .php extension or an article (if it is Joomla) having a separate menu is a page? In either case you have to track/store visited pages either in a session variable or cookie. If a page meant to be a Joomla article having a menu (Itemid) then you have to store Itemid or id (id of a content) once it is visited. And check the Itemid it is already visited. You need to write something like below code in a system plugin.
if(!in_array(JRequest::getVar('Itemid'), $_SESSION['_visited_page']){
$_SESSION['_visited_page'][] = JRequest::getVar('Itemid', 0);
}
else{
die('Sorry you are allowed to visit this page only once!'); // or anything
}
As I already told that PHP codes cannot be inserted directly into the article but you need to add the code in a plugin (possibly the system plugin and I presume you are quite aware of different types of plugins in Joomla since you are a Joomla developer). The code I gave above is just an idea how you can do to achieve the goal and you are the one to manage accordingly.
I don’t know what you have written, but when I tried to visit the page http://topplacestravel.co.za/index.php/quiz-pop I got the message ‘You are not authorised to view this resource.’. What it should show? Is it the article to be shown on the page? If you are not a Joomla developer and cannot operate with Plugins then you have to hire someone to look in to it.