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