New articles Năng lực quản lý: nhân tố thứ năm     ♥ Lựa chọn mục tiêu cuộc đời     ♥ 10 bí quyết cân bằng công việc và gia đình     ♥ Cô đơn trên mạng     ♥ Chứng khoán: Giấc mơ và ác mộng     ♥ Tám     ♥ Những tính năng của blog VnVista     ♥ Các mạng xã hội thống trị Google     ♥ Điều gì tạo nên một giám đốc công nghệ thông tin giỏi?     ♥ Cố gắng xóa bỏ những ấn tượng xấu     ♥ Cần một cách làm ăn mới     ♥ Tiếp thị hướng đến doanh nhân     ♥ Đưa cửa hàng thật lên chợ ảo     ♥ Bí quyết quản lý các nhân viên trẻ     ♥ Một số câu hỏi phỏng vấn “đặc biệt” của Microsoft     ♥ 4 bài học thành công trong kinh doanh     ♥ Tạo dựng hình ảnh một cô gái trẻ chuyên nghiệp     ♥ Góc “khác” của thế giới online đêm     ♥ Phong cách người Mỹ     ♥ Chỉ nghĩ đến tiền cũng làm người ta ích kỷ     
New blog entries Đại lý giày bảo hộ Jogger tại Hồ Chí Minh tốt      ♥ Hình ảnh Nami mặc váy màu cam dạo phố siêu xinh      ♥ SHEET Trả lại thoáng mây bay      ♥ Kinh doanh bảo hộ lao động tại Hồ Chí Minh      ♥ Công ty bảo hộ lao động tại Hà Nội uy tín nhất      ♥ chênh lệch sức mạnh giữa Quỷ và Đại Trụ      ♥ Phần Mềm Kế Toán Cho Doanh Nghiệp Nhỏ      ♥ 4 mẫu bàn cầu inax bán chạy T9/2025      ♥ Mức giá giày bảo hộ tại Bình Dương hiện nay      ♥ SHEET Ôm em được không      ♥ Hỗ trợ mái tóc chắc khỏe với dầu gội đầu c      ♥ Kinh nghiệm mua sắm thiết bị bảo hộ lao động      ♥ Phụ Gia PVC Giúp Ống Nhựa Giữ Vững Kích Thước      ♥ Nhóm thực phẩm tăng nguy cơ cục máu đông      ♥ Hướng dẫn chọn giày bảo hộ nam an toàn      ♥ SHEET Cha      ♥ Đăng ký hóa đơn điện tử khởi tạo từ máy      ♥ Check giá thương hiệu giày bảo hộ tại Hà Nội      ♥ Mở công ty bảo hộ lao động tại Hải Phòng      ♥ Hạch toán thuế xnk thế nào?      

[ Liệt Kê ] · Bình Thường · Tách Biệt+

Mod Hover Prompt


Tacaza
post Sep 7 2005, 01:25 AM
Gửi vào: #1


Group Icon

The chALLeNgER
**********
Thành viên: 1
Nhập: 3-July 05
Bài viết: 3,003
Tiền mặt: 1,210
Thanked: 1572
Cấp bậc: 43
------
Giới tính: Male
Sinh nhật: 3 Tháng 4 - 1983
Đến từ: Hà Nội
------
Xem blog
Bạn bè: 253 (Xem)
Thêm vào nhóm bạn bè
Gửi thiệp điện tử
Trang thông tin





DEMO: diễn đàn này

Mod này sẽ tạo một khung cửa sổ pupunder ko chặn được bằng trình diệt popup cho những khách ghé thăm diễn đàn để bảo họ đăng nhập hoặc đăng ký! Admin có thể đặt khoảng thời gian khung tự động đóng hoặc ko định thời gian.

### Down file đính kèm về, up lên host và chạy ###
Ví dụ: http://xxx.com/diendan/dinstall.php



##### Mở up sources/classes/class_display.php #####

Tìm: (có 3 phần giống vậy nhưng chọn cái ở dòng khoảng ~150)


CODE
//-----------------------------------------
      // CSS
      //-----------------------------------------



Thêm phía trên:

CODE
//---------------------------------------------------------
// Hover Prompt
//---------------------------------------------------------

