Cómo poner imagen predeterminada en código PHP

  • Autor Autor charky
  • Fecha de inicio Fecha de inicio
C

charky

Curioso
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Hola amigos, estoy buscando poner una imagen Default en este codigo para cuando un usuario no sube imagen.

PHP:
//Funcion de imagenes para slider
function image_box ($imgs) {
  $matches = explode(",", $imgs);
	foreach($matches as $var) {
		if ($var != "") {
			$thumb_var = str_replace(get_option('home')."/wp-content/uploads/imgs/", "", $var);
			$single_thumb_img_url = get_bloginfo('template_url')."/scripts/resize.php?url=".$var."&size=500x350c50";
			echo "<li><img src=\"$single_thumb_img_url\" alt=\"". get_the_title() ."\" /></li>"."\n";
		} else {
		  if($matches[0] == ""){
          }
        }
	}
}
function image_thumbnail ($imgs) {
  $matches = explode(",", $imgs);
	foreach($matches as $var) {
		if ($var != "") {
			$thumbnail_var = str_replace(get_option('home')."/wp-content/uploads/imgs/", "", $var);
			$single_thumbnail_img_url = get_bloginfo('template_url')."/scripts/resize.php?url=".$var."&amp;size=40x40c50";
			echo "<li><a href=\"javascript:;\"><img class=\"aligncenter\" src=\"$single_thumbnail_img_url\" width=\"40px\" height=\"40px\" alt=\"".get_the_title()."\" /></a><li>"."\n";
		} else {
			if ( $matches[0] == "") {
			}
		}
	}
}

Lo que quiero es que la imagen
PHP:
$single_thumb_img_url = get_bloginfo('template_url')."/scripts/resize.php?url=".$var."&amp;size=500x350c50";
sea remplazada por otra default.

si serian tan amables, gracias
 
Que tal si colocas la imagen default en el ELSE:
PHP:
        } else { 
          if($matches[0] == ""){ 
          } 
        }

Se supone que al no haber imagen es la parte del código que continua.
 
Atrás
Arriba