Keyword

Unserialize(?) extra fields

  • news-blitz
  • news-blitz's Avatar Topic Author
  • Offline
  • New Member
More
14 years 4 days 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.

More
13 years 10 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.
Attachments:

Please Log in or Create an account to join the conversation.

More
13 years 10 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
Attachments:

Please Log in or Create an account to join the conversation.

  • Gianmichele Genovese
  • Gianmichele Genovese's Avatar
  • Offline
  • New Member
More
13 years 6 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
Attachments:

Please Log in or Create an account to join the conversation.

More
13 years 1 week 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.


Powered by Kunena Forum