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