Jump to content


* * * * * 2 votes

AutoGalery


24 replies to this topic

#1 Guest_TScafa_*

  • Guests

Posted 05 March 2005 - 01:09 PM

-- Removed --

#2 Guest_TScafa_*

  • Guests

Posted 05 March 2005 - 03:37 PM

CORRECTED

IMPORTANT
document must not be cacheable!!!



/*
  Auto Galery Script
*/

$params = array(
   'gallery' => 'Your Galery',
   'error' => 'Fehlermeldung',
   'php_error' => 'PHP >= 4.1 erforderlich.',
   'gd_error' => 'GD-Bibliothek erforderlich. Siehe http://www.boutell.com/gd/.',
   'jpg_error' => 'JPEG-Software erforderlich. Siehe ftp://ftp.uu.net/graphics/jpeg/.',
   'mkdir_error' => 'Schreibrechte fehlen.',
   'opendir_error' => 'Das Verzeichnis "%1" darf nicht beschrieben werden.',
   'autogalerypath' => 'assets/images/'
  );

/**
  Private Functions
*/

/*
 * @return String
 * @param String $prm
 * @desc Private Function for returning parsed strings from function _html()
*/

function _word ($prm) {
   global $params;
   return _html($params[$prm]);
}

/**
 * @return String
 * @param String $prm
 * @desc Private Function for converting special chars to html conform entities
*/
function _html ($prmh) {
  global $charset;
  //return htmlentities($prmh, ENT_COMPAT, $charset); // with charset functionality
  return htmlentities($prmh, ENT_COMPAT); // without charset functionality
}

/**
 * @return String
 * @param String $prm
 * @param Variant $arg
 * @desc Private Function for returning error messages while executing script
*/
function _error ($prm, $arg = '') {
  global $params;
  return _html(str_replace('%1', $arg, $params[$prm .'_error']));
}


/*
	Public Functions
*/

/**
 * @return void
 * @param String $_galpath
 * @param String $_thumbdir
 * @param Bool $_included
 * @param Bool $_inline
 * @param String $_charset
 * @param Integer $_thumbsize
 * @param Integer $_maxpics
 * @param Bool $_filenames
 * @param Bool $_subdirs
 * @param Bool $_title
 * @param String $_bg
 * @param String $_delim
 * @param Integer $_fontsize
 * @desc OpenSource Auto Galery Function Set (osAGFS)
 * is a self-creating galeries script: 
 * Features: 
 * - osAGFS parses image Dirs recursively and 
 * - creates thumbnails via GD-Lib
 * - trailing navigation within directories, 
 * - customizeable thumb size and 
 * - picture list, 
 * - auto-creating thumbnail directories,
 * - includeable or standalone (if standalone => create new php-script)
 * - simple error messages
 * Requirements:
 * PHP 4.1 above
 * GD-Lib, JPEG
*/

