Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function displayAll ( $delete = false) {
- if (isset($_POST['ph_id'])) {
- $p = new photo();
- $content .= $p->deleteSelection($_POST['ph_id']);
- }
- if ($delete ) $content = '<form action="'.$_SERVER['REQUEST_URI'].'" enctype="multipart/form-data" method="post">';
- $content .= '<div id="gallery" ><ul>';
- $q = db::getInstance()->q( 'SELECT * FROM sm_photos WHERE `fk_web_id` = "'. website::get_session()->id .'"');
- while ( $array = $q->fetch_array() ) {
- $i = new image( 'uploads/'. website::get_session()->key .'/photos/'.$array['name']);
- if ( $i->is_bigger_than( 100, 100) ) {
- $i->resize( 100, 100 , 'uploads/'. website::get_session()->key .'/photos/'. 'temp100_'. $array['name'] );
- $i2 = new image( $i->image );
- if ( $i2->is_bigger_than( 600, 600) ) {
- $i2->resize( 600, 600 , 'uploads/'. website::get_session()->key .'/photos/'. 'temp600_'. $array['name'] );
- $i->image = $i2->target;
- }
- $content .= '<li><a href="'. $i->image .'" target="_blank" title="'.$array['legend'].'" >
- <img src="'. $i->target .'" class="png" /></a>';
- }
- else {
- $content .= '<li><img src="'. $i->image .'" title="'.$array['legend'].'" />';
- }
- if ($delete ) $content .= '<br /><input type="checkbox" name="ph_id[]" value="'.$array['id'].'" />';
- $content .= '</li>';
- }
- $content .= '</ul></div>';
- if ($delete ) $content .= '<input type="submit" name="submit" value="Supprimer les photos sélectionnées" /></form>';
- return $content;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement