|
|

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