Make image show a direct link for BBcode, blogs, etc. HELP!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ispshadow
Forum Newbie
Posts: 2
Joined: Mon Nov 06, 2006 3:09 pm

Make image show a direct link for BBcode, blogs, etc. HELP!!

Post by ispshadow »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


To all,

I have been using a gallery script that I found at hotscripts that allows you to build a gallery just by placing the images in a folder. Unfortunately, I'm still at a VERY novice stage in building HTML,PHP,etc and don't completely understand how to do this: 

I'd like to insert into this template file the proper code to make each picture that is shown also show a Direct URL for pasting in a blog, bulletin board type stuff. Can someone help me out? I know I have these variables that are used to put the picture up, (ex. DIR, FILENAME, etc) but the only one that puts anything into a text box is FILENAME... unfortunately it only shows the name of the picture and not the whole directory.

CODE BELOW - I highlighted the part that I attempted to add....

Code: Select all

<html>
<body>

<?if (IsSet($out['UP'])) {?>
<p align=center>
<a href="?dir=<?=$out['UP']?>"><<< Up</a><br>
</p>
<?}?>

<?
 if (is_Array($directories)) {
?>
<table border=0 width=90% align=center>
<?
 foreach ($directories as $v) {?>
 <tr>
 <td align=center><font face="arial">
  <big><b><a href="?dir=<?=$v['URL'];?>"><?if ($v['DESCRIPTION']!='') echo $v['DESCRIPTION']; else echo $v['FILENAME'];?></a>
 </td>
</tr>
<?}?>
</table>
<?}?>


<?
if (Is_Array($files)) {

?>
&nbsp;
<table border=0 align=center cellpadding=20>
 <tr>
  <?foreach ($files as $f) {?>
  <td align=center valign=top>
   <font face="arial">
   <a href="<?=$f['DIR']?><?=$f['FILENAME']?>" target=_blank><img src="?img=<?=$f['DIR']?><?=$f['FILENAME']?>&w=<?=THUMBNAIL_WIDTH?>&h=<?=THUMBNAIL_HEIGHT?>" border=0 alt="<?echo $f['DESCRIPTION'];?>"></a>
   <?if ($f['DESCRIPTION']!='') echo "<br>".$f['DESCRIPTION'];?>
  </td>
  <?if ($f['NEXT_ROW']) echo "</tr><tr>";?>
  <?}?>
 
[b]<tr><td>DIRECT URL:</td><td><input type="text" name="thetext" onClick='highlight(this);' size="60" value="<? echo $f['FILENAME']; ?>"></td></tr>  <?if ($f['NEXT_ROW']) echo "</tr><tr>";?>
[/b]

</tr>
</table>

<?
}
?>


</body>
</html>

I would very much appreciate it if someone could help me out here. It may seem like I'm just asking somebody to do it for me, but I'm really looking for the assistance to understand what I'm doing wrong as well. Thanks!

~Frank


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
ispshadow
Forum Newbie
Posts: 2
Joined: Mon Nov 06, 2006 3:09 pm

UPDATE

Post by ispshadow »

I didn't realize the page was going to highlight all kinds of php stuff in there, I guess I could have read directions!

The part I was trying to figure out is using the template above with this below:

<tr><td>DIRECT URL:</td><td><input type="text" name="thetext" onClick='highlight(this);' size="60" value="<? echo $f['FILENAME']; ?>"></td></tr> <?if ($f['NEXT_ROW']) echo "</tr><tr>";?>



using the FILENAME shows only .sample1.jpg.. I wanted to put make it show the whole code you'd paste into a blog with the a href and img src part...

I've noticed there are some pretty intelligent folks in here, hope somebody can help!!!

~Frank
Post Reply