dryanwp
Member
Posted 3 years ago #
I really like this plugin (esp the widget). But I would like to be able to change the contents of the field pb_embedFlash_widgets in the options table using a php script (so I can schedule different videos to display at different times). Unfortunately any change to the content of the pb_embedFlash_widgets field seems to inactivate the plugin.
Any suggestions?
This could have several reasons:
- Does your script use
unserialize and serialize to read/store the data from/into the pb_embedFlash_widgets field?
- Do you modify the structure in any way?
If the advices don't help then I'll need the full PHP code.
dryanwp
Member
Posted 3 years ago #
My mistake. In pb_embedFlash-widets you find an array whose elements look like this:
s:5:"title";
The "5" refers to the number of characters in "title". If you change "title" to "my_title" you must also change 5 to 8 or the plugin breaks.
You can ease your program heavily by using unserialize to make an array out of the {s:5:"title";...} string and use serialize to do vice versa. :D
Nothing else I'm doing to store an array in a single option field.