if (strtolower($ibforums->input['act']) != 'reg')
{
if (strtolower($ibforums->input['act']) != 'login')
{
 if ($ibforums->member['id'] == 0 || $ibforums->member['id'] == '')
 {
  $ah = ($ibforums->vars['hp_autohide'] == 1) ? "yes" : "no";
  $msg = $ibforums->vars['hp_message'];
  $msg = str_replace("{*boardname*}", $ibforums->vars['board_name'], $msg);
  $msg = str_replace("{*username*}", $ibforums->member['name'], $msg);
  $time = (($ibforums->vars['hp_hidesecs'] > 0) && ($ibforums->vars['hp_hidesecs'] == 1)) ? $ibforums->vars['hp_hidesecs'].' '.$ibforums->lang['hp_timersec'] : $ibforums->vars['hp_hidesecs'].' '.$ibforums->lang['hp_timersecs'];
  if (($ibforums->vars['hp_autohide'] == 1) && ($ibforums->vars['hp_hidesecs'] > 0))
  {
   $msg = str_replace("<!--HP_TIMER-->", "<small><i>{$ibforums->lang['hp_timertext']} {$time}</i></small>", $msg);
  }
  $nav .= $ibforums->skin_global->hover_prompt($ah, $ibforums->vars['hp_hidesecs'], $msg);
 }
}
}





##### Mở up sources/admin/admin_pages.php #####

Tìm:

CODE

14 => array( 'IPB Copyright Removal'   , 'act=pin&code=copy'    ),



Thêm phía dưới:

CODE

20 => array( 'D2-Hover Prompt'         , 'act=op&code=findsetting&key='.urlencode('hoverprompt'), '', 0, 1 ),





##### Mở lang/en/lang_global.php #####

Thêm vào: (lưu ý tuỳ định dạng của lang nữa)

CODE

'hp_timertext' => "This prompt auto closes in",
'hp_timersec' => "second(s)",





##### Mở up skin_cache/cacheid_2/skin_global.php #####

Tìm:

CODE

