|
|

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