|
|

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