Need Help With Code Please

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dennis69
    Confirmed User
    • Feb 2003
    • 1685

    #1

    Need Help With Code Please

    I just purchased UU Gallery for wordpress, I'm trying to use HQ images and then have the js scale them but I keep getting errors, I have used this script with robo Gallery and it worked fine

    Code:
    id="thepic" onClick="scaleImg('thepic')" onLoad="scaleImg('thepic')"
    And when I add it like this:

    Code:
       $BigLink['active']     = "<a href='#NextLink#'><img id="thepic" onClick="scaleImg('thepic')" onLoad="scaleImg('thepic')"src='#BigPhoto#' width='#Width#' height='#Height#' border='0' alt='Click here for next image'></a>";
       $BigLink['notactive']  = "<img id="thepic" onClick="scaleImg('thepic')" onLoad="scaleImg('thepic')"src='#BigPhoto#' width='#Width#' height='#Height#'>";
    I get the error:
    Parse error: syntax error, unexpected T_STRING in /home/celebuzz/public_html/galleries/viewer.php on line 8

    Any help would be greatly appreciated
    HaHaHa
  • Serge Litehead
    Confirmed User
    • Dec 2002
    • 5190

    #2
    is the code above exact copy?

    if so then inside most outer double quotes all other double quotes must be escaped with \

    like so

    $BigLink['active'] = "<a href='#NextLink#'><img id=\"thepic\" onClick=\"scaleImg('thepic')\" onLoad=\"scaleImg('thepic')\" src='#BigPhoto#' width='#Width#' height='#Height#' border='0' alt='Click here for next image'></a>";
    $BigLink['notactive'] = "<img id=\"thepic\" onClick=\"scaleImg('thepic')\" onLoad=\"scaleImg('thepic')\" src='#BigPhoto#' width='#Width#' height='#Height#'>";
    Last edited by Serge Litehead; 03-03-2011, 12:05 PM.

    Comment

    • Alky
      Confirmed User
      • Apr 2002
      • 5651

      #3
      you have to escape " when it's inside of "".

      so like:
      $BigLink['active'] = "This is just an example of \"quoting\"... mm kay?";

      Comment

      • FlexxAeon
        Confirmed User
        • May 2003
        • 3765

        #4
        put a backslash (\) in front of all those double quotes in the string

        lol i'm too slow i see...
        flexx [dot] aeon [at] gmail

        Comment

        • Dennis69
          Confirmed User
          • Feb 2003
          • 1685

          #5
          Thanks guys... working like a charm
          HaHaHa

          Comment

          Working...