Results 1 to 6 of 6

3.3.0 Java Script Problems

This is a discussion on 3.3.0 Java Script Problems within the Bug Reporting forums, part of the vBSEO SEO Plugin category; Recently I present a problem with a code Java on header: http://www.vbseo.com/f4/gigantic-pro...59/#post208250 Now I was trying to put a Google ...

  1. #1
    Member MaRµ's Avatar
    Real Name
    Miss Mariel xD
    Join Date
    Aug 2008
    Posts
    66
    Liked
    0 times

    3.3.0 Java Script Problems

    Recently I present a problem with a code Java on header: Gigantic PROBLEM - Vbseo delete my header

    Now I was trying to put a Google Adsense code wich is Java also and Vbseo just dont let this show.

    I hope Vbseo coders fix it as soon as they can.

    Thanks

  2. #2
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    your heading rotate is still bombing.

    once one thing in javascript bombs, the rest of it is dead too.


    Code:
    else {document.write('<img src=\'http://foro.enfierrados.com/+seleccionado+'\' width='+width+' height='+height+'>');
    Literal quotes needs to be escaped within a write statement.

    the problem is not vbseo.

  3. #3
    Member MaRµ's Avatar
    Real Name
    Miss Mariel xD
    Join Date
    Aug 2008
    Posts
    66
    Liked
    0 times
    If when I desactivate vbseo, the images shows ok... and when activated Vbseo, images aren´t... do you still think that the problem is the code?

    Well... maybe you are right, but I tell you... I dont know WHAT and WHERE make de change on the code.... I haven´t coding skill.

    And what do you think about Google Adsense problem?

  4. #4
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    vbseo adds a 'base href' to the pages. It prefixes all urls with the site path.

    IMO, you should do this server-side anyway.

    step 1, put all your header images in a UNIQUE folder:
    /images/misc/header/FILES HERE
    for example

    step 2:
    put
    Code:
    <img src="/images/misc/header/header.php" alt="your site name" />
    in your header template (replacing the current logo area)

    step 3:

    make a new php file called header.php and place it in the same directory as your images, thus, /images/misc/header/header.php

    Code:
    <?php
    
        $folder = '.';
    
    
        $extList = array();
        $extList['gif'] = 'image/gif';
        $extList['jpg'] = 'image/jpeg';
        $extList['jpeg'] = 'image/jpeg';
        $extList['png'] = 'image/png';
    
    
    $img = null;
    
    if (substr($folder,-1) != '/') {
        $folder = $folder.'/';
    }
    
    if (isset($_GET['img'])) {
        $imageInfo = pathinfo($_GET['img']);
        if (
            isset( $extList[ strtolower( $imageInfo['extension'] ) ] ) &&
            file_exists( $folder.$imageInfo['basename'] )
        ) {
            $img = $folder.$imageInfo['basename'];
        }
    } else {
        $fileList = array();
        $handle = opendir($folder);
        while ( false !== ( $file = readdir($handle) ) ) {
            $file_info = pathinfo($file);
            if (
                isset( $extList[ strtolower( $file_info['extension'] ) ] )
            ) {
                $fileList[] = $file;
            }
        }
        closedir($handle);
    
        if (count($fileList) > 0) {
            $imageNumber = time() % count($fileList);
            $img = $folder.$fileList[$imageNumber];
        }
    }
    
    if ($img!=null) {
        $imageInfo = pathinfo($img);
        $contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ];
        header ($contentType);
        readfile($img);
    } else {
        if ( function_exists('imagecreate') ) {
            header ("Content-type: image/png");
            $im = @imagecreate (100, 100)
                or die ("Cannot initialize new GD image stream");
            $background_color = imagecolorallocate ($im, 255, 255, 255);
            $text_color = imagecolorallocate ($im, 0,0,0);
            imagestring ($im, 2, 5, 5,  "IMAGE ERROR", $text_color);
            imagepng ($im);
            imagedestroy($im);
        }
    }
    
    ?>
    done.
    any images you place in this folder will automatically be added to rotation, and you won't have any more JS problems

  5. #5
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    168 times

  6. #6
    Member MaRµ's Avatar
    Real Name
    Miss Mariel xD
    Join Date
    Aug 2008
    Posts
    66
    Liked
    0 times
    Quote Originally Posted by briansol View Post
    vbseo adds a 'base href' to the pages. It prefixes all urls with the site path.

    IMO, you should do this server-side anyway.

    step 1, put all your header images in a UNIQUE folder:
    /images/misc/header/FILES HERE
    for example

    step 2:
    put
    Code:
    <img src="/images/misc/header/header.php" alt="your site name" />
    in your header template (replacing the current logo area)

    step 3:

    make a new php file called header.php and place it in the same directory as your images, thus, /images/misc/header/header.php

    Code:
     
    <?php
     
        $folder = '.';
     
     
        $extList = array();
        $extList['gif'] = 'image/gif';
        $extList['jpg'] = 'image/jpeg';
        $extList['jpeg'] = 'image/jpeg';
        $extList['png'] = 'image/png';
     
     
    $img = null;
     
    if (substr($folder,-1) != '/') {
        $folder = $folder.'/';
    }
     
    if (isset($_GET['img'])) {
        $imageInfo = pathinfo($_GET['img']);
        if (
            isset( $extList[ strtolower( $imageInfo['extension'] ) ] ) &&
            file_exists( $folder.$imageInfo['basename'] )
        ) {
            $img = $folder.$imageInfo['basename'];
        }
    } else {
        $fileList = array();
        $handle = opendir($folder);
        while ( false !== ( $file = readdir($handle) ) ) {
            $file_info = pathinfo($file);
            if (
                isset( $extList[ strtolower( $file_info['extension'] ) ] )
            ) {
                $fileList[] = $file;
            }
        }
        closedir($handle);
     
        if (count($fileList) > 0) {
            $imageNumber = time() % count($fileList);
            $img = $folder.$fileList[$imageNumber];
        }
    }
     
    if ($img!=null) {
        $imageInfo = pathinfo($img);
        $contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ];
        header ($contentType);
        readfile($img);
    } else {
        if ( function_exists('imagecreate') ) {
            header ("Content-type: image/png");
            $im = @imagecreate (100, 100)
                or die ("Cannot initialize new GD image stream");
            $background_color = imagecolorallocate ($im, 255, 255, 255);
            $text_color = imagecolorallocate ($im, 0,0,0);
            imagestring ($im, 2, 5, 5,  "IMAGE ERROR", $text_color);
            imagepng ($im);
            imagedestroy($im);
        }
    }
     
    ?>
    done.
    any images you place in this folder will automatically be added to rotation, and you won't have any more JS problems
    Thanks Brian!!... anyway Is good to learn differents way to resolve a problem.

    I just open a ticket for the Google AdSense Problem.

    Thanks for your time!

Similar Threads

  1. How to place external script without altering script?
    By dimas in forum URL Rewrite Settings
    Replies: 7
    Last Post: 09-14-2008, 03:20 AM
  2. Seo bots and java
    By DieselMinded in forum General Discussion
    Replies: 3
    Last Post: 07-18-2008, 09:08 PM
  3. Cannot open java in page after using CRR
    By basketmen in forum Custom Rewrite Rules
    Replies: 2
    Last Post: 12-11-2007, 04:06 AM
  4. Script?
    By Blootix in forum Pre-Sales Questions
    Replies: 4
    Last Post: 09-18-2006, 09:37 PM
  5. What does this script do ?
    By rex_b in forum General Discussion
    Replies: 7
    Last Post: 11-22-2005, 08:51 PM

Posting Permissions

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