|
|

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