Hello list,
can anyone be so kind to tell how (and if?) is possible to override in a multisite two variables coming from the Category_default.module initially looking like:
INSERT INTO `variable` VALUES ('catdef_storylink_50', 'i:0;');
so that they finally look like:
INSERT INTO `variable` VALUES ('catdef_storylink_50', 'a:1:{i:0;s:2:"75";}');
?
I've tryed in different ways, but keep getting errors:
1. using the whole string: 'catdef_storylink_50'=> 'a:1:{i:0;s:2:"75";}',
2. using only what's in between graffles: 'catdef_storylink_50'=> '{i:0;s:2:"75";}',
3. using only the number of the category: 'catdef_storylink_50'=> '75',
i keep getting the same error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /public_html/drupal/sites/mysite.com/settings.php on line 162
starting doubting this is actually possible...
Thanks lot
marco
On 12/7/06, marcob marcob@gawab.com wrote:
INSERT INTO `variable` VALUES ('catdef_storylink_50', 'a:1:{i:0;s:2:"75";}');
?
how about
variable_set('catdef_storylink_50',array('75'));
For more information on the function: http://api.drupal.org/api/4.7/function/variable_set
Regards, Greg
marcob wrote: 'catdef_storylink_50'=> 'a:1:{i:0;s:2:"75";}',
What you see is a serialized array. This is unserialized upon load; the definition should be unserialized, so you want to give it an actual array:
'catdef_storylink_50'=> array('75');
Greg, Merlin, thanks for the prompt help,
actually 'catdef_storylink_50'=>array('75'), worked like a champ! :)
PS: for handbook sake: would this approach be valid for *every* serialized array? if so i could eventually share your help under the "Define shared variables for all sites" page.
cheers, marco
On 08/dic/06, at 6:37 AM, Earl Miles wrote:
marcob wrote: 'catdef_storylink_50'=> 'a:1:{i:0;s:2:"75";}',
What you see is a serialized array. This is unserialized upon load; the definition should be unserialized, so you want to give it an actual array:
'catdef_storylink_50'=> array('75');
-- [ Drupal support list | http://lists.drupal.org/ ]