Jump to content


* * * * * 2 votes

AutoGalery


  • You cannot reply to this topic
24 replies to this topic

#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.


#21 Cris D.

    Loves Etomite Forums!

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

Posted 10 June 2008 - 09:35 PM

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

You have tried to concatenate _html($_urlsuffix) with html text target= You really need syntax highlighter or count your "'s and ''s and .'s really well. You can't concatenate text and php variables without quotes

#22 Excorio

    Etomite Forum Newbie

  • Member
  • 8 posts

Posted 11 June 2008 - 07:09 PM

Okay... Tried your suggestions and they didn't work. And like Chris said i missed something... :)

But i got it WORKING! I was working on the wrong part of the code... Duhhh... :Whistle:

Here's what i changed/added (code is at the end of the snippet):
$buffer .=  "<a href=\"" . _html("$_dirnamehttp/$_filename");
}
	 

// Added below line of code so the clicked thumbnail opens the image in a new window.

//  $buffer .=  "\" target=\"" . _blank;

//  Uncomment for use. Comment it and the image opens in the same window (default).
	 

$buffer .=  "\"><img src=\"" . _html("$_dirnamehttp/$_thumbdir/$_filename.thumb.jpg");
$buffer .=  "\" alt=\"" . _html($_filename) . "\" style=\"";
$buffer .=  "width: {$_thumbsize}px; height: {$_thumbsize}px\" />";

Man this thing was giving me a headache! :Silly:

Edited by Excorio, 11 June 2008 - 08:03 PM.


#23 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,506 posts
  • Gender:Male

Posted 11 June 2008 - 07:30 PM

Glad you got it working... Hey, sometimes the struggle to get past a problem helps gel things in the gray matter - meaning that maybe it wasn't the waste of time that it may have felt like during the struggle... It happens almost daily for me...

#24 Excorio

    Etomite Forum Newbie

  • Member
  • 8 posts

Posted 11 June 2008 - 07:44 PM

"It happens almost daily for me..."

Hehehe... I'm am engineer and i know what you mean :) It's indeed almost daily i also have those little 'bugs'.
My own designs make me go nuts sometimes... But after some trial and error things work... (most of the time)

:)

Edited by Excorio, 11 June 2008 - 07:46 PM.


#25 Ed Headset

    Likes Etomite Forums!

  • Developers
  • PipPip
  • 191 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Etomite, PHP, Ajax.
    3D imaging

Posted 12 June 2008 - 07:15 PM

Nice one!

I've sumbled somehow on a weird thing.

I've got 2 identical version of this script running.

1 with PHP 4.4.7 it works perfectly

2 with PHP 5.2.6, and this one doesn't work, well part of it.

It somehow want to open (when you click thum) an image including the full local path to the file.
Something like http://my.doamin.com/path/to file/<drive letter:>/Local/OS/path/to file/image.jpg.
Obiously this doesn't work, but I cant figure out why in PHP 5.2.6 he want's to add the local OS file location to it ?

Thumbs seems to be created correctly, it's the display of the thumb image, and link to the original, that seems to be out of order.
Anyone got an idea ?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users