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