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