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