- Posts: 4
COMMUNITY FORUM
Unserialize(?) extra fields
- news-blitz
-
Topic Author
- Offline
- New Member
Less
More
14 years 7 months ago #88975
by news-blitz
Unserialize(?) extra fields was created by news-blitz
How can I turn this into an array?[{"id":"1","value":"2010-09-27 18:58:42=:=:="}]Tried unserialize, didn't work.Thanks.
Please Log in or Create an account to join the conversation.
- Jeff Whitmore
-
- Offline
- Junior Member
Less
More
- Posts: 24
14 years 5 months ago #88976
by Jeff Whitmore
Replied by Jeff Whitmore on topic Unserialize(?) extra fields
I haven't made anything useful out of this yet, but the extra fields are stored as a json string. Here is some example code I've been playing with to create an array. I've done it two ways. Using JSON.php from K2 and using php json_decode. Neither makes a useful or pretty array and would need further cleaning.
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
14 years 5 months ago #88977
by william white
Replied by william white on topic Unserialize(?) extra fields
If you only want the extra fields in an array, take a look at the code in the attached txt file, Added to your override files it will work for you
Please Log in or Create an account to join the conversation.
- Gianmichele Genovese
-
- Offline
- New Member
Less
More
- Posts: 4
14 years 2 months ago #88978
by Gianmichele Genovese
Replied by Gianmichele Genovese on topic Unserialize(?) extra fields
Hi,
Can you help me? I need to show in my php test page the content of an item which has 3 extrafields.
I've tried to use your examples but but I was only able to show on screen the content of the extra field row, a string like this: [{"id":"1","value":"mytestvalue"},{"id":"2","value":["2","3"]}]
now, I did not understand how show on the screen, starting from this value, the exact content of the JSONS strings....
can you help me?!?! PLEASE!!!
I attach my basic file.....
thank you
Can you help me? I need to show in my php test page the content of an item which has 3 extrafields.
I've tried to use your examples but but I was only able to show on screen the content of the extra field row, a string like this: [{"id":"1","value":"mytestvalue"},{"id":"2","value":["2","3"]}]
now, I did not understand how show on the screen, starting from this value, the exact content of the JSONS strings....
can you help me?!?! PLEASE!!!
I attach my basic file.....
thank you
Please Log in or Create an account to join the conversation.
- Maurizio Peisino
-
- Offline
- New Member
Less
More
- Posts: 3
13 years 7 months ago #88979
by Maurizio Peisino
Replied by Maurizio Peisino on topic Unserialize(?) extra fields
Probably you receive this because in the article properties you need to select "show extra fields", so the model parse this json string from database and give you the object you expect in template
Please Log in or Create an account to join the conversation.