function autogalery($__galpath = null)
{
	
  global $params;
  //global $_SERVER; // uncomment with charset functionality (uncomment _html)
  
  //$_containerHAC = explode(",",$_SERVER["HTTP_ACCEPT_CHARSET"]); // for getting the initial charset of a requesting browser

  //$_charset 	 = $_containerHAC[0]; // uncomment for charset functionality
  $_charset;
  $_maxpics 	 = 12;
  $_thumbdir 	 = "mini";
  $_thumbsize  = 120;
  $_filenames  = false;
  $_subdirs 	 = true;	
  $_title    = $params["gallery"];
  $_picdir    = $__galpath;
  $_included 	 = true;
  $_inline    = true;
  $_bg      = "FFFFFF";
  $_delim    = "\\";

  
  isset($_SERVER) || ($_error = _error('php'));
  function_exists('imagecreate') || ($_error = _error('gd'));
  function_exists('imagejpeg') || ($_error = _error('jpg'));
  if (function_exists('ini_set')) {
    @ini_set('memory_limit', -1);
  }
  $_jpg = '\.jpg$|\.jpeg$'; 
  $_gif = '\.gif$'; 
  $_png = '\.png$';
  $_fontsize = 2;
  
  
  if ($_included==false) {
 	 // You may change the html-code for your own affords
    $buffer =  "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n".
              "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n".
              "<head>\n".
              "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . $__charset . "\" />\n".
              "<style type=\"text/css\">\n".
              "body { font-family: sans-serif }\n".
              "hr { border-style: none; height: 1px; background-color: silver; color: silver }\n".
              "p { margin: 0px; padding: 0px }\n".
              "#pagenumbers { text-align: center; margin: 0px 1em 0px 1em }\n".
              "img { margin: 10px; border: none }\n".
              "a { text-decoration: none }\n";
              
   if ($_filenames) {
     $buffer .=  "div a p { font-size: small }\n".
                "a:hover p { text-decoration: underline }\n".
                "div { width: " . ($_thumbsize + 20) . "px; text-align: center; float: left; margin: 1em }\n";
   }
   $buffer .=  "</style>\n";
  }
  
  
  if (array_key_exists('dir', $_REQUEST) && $_subdirs==true) 
    $_dir = $_REQUEST['dir'];
  else   
    $_dir = '';
  if (!empty($_SERVER['PATH_TRANSLATED'])) 
    $_d = dirname($_SERVER['PATH_TRANSLATED']);
  elseif (!empty($_SERVER['SCRIPT_FILENAME'])) 
    $_d = dirname($_SERVER['SCRIPT_FILENAME']);
  else 
    $_d = getcwd();
  
  $_delim = (substr($_d, 1, 1) == ':') ? '\\' : '/';
  $_rp = function_exists('realpath');
  
  if ($_rp) 
    $_root = realpath($_d . $_delim . $_picdir);
  else 
    $_root = $_d . $_delim . $_picdir;
  
  if ($_rp) 
    $_realdir = realpath($_root . $_dir);
  else 
    $_realdir = $_root . $_dir;
  
  if (substr($_realdir, 0, strlen($_root)) != $_root) 
  { 
    $_realdir = $_root; 
    $_dir = ''; 
  }
  $_dirname = substr($_realdir, strlen($_root));
  $_dirnamehttp = $_picdir . $_dir;
  if ($_delim == '\\') $_dirnamehttp = strtr($_dirnamehttp, '\\', '/');
  if (substr($_dirnamehttp, 0, 2) == './') 
    $_dirnamehttp = substr($_dirnamehttp, 2);
  if (empty($_dirnamehttp)) $_dirnamehttp = '.';
  $_ti = ($_subdirs && !empty($_dirname)) ? ": $_dirname" : '';
  if ($_included==false) {
   if (isset($_error)) 
     $buffer .=  "<title>$_error</title>";
   else
     $buffer .=  "<title>" . _word('gallery') . _html($_ti) . "</title>\n";
   $buffer .=  "</head>\n<body>\n";
  }
  if (($_d = @opendir($_realdir)) === false) $_error = _error('opendir', array($_realdir));
  if (isset($_error)) 
    $buffer .=  "<p style=\"color: red\">$_error</p>\n"; 
  else {
   if ($_title) 
     $buffer .=  "<h1>" . _word($params["gallery"]) . substr(_html($_ti),3) . "</h1>\n<hr />\n";
    
   $_dirs = $_pics = array();
   $_query = $_jpg;
   
   if (function_exists('imagecreatefromgif')) 
     $_query .= "|$_gif";
   if (function_exists('imagecreatefrompng')) 
     $_query .= "|$_png";
   
   while (($_filename = readdir($_d)) !== false) {
    if ($_filename == $_thumbdir || ($_filename == '..' && $_dirname == '') || ($_filename != '..' && substr($_filename, 0, 1) == '.')) 
      continue;
      
    $_file = $_realdir . $_delim . $_filename;
    
    if (is_dir($_file)) 
      $_dirs[] = $_filename;
    elseif (eregi($_query, $_file)) 
      $_pics[] = $_filename;
   }
   closedir($_d);
   sort($_dirs);
   sort($_pics);
   $_urlsuffix = '';
   
   foreach ($_GET as $_v => $_r) {
   	 if (!in_array($_v, array('dir', 'pic', 'offset'))) 
     	 $_urlsuffix .= "&$_v=" . urlencode($_r);
   }
   if ($_included && $_inline && array_key_exists('pic', $_REQUEST)) {
    $_pic = $_GET['pic'];
    $buffer .=  "<div id=\"picture\">\n";
    $buffer .=  "<img src=\"" . _html("$_dirnamehttp/{$_pics[$_pic]}") ."\" alt=\"" . _html(basename($_pics[$_pic])) . "\"";
    
    //list($_width, $_height, $_type, $_attr) = @getimagesize($_pic);
    
    if (!empty($_width)) 
   	 $buffer .=  " style=\"width: {$_width}px; height: {$_height}px\"";
   	 
    $buffer .=  " />\n";
    $_url = ($_dirname  == '') ? '?' : '?dir=' . urlencode($_dirname) . '&';
    $buffer .=  "<hr />\n";
    
    if ($_pic > 0)
      $buffer .=  "<a href=\"" . _html($_url) . "pic=" . ($_pic - 1) . _html($_urlsuffix) . "\">[zurück]</a> ";
    if ($_pic >= $_maxpics){
      $_u = "{$_url}offset=" . (floor($_pic / $_maxpics) * $_maxpics) . $_urlsuffix;
    }
    else {
     if (array_key_exists('dir', $_REQUEST)) {
      $_u = substr($_url, 0, strlen($_url) - 1) . $_urlsuffix;
     } else {
      $_u = ereg_replace('^([^?]+).*$', '\1', $_SERVER['REQUEST_URI']);
      if (!empty($_urlsuffix)) {
        if (strstr($_u, '?') === false) 
       	 $_u .= '?' . substr($_urlsuffix, 1);
        else 
       	 $_u .= $_urlsuffix;
      }
     }
    }
    $buffer .=  "<a href=\"" . _html($_u) . "\">[Übersicht]</a>";
    if ($_pic + 1 < sizeof($_pics)){
        $buffer .=  " <a href=\"" . _html($_url) . "pic=" . ($_pic + 1) . _html($_urlsuffix) . "\">[weiter]</a>";
    }
    $buffer .=  "\n</div>\n";
   } else {
     if (sizeof($_dirs) > 0 && $_subdirs) {
       $buffer .=  "<ul id=\"directories\">\n";
       
       foreach ($_dirs as $_filename){
        if ($_rp){
          $_target = substr(realpath($_realdir . $_delim . $_filename), strlen($_root));
        } else {
          $_target = substr($_realdir . $_delim . $_filename, strlen($_root));
        }
        if ($_delim == '\\'){
          $_target = strtr($_target, '\\', '/');
        }
        if ($_target == '') {
           $_url = ereg_replace('^([^?]+).*$', '\1', $_SERVER['REQUEST_URI']);
           if (!empty($_urlsuffix)) {
            if (strstr($_url, '?') === false) 
              $_url .= '?' . substr($_urlsuffix, 1);
            else 
              $_url .= $_urlsuffix;
           }
        } else {
          $_url = '?dir=' . urlencode($_target) . $_urlsuffix;
        }
        $buffer .=  "<li><a href=\"" . _html($_url) . "\">" . _html($_filename) . "</a></li>\n";
       }
       $buffer .=  "</ul>\n<hr />\n";
    }
    if (($_num = sizeof($_pics)) > 0) {
      if (array_key_exists('offset', $_REQUEST)) {
        $_offset = $_REQUEST['offset'];
      } else {
         $_offset = 0;
      }
      if ($_num > $_maxpics) {
        $buffer .=  "<p id=\"pagenumbers\">\n";
        
        for ($_i = 0; $_i < $_num; $_i += $_maxpics) {
           $_e = $_i + $_maxpics - 1;
           if ($_e > $_num - 1) 
             $_e = $_num - 1;
           if ($_i != $_e) 
             $_b = ($_i + 1) . '-' . ($_e + 1);
           else 
             $_b = $_i + 1;
           if ($_i == $_offset) {
             $buffer .=  "<b>$_b</b>";
           } else {
            $_url = ($_dirname  == '') ? '?' : '?dir=' . urlencode($_dirname) . '&amp;';
            $buffer .=  "<a href=\"{$_url}offset=$_i" . _html($_urlsuffix) . "\">$_b</a>";
           }
           if ($_e != $_num - 1) 
             $buffer .=  " |";
           
           $buffer .=  "\n";
        }
        $buffer .=  "</p>\n<hr />\n";
       }
       $buffer .=  "<p id=\"pictures\">\n";
       
       for ($_i = $_offset; $_i < $_offset + $_maxpics; $_i++) {
        if ($_i >= $_num) break;
        
        $_filename = $_pics[$_i];
        $_file = $_realdir . $_delim . $_filename;
      
        if (!is_readable($_file)) continue;
      
        if (!is_dir($_realdir . $_delim . $_thumbdir)) {
           $_u = umask(0);
           if (!@mkdir($_realdir . $_delim . $_thumbdir, 0777)) {
            $buffer .=  "<p style=\"color: red; text-align: center\">" . _word('mkdir_error') . "</span>";
            break;
           }
           umask($_u);
        }
      
        $_thumb = $_realdir . $_delim . $_thumbdir . $_delim . $_filename . '.thumb.jpg';
      
        if (!is_file($_thumb)) {
           if (eregi($_jpg, $_file))
             $_original = @imagecreatefromjpeg($_file);
           elseif (eregi($_gif, $_file))
             $_original = @imagecreatefromgif($_file);
           elseif (eregi($_png, $_file))
             $_original = @imagecreatefrompng($_file);
           else 
             continue;
         
           if ($_original) {
            if (function_exists('getimagesize'))
              list($_width, $_height, $_type, $_attr) = @getimagesize($_file);
            else 
              continue;
            
            if ($_width >= $_height && $_width > $_thumbsize) {
               $_smallwidth = $_thumbsize;
               $_smallheight = floor($_height / ($_width / $_smallwidth));
               $_ofx = 0; $_ofy = floor(($_thumbsize - $_smallheight) / 2);
            } elseif ($_width <= $_height && $_height > $_thumbsize){
               $_smallheight = $_thumbsize;
               $_smallwidth = floor($_width / ($_height / $_smallheight));
               $_ofx = floor(($_thumbsize - $_smallwidth) / 2); $_ofy = 0;
            } else {
               $_smallheight = $_height;
               $_smallwidth = $_width;
               $_ofx = floor(($_thumbsize - $_smallwidth) / 2);
               $_ofy = floor(($_thumbsize - $_smallheight) / 2);
            }
           }
       
           if (function_exists('imagecreatetruecolor'))
            $_small = @imagecreatetruecolor($_thumbsize, $_thumbsize);
           else 
             $_small = @imagecreate($_thumbsize, $_thumbsize);
       
           sscanf($_bg, "%2x%2x%2x", $_red, $_green, $_blue);
       
           $_b = @imagecolorallocate($_small, $_red, $_green, $_blue);
           imagefill($_small, 0, 0, $_b);
           
           if ($_original) {
            if (function_exists('imagecopyresampled'))
              @imagecopyresampled($_small, $_original, $_ofx, $_ofy, 0, 0, $_smallwidth, $_smallheight, $_width, $_height);
             else
              @imagecopyresized($_small, $_original, $_ofx, $_ofy, 0, 0, $_smallwidth, $_smallheight, $_width, $_height);
           } else {
            $_black = @imagecolorallocate($_small, 0, 0, 0);
            $_fw = @imagefontwidth($_fontsize);
            $_fh = @imagefontheight($_fontsize);
            $_htw = ($_fw * strlen($_filename)) / 2;
            $_hts = $_thumbsize / 2;
            @imagestring($_small, $_fontsize, $_hts - $_htw, $_hts - ($_fh / 2), $_filename, $_black);
            @imagerectangle($_small, $_hts - $_htw - $_fw - 1, $_hts - $_fh, $_hts + $_htw + $_fw - 1, $_hts + $_fh, $_black);
           }
           @imagejpeg($_small, $_thumb);
        }
      
        if ($_filenames) 
          $buffer .=  "<div>";
        
        if ($_included==true && $_inline) {
          $buffer .=  "<a href=\"?";
           
          if (array_key_exists('dir', $_REQUEST)) 
            $buffer .=  "dir=" . urlencode($_REQUEST['dir']) . "&amp;";
        
          $buffer .=  "pic=". $_i . _html($_urlsuffix);
        } else {
          $buffer .=  "<a href=\"" . _html("$_dirnamehttp/$_filename");
        }
        
        $buffer .=  "\"><img src=\"" . _html("$_dirnamehttp/$_thumbdir/$_filename.thumb.jpg");
        $buffer .=  "\" alt=\"" . _html($_filename) . "\" style=\"";
        $buffer .=  "width: {$_thumbsize}px; height: {$_thumbsize}px\" />";
        
        if ($_filenames) 
          $buffer .=  "<p>" . _html($_filename) . "</p>";
          
        $buffer .=  "</a>";
      
        if ($_filenames) 
          $buffer .=  "</div>\n"; 
        else 
          $buffer .=  "\n";
     }
     $buffer .=  "</p>\n";
    }
   }
  }
  if (!$_included==false) {
    $buffer .=  "</body>\n</html>";
  }
  return $buffer;
}
 

