|
|

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