|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
+ M6 n3 v, O9 m* w// Theme Option$ n: |+ i6 t# y6 E$ b
////////////////////////////////////////////////////////////////////////////////
+ x! ]; @3 b$ G7 \# D% Q+ _% ^- i9 `& ~. Z$ g$ P* `
$themename = "Zenx";
$ q2 u4 D+ m1 N; _$shortname = str_replace(' ', '_', strtolower($themename));
% n1 T% n+ F- \9 `% c4 V7 W9 |6 o" C L0 v* W
function get_theme_option($option)9 O, [2 {, _5 ~' j! R
{1 f" Z; t& o$ G
global $shortname;
q- ?' j' s3 `' X3 | return stripslashes(get_option($shortname . '_' . $option));& P" [$ {* ^) B. Q' b1 F2 C0 m
}3 T0 G$ k7 p" D, Y. z+ _, x2 M
, b' ]7 w5 [7 e+ ]/ g6 H
function get_theme_settings($option)
& U. K; o# O* w" L2 ~9 j{
. E; F: q5 B7 a return stripslashes(get_option($option));3 m4 M9 F2 k0 ]8 S0 \9 I: o
}3 M( ^- V2 b; x( z) v* u
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");* f6 }2 I% L) ~8 O/ d
$wp_getcat = array();3 X+ p! z$ D8 [, E
foreach ($wp_dropdown_rd_admin as $category_list) {! R6 ]: A0 i& O+ g9 j( m
$wp_getcat[$category_list->term_id] = $category_list->name;
+ Z) c4 S5 j S}+ M8 n: `) A+ S1 f6 ~5 w
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
4 w' c. P4 u. i; x( b$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");" [/ z' J, Z4 N5 J& M, c
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");% Z1 ]9 {& |- ?/ n* j8 r
; i2 u6 E7 P" s8 ?5 }$options = array (
* J" [& ^5 s0 U/ i) q: n2 w
`: W. A, e- X/ j! @* v# g$ {! x% u# a* n; u8 W/ S3 V5 \2 k" l
array( "name" => "Blog Header Settings",' \8 \1 L5 V7 a9 k$ p: d& N/ c
"type" => "heading",
& V1 e& ? U' p" h. t ),
! F+ u! G4 g f9 a0 b2 `; j2 B+ R/ [/ J. B8 A
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) r0 B7 e8 Y1 O* I' h
"id" => $shortname."_header_logo_activate",
" o0 u4 g0 V R. b "type" => "select",1 N' i/ L) L! |# c* l9 K
"std" => "No",7 x& n1 J8 l2 S# W' J
"options" => array("No", "Yes")),8 M7 F! R1 s9 t5 L8 c2 m v
7 M) E) n! B! A7 \' ?& C
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",/ k' M+ U1 G, {/ m& R5 C/ } ]( Z
"id" => $shortname."_logo_url",/ A+ k: n- J6 q3 Z. {
"type" => "text",9 s2 j0 N0 X$ v0 S1 c, E. \" r
"box" => "social", w- h5 A' `# K; J% z5 U* Z! V
"std" => "",
# E+ r+ R$ C. {3 j3 r4 Y2 F ),- q) s: E$ E( T: y- L- k
( k( ~0 X3 r2 U3 i! ~* M% [
array( "name" => "Insert Header Banner HTML Code (Header)
9 i% r. X; S' X! B4 R1 ] K0 d <br /><em>*Recommended Size 468 x 60</em>) k8 u* k* N* x
<br /><em>*leave blank if not use</em>",
1 \1 A1 p3 V0 l7 f N: s# V7 `: t7 m "id" => $shortname."_header_banner",$ b7 E. ?9 E) n; w( o1 I
"type" => "textarea",* {, U6 h6 y9 ?; F `5 B( { d
"std" => "",3 u3 U u& Z: d: K
),
4 |- J7 {9 ?/ i2 ^) Y
# H- A3 p6 c; i) x array( "name" => "</div></div>",+ o8 M7 F( c) t! v
"type" => "close",
. |- ]* G* }0 P ),. y! n; P# W7 B. \
" i2 M% ]/ y4 x+ B
+ A' ?8 ~5 S- z' C: X array( "name" => "Header Navigation Settings",1 p& L, u( X) Q
"type" => "heading",' T" n) J B7 O5 M$ O) D( e+ s2 D
),$ b2 b1 _" Z+ ]4 m+ a
! U& S7 e2 ]' M/ j1 O, U- ^
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />5 `, }; ?* H( C
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />1 Z6 z6 e9 X- f g
<em>*Enter the page post ID number only</em><br />
! j) c& i' j. y: M <em>*separate by comma</em><br /> W- A6 f7 C8 x7 F N
<em>*Exclude pages which you don't want to show on the header navigation</em>",
0 W' o/ q+ W" F6 c* i "id" => $shortname."_header_page_navigation",
/ p' F- | ?3 L |, D. {1 [ "type" => "text",$ d. e1 V2 o t; S
"std" => "",
) C8 t; \& D0 l! w- `# ? ),- |+ _* @# [5 s0 K; {% b
$ w: J1 L' b8 o$ N8 X array( "name" => "</div></div>",) w3 [& G* U! g$ Z1 x$ }' k' _+ H* \$ W
"type" => "close",
& C; \/ ^/ t( ` ),6 r1 t. m, f9 w" f, K
. J# N6 b" _. t4 Y' Y0 o& t. n
$ Q# T1 l5 z/ M, l array( "name" => "Post Auto Thumbnails Settings",3 a/ p* e3 E) W8 y6 h( p
"type" => "heading",% W+ C* x5 O5 Q: D. M; n( y5 F
),
6 w, t. f8 g J! U& c3 T
$ o4 @8 A4 I: Q$ G array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
- @, j. l% r' Y' ?" L/ I6 n- {: e "id" => $shortname."_timthumb_activate",$ y+ G- I% L! X x
"type" => "select",. E" _- w( a6 |: h3 ~
"std" => "No",6 Q6 i e% C6 ]
"options" => array("No", "Yes")),
# |# n6 j4 d( w. }% L
1 c2 `3 S$ P" \8 ^4 A {9 l: u array( "name" => "If Timthumb is enabled, Please choose its cropping method",
! ?/ g7 S: G" i& b' d" v "id" => $shortname."_timthumb_cropping",
# N! Q- b) f& U- E "type" => "select",
l) c2 G# d: J% p% f "std" => "",
; }; i( B8 y2 M$ L; [0 D3 K. ?2 L "options" => $crop_position),0 C( I) c) L I: x' O3 P+ x
7 N- j9 q& x% j1 M. I% ^$ o; w array( "name" => "Insert Width Of Thumbnail Image<br />
/ G* J0 {9 |- [. Y <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
# q7 h( y2 y7 G! V! H# B <em>*Leave Blank To Use Default: 250</em><br />",
8 \3 ~* B- j+ x "id" => $shortname."_thumb_width",- ~3 k: u% J! c
"type" => "text",$ O" ^( a0 v" n2 o+ k! o/ Q
"std" => "",
! c- q% u8 p% E2 _0 ~! U ),2 K2 \, H' p9 B
+ ?7 j# L" T2 n( }! O0 O array( "name" => "Insert Height Of Thumbnail Image<br />
8 l7 D4 v7 l# a <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />0 ?1 M& @- Z: ]9 |8 J/ d- m1 _0 w
<em>*Leave Blank To Use Default: 200</em><br />",2 Z: k% _: c4 q3 A: c3 k9 Z
"id" => $shortname."_thumb_height",( R4 o1 h ~. m$ e4 A; U
"type" => "text",
8 C& ~$ c4 L5 z1 a "std" => "",
% Z+ q: Y$ h* f4 t ),! h& V4 ^5 D0 C0 _
" @3 a. j& K2 _ k# G& q
array( "name" => "</div></div>",
: ?7 Q7 O6 ~& F' M) B1 G "type" => "close",
; b; z N1 I' ]% l" i$ c ),: s: S; M4 j# i* z' U: g- r
# I. r# o0 ~) a& p$ g! E# }
array( "name" => "Featured Content Slider Settings", S7 J* D. y$ t
"type" => "heading",
( |# D: l5 m' j7 ]8 p, M; k ),0 ]0 x* W1 S) Z. [- Q
+ y7 p8 X, o- K: c, b: R* X
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
' Z- u K( r- @: a2 m+ H "id" => $shortname."_featured_activate",1 G' l$ R. C. T, c9 c) W4 X
"type" => "select",
! }* c0 v# h4 T$ \ "std" => "No",
' ~9 G6 K6 n5 s3 V4 V "options" => array("No", "Yes")),9 o$ N- v1 e( k: }1 c+ J9 N
* k* K9 d% I. c! b$ H1 d
4 x, W, \ p# J @3 [ array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",/ }* D6 s/ R& D. T% _ @8 A% J# v
"id" => $shortname."_featured_category",* B5 Z3 @4 h; @ F
"type" => "select",5 p4 o* B" z8 l1 c+ {) F& O- A
"std" => "Choose a category:",9 X9 c$ i. d D9 B
"options" => $wp_getcat),) \' j; {% Z0 L8 ^* ]- l
, U0 Q7 k3 Y; m( u/ c/ q: d
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",$ ]1 u# ?& F1 ]4 L0 ?$ g
"id" => $shortname."_featured_number",, K2 D! c: N. y) I2 c) F
"type" => "select"," X) W/ y, U1 u! G
"std" => "Number of post:",
; b& a2 @/ s) X) \4 B1 R0 ~ "options" => $number_entries),
% e3 H9 `$ t; W! o4 c, h- p
" Z4 @. g& a; t array( "name" => "</div></div>",9 \3 ^5 ~, u. q, t
"type" => "close",
- d1 v: H0 B0 O0 }! r) a ),
5 r4 v- y+ t, t4 d ; v* z8 ]- a8 K) U2 v: ]0 {
array( "name" => "Featured Category Settings",3 P6 F+ W+ V9 N3 G! ~
"type" => "heading",# f5 v, A) o7 y) \ X
),9 I' u' g# v( }7 u
) U3 a- U. z* @' B, ^( d% d array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
" u' ^7 N+ \ ^0 r/ J "id" => $shortname."_featured_category_activate",
5 v6 J! u* {; I& x5 ?9 N$ ^4 p "type" => "select",% e P1 J+ `% l( X! j5 S, m
"std" => "No",% O8 H- E5 b7 H: A6 Z, q$ q
"options" => array("No", "Yes")),- E' b) L6 ?, y& y; e, N
0 u8 f: j$ @; `. `
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",; I' ]' w, H9 |; D! p
"id" => $shortname."_featured_category_id1", c, m. `" s+ M7 u- l
"type" => "select",
8 H, l% X5 C @' G; N* p# i "std" => "Choose a category:",+ a0 E) d2 p0 h8 U
"options" => $wp_getcat), i5 m0 b4 i$ S- ~# | Y: S1 B7 {
, A m, |" J" w. ~( }! y array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",, ?) K% Q5 U, Q
"id" => $shortname."_featured_number1", P/ A, C: l" S/ B7 h# o& @
"type" => "select",+ r9 L$ B0 h( ?# D2 O
"std" => "Number of post:",# s% u$ a5 n3 U/ j% B; ~2 U1 C
"options" => $number_entries),# u4 g' ~. p! ?. \' ~ c
4 X& f9 @( M' b array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",- R% G$ T- `$ L S
"id" => $shortname."_featured_category_id2",4 E: w2 [: w; n; o0 A( b/ }
"type" => "select",
5 r; v/ W: A) S) X% d! r "std" => "Choose a category:",
9 @5 {, X( j3 O "options" => $wp_getcat),
" n$ `1 ]" \" ~5 u% z# ]2 ]
6 @( f( L# s; l4 n. z4 p array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",8 a; U$ s6 n1 S% [
"id" => $shortname."_featured_number2",
5 T3 ~- J# m+ u "type" => "select",
; o' i, [# e1 k4 x; ^ "std" => "Number of post:",% i1 x$ x( w2 X6 ?2 j3 E4 q
"options" => $number_entries), u. J. u: |$ t9 h& w5 B( l" ~. U# @
+ R$ h7 U" ^, |7 U5 i' E: Q0 { 2 N. Y/ z6 t% h" O
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
% Y/ [$ E3 k; {: b "id" => $shortname."_featured_category_id3",
5 N* v, X$ R7 K- Y) K! j* G "type" => "select",
0 ~8 M& @8 V1 |7 ]. ~. t/ Q) J- C "std" => "Choose a category:",% y! N2 Q* Z0 Y6 s; m
"options" => $wp_getcat),
* q& W+ j* ]4 f7 h) u
: f1 y _- F8 O B' `7 X' ]7 ^ array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",& D0 D# f* {# [5 |! H- B5 b& ?8 x' J/ f
"id" => $shortname."_featured_number3",/ H- J* N! q$ [0 \
"type" => "select",
* v% C' X6 U( ?5 Z6 f0 q& Z "std" => "Number of post:",% C2 H, K Z! [
"options" => $number_entries)," [9 a8 Y+ V6 Y$ A1 C8 u3 C" y
6 V( H0 C* d) L
# T$ M+ x4 V) }" ]7 |/ R
array( "name" => "</div></div>",$ P& A7 p- d+ I- M) e1 H0 p. K
"type" => "close",# Y& |: p2 [7 e1 F( \
),
5 f, o7 x% o1 x( C# p$ p7 R
' f: A" {- l/ |1 \ F
7 ?0 F- ]- e+ n+ Y3 x5 R1 c/ d, X array( "name" => "Google Adsense & Analytics Settings",' ] o: f4 G, d8 \$ T
"type" => "heading",
( P$ e9 J' L+ o+ R; s1 x ),0 l+ `+ O7 X. F& H2 A j
# V0 v P. X! q1 m) R
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",/ J2 C$ v! P" ?9 Q
"id" => $shortname."_adsense_loop_activate",1 O7 Z O/ c! |: s; c& n
"type" => "select",4 g ~) c" k- ^3 _, w8 U
"std" => "Disable",6 D- O( @4 F- x( S( C
"options" => array("Disable", "Enable")),5 B: y& S$ R. f1 I* `
! R& U8 T. F# j. k! p6 o' ]
array( "name" => "Insert Google Adsense Code For Loops Here<br />: i8 |* A) P1 C# w; [; M: q7 l
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
3 s9 D1 [5 w8 ^# s( y7 m "id" => $shortname."_adsense_loop",
6 j4 l2 J* c( o x7 ^ "type" => "textarea",
4 R8 ]8 `8 l; O "std" => "",; A H& |0 ?6 T; D' `$ b
),1 ^3 x! B/ u) w& _
7 Y4 I8 P9 B/ c* {, m array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",! C# ?# W7 T' `
"id" => $shortname."_adsense_single_activate",& `" x% O% q: c, l6 D
"type" => "select",9 [0 I& n/ S6 @1 A0 l
"std" => "Disable",9 O( {( l* Q) e; Z' {) E0 d% l$ U
"options" => array("Disable", "Enable")),
) s9 s: U( y+ Q) ~( |
( I- h& n/ x7 X' L array( "name" => "Insert Google Adsense Code For Single Page Here<br />
( n% u' F0 [3 @1 z, A <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
+ Z) |/ O: q5 K. r' Y "id" => $shortname."_adsense_single",
( r9 c5 i3 x6 ^+ c "type" => "textarea",
& c- v+ Q( T! N5 L0 o E- H9 f "std" => "",
% Z1 |0 g% l* ^) g, X/ d ),
/ X6 X% Z3 q* G+ t! ~, N Z
i4 a# E& a+ h2 r8 W
0 D# n" {0 P# {1 F/ A/ c, ]% e array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",( t1 }. f8 \' E# z- u0 z0 f2 y
"id" => $shortname."_google_analytics",
8 g$ |2 A w7 j1 n% z9 G, v# u "type" => "textarea",$ [0 u- L* a/ I9 P
"std" => "",
, F1 h) _+ z8 g4 u. H ),
. j3 s2 g3 O' Y {! q) k! \! y B3 V6 v
array( "name" => "</div></div>",8 f% X- L: f# H$ a
"type" => "close",$ s) e b6 C& N. A* ]: [6 R- W, x
),. ]/ ~9 j# N R8 r# X
; c- h" i& E. X! r . O% `3 t A" k$ @7 t
array( "name" => "AddThis Social Bookmarking Settings",
! p# L: H5 J8 U- M' U7 a "type" => "heading",
# u7 e* c( D. R7 i )," g7 L: S" U& l$ s' e: V! r
" D+ O7 h, a3 P3 o array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>' | e# f3 K) V4 b( \" ]& h5 j+ c# e
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
r W7 v% w9 C( O "id" => $shortname."_addthis",2 B" b9 o' U, _( K
"type" => "text",$ L6 ]& h; H5 x. J% m; h' R
"box" => "social",% W, ^6 o8 a7 R. v
"std" => "",& n' Z, p5 C# l2 _) ?2 s1 W+ u! P
),; `; A) v' K+ T/ A/ f% V% W
: K0 v/ S0 w/ E. a array( "name" => "</div></div>",( Q, t r$ ]0 H2 }, p
"type" => "close",
[7 B" G: |2 x$ k$ X5 H ),( u' A$ T# f5 r( Q" n
6 q. B- L4 @ j* u8 o
* o+ l- |4 T; L* L7 d# q* d( t " Z- e, m) m; \9 a: C) ~
array( "name" => "YouTube Video Settings",- R8 \, z; A1 x4 V
"type" => "heading",. k9 l% n& X( w9 d. Z8 a7 {
),
5 Z# `5 b- J. F, u' l0 s9 F7 q% @' f8 m
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",* |. [9 E0 b) m! e% w
"id" => $shortname."_emvideo_activate",% x1 K3 R5 }% t4 G5 D
"type" => "select",+ \1 {0 A! T- V9 E% ]
"std" => "No",3 z; }$ f! @" K6 N8 q
"options" => array("No", "Yes")),
& [. K3 O7 Z1 N" ?* I1 q3 ^9 q
; @2 D5 w3 c6 e9 W array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",9 @# t$ l* T" E# L1 ?& r: X. }
"id" => $shortname."_emvideo",( V4 k9 k6 j N; V h2 `! Q
"std" => "",
6 M ~: N8 A& i/ c "type" => "text"),2 a; L6 Y* ~% Y' T! Y ^
( l- x" b8 j7 ?7 x5 K' U" }
array( "name" => "</div></div>",
0 d4 N% W7 V8 _% l& Y "type" => "close",- x$ g) s0 \: c' o4 g6 q# X5 w
),
9 j; K' G! ~! _! E/ c7 V- n
7 W& u2 E; h- I, ?! r( K& a' [1 C$ c( f array( "name" => "Twitter Settings",
. Z$ `& d2 W D- P "type" => "heading",
% E6 G( ~! w4 m. j& t2 L/ y0 x ),8 ^& ~ D7 o, i/ ~7 ^; b& X* {1 R
" \ J% G ]" F
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
* |! j( g/ m4 @4 W j: l ^ "id" => $shortname."_twitter_activate",
4 }' v3 J* c) d0 a. D "type" => "select",- U+ f7 V4 w" w9 H, A
"std" => "No",
2 E) I- B' h+ Z8 Y' C6 w "options" => array("No", "Yes")),
2 ^) t6 W8 G7 D1 |* h+ l
# x z6 Q% Y; Z array( "name" => "Insert Your Twitter ID here
, T& O3 U9 F# S, Q: m <br /><em>*leave blank if not necessary</em>
2 l# {/ x0 l* h5 G- Y/ g, Y: S <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
( [: y6 B: g9 w0 ~* D4 [% f! ^- R, b, Z "id" => $shortname."_twitter",6 U1 [& V2 U. r% Y% t) X
"type" => "text",
|; S* Z1 z( P) p2 H: V! G "box" => "social",
: G8 \: P4 `' q4 p. [ "std" => "",
, |4 n' F. i+ c& n ),; F3 [% ~ g& U4 a
) K+ K+ d: L9 L3 ~) H array( "name" => "Enter Twitter Feed Count here! c( Z+ ]$ `' H; o
<br /><em>*leave blank if not necessary</em>* V) ^) G3 A% O( K
<br /><em>*Enter How Many Twitter Feed To Display</em>",4 h3 u; f8 ?! R8 d$ M. J, h' x
"id" => $shortname."_twitter_count",
, O6 J* u8 q; N! [. i "type" => "text",. p8 W3 t" D2 F
"box" => "social",) ^- ^, ~, B* V% {$ C2 R
"std" => "",
9 r/ b `- d! i! P8 l) t0 P ),2 x9 J. S5 c2 {
' `( A/ Z4 q. K array( "name" => "</div></div>", g- h d8 h% y: a3 ~, T- t
"type" => "close",5 V$ n. }6 L/ e
),/ _+ d. ]' e7 E5 l9 p1 O
3 u; A7 [/ L# c+ } e8 r3 Q
* M( ^( Z2 ^* T' P& G# b! i. D" k array( "name" => "125 x 125 Banners Advertisement Settings",
8 D" ?; c5 R7 J8 H# y; i "type" => "heading",9 K0 _ J3 A! @5 h4 a- e
),
5 B8 _% [4 K: M% Z' J( G) t2 N
/ s# d. {* [2 d3 Y) h# Y8 f array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
1 g# |5 D. e- i$ d( l9 a* B6 Z2 B; M( J "id" => $shortname."_sponsor_activate",: s! i! v, m) x% Y3 c
"type" => "select",- A" D5 B: y/ c, {. ]0 q
"std" => "No",
# o- i N7 o7 g3 z2 Z, J. w "options" => array("No", "Yes")),
2 |$ V X% T: j8 q; B 8 }$ `0 y: G" G/ j9 C0 X2 U" J
% f: a' k' H9 ]4 k' o array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",7 }6 i5 ]! ~0 k7 V" {0 Q; p
"id" => $shortname."_sponsor_banner_one",
" C: d: R3 H4 e6 T2 i "type" => "textarea",4 W4 a. V' X6 t( n1 }# }1 [; ?/ ` ~$ s
"std" => "",4 E$ S2 G1 K3 `4 R' m0 d1 }
),
; x6 h& X" C, E1 Z' v5 P" J
9 D& e, i+ ~9 y* j! j9 Q3 z, Y$ a array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>", X/ A! `# b2 H$ s" n' G
"id" => $shortname."_sponsor_banner_two",2 S+ ^0 m8 I0 M, {! l e
"type" => "textarea",
( i& E' n4 `" T7 [- _& `0 Q* | "std" => "",: k6 u( W4 ?6 S
),% t& [- f2 f" W
0 v- t- R7 E I# m3 u
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
o, P( L" Y6 k" P- Y* { "id" => $shortname."_sponsor_banner_three",5 f% T4 u7 ?6 s
"type" => "textarea",
4 R# g$ x" Z7 h a7 ]7 q9 u. M3 x6 @ "std" => "",
2 |9 u4 ~9 B. c- p1 z j* V: \ ),# _1 ^" N- P! f8 b3 w
k+ W; j: I& C9 b7 s
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
: l; B; h! L" s "id" => $shortname."_sponsor_banner_four",
- b+ N8 v' t% I "type" => "textarea",. u- s5 P: \6 a7 H; p4 v1 q
"std" => "",
# Y0 h3 c% R( X7 o ),
1 T/ U& z U a4 p5 o. F
. ^; a0 c" ]9 f( P array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
% \2 q6 g" w. R "id" => $shortname."_sponsor_banner_five",( }! z6 n7 _3 P% S: N3 ?) a
"type" => "textarea",
# m; ^: ?# a6 X "std" => "",- q Y4 U' @, ~& V2 Y) W6 {
),
; R L" j$ D3 {
2 `' Y, d. F' ]6 ] C2 r8 f0 C array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",8 \7 N1 v. p; t% g
"id" => $shortname."_sponsor_banner_six",
7 E; S0 }* O! W& T "type" => "textarea",4 m0 c9 V' E k$ J. c0 O9 ^
"std" => "",% G3 L5 _- l: U# l+ f- m9 i) e
),/ S0 T; D% v% h. j' \
+ z8 m1 C% h( D5 K6 N% o" r array( "name" => "</div></div>",
8 B/ B7 O% { Z V* ~5 G "type" => "close",1 { E( Y# z& T0 {: ^
),
( o2 u7 t- T" ?/ j& |! u" {& X/ h
% a. W) G/ `3 ?8 O. l/ {. c1 b) C+ G6 g* S$ g
" N; {3 Q- |6 M; x6 ?: D4 ~+ M! g9 c, h);0 ~" p/ k2 e6 L# x/ x7 s
9 D9 d( @# }, [( _. f. H3 C
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
( \& H9 I3 d9 a
1 A4 d& ?! o' A- ?7 ^! i2 D8 lecho "<div id=\"admin-options\"> ";; v$ K8 |0 @; C" K; H
! T7 U9 F2 g! V8 m3 C8 _% e* p
global $themename, $shortname, $options;
4 V9 _! I) m- g2 _0 k$ u$ Y0 u+ A$ Rif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
+ c9 ?, z( Z0 G, `, s5 w3 zif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';) C* D4 [9 J V. v
?>
- r- {3 P! r( n) d. w6 u# K
x7 l, d5 S8 N K9 l<h4><?php echo "$themename"; ?> Theme Options</h4>2 ], Z- q" j4 C1 D O% P
9 ^/ q; j% e) G& n* `+ J4 X# w
<div class="annouce">
' j' K# G8 j- o/ n<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
0 P: y& i7 `$ z7 a( m0 t& H<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
0 z( |' F# z U4 A# t: L</div>
, p) s7 p( M0 h6 [! Q' g2 H1 b" C0 t; [% x& F' J( z c4 g3 ]5 }1 }/ I
<form action="" method="post"># T3 T' Y' e$ X4 S8 o" v7 T
6 M' {- w4 x8 m# }. W5 R$ V& E/ S7 M
<?php foreach ($options as $value) { ?>4 x, |( `) }* D
7 ?, N! k3 A( `$ j$ y<?php switch ( $value['type'] ) { case 'heading': ?>
4 L3 T# m R: H( M# {- A- Q- w. J3 V! z6 W/ c3 ` Z9 n
<div class="get-option">
, E3 f% m( ?+ A8 @6 ?0 n% B6 X6 H
9 N' v c5 E! [% z6 m5 k. R6 e<h2><?php echo $value['name']; ?></h2>
$ j4 Y: K9 U& g1 D8 G: t3 F
* v2 w2 f a5 v7 v: _0 q<div class="option-save">
- t0 \' f3 u) ]" h: U1 u' ~. Q
' A9 P9 V, k( O<?php
6 a3 I7 k* J9 |7 u+ \break;
! }2 ^8 t8 B& r* v; ~: gcase 'text':
9 v: l. d% L- B5 ^8 c" C?>
+ c2 }, U0 J/ v5 C/ s8 _2 A. E$ _; O- y$ C& }, Y8 ]6 ~
<div class="description"><?php echo $value['name']; ?></div>
1 S5 d0 O, a. q$ B6 w<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
+ M9 y% }. i1 H! E
7 H( ]1 b9 x" t! J% mget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
; V. |, S6 k/ D/ [5 c: e O
8 C4 d8 O$ P' P0 V' E0 O<?php
* ?9 o1 _! k1 y9 F6 xbreak;
: G/ g: v1 J9 b, I Z/ T Icase 'select':' @! i' b+ _5 o/ W4 n' U- _
?>& Q' ~8 i9 f" Z1 V; K: m' f
6 d! H- O) B( b; ^9 ~" O, Z$ }<div class="description"><?php echo $value['name']; ?></div>
2 B* V% K3 m# J3 L8 b+ ~<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">0 E' R- \, q6 s- P. X7 k
<?php foreach ($value['options'] as $option) { ?>
5 U- l+ {( j6 Y9 f/ U, m<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
1 C' ]' j! W$ O<?php } ?>
, s6 m0 [3 V! o' k& Q( j& X</select># s. A8 J3 t" H0 z5 B- X
</p>" g$ I+ h# C. n7 D: }
5 r9 @6 \/ `# \) W. |7 b. }) B<?php* x7 S4 o: h* U1 i! t, p6 C6 S
break;$ X; ^- T. T, _9 F& K! M" p( x
case 'textarea':
3 y' h1 d* `+ l1 S$valuex = $value['id'];' ]6 R. @3 x; p2 ?! s& E) @
$valuey = stripslashes($valuex);5 s! n F- }# z5 A" H
$video_code = get_settings($valuey);3 v5 B0 X: `. Z2 \2 Q) |& i
?>
9 ^" X" y* @, z0 F0 }' {9 G& [, c0 F
<div class="description"><?php echo $value['name']; ?></div>8 r* ]7 h3 u7 Q' N; W2 v
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }- x# N4 L$ Z4 x- B
5 d* f" ~, n1 S+ O$ C: yelse { echo $value['std']; } ?></textarea></p>
7 U! O+ K# _8 l9 {5 g' p/ @$ M: h1 V6 b2 V# C: E
<?php
3 t6 v- D, S# b/ i# g- R$ l; Ubreak;6 ^5 o+ O+ q5 t8 P
case 'close':
& a) {. x3 d! y9 \; |: [?> T9 `6 t, s* \4 i; W5 y
: l J9 V. x/ Z1 Z
<div class="clearfix"></div>5 j0 b- [- i" q+ S$ \
</div><!-- OPTION SAVE END -->
$ U" g$ M) U2 `$ P$ C6 {5 W1 l' T
5 V7 F) t3 V, T; A# A3 c( _2 ?<div class="clearfix"></div>9 x5 o: K, Q6 N' z* @) Y$ m
</div><!-- GET OPTION END -->
2 A" a. w( p! X# H" r5 U, p# G& |! G: k5 D: @5 `
<?php
$ z( O$ _8 N: g1 y) Wbreak;
. h. r2 j: A$ ]0 I: M0 ldefault;# w6 E6 V: L9 @2 L. ]
?>
6 g% X! H& O% w# K
" R: S. ?. a s2 R: C1 V2 [! j
<?php
% q8 v: U! s2 {( {4 Nbreak; } ?>1 u3 k7 ]7 W/ p: `0 [) H
2 q4 H; S O( v6 A6 R( Y2 W
<?php } ?>; w4 F' I8 O7 H4 C4 r2 i
& r+ G% `& f/ b1 b1 T5 I3 o' I5 _6 D. A
<p class="save-p">
3 m/ H- S# q. ]" J$ t<input name="save" type="submit" class="sbutton" value="Save Options" />1 y7 v7 k& L( i3 G6 h' ]' K
<input type="hidden" name="action" value="save" />
# C9 C. n; K3 z+ n. p</p>$ Z, w' a9 P2 M# _8 y; G
</form>
4 L" y! c4 _" H5 w( {7 A( z! q# p1 j! F$ z
<form method="post">: p2 q) W6 N3 ], F' G
<p class="save-p">
( o0 y' ]; W# s<input name="reset" type="submit" class="sbutton" value="Reset Options" />
) t, Q! d3 l- ~# g& e<input type="hidden" name="action" value="reset" />% N( ^7 ^" @$ K
</p>- `. n4 l" S R6 D; q2 s
</form>2 I* l- J# X( x; J3 T0 j
" A5 S. |7 _$ M. O+ t) n' o
</div><!-- ADMIN OPTIONS END -->: y" V! M6 ~% t8 m A
3 i' V2 X1 w4 A6 Q$ y! a4 g& W) F N- q<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
. d( u/ M$ ^$ t8 G, H3 I
3 L `, i! r" \% ?& Yfunction mytheme_admin_register() {
# P. m* D M {7 n: Z, t) x$ vglobal $themename, $shortname, $options;
: y4 r$ q& G- n: `. b# B+ i/ J) kif ( $_GET['page'] == basename(__FILE__) ) {
j* R6 e7 K% I9 Y7 L& Y5 Mif ( 'save' == $_REQUEST['action'] ) {+ t9 a/ c6 _( K: ^3 Q" Y+ [
foreach ($options as $value) {
G' J& y3 d0 w% x5 h& P% E1 mupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
~5 [/ x; p/ t% A7 i; d2 jforeach ($options as $value) {
* ~. h( H- l- mif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
/ {# H0 G* ?9 y9 l9 V; G$ aheader("Location: themes.php?page=functions.php&saved=true");
3 q ~, e( L; Sdie;
5 a& I+ O: j( i1 ~1 @, i} else if( 'reset' == $_REQUEST['action'] ) {
( [; g- F1 \: bforeach ($options as $value) {* E h) A: t0 C+ g4 l
delete_option( $value['id'] ); }! L2 z! d& ?: O
header("Location: themes.php?page=functions.php&reset=true");5 \, H5 {1 H- [" I7 n9 T5 K
die;1 d. t! S9 U9 t* ?* [2 G
}+ Q8 u, h0 O1 ~7 v; Q
}' \2 O q; }4 w2 d
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');! G8 O0 ?& E. e: H! X; Y: |
}. L, J. @7 d. C
8 u, g( S: E- R# a) Q& Afunction mytheme_admin_head() { ?>
: a% M3 A* G* m/ N; E<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
, n: R; W+ o7 R% N% u<?php }
) ` u+ \& q* l! I: O |
|