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