Wednesday, September 08, 2010

Viewing Category


Tips

 

    31

    Nếu bạn tạo 1 module chỉ cho Admin hay Host được view, thì trên module đó sẽ có dòng Visible By Administrators Only và có border màu đỏ. Điều đó gây khó chịu cho người dùng.

    Hôm nay, mình search và thấy có 2 cách để bỏ cái thông báo đó đi.

    *Cách 1:

    -Đăng nhập với quyền host.

    -Tạo 1 role mới, với tên linh linh tuỳ ý.

    -Không gán role đó cho bất kì user nào.

    -Vào module settings, gán quyền cho role đó được view module.

    *Cách 2:

    Vào module settings, click vào Hide Admin border. Click Update. Thế là xong.

    [Read the rest of this article...]

    Posted in: Tips
    13

    Dưới đây là link bài viết hướng dẫn cách customize lại RadEditor trên DNN. Mặc định là Editor có đủ các option. Tuy nhiên nhiều khi ta muốn nó chỉ hiện thị những cái thật cần thiết thôi. Tựu trung là bạn chỉ cần chỉnh lại trong web.config.

    <add name="TelerikEditorProvider" type="DotNetNuke.HtmlEditor.TelerikEditorProvider.EditorProvider, DotNetNuke.HtmlEditor.TelerikEditorProvider" providerPath="~/Providers/HtmlEditorProviders/Telerik/" toolsFile="~/Providers/HtmlEditorProviders/Telerik/Config/ToolsDefault.xml" configFile="~/Providers/HtmlEditorProviders/Telerik/Config/ConfigDefault.xml" FilterHostExtensions="True" />

    Thành:

    <add name="TelerikEditorProvider" type="DotNetNuke.HtmlEditor.TelerikEditorProvider.EditorProvider, DotNetNuke.HtmlEditor.TelerikEditorProvider" providerPath="~/Providers/HtmlEditorProviders/Telerik/" toolsFile="~/Providers/HtmlEditorProviders/Telerik/Config/ToolsMinimal.xml" configFile="~/Providers/HtmlEditorProviders/Telerik/Config/ConfigDefault.xml" FilterHostExtensions="True" />

    Link:

    http://www.willstrohl.com/Blog/EntryId/615/Customizing-the-RadEditor-in-DotNetNuke

    [Read the rest of this article...]

    Posted in: Tips
    26

    Dưới đây là đoạn script chuyển quyền của DNN user bình thường thành 1 user có quyền host.

    DECLARE @username varchar(50)

    SET @username = 'username_muon_doi'

    UPDATE 
       
    Users 
    SET 
       
    IsSuperUser = 1 
    WHERE 
       
    username = @username

    DELETE FROM 
       
    UserPortals 

    [Read the rest of this article...]

    Posted in: Tips
    03

    Các bạn có thể xem hướng dẫn cách dubug module dạng WAP của DNN module tại link sau:

    http://www.mitchelsellers.com/blogs/articletype/articleview/articleid/169/debugging-wap-dotnetnuke-modules.aspx

    [Read the rest of this article...]

    Posted in: Tips
    14
    Trên blog cá nhân, Will Strohl đã hướng dẫn các bước để convert 1 module DNN dạng WSP sang dạng WAP.
    Tóm tắt lại thì có 14 bước như sau:
    1. Make a New Folder for Your Module
    2. Move Your Existing Module Files
    3. Copy Solution & Project Files
    4. Update the Solution & Project Files
    5. Create Designer File Place Holders
    6. Open Your Solution
    7. Update the User Control Mark-Up
    8. Resolve Any Errors
    9. Update the Project Properties
    10. Build the Solution
    11. Fix Web.Config
    12. Check Your Bin Folder
    13. Update the Module Definition
    14. View the Site
    Các bạn có thể xem chi tiết tại

    [Read the rest of this article...]

    Posted in: Tips
    11
    Hôm nay, mình thử cài bản source của DNN 5.3.1 lên máy ảo. Khi build thì mình gặp lỗi sau:
    Unable to start debugging on the web server. Debugging failed because integrated Windows authentication is not enabled.
    Search một hồi thì mình phát hiện ra cách giải quyết.
    1. goto Administrative Tools | Internet Information Services
    2. right-click on your Website and select Properties
    3. switch to Directory Security tab
    4. click Edit button in Anonymous access and authentication control
    5. check Integrated Windows authentication

    [Read the rest of this article...]

    Posted in: Tips
    06

    Hôm nay, rảnh rang nên mình thử tạo 1 site DNN trên máy ảo rồi tìm cách để từ máy thật có thể truy xuất site đó.

    Máy ảo của mình dùng phần mềm Virtual PC 2007. Hệ điều hành của máy ảo là Win XP-dùng nó cho khỏe. Trên máy ảo, mình đã cài bản install của DNN v5.3.1. Code được đặt trên wwwroot. Việc cài đặt thành công và mình có thể run nó trên máy ảo.

    Tiếp đến là việc thiết lập để nó có thể truy xuất từ trên máy thật. Trên Virtual PC, mình vào phần Settings chổ ổ đĩa ảo, chỉnh phần Networking của nó thành Intel 82567LM Gigabit Network Connection hoặc Microsoft Loopback Adapter. Đây là những adapter mà máy mình có. Mình thử kiểm tra IP của máy ảo là bao nhiêu. Kiểm tra xem máy ảo có thể kết nối Internet không. Rồi từ máy thật ping thử tới máy ảo xem có được không.

    Bước này thì mình có vấn đề. Ping tới máy ảo không nhận. Sau một hồi thử mò thì phát hiện ra là mình cần tắt Windows Firewall trên máy ảo đi. Thế là ping được.

    [Read the rest of this article...]

    Posted in: Tips
    05

    Khi mở 1 site DNN bạn sẽ thấy có icon trên thanh address của IE hay FF. Nó là file có đuôi dạng .ico. Bạn có thể thay đổi file đó theo ý muốn bằng cách tạo 1 file .ico của riêng mình. Rồi đặt nó tại thư mục gốc của site.

    Ngoài ra, DNN còn hỗ trợ thay đổi icon theo portal. Khi đó bạn có thể đặt file .ico vào các portal. Ví dụ như portals/0…

    Link tham khảo:

    http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/108/threadid/253863/scope/posts/Default.aspx

     

    [Read the rest of this article...]

    Posted in: Tips
    31

    Tình huống ở đây là user có tài khoản host trên site Dotnetnuke nhưng lại quên mất mật khẩu của mình. Nếu anh ta có quyền truy xuất database của site thì có thể dùng cách sau đây để tạo lại mật khẩu cho account host của mình:

    -Mở database.

    -Nếu không vào được trang Register, hãy vào table Portals, trong cột UserRegistration, chỉnh giá trị lại thành 2.

    -Tạo 1 account mới trên trang Register. Hãy nhớ mật khẩu của account mới này.

    -Mở table aspnet_membership, tới account mới tạo, copy giá trị của 2 cột password và passwordsalt. Paste vào 2 cột password và passwordsalt của account host.

    -Login lại vào account host với mật khẩu vừa mới đổi. Bây giờ ta có thể đổi lại mật khẩu khác.

    -Bạn có thể xóa account mới tạo đi cũng được.

    Vậy là xong.

    Link tham khảo:

    http://www.deutschnetnuke.de/tabid/183/Default.aspx

    [Read the rest of this article...]

    Posted in: Tips
    19

    Vừa rồi, có một bạn đã gặp vấn đề như sau: Khi chỉnh sửa 1 site DNN trên host, bạn ấy đã chỉnh sửa các settings sao đó, đến nỗi làm thay đổi link đến trang Login. Do đó, bạn ấy không thể login được vào hệ thống. Tình hình còn tệ hơn là do site cài đặt trên host, database vì lý do nào đó bạn ấy không có quyền truy suất vào để chỉnh sửa.

    May mắn thay là sau khi tìm kiếm trên mạng, bạn ấy đã tìm được 1 blog giúp giải quyết việc ấy.

    http://blogs.snapsis.com/PermaLink,guid,3078311e-6925-4c03-8243-d1b9c8a11906.aspx

    Trên blog này, tác giả đã viết 1 trang code để chỉnh sửa lại trong database thông tin liên kết tới trang Login. Chỉ cần down trang code này về, đặt trong root của site và chạy nó. Hướng dẫn chi tiết và code có trong link trên.

    Xin cám ơn bạn có nick anhdh209 đã chia sẻ link.

     

    [Read the rest of this article...]

    Posted in: Tips
    18

    Để tăng thời gian login cho user trên site dotnetnuke, bạn có thể chỉnh giá trị timeout trong web.config. Hiện nay giá trị mặc định là 60 phút.

    forms name=".DOTNETNUKE" protection="All" timeout="60000" cookieless="UseCookies"

    Link chi tiết:

    http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/108/threadid/356359/scope/posts/Default.aspx

     

    [Read the rest of this article...]

    Posted in: Tips
    27

    Copy được đoạn code này từ forum dotnetnuke.com và chia sẻ cho những bạn mới tìm hiểu:

    //Get the role information
    RoleInfo oCurrentRole = oDnnRoleController.GetRoleByName(this.PortalId, "MyRoleName")

    //Assign to user
    oDnnRoleController.AddUserRole(this.PortalId, user.UserID, oCurrentRole.RoleID, System.DateTime.Now.AddDays(-1), DotNetNuke.Common.Utilities.Null.NullDate);

    the oDnnRoleController is an instance of the RoleController within DotNetNuke.

    Link chi tiết:

    http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/197/threadid/348216/scope/posts/Default.aspx

     

    [Read the rest of this article...]

    Posted in: Tips
    19

    Trong phần settings của module có thể bạn sẽ thấy checkbox Display module on all pages. Nó được chứa giá trị trong column AllTabs trong table Modules.

    Link chi tiết:

    http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/108/threadid/348777/scope/posts/Default.aspx

     

    [Read the rest of this article...]

    Posted in: Tips
    03

    Dưới đây là câu lệnh SQL để lấy những role chưa được sử dụng trong SQL.

    SELECT DISTINCT R.RoleID, R.PortalID, R.RoleName from {databaseOwner}{objectQualifier}Roles R
    LEFT JOIN {databaseOwner}{objectQualifier}TabPermission T on R.RoleID = T.RoleID LEFT JOIN {databaseOwner}{objectQualifier}ModulePermission M on R.RoleID = M.RoleID
    WHERE T.RoleID Is Null AND M.RoleID IS Null

    Link chi tiết từ:

    http://www.hilbertsolutions.com/Blog_/EntryId/62/Finding-All-Dotnetnuke-Roles-Not-Being-Used.aspx

    [Read the rest of this article...]

    Posted in: Tips
    02

    Dưới đây là code lấy tất cả table trong database. Chỉ cần copy nó và thả vào trong Query Windows của SQL Management Studio và Excute nó.

    SELECT name [Table Name]

    FROM sysobjects

    WHERE xtype = 'U'

    order by 'Table Name'

     

    Link tham khảo:

    http://www.hilbertsolutions.com/Blog_/EntryId/67/Getting-a-list-of-tables-from-your-Database-using-DotNetNuke.aspx

    http://bytes.com/topic/sql-server/answers/156628-how-get-table-list-db-thanks

    [Read the rest of this article...]

    Posted in: Tips
    Page 1 of 5First   Previous   [1]  2  3  4  5  Next   Last   
    HomeTrangITForum
    Copyright 2010 by Nguyễn Minh ĐứcDesigned by DyNNamiteTerms Of UsePrivacy Statement