|
|

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