'attachment', 'numberposts' => 1, 'post_status' => null, 'post_parent' => $postID,)) ){ foreach($images as $image) { $attachment=wp_get_attachment_image_src($image->ID, $size); $attachmentMobile=wp_get_attachment_image_src($image->ID, 'medium'); } } if ($list = get_post_meta($postID, "gal_value", $single = true)) { $list = get_post_meta($postID, "gal_value", $single = true); //$dbhost = "89.46.111.41"; // this will ususally be 'localhost', but can sometimes differ //$dbname = "Sql931907_1"; // the name of the database that you are going to use for this project //$dbuser = "Sql931907"; // the username that you created, or were given, to access your database //$dbpass = "6lqw2np6fy"; // the password that you created, or were given, to access your database $dbhost = constant('DB_HOST'); // this will ususally be 'localhost', but can sometimes differ $dbname = constant('DB_NAME'); // the name of the database that you are going to use for this project $dbuser = constant('DB_USER'); // the username that you created, or were given, to access your database $dbpass = constant('DB_PASSWORD'); // the password that you created, or were given, to access your database mysql_connect($dbhost, $dbuser, $dbpass) or die("MySQL Error: " . mysql_error()); mysql_select_db($dbname) or die("MySQL Error: " . mysql_error()); $query="SELECT G.title as Titolo, G.slug as slug, G.name as nome FROM motori09_ngg_gallery AS G WHERE G.gid=".$list.""; $trovagalleria=mysql_query($query) or die(mysql_error()); if( !$trovagalleria ) { return ''; } while ($row = mysql_fetch_assoc($trovagalleria)) { $TitoloGalleria = utf8_encode($row['Titolo']); $nomegalleria= utf8_encode($row['nome']); $slug=utf8_encode($row['slug']); if ($slug==$nomegalleria){ $galleria=$nomegalleria; }else{ $galleria=$nome; } if ($galleria==""){ $galleria=$nomegalleria; } $path='wp-content/gallery/'.$galleria; } $page = (isset($_GET['page']) ? $_GET['page'] : 0); $max_width = 100; $max_height = 100; $per_page = 999; $has_previous = false; $has_next = false; $linkbase='/foto/'.$galleria.'/'; $pathdettaglio='/foto/'.$galleria.'/'; //echo ''; if( !is_dir($path) ){ return ''; } if ( $handle = opendir($path) ) { $per_page = 18; //echo ''; //$lightbox = rand(); //$gallerySend.= '
'; if($type=='gallery'){ $gallerySend.=''; $gallerySend.='