$oval) /* fetch saved my theme and change values */ { $val = ttw_getmyopt($key); /* get the saved value */ if ($val !== false) { ttw_setopt( $key, $val); /* and set value really used */ } } } else { /* picked a pre-defined sub-theme */ // apply_filters('ttwx_themes_gettheme',$def,$use_subtheme))) // might be plugin theme // find the file name based on the name $theme_file = 'wvr-wheat'; // a default version foreach ($ttw_themeList as $theme) { if ($theme['name'] == $use_subtheme) { $theme_file = $theme['file']; break; } } // build the filename $filename = get_template_directory_uri() . '/subthemes/' . $theme_file . '.wvr'; ttw_upload_theme($filename, true /* main only */); } ttw_setopt('ttw_subtheme', $use_subtheme); ttw_saveopts(); } function ttw_savemytheme() { /* saves current settings into My Saved Theme */ global $ttw_optionsList; /* save current value into mysaved theme database */ foreach ($ttw_optionsList as $key => $oval) { $val = ttw_getopt($key); /* get the current value */ ttw_setmyopt( $key, $val ); /* and save into 'my_' db */ } ttw_setopt('ttw_subtheme', 'My Saved Theme'); ttw_saveopts(); } function ttw_themes_admin() { /* The opening default admin panel - used to pick a predefined theme. Put it first because it is less intimidating than the Main Options tab. */ global $ttw_themeList; ?>

Predefined Weaver Themes

Welcome to 2010 Weaver

Weaver gives you extreme control of your WordPress blog appearance using the different admin panels here. This page lets you get a quick start by picking one of our many predefined sub-themes. Once you've picked a starter theme, use the Main Options and Advanced Options panels to tweak the theme to be whatever you like. After you have a theme you're happy with, you can save it - both in the site data base, and as a download. The Snippets tab has some hints for additional fine tuning, and the Help tab has much more useful information.

Get started by trying one of the predefined sub-themes!

\n"); $themeimgs = get_template_directory_uri() . '/subthemes/'; /* first, show the default theme */ if (!ttw_getadminopt('ttw_hide_theme_thumbs')) { echo ("

Sub-theme thumbnails

\n"); echo (''); $col=0; /* have default, so start at 1 */ foreach ($ttw_themeList as $theme) { $name = $theme['name']; if ($name == 'My Saved Theme') { $img = ''; $desc = ''; } else if ($name == '') { $img = $themeimgs . 'custom.jpg'; $desc = "Description not available"; } else { $img = $themeimgs . $theme['img']; $desc = $theme['desc']; } if ($img == '') continue; // don't show my saved theme... if ($col == 0) {echo '\n"; ++$col; /* track # of cols output */ if ($col > 3) { echo ''; /* end of row? */ $col = 0; } else echo ''; echo "
';} echo("$name
"); /* info about the theme */ echo "
"; echo "$desc"; echo "
'; } if ($col != 0) echo '
\n"; /* all done with table */ } // end don't hide thumbs ?>

Get even more sub-themes.

More sub-themes are available for easy download at Twenty Ten Weaver Sub-Themes.

Select a theme:   Select a predefined sub-theme from the list. Current theme: $curTheme"); echo ("  "); ?>
  type='submit' value='Set to Selected Sub-Theme'/> Please note: Changing sub-theme will replace all your current "Main Options" settings. You can save them first with the "Save in My Saved Theme" button below.
  Save all currently saved options as My Saved Theme. You will be able to restore these later by selecting My Saved Theme. Please note: be sure to click Save Current Settings on the Main Options panel first to save any changes you might have made.
Please note: Changing sub-theme will replace all current "Main Options" settings, plus "Advanced Options" Predefined Theme CSS Rules settings. Other "Advanced Options" settings are not changed. (You can also save all current settings from the Save/Restore tab).
  Save all currently saved options (both Main and Advanced) as My Saved Theme. You will be able to restore these later by selecting My Saved Theme.
Theme name:  " />  This name is used only here, but is preserved when you "Save" a theme using this admin tab.
Theme image file:   " />
Theme description:   " />

Save/Restore Themes

You can save all the settings from the current theme by:

  1. "Save in My Saved Theme" - Saves a copy in server's database. Survives Weaver Theme updates. -or-
  2. Download current theme settings to a file on your own computer. -or-
  3. Save settings to a file on your Site's file system (in .

You can restore a saved theme by:

  1. Picking "My Saved Theme" from the standard themes list. -or-
  2. Restoring a theme that you saved in a file on your site (to "My Saved Theme"). -or-
  3. Uploading a theme from a file saved on your own computer (to "My Saved Theme"). -or-
  4. Uploading a theme from a web based URL (to "My Saved Theme").

You will be unable to restore your saved file directly

Since this is a WordPress Multi-site installation, you are restricted from uploading a Weaver theme from a saved file. However, the save file capability gives you the ability to save your work so you can transfer it to a WordPress site where you have full admin capabilities (non-Multi-site installation, for example), or to share with others. Please note that you can save your settings in "My Saved Theme" which will allow you to explore other predefined themes without losing your work.


Use "My Saved Theme"


Save Current Theme to File or Download to your computer

Save all currently saved options (both Main and Advanced) either by downloading to your computer or saving a file on your WordPress Site's directory. You will be able to restore this theme later using the Restore Theme button. Please note: be sure to click Save Current Settings first to save any changes you might have made.

Save as file on this website's server

Please provide a name for your file, then click the "Save File" button. Warning: Duplicate names will automatically overwrite existing file without notification.

Name for saved theme:  (Please use a meaningful name - do not provide file extension. Name might be altered to standard form.)
   Save Theme in File - Theme will be saved in directory on your site server.

Download to your computer

Please right-click ">[* here *] to download the saved theme to your computer.


Restore Saved Theme from file or URL

You can restore a previously saved theme file, directly from your WordPress Site's directory, from a file saved on your computer, or by providing an "http" URL address of the file (this might be from another site with Weaver themes). Note: after you restore a saved theme, it will be loaded into "My Saved Theme". If you've uploaded the theme from your computer or a URL, you might want to also then save a local copy on your website server.

Restore from file saved on this website's server
Select theme file name:  (Restores to "My Saved Theme")
   Restore a theme you've previously uploaded to your site's directory. Will become current "My Saved Theme".
 
" method="POST">
Upload file saved on your computer
Select theme file to upload:  (Restores to "My Saved Theme")
 Upload and Restore a theme from file on your computer. Will become current "My Saved Theme".
 
Restore from a URL
Enter theme file URL:  (Restores to "My Saved Theme")
Upload and Restore a theme from a web URL address. Will become current "My Saved Theme".

Sub-theme Maintenance

Warning!This action can't be undone, so be sure you mean to delete a file!

'; echo 'It looks like '.$save_dir.' does not exist.

You will need to create this writable directory in order to save sub-themes on your site.

Maybe This Article from WordPress will help.'; echo '


'; } else if (!is_writable($save_dir)) { if(!is_writable($save_dir)){ echo '

'; echo 'It looks like '.$save_dir.' is not writable.

You will need to directory writable in order to save sub-themes on your site.

Maybe This Article from WordPress will help.'; echo '


'; $ttw_theme_dir_writable = false; } } if (!$ttw_theme_dir_writable) return ''; $filename = $save_dir . '/'. $usename; // we will add txt if ( !($handle = fopen($filename, 'w')) ) { ?>

Sorry, something went wrong.

We were unable to create the temporary file to save the theme on the server. It is likely some kind of server file permission problem.

$val) { $curVal = ttw_getopt($key); $ttw_optionsList[$key] = $curVal; } /* ok, write that sucker out! */ $tosave = serialize($ttw_optionsList); fwrite($handle, $tosave); fclose($handle); return $save_url . '/' . $usename; } function ttw_upload_theme($filename, $main_only = false) { $handle = fopen($filename,'r'); if (!$handle) return ttw_file_fail("Can't open $filename"); /* can't open */ $contents = null; while ( !feof($handle) ) { $contents .= fread($handle, 1024); } fclose($handle); return ttw_save_serialized_theme($contents,$main_only); } function ttw_load_subtheme($filename) { $handle = fopen($filename,'r'); if (!$handle) return ttw_file_fail("Can't open $filename"); /* can't open */ $contents = null; while ( !feof($handle) ) { $contents .= fread($handle, 1024); } fclose($handle); return ttw_save_serialized_theme($contents); } function ttw_save_serialized_theme($contents, $main_only = false) { global $ttw_optionsList, $ttw_retain_opts; if (substr($contents,0,10) != "TTW-V01.10") return ttw_file_fail("Wrong theme file version"); /* simple check for one of ours */ $restore = array(); $restore = unserialize(substr($contents,10)); if (!$restore) return ttw_file_fail("Unserialize failed"); foreach ($ttw_optionsList as $key => $val) { /* first, clear EVERYTHING in both current and mysaved */ if (!$main_only) { ttw_deleteopt( $key ); ttw_deletemyopt( $key ); } else { if (!in_array($key, $ttw_retain_opts)) ttw_deleteopt( $key); } } st_set_to_defaults(); /* now restore defaults - saved will override changes */ /* now can set the new values from $restore */ foreach ($restore as $rkey => $rval) { if ($rval != '') { if (!$main_only) { ttw_setopt( $rkey, $rval ); /* and set both sets of values */ ttw_setmyopt($rkey, $rval); } else { /* setting to subtheme - retain some stuff */ if (!in_array($rkey, $ttw_retain_opts)) ttw_setopt( $rkey, $rval ); } } } ttw_setopt('ttw_subtheme', 'My Saved Theme'); ttw_saveopts(); /* and write them to db! */ return true; } function ttw_file_fail($msg) { // might someday do something with this ttw_debug($msg); return false; } ?>