class skin_global {



Thêm phía dưới:

CODE

// ============================================================
===============
// hover_prompt
// ============================================================
===============
function hover_prompt($ah="",$hsecs="",$msg="") {
global $ibforums;
$IPBHTML = "";
//--starthtml--//


$IPBHTML .= <<<EOF
<script type='text/javascript'>
var displaymode = 'always';
var enablefade = 'no';
var autohidebox = ['{$ah}', {$hsecs}];
var showonscroll = 'yes';
var IEfadelength = 1;
var Mozfadedegree = 0.05;

if (parseInt(displaymode) != NaN)
{
var random_num = Math.floor(Math.random() * displaymode);
}

function display_hover_prompt()
{
var ie = document.all && !window.opera;
var dom = document.getElementById;
var iebody = (document.compatMode == 'CSS1Compat') ? document.documentElement : document.body;
var objref = (dom) ? document.getElementById('hoverprompt') : document.all.hoverprompt;
var scroll_top = (ie) ? iebody.scrollTop : window.pageYOffset;
var docwidth = (ie) ? iebody.clientWidth : window.innerWidth;
var docheight = (ie) ? iebody.clientHeight: window.innerHeight;
var objwidth = objref.offsetWidth;
var objheight = objref.offsetHeight;
objref.style.left = docwidth/2-objwidth/2+'px';
objref.style.top = scroll_top+docheight/2-objheight/2+'px';

if (showonscroll == 'yes')
{
var showonscrollvar = setInterval('static_hover_prompt()', 50);
}

if (enablefade == 'yes' && objref.filters)
{
objref.filters[0].duration = IEfadelength;
objref.filters[0].Apply();
objref.filters[0].Play();
}

objref.style.visibility = 'visible';
if (objref.style.MozOpacity)
{
if (enablefade == 'yes')
{
 var mozfadevar = setInterval('mozilla_hover_prompt_fade()', 90);
}
else
{
 objref.style.MozOpacity = 1;
 initiate_hover_prompt_hiding();
}
}
else
{
initiate_hover_prompt_hiding()
}
}

function mozilla_hover_prompt_fade()
{
if (parseFloat(objref.style.MozOpacity) < 1)
{
objref.style.MozOpacity = parseFloat(objref.style.MozOpacity)+Mozfadedegree;
}
else
{
clearInterval(mozfadevar);
controlledhidebox();
}
}

function static_hover_prompt()
{
var ie = document.all && !window.opera;
var dom = document.getElementById;
var iebody = (document.compatMode == 'CSS1Compat') ? document.documentElement : document.body;
var objref = (dom) ? document.getElementById('hoverprompt') : document.all.hoverprompt;
var scroll_top = (ie) ? iebody.scrollTop : window.pageYOffset;
var docwidth = (ie) ? iebody.clientWidth : window.innerWidth;
var docheight = (ie) ? iebody.clientHeight: window.innerHeight;
var objwidth = objref.offsetWidth;
var objheight = objref.offsetHeight;
objref.style.top = scroll_top+docheight/3-objheight/2+'px';
}

function hide_hover_prompt()
{
var ie = document.all && !window.opera;
var dom = document.getElementById;
var iebody = (document.compatMode == 'CSS1Compat') ? document.documentElement : document.body;
var objref = (dom) ? document.getElementById('hoverprompt') : document.all.hoverprompt;
objref.style.visibility = 'hidden';
if (typeof showonscrollvar != 'undefined')
{
clearInterval(showonscrollvar);
}
}

function initiate_hover_prompt_hiding()
{
if (autohidebox[0] == "yes")
{
var delayvar = (enablefade == 'yes' && objref.filters) ? (autohidebox[1]+objref.filters[0].duration)*1000 : autohidebox[1]*1000;
initiate_timer(delayvar);
setTimeout('hide_hover_prompt()', delayvar);
}
}

function initiate_timer(time)
{
var newtime = time-1000;
setTimeout('update_timer('+newtime+')', 1000);
}

function update_timer(time)
{
var timer = time/1000;
var ie = document.all && !window.opera;
var dom = document.getElementById;
if (dom)
{
var hp = document.getElementById('hptimer');
 hp.innerHTML = "<small><i>{$ibforums->lang['hp_timertext']} "+timer+" {$ibforums->lang['hp_timersec']}</i></small>";
}
var newtime = time-1000;
setTimeout('update_timer('+newtime+')', 1000);
}

function initiate_hover_prompt()
{
setTimeout('display_hover_prompt()', 100);
}

function get_cookie(Name)
{
var search = Name + "=";
var returnvalue = "";
if (document.cookie.length > 0)
{
var offset = document.cookie.indexOf(search);
if (offset != -1)
{
 offset += search.length;
 var end = document.cookie.indexOf(';', offset);
 if (end == -1)
 {
  end = document.cookie.length;
 }
 returnvalue = unescape(document.cookie.substring(offset, end));
}
}
return returnvalue;
}

if (displaymode == 'always' || parseInt(displaymode) != NaN && random_num == 0)
{
if (window.addEventListener)
{
window.addEventListener('load', initiate_hover_prompt, false)
}
else if (window.attachEvent)
{
window.attachEvent('onload', initiate_hover_prompt)
}
else if (document.getElementById)
{
window.onload = initiate_hover_prompt;
document.cookie = 'fadedin=yes';
}
}
</script>
<style type='text/css'>#hoverprompt{position:absolute; width:350px; left:0; top:-400px; padding:4px; z-index:100; visibility:hidden}</style>
<div id='hoverprompt'>{$msg}</div>
EOF;

//--endhtml--//
return $IPBHTML;
}




##### DONE!!! #####


--------------------
Nhóm bạn bè:


dung_buong_tay

tamhonngoc_536

uchinhuong

MTTH

xuxusp2

Xem tất cả


--------------------

Sao không là mặt trời, gieo hạt nắng vô tư?


 
Nếu bạn thấy bài viết này vi phạm nội quy forum, hãy click nút này:
User is offlineProfile CardPM
Go to the top of the page
+Quote Post



Thank you! Reply to this topicTopic OptionsStart new topic
 

Bản Rút Gọn Bây giờ là: 21st September 2025 - 02:47 AM
Home | Mạng xã hội | Blog | Thiệp điện tử | Tìm kiếm | Thành viên | Sổ lịch