$output = autogalery($params["autogalerypath"]);
return $output;


#3 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 05 March 2005 - 03:45 PM

Using the first version I get the following error: Parse error: parse error, expecting `')'' in /var/www/html/index.php(558) : eval()'d code on line 421

I haven't taken much time to check the code... All I did was to try a couple different image directories, includinf my assets/images/...

#4 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 05 March 2005 - 03:54 PM

The second version produces the following error:

« Etomite Parse Error »
Etomite encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »

PHP error debug
Error: htmlentities(): charset `ANSI_X3.4-1968' not supported, assuming iso-8859-1
Error type/ Nr.: Warning - 2
File: /var/www/html/index.php(558) : eval()'d code
Line: 38

Parser timing
MySQL: 0.0208 s s (8 Requests)
PHP: 0.1757 s s
Total: 0.1964 s s


EDIT

Considering how there is no variable assignment to $charset, removing the variable corrects the problem...

Changed:
/**
* @return String
* @param String $prm
* @desc Private Function for converting special chars to html conform entities
*/
function _html ($prmh) {
 global $charset;
 return htmlentities($prmh, ENT_COMPAT, $charset);
}

To:
/**
* @return String
* @param String $prm
* @desc Private Function for converting special chars to html conform entities
*/
function _html ($prmh) {
 return htmlentities($prmh, ENT_COMPAT);
}


