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