|
|

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