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