![]() |
|
Album titles displaying incorrectly - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Translating (https://forum.zenphoto.org/forum-8.html) +--- Thread: Album titles displaying incorrectly (/thread-11625.html) |
Album titles displaying incorrectly - bearaa - 08-02-2014 Some time ago I created a website using zenphoto for the backend photo gallery management. I recently copied my web pages over to a new site, created an empty mysql database, and did a fresh install of the latest zenphoto release. I'm now getting weird strings such as "a:1:{s:5:"en_US";s:9:"album title";}" displaying in place of what displays as just the album title on the old site. Do I need to use a different method of getting/printing album titles, or change some kind of language encoding setting...? What's going on here exactly? Album titles displaying incorrectly - acrylian - 08-02-2014 Since you didn't mention the theme used that one might need an update. That is the correct way. Please see here: http://www.zenphoto.org/news/multi-lingual-sites#backend-usage (the box below the 2nd image). Album titles displaying incorrectly - bearaa - 08-02-2014 I created my own theme... so I guess I need to know what I need to change in my code? Album titles displaying incorrectly - acrylian - 08-02-2014 I suggest to re-read the theming tutorial. Album titles displaying incorrectly - bearaa - 08-02-2014 Here's a piece of my code. All I want to know is why $row['title'] no longer prints as simply the album title, and how to make it do so. Is there a function I need to use to strip out all the extra string characters so I'm left with just the album title?
The result prints on my page as "a:1:{s:5:"en_US";s:9:"my album title";}" instead of just "my album title". Album titles displaying incorrectly - sbillard - 08-02-2014 The simple answer is because that is not how those things are typically stored. The more complex answer is that you should NEVER bypass the object model. There is good reason why we use objects because they hide underlying implementations. The code you show seems to be an over complication of:
Album titles displaying incorrectly - bearaa - 09-02-2014 Ah I see, thanks. I read a theming tutorial way back when I built this, but since I was new to programming it was really confusing and had a lot that didn't apply to my site, so I ended up just using zenphoto to manage the back end and directly querying the database since that was the only thing I knew how to do. It worked fine for what I needed it for with the version of zenphoto that was out at that time, but I suppose I should reprogram everything correctly. Thanks. Album titles displaying incorrectly - earthnutvt - 17-05-2014 I am having this same issue. When I first create an album, the title appears fine. But if I update it, I get this: a:1:{s:5:"en_US";s:12:"Test Album 2";} I'm using the Default theme, so I'm not sure what the issue is. I recently upgraded to 1.4.5.9. Any help would be appreciated. I cannot figure out what formats the album title or sends it to the database, but something is clearly wrong. Album titles displaying incorrectly - acrylian - 18-05-2014 What you see is the string as correctly stored in the database to Zenphoto would work in multilingual mode:http://www.zenphoto.org/news/multi-lingual-sites You did not tell from which version you upgraded. Also please take a look at this bug report guide: http://www.zenphoto.org/news/general-contributor-guidelines#reporting-bugs (especially the error log part). You also probably should try the 1.4.6 RC2. Album titles displaying incorrectly - digheal - 04-08-2014 I am running the Zenphoto 1.4.6 and am experiencing the same issue - whenever I use the ZP web ui to modify albums and images, they end up with titles like this:
I can go in through phpMyAdmin and modify to remove the extra characters, but that's a lot of extra work I would like to avoid. Is there a way to permanently stop Zenphoto from adding these extra characters? I am only interested in having my website be in U.S. English so if it means completely disabling multilingual support, that's totally fine with me. Thus far, I've deselected all languages but US English and set US English to be the default language, but I am still getting those characters when I modify albums and images. Also, I am using Chrome if that makes any difference. Thanks in advance for any help you can provide. Album titles displaying incorrectly - sbillard - 04-08-2014 These are correctly represented titles. While the titles without the language elements will work, Zenphoto will never create them that way. So the real question is how you are outputting the title. If you are using the normal Zenphoto functions you should see normal text. If you are directly using the database you will have to process the data properly. There is a function to do so called Album titles displaying incorrectly - digheal - 04-08-2014 Thank you very much for your response. I should have mentioned that everything appears fine within the ZP galleries, etc. I am doing a direct manual PHP query against the database for another part of my site, which would explain why I am getting the extra characters. Here's what I am doing:
Is getLanguageString a PHP or a ZP function? I haven't been able to find anything about this command for ZP or PHP. Album titles displaying incorrectly - acrylian - 04-08-2014 Quite important information actually! Of course Of course direct mysql queries can bypass ZP functionality like this or for example rights management. A recommended way would be the "Zenphoto as a plugin" way on our user guide so you can use the actual object model (if possible on your site): http://www.zenphoto.org/news/integration-with-existing-sites-and-other-cms Besides that what you see is just a seralized string. There are standard php functions to unserialize it and use it as a normal array. Album titles displaying incorrectly - digheal - 04-08-2014 I'm actually using the queries to output HTML files that I PHP include in with a separate mobile theme I purchased. So, ZP powers my main site and I grab filenames and titles from the database to turn this:
` [*][img]images/boston_rockshots/peterbuzzelle.jpg[/img]` I'll check the Zenphoto as plugin thing. Thanks again. |