Results 1 to 6 of 6

Thread: JavaScript Help

  1. #1
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default JavaScript Help

    Hello Everyone,

    i have share 1 file of javascripting with invisionboard. its the 1 of modification file that work in Mozila but not work in IE6 IE7 IE8 and it's show below error

    Code:
    line: 167
    char: 1
    error: object doesn't support this property or methoud
    code: 0
    url: http://www.myforum.com/index.php?
    i don't know what is the problem in this file. so please check it's coding and tell me why is it not working with IE.

    File Name: d23_hp

    File:

    Code:
    function d23_hoverprompt(id)
    {
        this.obj;
        this.scroll_var;
    
        this.obj_id        = id;
        this.screen_scroll = true;
        this.enable_fade   = false;
        this.auto_hide     = false;
        this.show_timer    = false;
        this.suspend       = false;
        this.hide_time     = 0;
        this.langs         = new Array();
    
        this.obj = my_getbyid(this.obj_id);
    
        return this;
    }
    
    d23_hoverprompt.prototype.display = function()
    {
        d = this._calc_data();
        this.obj.style.position = 'absolute';
        this.obj.style.display  = '';
        this.obj.style.zIndex   = 1000;
        this.obj.style.left     = d['doc_width']/2-d['obj_width']/2+'px';
        this.obj.style.top      = d['scroll_top']+d['doc_height']/3-d['obj_height']/2+'px';
    
        if (this.screen_scroll)
        {
            this.scroll_var = setInterval(this.obj_id+'.scroll_screen()', 15);
        }
    
        if (this.enable_fade)
        {
            this.start_fade_in();
        }
        else
        {
            this.initiate_countdown();
        }
    }
    
    d23_hoverprompt.prototype.start_fade_in = function()
    {
        if (this.enable_fade)
        {
            this.opacity(0, 100, 1000);
            setTimeout(this.obj_id+'.end_fade_in()', 100);
        }
    }
    
    d23_hoverprompt.prototype.end_fade_in = function()
    {
        if (this.enable_fade && this.obj.style.opacity >= 1)
        {
            this.initiate_countdown();
        }
        else
        {
            setTimeout(this.obj_id+'.end_fade_in()', 100);
        }
    }
    
    d23_hoverprompt.prototype.start_fade_out = function()
    {
        if (this.enable_fade)
        {
            this.opacity(100, 0, 1000);
            setTimeout(this.obj_id+'.end_fade_out()', 100);
        }
    }
    
    d23_hoverprompt.prototype.end_fade_out = function()
    {
        if (this.enable_fade && this.obj.style.opacity <= 0)
        {
            this.hide(true);
        }
        else
        {
            setTimeout(this.obj_id+'.end_fade_out()', 100);
        }
    }
    
    d23_hoverprompt.prototype.scroll_screen = function()
    {
        d = this._calc_data();
    
        this.obj.style.left = d['doc_width']/2-d['obj_width']/2+'px';
        this.obj.style.top  = d['scroll_top']+d['doc_height']/3-d['obj_height']/2+'px';
    }
    
    d23_hoverprompt.prototype.hide = function()
    {
        if (arguments[0] !== true && this.suspend)
        {
            return false;
        }
    
        if (this.enable_fade && arguments[0] !== true)
        {
            this.start_fade_out();
        }
        else
        {
            this.obj.style.display = 'none';
            this.obj.style.top     = '0px';
            this.obj.style.left    = '0px';
    
            this._clear_vars();
        }
    
        return false;
    }
    
    d23_hoverprompt.prototype.register = function()
    {
        locationjump('act=reg');
    }
    
    d23_hoverprompt.prototype.focused = function()
    {
        this.suspend = true;
    
        //my_getbyid(this.obj_id+'-close').style.display     = '';
        my_getbyid(this.obj_id+'-timer-row').style.display = 'none';
    }
    
    d23_hoverprompt.prototype.initiate_countdown = function()
    {
        if (this.auto_hide && this.hide_time > 0)
        {
            t = parseInt(this.hide_time)*1000;
    
            setTimeout(this.obj_id+'.hide()', t);
            if (this.show_timer)
            {
                setTimeout(this.obj_id+'.update_countdown('+(t-1000)+')', 1000);
            }
        }
    }
    
    d23_hoverprompt.prototype.update_countdown = function(t)
    {
        if (!this.show_timer || this.suspend)
        {
            return false;
        }
    
        var n = t/1000;
        var o = my_getbyid(this.obj_id+'-timer');
    
        if (o)
        {
            o.innerHTML = "<small><i>"+this.langs['timetxt']+" "+n+" "+((n == 1) ? this.langs['timesec'] : this.langs['timesecs'])+"</i></small>";
        }
    
        n = t-1000;
        if (n > 0)
        {
            setTimeout(this.obj_id+'.update_countdown('+n+')', 1000);
        }
    }
    
    d23_hoverprompt.prototype.add_langs = function(a)
    {
        for (var i in a)
        {
            this.langs[i] = a[i];
        }
    }
    
    d23_hoverprompt.prototype._calc_data = function()
    {
        var a = new Array();
    
        a['body']       = (document.compatMode == 'CSS1Compat') ? document.documentElement : document.body;
        a['scroll_top'] = (is_ie) ? a['body'].scrollTop    : window.pageYOffset;
        a['doc_width']  = (is_ie) ? a['body'].clientWidth  : window.innerWidth;
        a['doc_height'] = (is_ie) ? a['body'].clientHeight : window.innerHeight;
        a['obj_width']  = this.obj.offsetWidth;
        a['obj_height'] = this.obj.offsetHeight;
    
        return a;
    }
    
    d23_hoverprompt.prototype._clear_vars = function()
    {
        if (typeof(this.scroll_var) != 'undefined')
        {
            clearInterval(this.scroll_var);
        }
    
        if (typeof(this.display_var) != 'undefined')
        {
            clearInterval(this.display_var);
        }
    
        if (typeof(this.fade_var) != 'undefined')
        {
            clearInterval(this.fade_var);
        }
    }
    
    d23_hoverprompt.prototype.opacity = function(s, e, m)
    {
        var a = Math.round(m/100);
        var b = 0;
    
        if (s > e)
        {
            for (var i=s; i>=e; i--)
            {
                setTimeout(this.obj_id+'.change_opacity('+i+')', (a*b));
                b++;
            }
        }
        else if (s < e)
        {
            for (var i=s; i<=e; i++)
            {
                setTimeout(this.obj_id+'.change_opacity('+i+')', (a*b));
                b++;
            }
        }
    }
    
    d23_hoverprompt.prototype.change_opacity = function(o)
    {
        this.obj.style.opacity = o/100;
        this.obj.MozOpacity    = o/100;
        this.obj.KhtmlOpacity  = o/100;
        this.obj.filter        = 'alpha(opacity='+o+')';
    }
    thank you

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    try

    Code:
    d23_hoverprompt.prototype._calc_data = function()
    {
        var a = new Array();
    
        a['body']       = (document.compatMode == 'CSS1Compat') ? document.documentElement : document.body;
        a['scroll_top'] = zxcWWHS()[3];
        a['doc_width']  = zxcWWHS()[0];
        a['doc_height'] = zxcWWHS()[1];
        a['obj_width']  = this.obj.offsetWidth;
        a['obj_height'] = this.obj.offsetHeight;
    
        return a;
    }
    
    function zxcWWHS(){
     if (window.innerHeight) return [window.innerWidth-10,window.innerHeight-10,window.pageXOffset,window.pageYOffset];
     else if (document.documentElement.clientHeight) return [document.documentElement.clientWidth-10,document.documentElement.clientHeight-10,document.documentElement.scrollLeft,document.documentElement.scrollTop];
     return [document.body.clientWidth,document.body.clientHeight,document.body.scrollLeft,document.body.scrollTop];
    }
    or post example HTML of application

  3. #3
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    No, it doesn't effect. same error will show. but some thing changed now last error is on line: 167 now after this part adding it's move on line: 171

    now the this error look

    Code:
    line: 167
    char: 1
    error: object doesn't support this property or methoud
    code: 0
    url: http://www.myforum.com/index.php?
    more information i will give u. it's the modification of Invision power board forum and it's show the HoverPrompet login box to guests. it's working fine one MozillaFirefox but not working in Internet Explorers. and after your coding part adding the prompet box will look more big in size on MozillaFirefox.

  4. #4
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    You will need to post the relavent HTML and CSS code.

  5. #5
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok i will post a full modification files

    1.xml file
    2.js file
    3.php file

    d23_hp.xml
    size:10kb

    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <mod_data>
    	<mod_info>
    		<title>D23-Hover Prompt</title>
    		<version>1.0</version>
    		<author></author>
    		<website></website>
    		<ipbver>2.3</ipbver>
    		<version_file></version_file>
    	</mod_info>
    
    	<settings_group>
    		<setting>
    			<conf_id>293</conf_id>
    			<conf_title>Enable Hover Prompt</conf_title>
    			<conf_description>Enable the Hover Prompt to be displayed?</conf_description>
    			<conf_group>32</conf_group>
    
    			<conf_type>yes_no</conf_type>
    			<conf_key>d23_hp_enable</conf_key>
    			<conf_value></conf_value>
    			<conf_default>1</conf_default>
    			<conf_extra></conf_extra>
    			<conf_evalphp></conf_evalphp>
    			<conf_protected>1</conf_protected>
    
    			<conf_position>1</conf_position>
    			<conf_start_group>Global Settings</conf_start_group>
    			<conf_end_group>1</conf_end_group>
    			<conf_help_key></conf_help_key>
    			<conf_add_cache>1</conf_add_cache>
    		</setting>
    
    		<setting>
    			<conf_id>294</conf_id>
    			<conf_title>Auto-Hide Prompt</conf_title>
    			<conf_description><![CDATA[Auto-Hide the Hover Prompt after a certain time length?<br /><i>Note: The time length must be greater than 0.</i>]]></conf_description>
    			<conf_group>32</conf_group>
    			<conf_type>yes_no</conf_type>
    			<conf_key>d23_hp_autohide</conf_key>
    
    			<conf_value></conf_value>
    			<conf_default>1</conf_default>
    			<conf_extra></conf_extra>
    			<conf_evalphp></conf_evalphp>
    			<conf_protected>1</conf_protected>
    			<conf_position>2</conf_position>
    			<conf_start_group>Auto-Hide Settings</conf_start_group>
    
    			<conf_end_group>0</conf_end_group>
    			<conf_help_key></conf_help_key>
    			<conf_add_cache>1</conf_add_cache>
    		</setting>
    
    		<setting>
    			<conf_id>295</conf_id>
    			<conf_title>Time Length</conf_title>
    
    			<conf_description><![CDATA[The time length to wait before auto-hiding the Hover Prompt.<br /><i>Note: Time length is in seconds.</i>]]></conf_description>
    			<conf_group>32</conf_group>
    			<conf_type>input</conf_type>
    			<conf_key>d23_hp_timelength</conf_key>
    			<conf_value></conf_value>
    			<conf_default>30</conf_default>
    			<conf_extra></conf_extra>
    
    			<conf_evalphp></conf_evalphp>
    			<conf_protected>1</conf_protected>
    			<conf_position>3</conf_position>
    			<conf_start_group></conf_start_group>
    			<conf_end_group>0</conf_end_group>
    			<conf_help_key></conf_help_key>
    			<conf_add_cache>1</conf_add_cache>
    
    		</setting>
    
    		<setting>
    			<conf_id>296</conf_id>
    			<conf_title>Display Auto-Hide Timer</conf_title>
    			<conf_description>Display the countdown timer until the Hover Prompt will hide?</conf_description>
    			<conf_group>32</conf_group>
    
    			<conf_type>yes_no</conf_type>
    			<conf_key>d23_hp_showtimer</conf_key>
    			<conf_value></conf_value>
    			<conf_default>1</conf_default>
    			<conf_extra></conf_extra>
    			<conf_evalphp></conf_evalphp>
    			<conf_protected>1</conf_protected>
    
    			<conf_position>4</conf_position>
    			<conf_start_group></conf_start_group>
    			<conf_end_group>1</conf_end_group>
    			<conf_help_key></conf_help_key>
    			<conf_add_cache>1</conf_add_cache>
    		</setting>
    
    		<setting>
    
    			<conf_id>299</conf_id>
    			<conf_title>Enable Fading Effect</conf_title>
    			<conf_description>Enable the fade in/fade out effect on the Hover Prompt?</conf_description>
    			<conf_group>32</conf_group>
    			<conf_type>yes_no</conf_type>
    			<conf_key>d23_hp_enablefade</conf_key>
    
    			<conf_value></conf_value>
    			<conf_default>1</conf_default>
    			<conf_extra></conf_extra>
    			<conf_evalphp></conf_evalphp>
    			<conf_protected>1</conf_protected>
    			<conf_position>5</conf_position>
    			<conf_start_group>Prompt Extra Settings</conf_start_group>
    
    			<conf_end_group>0</conf_end_group>
    			<conf_help_key></conf_help_key>
    			<conf_add_cache>1</conf_add_cache>
    		</setting>
    
    		<setting>
    			<conf_id>300</conf_id>
    			<conf_title>Manual Close Button</conf_title>
    
    			<conf_description><![CDATA[Display the manual close button for viewer's to manually close the Hover Prompt?]]></conf_description>
    			<conf_group>32</conf_group>
    			<conf_type>yes_no</conf_type>
    			<conf_key>d23_hp_showclose</conf_key>
    			<conf_value></conf_value>
    			<conf_default>0</conf_default>
    			<conf_extra></conf_extra>
    
    			<conf_evalphp></conf_evalphp>
    			<conf_protected>1</conf_protected>
    			<conf_position>6</conf_position>
    			<conf_start_group></conf_start_group>
    			<conf_end_group>1</conf_end_group>
    			<conf_help_key></conf_help_key>
    			<conf_add_cache>1</conf_add_cache>
    
    		</setting>
    
    		<setting>
    			<conf_id>298</conf_id>
    			<conf_title>Prompt Title</conf_title>
    			<conf_description><![CDATA[Customize the title of the Hover Prompt.<br /><u>Quick Vars</u><br />{hp:name} = Member's Name<br />{hp:board} => Board's Name<br />{hp:url|%1|%2}...{/hp:url} = Link Some Text (%1=key, %2=value - Ex: {hp:url|act|idx}Index{/hp:url})]]></conf_description>
    			<conf_group>32</conf_group>
    			<conf_type>input</conf_type>
    
    			<conf_key>d23_hp_title</conf_key>
    			<conf_value></conf_value>
    			<conf_default>Welcome To {hp:board}, {hp:name}</conf_default>
    			<conf_extra></conf_extra>
    			<conf_evalphp></conf_evalphp>
    			<conf_protected>1</conf_protected>
    			<conf_position>7</conf_position>
    
    			<conf_start_group>Prompt Settings</conf_start_group>
    			<conf_end_group>0</conf_end_group>
    			<conf_help_key></conf_help_key>
    			<conf_add_cache>1</conf_add_cache>
    		</setting>
    
    		<setting>
    			<conf_id>297</conf_id>
    
    			<conf_title>Prompt Message</conf_title>
    			<conf_description><![CDATA[Customize the message to your liking that will be displayed on the Hover Prompt.<br /><u>Quick Vars</u><br />{hp:name} = Member's Name<br />{hp:board} => Board's Name<br />{hp:buttons} = Login & Register Buttons<br />{hp:url|%1|%2}...{/hp:url} = Link Some Text (%1=key, %2=value - Ex: {hp:url|act|idx}Index{/hp:url})]]></conf_description>
    			<conf_group>32</conf_group>
    			<conf_type>editor</conf_type>
    			<conf_key>d23_hp_message</conf_key>
    			<conf_value></conf_value>
    			<conf_default><![CDATA[{hp:name}, by {hp:url|act|reg}registering{/hp:url} on our forums, you will have access to many other sections than you currently do. So, why wait? Come join us today!
    <div align='center'>{hp:buttons}</div>]]></conf_default>
    
    			<conf_extra></conf_extra>
    			<conf_evalphp></conf_evalphp>
    			<conf_protected>1</conf_protected>
    			<conf_position>8</conf_position>
    			<conf_start_group></conf_start_group>
    			<conf_end_group>1</conf_end_group>
    			<conf_help_key></conf_help_key>
    
    			<conf_add_cache>1</conf_add_cache>
    		</setting>
    	</settings_group>
    
    	<sections_group>
    		<section>
    			<conf_title_title>D23-Hover Prompt</conf_title_title>
    			<conf_title_desc>Settings for D23-Hover Prompt.</conf_title_desc>
    			<conf_title_noshow>0</conf_title_noshow>
    			<conf_title_keyword>d23_hp</conf_title_keyword>
    		</section>
    	</sections_group>
    
        <templates_group>  
            <template>  
                <group_name>skin_d23_hp</group_name>  
                <section_content><![CDATA[<style type='text/css'> 
    #d23hp 
    { 
        -display: none; 
        position: absolute; 
        top: -1000px; 
        left: -1000px; 
    } 
     
    #d23hp-close 
    { 
        position: absolute; 
        right: 5px; 
        top: 9px; 
    } 
    </style> 
    <div class='borderwrap' id='d23hp'> 
    <div class='maintitle' style='position:relative'><div id='d23hp-close' style='display:<if="!$d['showclose']">none</if>'><a href='#' id='d23hp-close-link' onclick='return d23hp.hide(true)'><img src='style_images/<#IMG_DIR#>/close.png' border='0' alt='[X]' /></a></div><{CAT_IMG}> {$d['title']}</div> 
    <table cellspacing='1' cellpadding='5'> 
      <tr> 
        <td align='center' class='row1'>{$d['message']}</td> 
      </tr> 
      <if="$d['autohide'] == 'true' && $d['showtimer'] == 'true' && $d['time'] > 0"><tr id='d23hp-timer-row'> 
        <td align='center' class='row1'><div id='d23hp-timer'>{$d['timetxt']}</div></td> 
      </tr></if> 
    </table></div> 
     
    <script type='text/javascript' src='jscripts/d23_hp.js'></script> 
    <script type='text/javascript'> 
    d23hp = new d23_hoverprompt('d23hp'); 
    d23hp.auto_hide   = {$d['autohide']}; 
    d23hp.hide_time   = {$d['time']}; 
    d23hp.show_timer  = {$d['showtimer']}; 
    d23hp.enable_fade = {$d['enablefade']}; 
    d23hp.add_langs({'timetxt' : "{$this->ipsclass->lang['d23_hp_timer_text']}", 'timesec' : "{$this->ipsclass->lang['d23_hp_timer_sec']}", 'timesecs' : "{$this->ipsclass->lang['d23_hp_timer_secs']}"}); 
    d23hp.display(); 
    </script>]]></section_content>  
                <func_name>hover_prompt</func_name>  
                <func_data><![CDATA[$d='']]></func_data>  
            </template>
      
            <template>  
                <group_name>skin_d23_hp</group_name>  
                <section_content><![CDATA[<form action='{$this->ipsclass->base_url}act=login&CODE=01' method='post' name='LOGIN'> 
    <input type='hidden' name='CookieDate' value='1' /> 
    <input type='hidden' name='referer' value='{$d['curl']}' /> 
    <label for='d23_hp_user'>{$this->ipsclass->lang['d23_hp_user']}:</label> <input type='text' name='UserName' id='d23_hp_user' value='' maxlength='64' size='10' onfocus='d23hp.focused()' /> 
    <label for='d23_hp_pass'>{$this->ipsclass->lang['d23_hp_pass']}:</label> <input type='password' name='PassWord' id='d23_hp_pass' size='10' onfocus='d23hp.focused()' /><br /> 
    <input type='submit' name='submit' value='{$this->ipsclass->lang['d23_hp_login']}' class='button' /> 
    <input type='button' value='{$this->ipsclass->lang['d23_hp_register']}' class='button' onclick='d23hp.register()' /></form>]]></section_content>  
                <func_name>prompt_buttons</func_name>  
                <func_data><![CDATA[$d='']]></func_data>  
            </template>  
        </templates_group>  
    </mod_data>

  6. #6
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    d23_hp.js

    Code:
    //----------------------------------------------------
    // D23-Hover Prompt Javascript Library
    // Copyright © 2007
    //----------------------------------------------------
    
    function d23_hoverprompt(id)
    {
    	this.obj;
    	this.scroll_var;
    
    	this.obj_id        = id;
    	this.screen_scroll = true;
    	this.enable_fade   = false;
    	this.auto_hide     = false;
    	this.show_timer    = false;
    	this.suspend       = false;
    	this.hide_time     = 0;
    	this.langs         = new Array();
    
    	this.obj = my_getbyid(this.obj_id);
    
    	return this;
    }
    
    d23_hoverprompt.prototype.display = function()
    {
    	d = this._calc_data();
    	this.obj.style.position = 'absolute';
    	this.obj.style.display  = '';
    	this.obj.style.zIndex   = 1000;
    	this.obj.style.left     = d['doc_width']/2-d['obj_width']/2+'px';
    	this.obj.style.top      = d['scroll_top']+d['doc_height']/3-d['obj_height']/2+'px';
    
    	if (this.screen_scroll)
    	{
    		this.scroll_var = setInterval(this.obj_id+'.scroll_screen()', 15);
    	}
    
    	if (this.enable_fade)
    	{
    		this.start_fade_in();
    	}
    	else
    	{
    		this.initiate_countdown();
    	}
    }
    
    d23_hoverprompt.prototype.start_fade_in = function()
    {
    	if (this.enable_fade)
    	{
    		this.opacity(0, 100, 1000);
    		setTimeout(this.obj_id+'.end_fade_in()', 100);
    	}
    }
    
    d23_hoverprompt.prototype.end_fade_in = function()
    {
    	if (this.enable_fade && this.obj.style.opacity >= 1)
    	{
    		this.initiate_countdown();
    	}
    	else
    	{
    		setTimeout(this.obj_id+'.end_fade_in()', 100);
    	}
    }
    
    d23_hoverprompt.prototype.start_fade_out = function()
    {
    	if (this.enable_fade)
    	{
    		this.opacity(100, 0, 1000);
    		setTimeout(this.obj_id+'.end_fade_out()', 100);
    	}
    }
    
    d23_hoverprompt.prototype.end_fade_out = function()
    {
    	if (this.enable_fade && this.obj.style.opacity <= 0)
    	{
    		this.hide(true);
    	}
    	else
    	{
    		setTimeout(this.obj_id+'.end_fade_out()', 100);
    	}
    }
    
    d23_hoverprompt.prototype.scroll_screen = function()
    {
    	d = this._calc_data();
    
    	this.obj.style.left = d['doc_width']/2-d['obj_width']/2+'px';
    	this.obj.style.top  = d['scroll_top']+d['doc_height']/3-d['obj_height']/2+'px';
    }
    
    d23_hoverprompt.prototype.hide = function()
    {
    	if (arguments[0] !== true && this.suspend)
    	{
    		return false;
    	}
    
    	if (this.enable_fade && arguments[0] !== true)
    	{
    		this.start_fade_out();
    	}
    	else
    	{
    		this.obj.style.display = 'none';
    		this.obj.style.top     = '0px';
    		this.obj.style.left    = '0px';
    
    		this._clear_vars();
    	}
    
    	return false;
    }
    
    d23_hoverprompt.prototype.register = function()
    {
    	locationjump('act=reg');
    }
    
    d23_hoverprompt.prototype.focused = function()
    {
    	this.suspend = true;
    
    	//my_getbyid(this.obj_id+'-close').style.display     = '';
    	my_getbyid(this.obj_id+'-timer-row').style.display = 'none';
    }
    
    d23_hoverprompt.prototype.initiate_countdown = function()
    {
    	if (this.auto_hide && this.hide_time > 0)
    	{
    		t = parseInt(this.hide_time)*1000;
    
    		setTimeout(this.obj_id+'.hide()', t);
    		if (this.show_timer)
    		{
    			setTimeout(this.obj_id+'.update_countdown('+(t-1000)+')', 1000);
    		}
    	}
    }
    
    d23_hoverprompt.prototype.update_countdown = function(t)
    {
    	if (!this.show_timer || this.suspend)
    	{
    		return false;
    	}
    
    	var n = t/1000;
    	var o = my_getbyid(this.obj_id+'-timer');
    
    	if (o)
    	{
    		o.innerHTML = "<small><i>"+this.langs['timetxt']+" "+n+" "+((n == 1) ? this.langs['timesec'] : this.langs['timesecs'])+"</i></small>";
    	}
    
    	n = t-1000;
    	if (n > 0)
    	{
    		setTimeout(this.obj_id+'.update_countdown('+n+')', 1000);
    	}
    }
    
    d23_hoverprompt.prototype.add_langs = function(a)
    {
    	for (var i in a)
    	{
    		this.langs[i] = a[i];
    	}
    }
    
    d23_hoverprompt.prototype._calc_data = function()
    {
    	var a = new Array();
    
    	a['body']       = (document.compatMode == 'CSS1Compat') ? document.documentElement : document.body;
    	a['scroll_top'] = (is_ie) ? a['body'].scrollTop    : window.pageYOffset;
    	a['doc_width']  = (is_ie) ? a['body'].clientWidth  : window.innerWidth;
    	a['doc_height'] = (is_ie) ? a['body'].clientHeight : window.innerHeight;
    	a['obj_width']  = this.obj.offsetWidth;
    	a['obj_height'] = this.obj.offsetHeight;
    
    	return a;
    }
    
    d23_hoverprompt.prototype._clear_vars = function()
    {
    	if (typeof(this.scroll_var) != 'undefined')
    	{
    		clearInterval(this.scroll_var);
    	}
    
    	if (typeof(this.display_var) != 'undefined')
    	{
    		clearInterval(this.display_var);
    	}
    
    	if (typeof(this.fade_var) != 'undefined')
    	{
    		clearInterval(this.fade_var);
    	}
    }
    
    d23_hoverprompt.prototype.opacity = function(s, e, m)
    {
    	var a = Math.round(m/100);
    	var b = 0;
    
    	if (s > e)
    	{
    		for (var i=s; i>=e; i--)
    		{
    			setTimeout(this.obj_id+'.change_opacity('+i+')', (a*b));
    			b++;
    		}
    	}
    	else if (s < e)
    	{
    		for (var i=s; i<=e; i++)
    		{
    			setTimeout(this.obj_id+'.change_opacity('+i+')', (a*b));
    			b++;
    		}
    	}
    }
    
    d23_hoverprompt.prototype.change_opacity = function(o)
    {
    	this.obj.style.opacity = o/100;
    	this.obj.MozOpacity    = o/100;
    	this.obj.KhtmlOpacity  = o/100;
    	this.obj.filter        = 'alpha(opacity='+o+')';
    }
    d23_hp.php


    Code:
    <?php
    if (!defined('IN_IPB'))
    {
    	print 'Get out.';
    	exit();
    }
    
    class d23_hp
    {
    	var $ipsclass;
    
    	function initiate()
    	{
    		if (!$this->ipsclass->vars['d23_hp_enable'])
    		{
    			return false;
    		}
    
    		$this->ipsclass->load_language('lang_d23_hp');
    		$this->ipsclass->load_template('skin_d23_hp');
    
    		$la = strtolower($this->ipsclass->input['_low_act']);
    		if (($la != 'reg' && $la != 'login') && intval($this->ipsclass->member['id']) <= 0)
    		{
    			$d = array
    			(
    				'autohide'   => ($this->ipsclass->vars['d23_hp_autohide'])   ? 'true' : 'false',
    				'showtimer'  => ($this->ipsclass->vars['d23_hp_showtimer'])  ? 'true' : 'false',
    				'enablefade' => ($this->ipsclass->vars['d23_hp_enablefade']) ? 'true' : 'false',
    				'showclose'  => ($this->ipsclass->vars['d23_hp_showclose'])  ? true   : false,
    				'title'      => $this->ipsclass->vars['d23_hp_title'],
    				'message'    => $this->ipsclass->vars['d23_hp_message'],
    				'time'       => intval($this->ipsclass->vars['d23_hp_timelength']),
    				'timetxt'    => '',
    			);
    
    			if ($d['time'] > 0)
    			{
    				$d['timetxt'] = $d['time'];
    				if ($d['time'] == 1)
    				{
    					$d['timetxt'] .= ' '.$this->ipsclass->lang['d23_hp_timer_sec'];
    				}
    				else
    				{
    					$d['timetxt'] .= ' '.$this->ipsclass->lang['d23_hp_timer_secs'];
    				}
    			}
    
    			if (preg_match_all("#\{hp:url\|(.+?)\|(.+?)\}(.+?)\{\/hp:url\}#is", $d['message'], $_m))
    			{
    				if (is_array($_m[1]) && count($_m[1]) > 0)
    				{
    					foreach ($_m[1] as $mk => $mv)
    					{
    						$_k = trim($mv);
    						$_v = trim($_m[2][$mk]);
    
    						$d['message'] = preg_replace("#\{hp:url\|".$_k."\|".$_v."\}(.+?)\{\/hp:url\}#is", "<a href='{$this->ipsclass->base_url}{$_k}={$_v}'>\\1</a>", $d['message']);
    					}
    				}
    			}
    
    			$_a = array
    			(
    				'name'    => $this->ipsclass->member['name'],
    				'board'   => $this->ipsclass->vars['board_name'],
    				'buttons' => $this->prompt_buttons(),
    			);
    
    			$d['title']   = preg_replace("#\{hp:(.+?)\}#ise", "\$_a['\\1']", $d['title']);
    			$d['message'] = preg_replace("#\{hp:(.+?)\}#ise", "\$_a['\\1']", $d['message']);
    
    			if ($d['autohide'] == 'true' && $d['showtimer'] == 'true' && $d['time'] > 0)
    			{
    				$d['timetxt'] = "<small><i>{$this->ipsclass->lang['d23_hp_timer_text']} {$d['timetxt']}</i></small>";
    			}
    
    			return $this->ipsclass->compiled_templates['skin_d23_hp']->hover_prompt($d);
    		}
    	}
    
    	function prompt_buttons()
    	{
    		$d = array
    		(
    			'curl' => trim('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']),
    		);
    
    		return $this->ipsclass->compiled_templates['skin_d23_hp']->prompt_buttons($d);
    	}
    }
    ?>

    3 files are above is full of modification files. but ireally don't know what is the reason of not working with in Internet Explorer. ?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •