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
2 days 20 hours ago
2 days 21 hours ago
10 weeks 1 day ago
10 weeks 2 days ago
10 weeks 2 days ago
10 weeks 2 days ago
34 weeks 4 days ago
41 weeks 9 hours ago
1 year 2 weeks ago
1 year 8 weeks ago