|
|

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