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