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