The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Jul 09, 2012 4:13 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Wed Sep 07, 2005 10:18 pm
Posts: 594
Location: London
I would like to set a cookie on the user machine from first page load - this is a welcome message kind of thing so that they wont get it after the first site use. Or after registration and if they are logged in not sure yet..

So I would like to know a good place for the php for a start and based on this cookie I want to disable the display of a div using javascript. So I am saying I would like the page to be loaded.

I suppose I can set the cookie using php or javascript but I would like to get an accurate value of the ip.
Then on page load I can read this cookie via javascript and hide the div.

I have seen there are some special methods for setting and retrieving cookies in J2.5 I will look for a link.

But to a first question where can I add some custom php to my site that will be secure and not get wiped out by upgrading J.
Thanks
;D

_________________
Check out the 'bad toilet' online !


Top
 Profile  
 
PostPosted: Mon Jul 09, 2012 9:20 pm 
Joomla! Master
Joomla! Master

Joined: Mon Oct 27, 2008 9:27 pm
Posts: 13755
Location: Akershus, Norway
Write a plugin.

http://api.joomla.org/Joomla-Platform/Session/JSession.html
http://docs.joomla.org/Plugin/Events/System


Top
 Profile  
 
PostPosted: Tue Jul 10, 2012 7:56 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Wed Sep 07, 2005 10:18 pm
Posts: 594
Location: London
That makes a lot of sense, I wrote a plugin (or customised a boilerplate one) for 1.5 before.

I am not sure of which event I should take advantage of. But I also need to get some javascript in there - can I do something like the following

echo ('<script>my javascript</script>');

_________________
Check out the 'bad toilet' online !


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 



Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group