|
|

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