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