|
|

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