|
|

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