|
|

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