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