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