Xuất hiện những cảnh báo sau đây:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.33 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.33 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined array key 2 - Line: 89 - File: inc/plugins/phptpl.php PHP 8.1.33 (Linux)
File Line Function
/inc/plugins/phptpl.php 89 errorHandler->error
[PHP]   {closure}
/inc/plugins/phptpl.php 109 preg_replace_callback_array
/inc/plugins/phptpl.php(70) : eval()'d code 19 phptpl_parsetpl
/global.php 844 phptpl_templates->get
/showthread.php 26 require_once
Warning [2] Undefined array key 2 - Line: 89 - File: inc/plugins/phptpl.php PHP 8.1.33 (Linux)
File Line Function
/inc/plugins/phptpl.php 89 errorHandler->error
[PHP]   {closure}
/inc/plugins/phptpl.php 109 preg_replace_callback_array
/inc/plugins/phptpl.php(70) : eval()'d code 19 phptpl_parsetpl
/global.php 844 phptpl_templates->get
/showthread.php 26 require_once
Warning [2] Undefined variable $awaitingusers - Line: 102 - File: global.php(844) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/global.php(844) : eval()'d code 102 errorHandler->error
/global.php 844 eval
/showthread.php 26 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.33 (Linux)
File Line Function
/global.php 909 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.33 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.33 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.33 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key "avatar" - Line: 80 - File: global.php(938) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/global.php(938) : eval()'d code 80 errorHandler->error
/global.php 938 eval
/showthread.php 26 require_once
Warning [2] Undefined array key "pms_unread" - Line: 99 - File: global.php(938) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/global.php(938) : eval()'d code 99 errorHandler->error
/global.php 938 eval
/showthread.php 26 require_once
Warning [2] Undefined array key "logoutkey" - Line: 101 - File: global.php(938) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/global.php(938) : eval()'d code 101 errorHandler->error
/global.php 938 eval
/showthread.php 26 require_once
Warning [2] Undefined property: MyLanguage::$ratings_update_error - Line: 4 - File: showthread.php(732) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/showthread.php(732) : eval()'d code 4 errorHandler->error
/showthread.php 732 eval
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.33 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 5 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 5 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.33 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.33 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.33 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 784 - File: inc/functions_post.php PHP 8.1.33 (Linux)
File Line Function
/inc/functions_post.php 784 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined variable $similarthreads - Line: 155 - File: inc/plugins/similarthreadsinfirstpost.php PHP 8.1.33 (Linux)
File Line Function
/inc/plugins/similarthreadsinfirstpost.php 155 errorHandler->error
/inc/class_plugins.php 139 similarthreadsinfirstpost_main
/inc/functions_post.php 826 pluginSystem->run_hooks
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "thanks" - Line: 37 - File: inc/functions_post.php(867) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/inc/functions_post.php(867) : eval()'d code 37 errorHandler->error
/inc/functions_post.php 867 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "thxdsp_outline" - Line: 38 - File: inc/functions_post.php(867) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/inc/functions_post.php(867) : eval()'d code 38 errorHandler->error
/inc/functions_post.php 867 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyviewownthreads" - Line: 1081 - File: showthread.php PHP 8.1.33 (Linux)
File Line Function
/showthread.php 1081 errorHandler->error
Warning [2] Undefined array key "threadprefix" - Line: 5 - File: showthread.php(1168) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/showthread.php(1168) : eval()'d code 5 errorHandler->error
/showthread.php 1168 eval
Warning [2] Undefined array key "invisible" - Line: 1506 - File: showthread.php PHP 8.1.33 (Linux)
File Line Function
/showthread.php 1506 errorHandler->error
Warning [2] Undefined property: MyLanguage::$thx_processing - Line: 8 - File: showthread.php(1533) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 8 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $threadnotesbox - Line: 35 - File: showthread.php(1533) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 35 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $first_post - Line: 55 - File: showthread.php(1533) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 55 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $forumjump - Line: 88 - File: showthread.php(1533) : eval()'d code PHP 8.1.33 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 88 errorHandler->error
/showthread.php 1533 eval




  • 0 Votes - 0 Average
  • 5
  • 4
  • 3
  • 2
  • 1
Chế độ chủ đề

Tùy biến công cụ tìm kiếm google cho mybb
ngocvu1403 Offline
Phó giám đốc
******
Administrators

Bài viết: 1,186
Chủ đề: 877
Tham gia: May 2011
Danh tiếng: 4
Hum nay ngồi tổng hợp thêm 1 cái nữa cho mybb ...( phòng sau này quên)hihi :sm4cute_smiley36::sm4cute_smiley36:
Demo: cái thanh search bên trên góc phải của diễn đàn nhé:

Các bước thực hiện:


1. Tạo công cụ tìm kiếm tùy chỉnh - Custom Search Engine (CSE)
- Truy cập vào Custom Search Engine và đăng nhập bằng tài khoản Google của mọi người.
- Điền đầy đủ thông tin cần thiết và tiến hành cho đến khi lấy được code (Bước 3. Nhận mã). Chú ý ở chỗ "Trang web tìm kiếm:" thì nhập URL diễn đàn hoặc trang web của mọi người, mỗi URL trên 1 dòng.
Ở bước này nếu ai gặp khó khăn thì có thể search thêm trên net rất nhiều.



Ví dụ mình nhận được mã sau:

Code:
<div id="cse" style="width: 100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript"> 
  google.load('search', '1', {language : 'vi', style : google.loader.themes.V2_DEFAULT});
  google.setOnLoadCallback(function() {
    var customSearchOptions = {};  var customSearchControl = new google.search.CustomSearchControl(
      '004142063128979054355:eczye4qariq', customSearchOptions);
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESU​LTSET);
    customSearchControl.draw('cse');
  }, true);
