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