diff -r 0d9a58d2c515 -r 0d28b7c10758 web/wp-content/themes/WNN-WP/functions.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/themes/WNN-WP/functions.php Fri Mar 12 13:29:04 2010 +0000 @@ -0,0 +1,255 @@ + "Front Page Advertisement", + "type" => "title"), + + array( "type" => "open"), + + array( "name" => "Adsense Code", + "desc" => "Enter Your Adsense Code for a 468x60 advertisement.", + "id" => $shortname."_ad_code", + "type" => "textarea"), + + array( "type" => "close"), + + array( "name" => "Featured Post Image (Width 267px)", + "type" => "title"), + + array( "type" => "open"), + + array( "name" => "Img Url", + "desc" => "Enter the url to the image you would like to appear (max width of 267px).", + "id" => $shortname."_fimg", + "type" => "textarea"), + + array( "type" => "close"), + + array( "name" => "Featured Video (333x333px)", + "type" => "title"), + + array( "type" => "open"), + + array( "name" => "Featured Video", + "desc" => "Enter the code for the featured video (333x333px).", + "id" => $shortname."_fvideo", + "type" => "textarea"), + + array( "type" => "close"), + + array( "name" => "Advertisement Cubes (125x125px)", + "type" => "title"), + + array( "type" => "open"), + + array( "name" => "First Advertisement Image", + "desc" => "Enter the image for the first advertisement.", + "id" => $shortname."_ad1img", + "type" => "textarea"), + + array( "name" => "First Advertisement Link", + "desc" => "Enter the link for the first advertisement.", + "id" => $shortname."_ad1link", + "type" => "textarea"), + + array( "name" => "Second Advertisement Image", + "desc" => "Enter the image for the second advertisement.", + "id" => $shortname."_ad2img", + "type" => "textarea"), + + array( "name" => "Second Advertisement Link", + "desc" => "Enter the link for the second advertisement.", + "id" => $shortname."_ad2link", + "type" => "textarea"), + + array( "name" => "Third Advertisement Image", + "desc" => "Enter the image for the third advertisement.", + "id" => $shortname."_ad3img", + "type" => "textarea"), + + array( "name" => "Third Advertisement Link", + "desc" => "Enter the link for the third advertisement.", + "id" => $shortname."_ad3link", + "type" => "textarea"), + + array( "name" => "Fourth Advertisement Image", + "desc" => "Enter the image for the fourth advertisement.", + "id" => $shortname."_ad4img", + "type" => "textarea"), + + array( "name" => "Fourth Advertisement Link", + "desc" => "Enter the link for the fourth advertisement.", + "id" => $shortname."_ad4link", + "type" => "textarea"), + + array( "type" => "close") + + +); + +function mytheme_add_admin() { + + global $themename, $shortname, $options; + + if ( $_GET['page'] == basename(__FILE__) ) { + + if ( 'save' == $_REQUEST['action'] ) { + + foreach ($options as $value) { + update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } + + foreach ($options as $value) { + if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } } + + header("Location: themes.php?page=functions.php&saved=true"); + die; + + } else if( 'reset' == $_REQUEST['action'] ) { + + foreach ($options as $value) { + delete_option( $value['id'] ); } + + header("Location: themes.php?page=functions.php&reset=true"); + die; + + } + } + + add_theme_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'mytheme_admin'); + +} + +function mytheme_admin() { + + global $themename, $shortname, $options; + + if ( $_REQUEST['saved'] ) echo '

'.$themename.' settings saved.

'; + if ( $_REQUEST['reset'] ) echo '

'.$themename.' settings reset.

'; + +?> +
+

settings

+ +
+ + + + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + +

+ + +

+ + +

+ + + + \ No newline at end of file

" />
 
 
 
 
 
 
+ /> +