Daily Archives: May 27, 2012

May 27

Thêm bộ soạn thảo cho phần hiển thị ngắn gọn mod news 3.1

By Phạm Đình Hậu | Nukeviet

Hướng dẫn dành cho 3.1

Với mục đích căn chỉnh định dạng văn bản cho phần giới thiệu ngắn gọn để các bạn có thể tạo ra các dạng giới thiệu như kiểu sản phẩm hay làm gì đó. bài viết này sẽ hướng dẫn các bạn làm vấn đề này. do việc update sau này lên minh sẽ hướng dẫn thế này, tìm từ thay vi tìm số dòng.

Đầu tiên các bạn mở file

modules/news/admin/content.php

1.Các bạn thay đoạn này

$rowcontent[‘hometext’] = filter_text_input( ‘hometext’, ‘post’, ” );

thành đoạn

$hometext = $nv_Request->get_string( ‘hometext’, ‘post’, ” );
$rowcontent[‘hometext’] = defined( ‘NV_EDITOR’ ) ? nv_nl2br( $hometext, ” ) : nv_nl2br( nv_htmlspecialchars( strip_tags( $hometext ) ), ‘<br />’ );

2.Các bạn thêm đoạn 

if ( defined( ‘NV_EDITOR’ ) and nv_function_exists( ‘nv_aleditor’ ) )
{
$editss = nv_aleditor( ‘hometext’, ‘100%’, ‘300px’, $rowcontent[‘hometext’], $uploads_dir_user, $currentpath );
}
else
{
$editss = “<textarea style=\”width: 100%\” name=\”hometext\” id=\”hometext\” cols=\”20\” rows=\”15\”>” . $rowcontent[‘hometext’] . “</textarea>”;
}

vào trước đoạn này

if ( defined( ‘NV_EDITOR’ ) and nv_function_exists( ‘nv_aleditor’ ) )

3. Thêm đoạn

$xtpl->assign( ‘edit_hometext’, $editss );

vào trước đoạn

$xtpl->assign( ‘edit_bodytext’, $edits );

Lưu lại

Tiếp theo các bạn mở file

themes/admin_default/modules/news/content.tpl

Các bạn dùng đoạn này

<tbody>
<tr>
<td>
<div style=”padding:2px; background:#CCCCCC; margin:0; display:block;position:relative”>{edit_hometext}
</div>
</td>
</tr>
</tbody>

Thay cho đoạn

<tbody>
<tr>
<td><textarea name=”hometext” rows=”5″ cols=”75″ style=”font-size:12px; width: 98%; height:100px;”>{rowcontent.hometext}</textarea></td>
</tr>
</tbody>

OK

Nguồn: http://forum.nukeviet.vn

May 27

Format CSS code using Dreamweaver

By Phạm Đình Hậu | CSS

You can set preferences that control the format of your CSS code whenever you create or edit a CSS rule using the Dreamweaver interface. For example, you can set preferences that will place all CSS properties on separate lines, place a blank line between CSS rules, and so on.

When you set CSS code formatting preferences, the preferences you select are automatically applied to all new CSS rules that you create. You can, however, also apply these preferences manually to individual documents. This might be useful if you have an older HTML or CSS document that needs formatting.

Note: CSS code formatting preferences apply to CSS rules in external or embedded style sheets only (not to in-line styles)

Set CSS code formatting preferences

1. Select Edit > Preferences.

2. In the Preferences dialog box, select the Code Format category.

3. Next to Advanced Formatting, click the CSS button.

4. In the CSS Source Format Options dialog box, select the options that you want to apply to your CSS source code. A preview of the CSS as it would look according to the options you’ve selected appears in the Preview window below.

Indent Properties With Sets the indentation value for properties within a rule. You can specify tabs or spaces.

Each Property On A Separate Line Places each property within a rule on a separate line.

Opening Brace On Separate Line Places the opening brace for a rule on a separate line from the selector.

Only If More Than One Property Places single-property rules on the same line as the selector.

All Selectors For A Rule On Same Line Places all selectors for the rule on the same line.

Blank Line Between Rules Inserts a blank line between each rule.

5.Click OK.

Note: CSS code formatting also inherits the Line Break Type preference that you set in the Code Format category of the Preferences dialog box.

Format CSS code in a CSS style sheet manually

1. Open a CSS style sheet.
2. Select Commands > Apply Source Formatting.

The formatting options you set in CSS code formatting preferences are applied to the entire document. You cannot format individual selections.

Format embedded CSS code manually

1. Open an HTML page that contains CSS embedded in the head of the document.

2. Select any part of the CSS code.

3. Select Commands > Apply Source Formatting To Selection.

The formatting options you set in CSS code formatting preferences are applied to all CSS rules in the head of the document only.

Note: You can select Commands > Apply Source Formatting to format the entire document according to your specified code formatting preferences.