|
|

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