|
|

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