Click to See Complete Forum and Search --> : Add new line after url?


rstan
06-26-2004, 06:26 PM
I cant figure this out. I need to have a carrige return or a new line insterted with the imgurl. This script places the images in a single line. I need onclick insert url and a carrige return. I dont know if this should be in Jscript or PHP forums so please excuse if its in the wrong place....thanks


if ( $medsize > 0 ) $imgurl = "{$data_dir}/$ppcat/{$user}{$photo_name}-med{$theext}";
else $imgurl = "[img]{$data_dir}/$ppcat/{$user}{$photo}[/img]";

$mthumb = "<img border=\"0\" src=\"{$data_dir}/{$ppcat}/{$user}{$photo_name}-thumb{$theext}\" alt=\"\" />";

$photorow .= <<<EOF
<td width="25%" align="center" valign="middle" class="$bgclass">
<a href="javascript:void(0)" onclick="updatePost('$imgurl')">$mthumb</a>

David Harrison
06-26-2004, 06:49 PM
Like this?<a href="$imgurl" onclick="updatePost(this.href);return false;">$mthumb</a><br>Code altered to account for no-JavaScript browsers. Never use javascript: in the href unless you are creating a bookmarklet.

rstan
06-26-2004, 08:59 PM
doesnt add a line break and adds the url in front of the data its inserting.

Instead of adding http://www.domain.com/gallery/data/500/pic.jpg

it adds

http://www.domain.com//http://www.domain.com/gallery/data/500/pic.jpg

David Harrison
06-26-2004, 09:58 PM
What bit adds that? I don't know PHP very well and this seems a lot like a PHP question, I don't know what you want, I don't understand what is going wrong, sorry.

rstan
06-26-2004, 10:59 PM
Its a popup that shows all the pics in a memebers gallery...Basicly when an image is clicked it insterts the url inside the img tag into the post. But if they click more then one photo it puts it right after the first one on the same line. It stretches the forums waaaay out if the images are big. It should be inserted on a new line each time its clicked. Its javascript pulling php so I dont know where it should go.

David Harrison
06-27-2004, 12:27 AM
Perhaps if I could see the updatePost function.

rstan
06-27-2004, 01:12 AM
even better, i figured out how to insert a clickable thumbnail to the large image......solved the big image problem....thanks for your help.