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