Textarea for photos/saving line breaks
Submitted by baumli on Thu, 2009-12-17 17:39.
Just thought I would share this, I am setting up phpAlbum for someone who doesn't know html. I wanted to change the long description from a text box, to a text area. In doing that, I wanted to also be able to save line breaks to format it exactly as the user entered it.
First, make a backup of the files before modifying.
Edit setup_photos.inc
Find the long_desc section.
Replace the line (change * to <):
*input name="p_long_desc<?=$cnt?>" size="80" class="form-text" value="<?=prepit($pic["long_desc"])?>">
With:
*TEXTAREA name="p_long_desc<?=$cnt?>" rows="4" cols="80"><?=prepit($pic["long_desc"])?>*/TEXTAREA>
Edit imageview.tpl.php in the template.
Replace the line:
<? print $long_desc?>
With:
<? print nl2br($long_desc)?>

Recent comments
8 hours 47 min ago
1 day 12 hours ago
1 day 12 hours ago
4 days 15 hours ago
5 days 13 hours ago
5 days 13 hours ago
6 days 10 hours ago
6 days 21 hours ago
1 week 9 hours ago
1 week 1 day ago