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