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