|
|

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