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