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