|
|

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