<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>WPMU DEV Community &#187; Topic: Default some widgets when a blog is created.</title>
		<link>http://premium.wpmudev.org/forums/topic/default-some-widgets-when-a-blog-is-created</link>
		<description>WPMU DEV Community &#187; Topic: Default some widgets when a blog is created.</description>
		<language>en-US</language>
		<pubDate>Wed, 22 May 2013 12:28:39 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://premium.wpmudev.org/forums/search.php</link>
		</textInput>
		<atom:link href="http://premium.wpmudev.org/forums/rss/topic/default-some-widgets-when-a-blog-is-created" rel="self" type="application/rss+xml" />

		<item>
			<title>mikee17 on "Default some widgets when a blog is created."</title>
			<link>http://premium.wpmudev.org/forums/topic/default-some-widgets-when-a-blog-is-created#post-19928</link>
			<pubDate>Mon, 16 Nov 2009 15:16:05 +0000</pubDate>
			<dc:creator>mikee17</dc:creator>
			<guid isPermaLink="false">19928@http://premium.wpmudev.org/forums/</guid>
			<description><p>Bowromir, if you are not technically involved...a better method may be to just have it as a plugin and give instructions on how to activate that plugin.</p>
<p>Thanks &#38; Regards
</p></description>
		</item>
		<item>
			<title>Bowromir on "Default some widgets when a blog is created."</title>
			<link>http://premium.wpmudev.org/forums/topic/default-some-widgets-when-a-blog-is-created#post-19654</link>
			<pubDate>Fri, 13 Nov 2009 19:15:32 +0000</pubDate>
			<dc:creator>Bowromir</dc:creator>
			<guid isPermaLink="false">19654@http://premium.wpmudev.org/forums/</guid>
			<description><p>Mikee17 are you willing to share this code with me? I'm setting up a (non profit) wpmu powered site and I would like to make it easier for new members to get started, so I would like to add some default pages/widgets as well.. I'm no programmer whatsoever but if with some minor instructions I might be able to get it working for my site.. </p>
<p>Please let me know :)<br />
Bowe
</p></description>
		</item>
		<item>
			<title>mikee17 on "Default some widgets when a blog is created."</title>
			<link>http://premium.wpmudev.org/forums/topic/default-some-widgets-when-a-blog-is-created#post-19602</link>
			<pubDate>Fri, 13 Nov 2009 12:19:04 +0000</pubDate>
			<dc:creator>mikee17</dc:creator>
			<guid isPermaLink="false">19602@http://premium.wpmudev.org/forums/</guid>
			<description><p>Thanks Andrew, that solved the issue, was using unserialize at the wrong line.</p>
<p>Thanks &#38; Regards
</p></description>
		</item>
		<item>
			<title>Andrew on "Default some widgets when a blog is created."</title>
			<link>http://premium.wpmudev.org/forums/topic/default-some-widgets-when-a-blog-is-created#post-19521</link>
			<pubDate>Thu, 12 Nov 2009 19:10:21 +0000</pubDate>
			<dc:creator>Andrew</dc:creator>
			<guid isPermaLink="false">19521@http://premium.wpmudev.org/forums/</guid>
			<description><p>Hiya,</p>
<p>You cannot edit a serialized string. You'll need to unserialize it, and edit the array.</p>
<p>Thanks,<br />
Andrew
</p></description>
		</item>
		<item>
			<title>mikee17 on "Default some widgets when a blog is created."</title>
			<link>http://premium.wpmudev.org/forums/topic/default-some-widgets-when-a-blog-is-created#post-19497</link>
			<pubDate>Thu, 12 Nov 2009 14:27:28 +0000</pubDate>
			<dc:creator>mikee17</dc:creator>
			<guid isPermaLink="false">19497@http://premium.wpmudev.org/forums/</guid>
			<description><p>Hi,</p>
<p>Ref: WPMU Ver.: 2.8.4</p>
<p>We are working on some custom functions that adds required pages, plugins, widgets automatically apart from the default stuff when a new blog is created.</p>
<p>Successfully,<br />
1. Added additional posts/pages as required.<br />
2. Added some code to have plugins to be active by default using &#62;&#62; update_blog_option($blogID, 'active_plugins', $default_plugins);<br />
* $default_plugins is an array of plugins path.<br />
3. Added code to activate some sidebar widgets<br />
update_blog_option($blogID, 'sidebars_widgets', unserialize('a:4:{.....;i:3;}'));  &#38;<br />
update_blog_option($blogID, 'widget_name', unserialize('a:7:{s:5:&#34;....&#34;;}'));<br />
All the above works well.</p>
<p>The issue is,<br />
when for the 3rd above if we want to add a dynamic value to the string inside the &#34;unserialize&#34; fn()...say for eg:<br />
$blogkeyword = &#34;baseball&#34;;<br />
unserialize('.....s:8:&#34;keywords&#34;;s:6:&#34;'.$blogkeyword.'&#34;;s:9:......;}';) does NOT work....it does not get updated to the database.<br />
It works well if the above is like:<br />
unserialize('.....s:8:&#34;keywords&#34;;s:6:&#34;baseball&#34;;s:9:......;}';)</p>
<p>Am I missing anything or doing anything wrong? Kindly advice....</p>
<p>Thanks &#38; Regards
</p></description>
		</item>

	</channel>
</rss>