#5 Guest_TScafa_*

  • Guests

Posted 06 March 2005 - 10:16 AM

   global $_SERVER;
  
    $_containerHAC = explode(",",$_SERVER["HTTP_ACCEPT_CHARSET"]); // for getting the initial charset of a requesting client browser

  $_charset = $_containerHAC[0];

If you want to use charset functionality than place code above into function autogalery()

#6 Ravage

    Etomite Forum Newbie

  • Member
  • 13 posts

Posted 14 June 2005 - 02:40 PM

Installed this snippet and so far ...

ITS GREAT! Just what i needed!

Creates subdirectory's, reads all images, CREATES AUTOMATIC thumbs!, thumbsize is set as easy as ... :)



The only thing is the etomite linkback on the bottom, I have this showing on the main site and now its also showing on the gallery page, so its there twice.

I love Etomite, I do :D nut two linkback on one page? just doenst look nice :(

Anybody to tell me how to remove it from te snippet?

Thanks! :D

#7 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 14 June 2005 - 02:56 PM

It's because Etomite automatically chucks the powered by stuff where it detects a /body tag - and I notice that there is a /body tag in the snippet, so this would be why :)

#8 Ravage

    Etomite Forum Newbie

  • Member
  • 13 posts

Posted 14 June 2005 - 03:00 PM

Ravage, on Jun 14 2005, 05:40 PM, said:

The only thing is the etomite linkback on the bottom, I have this showing on the main site and now its also showing on the gallery page, so its there twice.

...

Anybody to tell me how to remove it from te snippet?


Found it myself :P

Just replace:
if (!$_included==false) {
   $buffer .=  "</body>\n</html>";
 }
with:
if (!$_included==false) {
   $buffer .=  "\n</html>";
 }


#9 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 14 June 2005 - 03:20 PM

You may have problems with it validating, as you will have two <body> tags if you use this snippet - strip the header stuff out and you should be ok :)

