|
|

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