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