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