#10 Ravage

    Etomite Forum Newbie

  • Member
  • 13 posts

Posted 17 June 2005 - 12:22 PM

Is there a way to make the full view of the images open in a new window?(target _blank kinda link :) ) because the pictures dont show completely in my template, you have to scroll around to view them and thats dum :s

A link so that when you click on the thumbnail it opens the full view part, with the next and previous links to, in a new window.

I thought it would just be adjusting some link in the snippet code but I cant find it :(

Any help on this? Thanks.

#11 Markioooo

    Etomite Forum Newbie

  • Member
  • 16 posts

Posted 13 January 2007 - 03:50 PM

cool!

one small error (removed exclamation mark):

changed:

if (!$_included==false) {
  $buffer .=  "\n</html>";
 } return $buffer;

into:

if ($_included==false) {
  $buffer .=  "\n</html>";
 } return $buffer;


#12 Excorio

    Etomite Forum Newbie

  • Member
  • 8 posts

Posted 09 June 2008 - 07:28 PM

Which part of the code of this mod do i need change to make the image open in a new window?

#13 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 10 June 2008 - 09:31 AM

There's only 7 cases of <a href= in the code, you have a 1 in 7 chance of guessing the correct one. Either that or change them 1 at a time until you find the link you want to open in a new window... It's called trial and error!

#14 Excorio

    Etomite Forum Newbie

  • Member
  • 8 posts

Posted 10 June 2008 - 10:34 AM

I did what you thought i didn't do. I did edit the href's (trial and error). I don't know anything about
coding or website building. I could not get the "target=_blank" to work. Thats why i came here to ask.

And why do i get the feeling i'm being talked to like i'm a 10 year old?

Edited by Excorio, 10 June 2008 - 11:06 AM.


#15 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 10 June 2008 - 11:11 AM

just in case, the actual code needed to open in a new window
target='_blank'
or
target="_blank"
(ie the _blank bit must be in quotes, and the quotes should be the opposite form of quotes to those containing the string they are in)

Edited by mikef, 10 June 2008 - 11:12 AM.


#16 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 10 June 2008 - 11:37 AM

Quote

I did what you thought i didn't do. I did edit the href's (trial and error). I don't know anything about
coding or website building. I could not get the "target=_blank" to work. Thats why i came here to ask.

And why do i get the feeling i'm being talked to like i'm a 10 year old?

Sorry if I caused any offence, it is never my intention. You can never guess how people will react to anything that is posted. My suggestion is that if you are really starting out, you have probably chosen a quite long and overly complex snippet (both with it's embedded spaghetti code output and embedded template) to start out with. If you have tried target="_blank" or target =\"_blank\" (if you escape the quotes) and it doesn't work, you must be either getting an error which you can't see because your template is covering the error message or something else wierd is going on that you will need to explain. I doubt that you would have added the target tags AND they don't work AND the snippet still works as expected.

Edited by Cris D., 10 June 2008 - 11:58 AM.


#17 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 10 June 2008 - 12:50 PM

What DOCTYPE is your page template using...??? XHTML doesn't allow target="_blank"... While XHTML 1.0 Transitional might allow it, that attribute shouldn't be used... I can't say for sure that this is your problem, but you never know... I use an alternate method to open document in a new window, using a Javascript hack based on a CSS class...

If this it truly a PHP coding error you should either be able to see a PHP parser error or an HTML markup validation error if you check such things...

#18 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 10 June 2008 - 05:55 PM

View PostRalph, on Jun 10 2008, 01:50 PM, said:

While XHTML 1.0 Transitional might allow it
It does, and is one reason I still use XHTML 1.0 Transitional. There is a genuine need for the capability, and requiring developers to use CSS and javascript hacks to get such basic functionality is in my view a mistake.

#19 Excorio

    Etomite Forum Newbie

  • Member
  • 8 posts

Posted 10 June 2008 - 07:04 PM

@ Cris D... No problem :)

The template uses 1.0 Transitional.

I added target="_blank" to the line $buffer .= "<a href=\"{$_url}offset=$_i" . _html($_urlsuffix) . target="_blank" . "\">$_b</a>";

This results in an error Parse error: syntax error, unexpected '=' in C:\wamp\www\index.php(508) : eval()'d code on that line.

If i change this to target =\"_blank\" i get the same error...

Adding target="_blank" or target =\"_blank\" to the other lines with href in it, also result in the same parse errors.


I kow i didn't choose the easiest snippet but it does exactly what i need except for the new window thing:)

Edited by Excorio, 10 June 2008 - 07:09 PM.


#20 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 10 June 2008 - 08:03 PM

try replacing
target="_blank"
with
'target="_blank"'

Edited by mikef, 10 June 2008 - 08:04 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users