|
|

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