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