|
|

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