|
|

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