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