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