|
|

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