|
|

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