|
|

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