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