|
|

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