|
|

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