|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
/ I" M, e6 X$ J# l' G5 e5 d// Theme Option
" t0 G7 L$ n, O5 F, r////////////////////////////////////////////////////////////////////////////////3 }: n8 G$ }4 Q+ S% g' Y
5 N2 l. R& Z0 K& @$ T' g
$themename = "Zenx";
7 p' p5 v8 C& B$shortname = str_replace(' ', '_', strtolower($themename));
. u, G9 T0 k6 N% X) W g8 t2 x% l
% a& Q- K* M9 U, K% d) ifunction get_theme_option($option)0 f! H- S$ @/ \# Y# M+ C9 @1 w5 u
{
* S1 |/ i4 v6 f( q v* y global $shortname;
% f: s) @; t. m# \7 A) } return stripslashes(get_option($shortname . '_' . $option));
! ^7 o; ?& O0 p* f+ `}9 O( N" c; ^- M( A' G& R3 U# i
4 ? @5 E! X3 U3 G7 Sfunction get_theme_settings($option)6 F: x( t! b( H3 v2 `: W3 t% X0 A( F
{7 j" u0 o$ U5 M; k9 _' z1 p
return stripslashes(get_option($option));
. A( ~2 ~% D8 h; Q! h0 H}
1 h2 [2 T7 [4 ^# `/ g% ~+ D5 O$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");9 Z- r$ a4 l" Y+ g& A
$wp_getcat = array();" |* b' ~! m5 R" ~8 _1 _
foreach ($wp_dropdown_rd_admin as $category_list) {
2 n3 ?4 V- c* ]$wp_getcat[$category_list->term_id] = $category_list->name;9 {0 F2 w% j8 t
}
+ p( S; K: g: Z+ }. y$ v G+ H l5 T$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
4 f8 z: M, q# K2 L0 J. ^$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
0 R# K! f. S: F w4 V! D: U$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
/ x3 i6 E h2 e+ W
# }$ | P) L6 y3 D' \- m$options = array (- p9 P! z% ^ S- q
$ x5 p# i( @7 x- O
$ b8 K% L% u" p* m1 F array( "name" => "Blog Header Settings",4 U3 y i9 V7 D7 h
"type" => "heading",7 V4 K; j9 `) L: K. j$ n) K& j
),5 E$ h8 C5 h6 L2 @5 l7 h1 K
`( ?& W9 M7 ?1 B
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",# ^6 w4 c N5 N( V* ]- s {7 M
"id" => $shortname."_header_logo_activate",8 W* R4 P* G4 c5 H- F
"type" => "select",
! b5 {: W) I9 ^$ d& i8 B h "std" => "No",
& f7 K" K, V3 b6 V3 [8 D c0 r "options" => array("No", "Yes")),
+ C8 E0 c: Q: J, i _- h
- Q8 r" D) t+ J5 Y6 H$ E array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>", C' \& k5 ~& I+ T6 y
"id" => $shortname."_logo_url",
* y6 M' W7 D8 B "type" => "text",
2 A& P1 {( g8 q5 S "box" => "social",( y* T8 k, i# J1 V) G: p( m
"std" => "",) g- r1 k; o' R( t+ R: o/ {% U& Y2 @# R
),
& u n" R) @+ d ; \2 f* z8 D/ G0 Q! p+ O ~
array( "name" => "Insert Header Banner HTML Code (Header)
+ T# \) n! {9 m% f1 Y <br /><em>*Recommended Size 468 x 60</em>
: p {1 P, x/ I+ ~" |! E <br /><em>*leave blank if not use</em>",
9 V2 C+ l! j9 r "id" => $shortname."_header_banner",2 Z/ A& \& m+ B
"type" => "textarea",
1 O+ d% m9 }% P4 z "std" => "",
* F% }1 }+ c" E( z" s7 U, l/ ] ),: l5 @" `& z8 `) N! u/ P1 {% @
, b# Z6 r: d7 ~& d+ g' \+ x H array( "name" => "</div></div>",+ S, w, \ q: ^( o1 f: o
"type" => "close",% L* t3 G: t# K" I* ~
), `9 | i( f1 Y* ~2 R J; V
8 m: T" P" }9 s
" }' U" x5 V9 y- g7 g array( "name" => "Header Navigation Settings",& S- l/ D0 ^: G* a# Q k* d
"type" => "heading",% n2 I A7 D. ?/ `8 j
),
1 o( H$ t" Q$ F4 R* }
2 C6 V9 o \# d: ^3 [9 n6 S- z array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
- U/ q2 O, H4 C0 D3 D <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />8 {0 ^, J+ a: \* @) q' g$ K% B
<em>*Enter the page post ID number only</em><br />
3 k) z; v( E: V, @' {9 B9 U <em>*separate by comma</em><br />
% E3 h l1 T. m# b$ n! o a <em>*Exclude pages which you don't want to show on the header navigation</em>",; y4 p3 u: S& J, E' B* o
"id" => $shortname."_header_page_navigation",
' r( B. R3 \4 y1 z7 l( t& b "type" => "text",
! C: j3 D# i$ @9 f! ]) d "std" => "",6 ~3 \: y- i; o2 s; X
)," c" F' d% E, ?6 T1 A1 W
/ i7 y8 D9 R5 ^. J, _+ P array( "name" => "</div></div>",3 N" N- |' z7 w2 C' @: z
"type" => "close",7 o: Y; p8 ~9 R: n
),
8 E( f/ Z6 u' `! D , D# G) h1 d1 m$ h; l
+ D: m7 ?5 _* L! J- M" |) j2 E array( "name" => "Post Auto Thumbnails Settings",
; e: a) A* A% Q "type" => "heading",6 _) U& w( @; [
),
0 V5 e% g! S; g" u* X8 `& Q
4 X6 l, P B( [7 d: h$ V4 U U array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",: z" t, }+ Q' e" Z# I* W3 [
"id" => $shortname."_timthumb_activate",2 X: a8 [% L& k% R) N0 e6 f
"type" => "select",
8 k! I |6 E5 e1 O' n "std" => "No",* b+ C. M C% [3 }, P- l5 M
"options" => array("No", "Yes")),
6 I; X+ Y, Q9 `0 }* {8 a3 T: ~
1 i& m/ B2 N$ l$ r9 @1 Y9 Y array( "name" => "If Timthumb is enabled, Please choose its cropping method",
. C. H v! I2 X/ |7 h) V "id" => $shortname."_timthumb_cropping",5 l/ K6 X; {$ ~) W [
"type" => "select",
1 H0 s) l1 t% j' x! j1 J "std" => "",2 C7 [, }! P5 o2 I$ s# R
"options" => $crop_position)," B& K) [; J, X2 P8 E
1 R4 D; O' O7 K* S array( "name" => "Insert Width Of Thumbnail Image<br />
) `0 R/ s. Y. `2 [ <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />" N9 q3 G6 H$ B' d
<em>*Leave Blank To Use Default: 250</em><br />",& P+ z. C$ F3 z9 Z6 {
"id" => $shortname."_thumb_width",$ S% {% G: _1 w8 V* L2 d
"type" => "text",
! l7 M& _, U4 F" I; T' a+ k "std" => "",
5 ~& g k" h) _. W" E# e ),
. e+ y6 c* {/ @, K: K d" T+ |5 D* ^
array( "name" => "Insert Height Of Thumbnail Image<br />
% P! v7 v' _% T( w4 }$ A <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
% `: ]7 m; B8 j$ H$ v% G7 n' A <em>*Leave Blank To Use Default: 200</em><br />",
+ p% H) }' `5 v% R6 B) L "id" => $shortname."_thumb_height",5 D; [3 P) o1 S4 c7 j5 n
"type" => "text",8 ^1 r' L- n8 y7 c- a
"std" => "",, m' R* k; D8 Q
),) v6 y+ [8 w" ]7 b
; \4 P4 t4 k6 n+ C6 G
array( "name" => "</div></div>",
8 [9 i- T. t/ F: } "type" => "close",3 \8 a! G& a9 ~* }. t( D8 i1 [. ~
),
0 v3 N+ v' M' f& C* I; {# e, P0 P
' a" H* \2 y$ p D array( "name" => "Featured Content Slider Settings",
: u' U; C6 E! J0 j- u "type" => "heading",
5 V z/ c$ ^& t: W ),; P) g q- |3 X8 O
0 _! b9 o4 k; X7 _! ^
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
a; N: B/ G9 u( _ "id" => $shortname."_featured_activate", R. }* g$ n9 D1 C8 f- C
"type" => "select",
3 m* T9 r0 i& ^ "std" => "No",
1 }2 }9 v, _& H. G+ F$ I "options" => array("No", "Yes")),* N+ K7 `( B* K4 e8 b- D; v
! Q3 H8 \9 Q" H: B' M0 Q; z
# Q: n; S" ^" U) l- M" M" S X array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
% l G+ c. ~; N( @: P4 S9 S "id" => $shortname."_featured_category",! {# p8 T- z; n/ s; `
"type" => "select",
' d5 @5 t% F5 ]+ m0 ~0 n# u "std" => "Choose a category:",% Q/ }0 F+ _1 E" z
"options" => $wp_getcat),
+ b& r, `% S# w+ I5 v2 T* X/ g' R6 P& }+ r% y$ Y/ y9 ~3 F, m
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",. w0 z' c4 L- C+ P4 T+ t
"id" => $shortname."_featured_number",
# d! ?2 k; `8 ~; a "type" => "select",5 Z4 l. \( o9 f6 |
"std" => "Number of post:",. |6 o7 I, P& ~' c
"options" => $number_entries),) G3 {: A( F3 v: o% g
7 B3 @/ h) K5 I4 X# n array( "name" => "</div></div>",5 I3 R2 @, ]4 s0 h) K
"type" => "close",
9 i* V+ Y. B' C1 n5 @6 k, A( x ),3 W0 ^ x7 I" z. F. a' z
. x3 K8 |) a7 T array( "name" => "Featured Category Settings",0 \. }" l) J) ~' g O
"type" => "heading",
8 H3 [; A2 M* i# B7 \/ B" B9 l ),: z4 @% m" L1 C. m, L
( V0 n0 R6 N( v: O0 g array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",& j9 N% j3 H3 B6 F2 Y8 B9 y
"id" => $shortname."_featured_category_activate",
, T5 l. v- x4 \+ T" d/ {* B1 D' s "type" => "select",( D: k- @5 n, Y! F$ a e
"std" => "No",
' D' F2 s: @3 L! m! y7 n# U "options" => array("No", "Yes")),
* p1 j0 E# N" X, z$ h$ [. I! U
* G3 J" d% l% I# b' F# d1 Z# P array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",- D* m8 y% Q9 ?7 n+ C% ~
"id" => $shortname."_featured_category_id1",. z4 T% }' S: D/ Q8 Y* N
"type" => "select",
& |9 [, a7 k8 l "std" => "Choose a category:",; A9 p* }( n0 l8 X g' P( }+ O9 i
"options" => $wp_getcat),
" }$ t9 s4 h( n2 l: W, F/ v $ Q! j5 o/ A+ W6 C2 Q: r n9 w8 W
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
$ Z3 ?/ [6 n! \& C0 E" ~ "id" => $shortname."_featured_number1",
7 b, b" F* F; M" R "type" => "select",. U! K, ^1 r5 q- M& a
"std" => "Number of post:",
+ o" G$ ?% X0 x( f) W "options" => $number_entries),
, R) ~- Z! E0 A4 v; _5 Y9 V4 D; M " B# R' W E$ U4 I' s3 B3 e
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",0 [, t' K, t$ w0 A
"id" => $shortname."_featured_category_id2",- s# r$ B9 L0 m. V6 f+ L' ^
"type" => "select",
6 K- X# {' B. Y F( f7 ^# O "std" => "Choose a category:",( g, V( x# z5 \( H x
"options" => $wp_getcat),
: K/ X& z, ^$ Z% _4 |% E 9 [0 D1 g( c+ |# C( [" }
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
! R6 u! V( [! C( K) ^ "id" => $shortname."_featured_number2",
s5 S6 R* q6 h( ]' \ "type" => "select",. |5 q8 b# Q& p/ u) |% `
"std" => "Number of post:",
: J4 V; ?4 I3 a7 v* J# ]/ U) _# Q2 I "options" => $number_entries),# }4 ~ O7 c% [
4 d% [ n1 u" T k$ g
) [+ i* t1 ?9 v array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
" w# d8 T+ z# M) z0 v' I' B "id" => $shortname."_featured_category_id3",
6 Z2 K6 \6 P% X1 H* Q3 y1 ` "type" => "select",% Y( g& ?3 | e( O, e* M
"std" => "Choose a category:",1 v% {/ O, l; p, @
"options" => $wp_getcat),+ y7 f/ t7 C* J! [5 O; _8 F
, i$ H- F9 g/ H
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
, P9 F2 [! j7 U/ p4 U6 [ "id" => $shortname."_featured_number3",% W8 e2 I* g2 w* q5 R/ z
"type" => "select",! Y6 \4 J) j$ P0 q1 U! }+ F K
"std" => "Number of post:",
0 D+ o$ q, P7 n0 @: ~ "options" => $number_entries),
7 |& D& U! q( `& [- L- V$ b: t' H" F
1 l D ^0 R, x+ z) v) E, K* n& y0 e4 O: E0 t+ P/ F
array( "name" => "</div></div>",
% ?/ P8 Y) ?" M+ a+ ?5 Y- E "type" => "close",: }/ v0 U! q1 Z& G
),
# P" t. u, A6 v5 u, t4 H
2 m9 m% P+ D3 W& L; a: |* l; ?, _: J: d% p
array( "name" => "Google Adsense & Analytics Settings",& ~* y9 I+ C9 w: ]$ u2 o) b$ t* I
"type" => "heading",
/ Z' a/ V1 ]0 n) q# A% r ),
* {" M# H+ @# A9 j1 J K$ ^
/ m( z! D4 i6 Z$ G array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",, S$ F; _1 S: `( P
"id" => $shortname."_adsense_loop_activate",
0 {3 o" q$ m7 v "type" => "select",
g: F3 ~6 y/ R5 T, N "std" => "Disable",! i+ F4 J) v0 i! D; t
"options" => array("Disable", "Enable")),1 M0 Y' d2 k8 \* j t2 ?
: L! \& m) H; P E7 L array( "name" => "Insert Google Adsense Code For Loops Here<br />% a4 I) c* w6 V" a" r8 i$ b
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
! @8 R ?5 Q: J+ s6 i "id" => $shortname."_adsense_loop",% M: v* O H+ z% w. f9 c6 }
"type" => "textarea",
8 }% h! E' x# _ q "std" => "",6 r) E3 B* F4 y$ [
),. ?( c6 {! E0 P' w" y1 A9 E
9 S" [9 j _' `( }- L array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
9 v$ m) I! ?& u, j- c( B "id" => $shortname."_adsense_single_activate",
! @1 O4 R. l2 b, j8 K "type" => "select",
- K4 k* p5 j% ^$ `2 n "std" => "Disable",
; H) [1 C) Y. a: l3 ~2 l) o/ y' u "options" => array("Disable", "Enable")),
6 E0 z# O8 n) c& l) Q* ]' a
( o7 ~( C7 _8 N/ ?( L# J# x6 @. L! h3 B array( "name" => "Insert Google Adsense Code For Single Page Here<br />
& [$ s# N+ f8 ^' M8 J$ r# I <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>", `6 f( K% I q V1 y5 ?
"id" => $shortname."_adsense_single",
- K- k: N3 [+ ^9 _ "type" => "textarea",* \1 \8 H. p# l% V4 ^) T
"std" => "",
* U" Y) I6 o5 `+ O! ~ ),
1 B6 A. [+ Q# r& A5 q
& V# @) m6 D& n9 m9 q3 f! L# f8 s- e% D& O; H
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
* M8 U0 R N! J% h "id" => $shortname."_google_analytics",4 U% w/ g! Z/ |* z/ H2 r7 C; `
"type" => "textarea",
% L V! \* @) a9 K "std" => "",6 s( E8 z6 A/ p. U5 t. J) p c- h
),
! I7 M- B# Z; n5 }
" c8 ?2 q8 T. ~' ~ Q$ `: } array( "name" => "</div></div>",
6 f. {8 h1 l+ I+ m4 r "type" => "close",
( f0 g0 G% d/ G ),
' b: N) X5 ~5 ~! A; E) [
; {3 W' R9 y7 K0 M, G
$ z9 c. \# }- e. r; b5 l array( "name" => "AddThis Social Bookmarking Settings",9 ]# U0 j5 e- R. K# m$ P
"type" => "heading",
" P( D% f0 D8 D& ]+ i( g# Q) B ),
- O3 p, ?8 Q! I8 A P N- ^9 f, X/ J; _" p
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
6 [# S9 B7 e) G$ p8 A7 K <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",# I8 f, _8 i, w( o5 V
"id" => $shortname."_addthis",1 i+ Z. B+ w: m0 ` x: L7 Y
"type" => "text",
+ l/ o e ^/ | "box" => "social",
7 ~$ v7 y9 i) U9 A% l "std" => "",% l! B4 L, m1 e* I: ^
),6 h+ O D. M4 h; H
( \( ~7 t! D. r# A4 \7 V array( "name" => "</div></div>",
5 H1 _. H! F+ D "type" => "close",6 y1 s) t% F$ F& Q
),$ k; M7 q; Y: S# b. w8 i5 {
. S; k0 ]: J) G6 A) {; i
+ i4 ?/ d7 F* N4 M
7 c" z' m6 e6 }% d# @ m# p* s array( "name" => "YouTube Video Settings",. z8 o3 g4 q* z1 g
"type" => "heading",; Z) M/ L9 F9 G9 K% p. d. p
)," Q0 Q0 w( p5 [( D! I1 y9 p% e
& N1 T- u2 p; V- H array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
( Y- q2 l) V n. B4 n; P9 j4 h( P "id" => $shortname."_emvideo_activate",
4 r9 D p$ c' ~9 O) n "type" => "select",
1 Z% G/ h& @4 ?' q9 `! s "std" => "No",
( V* K B( W, J$ c2 N "options" => array("No", "Yes")),
% S6 n. V: Z1 l, w! ^( Z& V4 P, N1 b% r
) I2 c. L S# n5 w3 y 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>",4 E8 c& E; w! G+ r1 L8 u
"id" => $shortname."_emvideo",
* P6 ]. A: i; W9 a- v "std" => "",
4 C( S, W& ~' J; E" t( T* |) u "type" => "text"),
# M2 B( _5 J7 _7 L: u9 Z7 y, S I# w N% O
array( "name" => "</div></div>",2 N9 i. R- [2 S/ M# B5 ?! n
"type" => "close",: v0 f' L5 Q A( [: w
), u0 g& D* `. P4 B8 `7 o
8 H }% ?- U! U' H" J# X array( "name" => "Twitter Settings",
1 B) D5 j* G0 @3 b "type" => "heading",
5 G# O$ m5 C# N ),
1 z/ X. D0 a8 z! G3 _, E/ ]8 D6 b, g0 G/ z X7 U3 q) h* W" {0 `
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
6 |5 f' g9 r. S# l$ U "id" => $shortname."_twitter_activate",* M) X& L' k7 ]4 u7 G5 Z# F+ A, e
"type" => "select",
7 p1 v5 z' {8 h4 O4 z "std" => "No",
7 \5 C0 v/ V( F$ c "options" => array("No", "Yes")),4 Y4 J2 j! @7 z- I7 D7 t. m2 S
+ w" r9 o8 v- Y1 j5 G6 W4 k array( "name" => "Insert Your Twitter ID here
8 I& W! h5 f8 R <br /><em>*leave blank if not necessary</em>- a8 q! n! d% S% h5 N& s
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",2 P6 [9 s4 ? i. m+ o; E
"id" => $shortname."_twitter"," A! E9 P8 T y5 e* Q4 T! d
"type" => "text",
; @. ]1 Q" `3 O- b1 R. x' [ "box" => "social",2 @5 E+ {. ]1 d1 ?; a
"std" => "",: ]' c" Q# I9 p* c% s s: {
),/ h2 g, o5 k* w) c! N0 a- L
. Y) \- O. E$ h D( B
array( "name" => "Enter Twitter Feed Count here) f* c1 M# L+ L& x& d
<br /><em>*leave blank if not necessary</em>
1 @+ S! ?& t, ?; }# J <br /><em>*Enter How Many Twitter Feed To Display</em>",
) J9 S) H: S& A, y' M& b! Y+ U+ G' O "id" => $shortname."_twitter_count",
! Z7 N; |8 R! w+ f7 ] "type" => "text",
* r& `' T" h% ~. F* b% B "box" => "social",2 b+ K3 y/ v! E4 m! C2 T, J) O+ b Z
"std" => "",
9 i! L: F8 ?3 R# ]0 W5 o ),
& A; `$ O" y' j% l
, L/ U# w) H4 B0 P3 F array( "name" => "</div></div>",
6 C+ m! t4 @$ [7 p8 @. h' b( J; s "type" => "close",' \* y9 N2 n$ I- X o, ~. R
),
+ @7 Y( [8 [. s( V
7 J4 B* E$ l4 R9 i) M8 O. C
) I+ a- Q9 v% f5 C5 y2 c1 x! c array( "name" => "125 x 125 Banners Advertisement Settings",. W5 e# X. o1 E# s
"type" => "heading",, X' v0 l, t0 I% _! u! k0 ]
),
0 W. _- W1 j& D0 P
/ b* G, w6 Q# Q; n array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",8 O0 o5 V1 i7 g/ f) k4 q3 L- F
"id" => $shortname."_sponsor_activate",5 g# y6 {( A6 \) v& p" l1 L+ t
"type" => "select",
, X* x8 R2 N0 d' a, G0 V "std" => "No",
9 m9 \# M" G6 m% ~3 q2 a "options" => array("No", "Yes")),, i) e0 D6 [) }3 H5 ^
6 E3 l2 F. v, g0 ?4 h
1 h' h+ }; E+ }! u array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
+ @0 D1 |; l6 p8 k+ |7 E "id" => $shortname."_sponsor_banner_one",
; T I$ E" ]6 e% E "type" => "textarea",+ H4 n9 A: F7 B& |: I* l; p+ f
"std" => "",
: ]# }3 }( p. `. x! T# b$ X& K ),
+ l' r+ y; j' ?+ D3 {' q9 K0 u% l3 r/ a: q m" q6 w) m
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
- R1 v8 k, B' b- m7 t1 B "id" => $shortname."_sponsor_banner_two",
; y9 @- O! l, Q! B' z "type" => "textarea",, L3 b) c# L" X+ z
"std" => "",
: k: B2 m$ x! Z* s( Q ),
% V- w. h9 M6 |( s; w, @' a, ~7 u1 p8 n6 v; K0 n- c, d3 h( F
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
' j$ C" B: f: k" C) D0 r ~0 a "id" => $shortname."_sponsor_banner_three",9 a$ I1 M- Z$ f. e
"type" => "textarea",7 L* K0 ]5 t4 O0 N) h$ X5 m* ?
"std" => "",' t6 c0 X# F' I# }# `# B. l
),; V4 r! _% X' t: G
- h5 B! Z. b, y' f" j
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
4 Y9 E! t" E1 |. c$ d "id" => $shortname."_sponsor_banner_four",* u! h. r- I' H. V B
"type" => "textarea",9 E& Q) H8 k, b4 k: W7 o/ [$ F# _
"std" => "",' u" f6 G2 E1 x, O: @4 Z1 c
),$ B' Z0 T; h: Y# ~
' G/ N1 u) T% K6 E4 j array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>", V4 T9 @6 n" b1 q0 G8 L0 e
"id" => $shortname."_sponsor_banner_five",
; P4 h$ r3 D: N' N; U "type" => "textarea",
8 l* d6 f( l1 q% g; n7 u' A S5 x "std" => "",0 }$ C& X7 m6 c$ e7 B
),
, [3 E/ ]+ `; N% w7 k% p1 e* a
2 e/ P! U# J7 f I- f k; ?' ? array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
! ~8 Y) ] V- d "id" => $shortname."_sponsor_banner_six",
9 l N5 B$ y) l! q4 @8 J2 K7 F4 Q" f. g "type" => "textarea",+ Y0 x; F. F5 _& I6 e, Q
"std" => "", g4 C6 q2 @ U1 W3 J
),6 a1 P& [, Z! O# h
( l/ }% E/ O3 b/ n0 \& s2 _3 g; d
array( "name" => "</div></div>",
% K" e D8 j% ~. a. `" s# ?9 r "type" => "close",
6 s$ A; _9 [" q; {, D# l ),
& K( i- Y5 r) J! Q. @- h" [. M' C% G! W' \& }) U
' G# p% V# c& H3 P$ d0 y E& i1 M
6 P5 d; M$ r; e);
: P- l% [% J; ?1 K3 Y, O& _0 y8 n0 G
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
% C# H. `3 G9 X$ r& b! H
4 j6 ~2 F' V# v7 Eecho "<div id=\"admin-options\"> ";
8 h x2 p7 d* [" l% o7 J7 m) w* d
global $themename, $shortname, $options;3 ~/ f" @( v9 ?& z5 X/ t, V# r" [, \
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
( _6 E: w1 W: U( o4 k! kif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';$ r* D8 v9 U6 [% z3 i- u
?>
8 L# v% p( l2 A' g4 T. H: {1 @! p( j- i
<h4><?php echo "$themename"; ?> Theme Options</h4>
: g. X0 n0 H, d- g# }
* P0 d" S6 t5 \. K/ t<div class="annouce">8 G2 q( m3 C( t* r$ D0 v: x
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
6 ~5 Z {' M8 t7 g* n<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>3 M: k# g6 W% y+ n4 G
</div>; e* h' R1 S. |; x( \: ~4 x" C
9 L; n/ L* Y* f3 ?" C u$ K& u
<form action="" method="post">
+ N. `+ ?# J0 n% L. n: g( a3 H) `9 m9 k, K
<?php foreach ($options as $value) { ?>) p( D% `$ k' P1 ?) Q
/ A: K' T) }0 { g' L3 g
<?php switch ( $value['type'] ) { case 'heading': ?>; C0 G6 a o! x' z
4 [, C/ R( e5 v/ @* P' D Q1 s. l<div class="get-option">0 l0 j$ t! X# h9 K5 h: O# O! u+ |# s
6 i6 U/ w& z c$ h# W<h2><?php echo $value['name']; ?></h2>
2 K$ d6 A4 k; t% N* F% a* d" Y2 B3 l# I
<div class="option-save">
! B/ u0 L9 `/ ^
8 J, T* `- _- m. }* O- H" q, ?<?php
K( [8 M9 ^! c, ~break;; A) {; n- V p7 K z( m
case 'text':
' L/ a; p% `- G3 f% i?>' g" K8 R5 b9 ~5 M K& c2 R" a
" }( r }+ c8 t1 d/ B
<div class="description"><?php echo $value['name']; ?></div>! Y) d6 B! H1 p/ K/ J. `
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (0 p6 [4 v* t9 m d3 ^
. q8 ?3 R5 G- d- Nget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>+ H. ?8 o& B/ O
! t* T/ Z) Y9 g* F<?php0 c! N7 u5 J) a7 ^
break;' i; m; v& i9 [: n
case 'select':
: `: \( p0 w" ]# _6 ]* A; u?>
- ^8 B, S5 j/ L1 d+ y' c
, u# A1 v8 P, S0 V$ L<div class="description"><?php echo $value['name']; ?></div>
9 l# |$ W; f9 R<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
, b* c- Q9 a9 R! G<?php foreach ($value['options'] as $option) { ?>
4 D9 p" t: S/ C, m% e# K f<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
8 x2 X$ C. n9 J- s<?php } ?>& k$ o/ i2 |6 G4 v( I( U
</select>
. S, i! |# G6 H! ?</p>
1 Z: y1 W0 t/ v6 w6 g' C! H5 @* H% ?, v8 ?: F3 N# l B; c N
<?php
2 j$ l. \ H- b: t4 J1 {( k# X3 P- hbreak;! X+ ?0 f2 q+ Z5 H
case 'textarea':; U1 ^( \( R J8 {" U+ L5 n
$valuex = $value['id'];! q+ {' X* Z/ G. g+ j4 ?8 R
$valuey = stripslashes($valuex);( }, B1 p& R- [. j4 P
$video_code = get_settings($valuey);
/ l1 u, Y1 f* Q6 n?>
/ M T. z/ \' P# J) J3 D0 J- S$ l2 w. w6 l, a
<div class="description"><?php echo $value['name']; ?></div>' H f% U1 |$ n+ a
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
2 h- [; m( g5 [0 l0 J5 H+ [8 R
9 [# q, J1 h# K: b% Celse { echo $value['std']; } ?></textarea></p>
4 ]$ J3 r& n* Z% I3 n0 l( S6 K7 Q/ J! m4 B; @* M, }
<?php" X+ g1 ]1 }; x0 L. t5 s N
break;
) q5 l+ k9 n9 ~case 'close':1 d/ e+ H) _8 X6 m* Z! ^; c6 x
?>
: Z/ J( ]9 i3 \6 k- F [
) W# L. `/ R; r& t3 U3 m<div class="clearfix"></div>
. {- W2 {2 ? B6 X( {' a9 ?8 K</div><!-- OPTION SAVE END -->$ C, _ b! n1 X% q9 \
" n% M6 z5 q' _+ v5 o7 w
<div class="clearfix"></div>
2 X; |! S" k2 E& I: |</div><!-- GET OPTION END -->1 W. k s) T8 D: K6 w2 O
5 x2 p' s& |- u<?php }% ]! d' `/ e; s; \, |
break;
. w/ m" s$ c+ X8 ?: h& Ddefault;) u& v" E5 M- ]& S% t
?>$ n/ d3 y' _2 S( b4 {8 f5 N
; \+ F* y0 l9 A- M4 W: t3 C( Z5 X7 ?$ j& k9 a/ _
<?php
2 X: c8 q' J% z# kbreak; } ?>
7 q- g. ~+ h% x* c
1 o- e; H5 u% ]: v! T: R t2 {) u<?php } ?>
\# f/ e2 w4 B) a7 B/ L$ O' T9 n1 t5 d, i" t* [$ {, q
<p class="save-p">
" C( {7 c7 s1 h* }# q0 c( ^<input name="save" type="submit" class="sbutton" value="Save Options" />: l; q# r4 z$ g: p0 V- }0 J
<input type="hidden" name="action" value="save" />
; ^1 X9 c$ J+ m+ G i6 K/ p5 |7 ^</p>
/ I0 L2 ^3 z" e- E4 P</form>% Q O" g" N5 R! c
7 }% ?' v0 V( j8 w1 [<form method="post">1 f8 v- B7 A2 w! |% j4 y
<p class="save-p">
# _. ?2 }: I; t<input name="reset" type="submit" class="sbutton" value="Reset Options" />
, N& `6 X$ |+ q5 X3 Q& }1 V<input type="hidden" name="action" value="reset" />
" S7 \/ @* h5 |) j</p>( g. `4 M& G# g3 e- o! u, A
</form>2 B& I" o+ ?6 X c+ _/ @) ]
% ]9 l6 s2 E/ p! m% m2 B$ G' ~* D {</div><!-- ADMIN OPTIONS END -->& \/ w9 B/ |. W n5 X
# j I+ I9 O/ x) ^; h) K4 Q<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
, O7 `& ~& J' z+ O$ M1 D. B1 N u1 Y, o1 X5 O" ]5 H$ v i
function mytheme_admin_register() {, w. L- p. V3 j! g1 ^
global $themename, $shortname, $options;( d7 X; w* t2 q! c% S, t
if ( $_GET['page'] == basename(__FILE__) ) {
& E3 z# }7 n& w$ eif ( 'save' == $_REQUEST['action'] ) {
7 M4 q* d! C) f* h* a- F& ], G0 I' J! jforeach ($options as $value) {
8 f1 K1 T7 H. u# n: Z0 R! e' s+ qupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }) K) l* u) z% `) y. u- W u
foreach ($options as $value) {) Q# [/ L- |( ~; Q4 Y3 s8 C
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }* \" n9 |" V" r+ t8 G( u
header("Location: themes.php?page=functions.php&saved=true");- r/ Y) g! l7 d( A% {- E
die;
+ @) X' {( D% ^5 O} else if( 'reset' == $_REQUEST['action'] ) {0 b8 ^5 ?2 @; U6 g6 j* U. s
foreach ($options as $value) {
5 Q; o4 \& B1 m9 A Sdelete_option( $value['id'] ); }
! j. Q! `" D. r3 nheader("Location: themes.php?page=functions.php&reset=true");
! a+ t1 M# u v' {! Y+ Mdie;
0 ^% Z+ O& |6 d/ u \5 e4 o}
6 ^" h( H$ }1 Q# z9 k8 n}; O$ ~$ ]' q) G) h0 b' T* k' V
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
3 I) h b- h- @! ]: N}
: u1 }# Z6 Q% Q8 |
, Y# c4 G# X. ?# t4 Zfunction mytheme_admin_head() { ?>
+ g2 u X& @9 X<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />, P; c" ?% E; W9 x7 V
<?php }
4 G( R. x& T. c% M |
|