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