Hệ thống diễn đàn cho Unreal Portal

Thảo luận trong 'Lập trình & Đồ hoạ' bắt đầu bởi Maxx_Noob, 29/10/05.

  1. Maxx_Noob

    Maxx_Noob Youtube Master Race

    Tham gia ngày:
    13/10/05
    Bài viết:
    5
    + Mod Hệ thống diễn đàn cho Unreal Portal +
    by Ongia
    (Work with PDR4, PDR5..)

    Trong ACP=>Unreal Portal tìm
    Add Custom Blocks <=== Click vào
    Trong khung Block Name: ==> Điền forumlist
    Trong khung Block Title: ==> Điền Hệ Thống diễn đàn
    Trong khung Block PHP/HTML: ==> Điền Code như sau:
    Mã:
    <?php
    
    $query = $DB->query("SELECT * FROM ibf_forums WHERE parent_id='-1' ORDER BY position");
    while($out_cats=$DB->fetch_row($query)){
    
    $thread_urls .= "<img src={$ibforums->vars['img_url']}/cat.gif> <a href={$ibforums->vars['board_url']}/index.php?showforum={$out_cats['id']}><b>{$out_cats['name']}</b></a><br>";
    
    $query_f = $DB->query("SELECT * FROM ibf_forums WHERE parent_id='{$out_cats['id']}' ORDER BY position");
    while($out_f=$DB->fetch_row($query_f)){
    
    $thread_urls .= "  <img src={$ibforums->vars['img_url']}/forump.gif> <a href={$ibforums->vars['board_url']}/index.php?showforum={$out_f['id']}>{$out_f['name']}</a><br>";
    $query_sf = $DB->query("SELECT * FROM ibf_forums WHERE parent_id='{$out_f['id']}' ORDER BY position"); 
    while($out_sf=$DB->fetch_row($query_sf)){
    $thread_urls .= "     · <a href={$ibforums->vars['board_url']}/index.php?showforum={$out_sf['id']}>{$out_sf['name']}</a><br>";
    }
    }
    }
    echo "<tr><td colspan=2 width=100% align=center class=titlemedium>Hệ thống diễn đàn</td></tr>
    <tr>
    <td class=row2>
    <div style='overflow:auto;height:400px'>
    {$thread_urls}
    </div>
    </td>
    </tr>";
    
    ?>
    Save lại .

    Xong vào Portal Main tìm dòng

    Show Hệ thống diễn đàn? ===> Chọn Yes

    Xong tìm trong Mod cũ của 1.3x lấy 2 cái hình cat.gif và forump.gif.. xong up vào thư mục style_images/1/
     
  2. Maxx_Noob

    Maxx_Noob Youtube Master Race

    Tham gia ngày:
    13/10/05
    Bài viết:
    5
    +Sound & Flash BBCode Tags

    Flash Tag:
    Hướng dẫn by OG
    ============
    Flash tag có sẵn trong IPB rùi nên mình ko cần phải add thêm vào custom bbcode nữa mà chỉ edit java và skin cho Click được thui.

    Mở jscripts/ipb_bbcode.js ra tìm:
    Mã:
    //==========================================
    // URL tag
    //==========================================
    Thêm vào bên trên :
    Mã:
    //==========================================
    // Flash tag
    //==========================================
    
    function tag_flash()
    {
     var FoundErrors = '';
     var enterURL   = prompt(text_enter_url, "http://");
     var w = prompt(text_enter_flashW, "400");
     var h = prompt(text_enter_flashH, "350");
     if (!enterURL) {
         FoundErrors += " " + error_no_url;
     }
     if (!w) {
         FoundErrors += " " + error_no_flashW;
     }
     if (!h) {
         FoundErrors += " " + error_no_flashH;
     }
    
     if (FoundErrors) {
         alert("Error!"+FoundErrors);
         return;
     }
    
    doInsert("[flash="+w+","+h+"]"+enterURL+"[/flash]", "", false);
    }
    
    ACP=>Skin Manager=>Edit Root skin template HTML=>Post Screen =>get javascript :
    Mã:
    var text_enter_url      = "{ipb.lang['jscode_text_enter_url']}";
    Thêm vào bên dưới :
    Mã:
    var text_enter_flashW      = "{ipb.lang['jscode_text_enter_flashW']}";
    var text_enter_flashH      = "{ipb.lang['jscode_text_enter_flashH']}";
    var error_no_flashW        = "{ipb.lang['jscode_error_no_flashW']}";
    var error_no_flashH        = "{ipb.lang['jscode_error_no_flashH']}";
    var help_flash           = "{ipb.lang['hb_sound']}";
    Cũng trong acp ngay đó luôn Click vô postbox_buttons
    rùi Tìm (trong cái khung bự):
    Mã:
    <input type="button" accesskey="p" value=" CODE " onclick="simpletag('CODE')" class="codebuttons" name="CODE" onmouseover="hstat('code')" />
    Thêm vào sau nó:
    Mã:
    <input type='button' accesskey='f' value=' FLASH '     onclick='tag_flash()'          class='codebuttons' name='flash' onmouseover="hstat('flash')" />
    Mở lang_post.php ra Thêm vào bên trên :
    Mã:
    'hb_flash'     => "Insert Flash hyperlink",
    jscode_text_enter_flashW  => "Enter the Width of the Flash movie in pixels.",
    jscode_text_enter_flashH   => "Enter the Height of the Flash movie in pixels.",
    jscode_error_no_flashW     => "You must enter a width",
    jscode_error_no_flashH      => "You must enter a height",
    
    Vào ACP=>View All General Settings =>Security and Privacy=> Tìm dòng

    Allow flash movies in posts and avatars? ===> Coi phải nó đang là No ko? Nếu phải thì đổi wa Yes.

    Lưu ý : Nhớ set cho chiều ngang Flash lớn hơn 400 và chiều dọc Flash lớn hơn 350 . Set ở trong Topics,Posts, and Polls ở phần Settings

    Xong... giờ có thể post Flash bằng cách bấm vào nút giống như Image.
     

Chia sẻ trang này