Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 10-15-2008, 08:46 PM
RobbieMc Offline
pp veteran
 
Join Date: Feb 2006
Location: Canada
Posts: 78
Language Cookie

Hi folks, it's been a long time since I was around.

I am back to tinkering with the language issues and have run into a problem. My wife's site, for which I originally developed the code for the multilingual pixelpost, has grown a bit. It now is a mix of Joomla and Pixelpost, and we are trying to make them work together.

We would like to set it up so that when a user selects a language on one part of the site, that language choice remains when switching to the other part of the site. The problem is that JoomFish (Joomla's multilingual extension) and Pixelpost use different cookie structures to store the language settings. I have tried hacking both sets of codes but for the life of me I can't get the two to work together.

Joomla sets the cookie name as 'jfcookie[lang]'
Pixelpost sets it as 'lang'

Any thoughts on how to make this work?

Thanks
Rob
Reply With Quote
  #2  
Old 10-15-2008, 09:07 PM
jaywilliams's Avatar
jaywilliams+ Offline
Team Pixelpost
 
Join Date: Sep 2005
Posts: 1,003
Send a message via AIM to jaywilliams Send a message via MSN to jaywilliams Send a message via Yahoo to jaywilliams Send a message via Skype™ to jaywilliams
I don't know if this would work or not, but it's sure worth a try.

What if you added something like this to the bottom of your pixelpost.php file (located in the includes directory:
PHP Code:
if (isset($_COOKIE['jfcookie'])) {
    
// If the jfcookie is set, tell Pixelpost to use the same langauge:
    
$_GET['lang'] = $_COOKIE['jfcookie']['lang'];
}elseif(isset(
$_COOKIE['lang'])) {
    
// Otherwise, if the pixelpost langauge is set, set the cookie for jfcookie:
    
setcookie ('jfcookie[\'lang\']'substr($_COOKIE['lang'],0,2), time() +60*60*24*30'/'false0);

Note: this is un-tested, and might need a bit of tweaking, as I don't know exactly how your Joomla cookie system is setup.
__________________
Jay Williams | A Different View
Reply With Quote
  #3  
Old 10-17-2008, 05:40 PM
RobbieMc Offline
pp veteran
 
Join Date: Feb 2006
Location: Canada
Posts: 78
Thanks Jay. I will try it out this weekend.
Rob
Reply With Quote
  #4  
Old 10-17-2008, 05:44 PM
RobbieMc Offline
pp veteran
 
Join Date: Feb 2006
Location: Canada
Posts: 78
Based on a quick install, it doesn't work. The page comes back blank, so maybe there is a glitch somewhere in the syntax. I'll tinker with it this weekend.

Thanks again.
Rob
Reply With Quote
  #5  
Old 10-17-2008, 06:53 PM
austriaka's Avatar
austriaka+ Offline
Team Pixelpost
 
Join Date: Nov 2006
Location: Germany
Posts: 1,175
Send a message via ICQ to austriaka Send a message via AIM to austriaka
I would just change the links from Joomla to Pixelpost and vice versa. Add a simple get variable to the URL: &lang=$_COOKIE['jfcookie']['lang'] of every PP link in Joomla and do that vice versa in the Links from Pixelpost to Joomla: &lang=$_COOKIE['lang']

Just check if the language abbreviations are the same in both systems, otherwise you need a check/replace for that
__________________
Uh!log Photoblog
My Addons
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 10:59 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs