|
|

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