Menu

adding image caption

agarcia4
2011-12-01
2013-04-15
  • agarcia4

    agarcia4 - 2011-12-01

    Hi I have started learning PHP, but I am not experienced enough to know how to add this. I want to add a caption to every image in the image gallery. Right now I am using the text file alternative, rather than the mySQL database. Right now I am editing the slooze.php file, but I am not sure what else I need to edit or how I should go about this task.

     
  • Matthew Kendall

    Matthew Kendall - 2011-12-01

    Add a "Caption" column to the pictures text file.
    Modify showPicture() to emit some HTML to show the caption. The caption will be in $picture at this point.

    That's about it for showing captions. You can test it by manually adding data to the Caption column in your text file.

    To allow captions to be added and edited through the web forms do this:

    Create a function showFormElementCaption(), perhaps modeled after $this->showFormElementDescriptionTextArea().
    Call it from showFormAddPicture.

    I'm going from memory here and I haven't touched this code in about eight years so I may have missed something, but that should get you going.

    Matthew

     

Log in to post a comment.