Chacking that picture and gallery ids are not null before trying to find them (#2).
This commit is contained in:
parent
de3b4f2593
commit
bcee865e1d
|
@ -28,11 +28,15 @@ function getNGGalleryImages( $ngGalleries, $ngImages, $dt, $lat, $lon, $dtoffset
|
||||||
try {
|
try {
|
||||||
$pictures = array();
|
$pictures = array();
|
||||||
foreach ( $galids as $g ) {
|
foreach ( $galids as $g ) {
|
||||||
|
if ($g != null ) {
|
||||||
$pictures = array_merge( $pictures, nggdb::get_gallery( $g ) );
|
$pictures = array_merge( $pictures, nggdb::get_gallery( $g ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
foreach ( $imgids as $i ) {
|
foreach ( $imgids as $i ) {
|
||||||
|
if ($i != null) {
|
||||||
array_push( $pictures, nggdb::find_image( $i ) );
|
array_push( $pictures, nggdb::find_image( $i ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
foreach ( $pictures as $p ) {
|
foreach ( $pictures as $p ) {
|
||||||
$item = array();
|
$item = array();
|
||||||
$item['data'] = $p->thumbHTML;
|
$item['data'] = $p->thumbHTML;
|
||||||
|
|
Loading…
Reference in New Issue