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