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