|
|

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