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