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