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