• Anonymous User 5746546

    (@anonymized-5746546)


    The script will clash with other scripts using jquery in the following circumstance:

    – cevhershare is disabled for a page/post

    Cause:

    The plugin’s header function will add the script’s init to the header regardless of whether cevhershare is enabled or not. On a page where cevhershare is disabled, IE will give a warning message indicating that on line 27 of cevhershare.js, offset().top is null or that the object is undefined. Depending on your browser settings, this error will prevent further processing of scripts.

    Fix:

    The fix is to ensure that cevhershare does not add the init script to the header for a page/post that has cevhershare disabled.

    Find the following line in cevhershare.php:
    if(function_exists('wp_enqueue_script') && (is_single() || is_page())) {

    Replace the above line with:
    if(function_exists('wp_enqueue_script') && (is_single() || get_post_custom_values('sharebar'))) {

    The fix instructs cevhershare to insert the init code into the header only if it is a single post or if a custom field of “sharebar” is set to true for the page/post. You can play around with the conditional statement to obtain the desired result. Of course, this is only a quick fix. If you need additional customization, it would take a bit more modding of the code.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Anonymous User 5746546

    (@anonymized-5746546)

    I did a bit more exploring and *hopefully*, this modification will correct the logic error.

    Find the following line in cevhershare.php:
    if(function_exists('wp_enqueue_script') && (is_single() || is_page())) {

    Replace with the following:
    if(function_exists('wp_enqueue_script') && (($auto_posts && is_single()) || ($auto_pages && is_page()) || get_post_custom_values('sharebar'))) {

    If you are not enabling automatic mode, you will need to insert the following code into your pages/posts (i.e. single.php, etc.):

    if(function_exists('cevhershare') && get_post_custom_values('share')){
    cevhershare();
    cevhershare_horizontal();
    }

    For each of these custom pages/posts, you need to add a custom field of “sharebar” with a value of “true” for it to work.

    Thread Starter Anonymous User 5746546

    (@anonymized-5746546)

    Here’s another small bug. This one is in the HTML for the admin screen. Some browsers will not render the tables and forms correctly and the result is that parts of the admin screen overlap with other parts.

    The Fix:

    1. Find the following line:

    <h3 class="alignleft"><?php echo AVAILABLE_BUTTONS;?>:</h3>
    	<div class="alignright">
    		<a href="?page=<?php echo $_GET['page']; ?>&t=reset" class="alignleft button right-button"><?php echo RESET_BUTTONS;?></a> <a href="?page=CevherShare&t=new" class="button-primary alignleft right-button"><?php echo ADD_NEW_BUTTON;?></a>
    	</div>

    2. Insert the following code right after the </div> for the above code:

    <div style="clear:both;"></div>

    So it should now look like this:

    <h3 class="alignleft"><?php echo AVAILABLE_BUTTONS;?>:</h3>
    	<div class="alignright">
    		<a href="?page=<?php echo $_GET['page']; ?>&t=reset" class="alignleft button right-button"><?php echo RESET_BUTTONS;?></a> <a href="?page=CevherShare&t=new" class="button-primary alignleft right-button"><?php echo ADD_NEW_BUTTON;?></a>
    	</div>
    <div style="clear:both;"></div>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Header Errors for IE’ is closed to new replies.