<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <font size="-1"><font face="Arial">Thanks, Satish. That'll come in
        handy :)</font></font><br>
    <pre class="moz-signature" cols="72">-- 
Regards,
Syahir Hakim

Contact:
<a class="moz-txt-link-freetext" href="http://www.khairul-syahir.com">http://www.khairul-syahir.com</a>
+64(21) 0333 649</pre>
    <br>
    On 21/10/2010 10:16 AM, Satish Gandham wrote:
    <blockquote
      cite="mid:AANLkTinAhRF39tSxLRB5emdvOJ52gzYEYU5tE2wNVEuz@mail.gmail.com"
      type="cite">This is the code i used when i decided to use array
      for storing options in my theme.<br>
      Code is self explanatory, feel free to contact me if you have any
      questions.<br>
      <br>
      &lt;?php<br>
      function on_theme_activation(){<br>
      &nbsp;&nbsp; &nbsp;if ( get_option('swift_activation_check')!="set" ){<br>
      &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//Checking if the user used the theme before<br>
      &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//Pick some variable from your theme and see if its set<br>
      &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(get_option('swift_logo_url')){<br>
      &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;foreach ($swift_options as $value) {<br>
      &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$swift_opt[$value['id']]=get_option($value['id']);<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;delete_option($value['id']); <br>
      &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br>
      &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;update_option('swift_opt',$swift_opt);&nbsp;&nbsp; &nbsp;<br>
      &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br>
      }&nbsp;&nbsp; &nbsp;<br>
      &nbsp;&nbsp;&nbsp; // Add marker so it doesn't run in future<br>
      &nbsp;&nbsp;&nbsp; update_option('swift_activation_check', "set");<br>
      <br>
      }<br>
      add_action('admin_head', 'first_run_options');<br>
      ?&gt;<br>
      <br>
      <br>
      Satish Gandham<br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
theme-reviewers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a>
<a class="moz-txt-link-freetext" href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a>
</pre>
    </blockquote>
  </body>
</html>