Member
Member
Vaisak   2008-06-06, 20:15
#1

I wonder if there's a way to do this, since I've been trying the nightly build with localization plugin and managed to get the description from the custom data field when I change to German (using switch). I think this is quite an easy way to have descriptions in different languages for those who, like me, doesn't know a lot of php.
But the thing is, the way I'm using Paypal integration uses the custom data field too (checking if there's something written, to have individual prices and sizes, or simply nothing), so I cannot use both at the same time. Also, if I wanted a third language, I'd need another one...

Well, I was wondering if I'd have to mess with mysql to do this. Most of the times I can do things when they require php, but I've never edited a database.

Member
Member
sbillard   2008-06-06, 22:38
#2

You can always partition your customdata field into parts. Use some character as a part separator that will not appear in any of the items you want to store.

Suppose you use | as your separator. Then you could store
paypal data|someother data|the third set
in the custom data. You would then use the explode() function to separate out each of the fields:
$mycustomdata = explode('|', getCustomData());
then $mycustomdata[0] would have the paypal date, $mycustomdata[1] would have the someother data and $mycustomdata[2] would have the third set.

We really discourage you from hacking the core of zenphoto (which is what you would need to do to create multiple table columns for your extra custom data fields.) Hacking the core makes it hard for you when you want to upgrade and it makes it hard for us to diagnose problems you might someday have.

Member
Member
Vaisak   2008-06-06, 22:53
#3

Thanks sbillard, I'm gonna try that asap. I didn't really like the idea of hacking the code, either. Thankfully is just a local installation, so if I mess things up, I won't have any problems XD

By the way, is the spanish localization available for download? I'm interested in giving it a try.

EDIT: It works wonderfully, thanks again, sbillard!

Administrator
Administrator
acrylian   2008-06-07, 09:14
#4

You find always all available translations here: http://www.zenphoto.org/trac/report/9

Member
Member
special-k   2010-03-01, 03:23
#5

When I try this, I get an error "call to undefined function".
What am I doing wrong?

I just did
$custom=getCustomData();

Member
Member
sbillard   2010-03-01, 04:15
#6

There are versions of this function based on the object you are using--for instance getAlbumCustomData(). But if you just want to have translatable descriptions, you can do that by enabling the multi-lingual option. Then the description edit will allow you to provide multiple versions for various languages. (If that is not you intent, be careful what thread you hijack.)

Member
Member
special-k   2010-03-01, 04:30
#7

Sorry sbillard, didn't realize I updated on a year old thread. (also didn't mean to hijack anything; Just figured I'd post here since it was a similar question).

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.