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