</script>


Mọi người lấy cái phần code sau:

Code:
004142063128979054355:eczye4qariq  

2. Tạo module tìm kiếm sử dụng Google Custom Search:

- Vào AdminCP » Template Sets » Global Templates » Add Template
>> Template Name: customsearch
>> Nội dung của template:


Trích dẫn:<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->toplinks_search}</title>
{$headerinclude}
</head>
<body>
{$header}
<table cellspacing="0" cellpadding="4" border="0" class="tborder">
    <tbody><tr>
        <td class="thead"><strong>{$mybb->settings['bbname']}  - Tìm kiếm với Google</strong></td>
    </tr>
    <tr>
        <td class="trow1">


            <form method="GET" action="customsearch.php">
                <fieldset class="noborder">
                    <label for="search_box">
                        <span id="search_left"></span>
                    </label>
<input type="text" style="width: 85%;" title="Nhập từ khóa bạn muốn tìm kiếm" id="search_box" name="q" value="Tìm kiếm trong diễn đàn với Google..." onfocus="if(this.value == 'Tìm kiếm trong diễn đàn với Google...') { this.value = ''; }" onblur="if(this.value=='') { this.value='Tìm kiếm trong diễn đàn với Google...'; }">
                    <input type="submit" id="search_button" name="submit-search" value="Tìm kiếm">
                </fieldset>
            </form>           
        </td>
    </tr>
    <tr>
        <td class="trow1">
           
           
<div id="cse" style="width: 100%;"></div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
        <script type="text/javascript">
          function parseQueryFromUrl () {
            var queryParamName = "q";
            var search = window.location.search.substr(1);
            var parts = search.split('&');
            for (var i = 0; i < parts.length; i++) {
              var keyvaluepair = parts[i].split('=');
              if (decodeURIComponent(keyvaluepair[0]) == queryParamName) {
                return decodeURIComponent(keyvaluepair[1].replace(/\+/g, ' '));
              }
            }
            return '';
          }
          google.load('search', '1');
          google.setOnLoadCallback(function() {
            var customSearchControl = new google.search.CustomSearchControl('015027525266926634575:sg4ezpg7vgm');
            customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESU​LTSET);
            var options = new google.search.DrawOptions();
            options.setAutoComplete(true);
            options.enableSearchResultsOnly();    
            customSearchControl.draw('cse', options);
            var queryFromUrl = parseQueryFromUrl();
            if (queryFromUrl) {
              customSearchControl.execute(queryFromUrl);
            }
          }, true);
        </script>
            <link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" />
           
        </td>
    </tr>

</tbody></table>
{$footer}
</body>
</html>




Ở nội dung trên, chúng ta chú ý dòng sau:

Code:
var customSearchControl = new google.search.CustomSearchControl('004142063128979054355:eczye4qariq'); 

Thay bằng code của mọi người có được ở bước trên vào đó.

- Tạo file customsearch.php với nội dung sau:


Code:
<?php
define("IN_MYBB",1);
require_once("./global.php");
add_breadcrumb("Custom Search", "customsearch.php");
eval("\$customsearch = \"".$templates->get("customsearch")."\";");
output_page($customsearch);
?>
và upload lên host ngang hàng với index của diễn đàn.

Bây giờ coi như đã thành tạo thành công module search của riêng mọi người sử dụng Google Custom Search.
Mọi người có thể test thử theo link YourDomain/MyBB_ROOT/customsearch.php

3. Sử dụng:
- Có thể chèn link trên ở đâu đó trong diễn đàn để thành viên sử dụng.
- Có thể add Search Box vào banner như của mình:
Sử dụng code để chèn vào template:


Trích dẫn:<div id="search">
                    <form action="{$mybb->settings['bburl']}/customsearch.php" method="GET">
                    <fieldset class="noborder">
                    <label for="search_box">
                    <span id="search_left"></span>
                    </label>
                    <input name="q" id="search_box" onkeyup="buscar_ahora(this.value);" onblur="if(this.value=='')this.value='Tìm kiếm với google';" onclick="if(this.value=='Tìm kiếm với google')this.value='';" value="Tìm kiếm với google"  title="Nhập từ khóa bạn muốn tìm kiếm" type="text" />
                    <input value="{$lang->toplinks_search}" name="submit-search" id="search_button" type="submit" />
                    </fieldset>
                    </form>

                </div>



css: (thêm vào global.css)


Code:
div#search {
    top: 55px;
    right: -5px;
    height: 26px;
    position: absolute;
    display: inline-table;
    float: right;

Hoặc đâu đó mọi nơi mọi người muốn.

Nguồn: mybb.vn


Có thể liên quan đến chủ đề...
Plugin SCEditor-MyBB Version 1.4.4.1
lỗi quote không hoạt động khi upgrade từ mybb 1.6.9 lên 1.6.10
BỘ GÕ TIẾNG VIỆT THỤT THÒ FULL CHO MYBB
Add Facebook Comments - MyBB
Thêm trang upanh lên picasa cho mybb
[Plugins/Mods] FaceBook Connect for MyBB
[MyBB Plugin/Mod] IC Ads - Adds advertisements to category on index page
Hướng dẫn Đóng khung chữ ký trong mybb
Đóng khung bài viết cho mybb
Add Facebook Comments - MyBB

Hãy nhấn
Like - Share Nếu Bài Viết Có Ích



Có thể liên quan đến chủ đề...
Chủ đề: / Tác giả Trả lời: / Xem: Bài mới nhất




Những người đang xem chủ đề này: 1 khách

Color Skins

Change Color:

Background Patterns:

Background Images:

Background Header:

Setting Panel

Main Options: