Recent Topics

1 May 08, 2007 20:57    

I have just upgraded my b2evo to version 1.9.3 and then downloaded the Star Rating Plugin from [url=http://www.brendoman.com/plugins/starrating.zip]here[/url], I followed the instruction and added this code

<?php $Plugins->call_by_code( 'starrating', array('id' => $Item->ID ) ); ?> 

and this

 <?php $Plugins->call_by_code( 'starrating', array('display' => 'notice' ) ); ?> 

per instruction.

When I tested the plugin in Fire Fox, everything works just fine, but in IE version 6 and 7, I am getting error although I am able to vote in IE, I get Javascript error when the page loads.

Here is the error message on IE

Line 40
Char 2
Error 'document.getElementById(...)' is null or not an object
Code 0

and then URL for the doc in the blog.

Please help

2 May 09, 2007 14:18

Tugapasta,
Can you provide a link to your site so I can see this error in action?

3 May 09, 2007 16:00

personman

The site is running on localhost I am testing it before launching it online

I am posting the javascript file js.js part here in case if the error is from here

  var response = xmlhttp.responseText;
        var update = new Array();
        //alert (response)
        if(response.indexOf('|') != -1) {
            update = response.split('|');
            changeText(update[0], update[1]);
            if (update[2]) disp_notice(update[3]);
            new Effect.Highlight(update[0], {startcolor: '#ff9900', endcolor: '#EEEEEE'});

        }
                }
    }
}

function disp_notice(text)
{
    elid = 'ratingResults';
    changeText( elid, text );
    el = document.getElementById(elid);
    var theTop = 30;
    if (window.innerHeight)
        {
                  pos = window.pageYOffset
        }
        else if (document.documentElement && document.documentElement.scrollTop)
        {
                pos = document.documentElement.scrollTop
        }
        else if (document.body)
        {
                  pos = document.body.scrollTop
        }
        if (pos < theTop) pos = theTop;
        else pos += 30;
                el.style.top = pos +'px';
        new Effect.Appear(elid, {from: 0.0, to: 0.8});
        setTimeout('new Effect.Fade("ratingResults")', 4000);
}

function changeText( div2show, text ) {
    // Detect Browser
    var IE = (document.all) ? 1 : 0;
    var DOM = 0;
 if (parseInt(navigator.appVersion) >=5) {DOM=1};

    // Grab the content from the requested "div" and show it in the "container"

    if (DOM) {
        var viewer = document.getElementById(div2show)
        viewer.innerHTML=text
    }
    else if(IE) {
        document.all[div2show].innerHTML=text
    }
}

Thank You

4 May 09, 2007 16:06

You may have skipped a step in the setup. There's a skintag that has to be added to insert the ratingResults div.

5 May 09, 2007 18:02

personman

Thank you for getting back tome again.

Here is what I have done based on [url=http://manual.b2evolution.net/Plugins/starrating_plugin]the instruction [/url]

After unzipping the file and put the files in the plugins folder

1. Install the plugin from the admin page
2. Added the following code in the _main.php for the custom skin I am using

 <?php $Plugins->call_by_code( 'starrating', array('id' => $Item->ID ) ); ?>  

below the post title

3. Added

<?php $Plugins->call_by_code( 'starrating', array('display' => 'notice' ) ); ?>

after the openning body in _main.php

I did not add the optional part to add the top rated posts in the side bar.

So I don't think I skipped any step, hope this will help.

Thank You

6 May 09, 2007 18:53

Ok, good. Can you paste the full error in and show me the line it points to?

7 May 09, 2007 22:53

personman

I had another java script for the header part of the page and apparently that was the cause of the problem. I removed that script and load it in IE and the star rating works except there is extra blank line next to the last star, I thing this has already been pointed out and we gonna have to live with that.

Thank You very much for everything. You guys are awesome

8 May 10, 2007 04:40

I'm glad to hear that you got it sorted. You can edit the css if the layout is not how you want.


Form is loading...