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