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