Why dosent it display picture ?

Hi!

Include source for displaying picture.
But it dosent display any picture ?

What is wrong with this line:
<img src="getsnap.php?id={$user.id}&amp;typ=pic&amp;width={$config.disp_snap_width}&amp;height={$config.disp_snap_height}" width=100 height=118 class="smallpic" style="margin:10px 20px 10px 0px;" alt="" />


{strip}
<div class="module_detail">
    <br />  
	<div style="text-align:center;margin-top:2px;">
		{if ($smarty.session.UserId != '' && $smarty.session.security.seepictureprofile == 1) or $smarty.session.UserId == ''}
			{if $config.enable_mod_rewrite == 'Y'}
				<a href="javascript:popUpScrollWindow2('{$docroot}{if $smarty.session.AdminId > 0}{$smarty.const.ADMIN_DIR}{/if}{if $config.seo_username == 'Y'}{$item.username}{else}{$item.id}.htm{/if}','center',650,600)" class="textcolor">
			{else}
				<a href="javascript:popUpScrollWindow2('{$docroot}{if $smarty.session.AdminId > 0}{$smarty.const.ADMIN_DIR}{/if}showprofile.php?id={$item.id}','center',650,600)" class="textcolor">
			{/if}
			<img src="getsnap.php?id={$user.id}&amp;typ=pic&amp;width={$config.disp_snap_width}&amp;height={$config.disp_snap_height}" width=100 height=118 class="smallpic" style="margin:10px 20px 10px 0px;" alt="" />
			</a>
		{/if}
	</div>
	<div style="text-align:center;margin-top:2px; " class="smallest_profiles">
		<strong>{$item.username}</strong><br />
		{$item.age} , {$item.city} {mylang mkey='signup_gender_values' skey=$item.city}
		
	</div>
	<div class="line_top_bottom_pad"  align="center">
		{checkuser userid=$item.id checkfor='online'}
	</div>
</div>
{/strip}

Open in new window

LVL 2
team2005Asked:
Who is Participating?
 
EyalCommented:
view the source and see what is the value of the src of the image
0
 
team2005Author Commented:
Hi!

Include the getsnap.php to:


<?php
/***********************************************
osDate Open-Source Dating and Matchmaking Script

(c) 2009 TUFaT.com

osDate was created by Darren Gates and Vijay Nair,
and can be downloaded freely from www.TUFaT.com.
It is distributed under the LGPL license.

osDate is free for commercial and non-commercial
uses. You may modify, re-sell, and re-distribute
osDate. Links back to TUFaT.com are appreciated.

This program is distributed in the hope that it
will be useful, but without any warranty, and
without even the implied warranty of merchantability
or fitness for a particular purpose. While strong
efforts have been taken to ensure the reliability,
security, and stability of osDate, all software
carries risk. Your use of osDate means that you
understand and accept the risks of using osDate.

For osDate documentation, change log, community
forum, latest updates, and project details,
please go to www.TUFaT.com  The osDate project is
supported through the sale of skins and add-ons,
which are entirely optional but help with the
development and design effort.
***********************************************/

ob_start();

if ( !defined( 'SMARTY_DIR' ) ) {
	include_once( 'minimum_init.php' );
}

include(OSDATE_INC_DIR.'internal/snaps_functions.php');

if (isset($_REQUEST['username']) && $_REQUEST['username'] != '') {
	$userid = $osDB->getOne('select id from ! where username = ?',array(USER_TABLE, $_REQUEST['username']) );
} else {
	//  include ( 'sessioninc.php' );

	if( !isset($_GET['id']) || (isset($_GET['id'])&& (int)$_GET['id'] <= 0 ) ) {

		$userid = $_SESSION['UserId'];

	} else {

		$userid = $_GET['id'];

	}
}


if (!isset($_GET['picid']) ) {

	if ((isset($_REQUEST['type']) && $_REQUEST['type'] != 'gallery') || !isset($_REQUEST['type']) ) {

		$defpic = $osDB->getOne('select picno from ! where userid = ? and ( album_id is null or album_id = ?) and default_pic = ? and active = ? ',array(USER_SNAP_TABLE, $userid,'0','Y','Y' ) );

		if ($defpic != '') {
			$picid = $defpic;
		} else {

			$picid = $osDB->getOne('select picno from ! where userid = ? and ( album_id is null or album_id = ?) and active=? order by rand()',array(USER_SNAP_TABLE, $userid,'0','Y' ) );

		}
		unset( $defpic);
	}
} else {

	$picid = $_GET['picid'];

}

$typ = isset( $_GET['typ'])?$_GET['typ']:'pic' ;

$cond = '';

if ( ($config['snaps_require_approval'] == 'Y' || $config['snaps_require_approval'] == '1') && $userid != $_SESSION['UserId'] ) {

	$cond = " and active = 'Y' ";
}

$sql = 'select *  from ! where userid = ? and picno = ? '.$cond;

/* Get the watermarked picture file from cache directory.  */
$row =& $osDB->getRow ( $sql, array( USER_SNAP_TABLE, $userid, $picid ) );

$img = getPicture($userid, $picid, $typ, $row);

$ext = ($typ = 'tn')?$row['tnext']:$row['picext'];

if ( $img != '' && ( ( hasRight('seepictureprofile') && ( $config['snaps_require_approval'] == 'Y' && $row['active'] == 'Y'  ) ||$config['snaps_require_approval'] == 'N' ) || $userid == $_SESSION['UserId']  ) ) {

	$img2 = $img;

} else {

	$gender = $osDB->getOne( 'select gender from ! where id = ?', array( USER_TABLE, $userid ) ) ;

	if ($gender == 'M') {
		$nopic = SKIN_IMAGES_DIR.'male.jpg';
	} elseif ($gender == 'F') {
		$nopic = SKIN_IMAGES_DIR.'female.jpg';
	} elseif ($gender == 'C') {
		$nopic = SKIN_IMAGES_DIR.'couple.jpg';
	}

	$img2 = imagecreatefromjpeg($nopic);
	$ext = 'jpg';
}

ob_end_clean();
header("Pragma: public");
header("Content-Type: image/".$ext);
header("Content-Transfer-Encoding: binary");
header("Cache-Control: must-revalidate");

$ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time() - 30) . " GMT";

header($ExpStr);
header("Content-Disposition: attachment; filename=profile_".$userid."_".$typ.".".$ext);

/*
 if ($_SESSION['browser'] != 'MSIE') {

	header("Content-Disposition: inline" );
 }
*/
if ($ext == 'jpg') {
	imagejpeg($img2);
} elseif ($ext == 'gif') {
	imagegif($img2);
} elseif ($ext == 'png') {
	imagepng($img2);
} elseif ($ext == 'bmp') {
	imagewbmp($img2);
}
imagedestroy($img2);
?>

Open in new window

0
 
EyalCommented:
try this...

<img src="getsnap.php?id={$user.id}&typ=pic&width={$config.disp_snap_width}&height={$config.disp_snap_height}" width=100 height=118 class="smallpic" style="margin:10px 20px 10px 0px;" alt="" />
                  
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
team2005Author Commented:
Hi!

Dosent help, sorry :(
0
 
EyalCommented:
take the generated image link and try to open it in a browser. does it show the image?
0
 
team2005Author Commented:
Hi!

Yes it shows the profilepage with the picture. When i click on the Image link
0
 
team2005Author Commented:
Hi!

When i clik right mouse button, and select show picture. It say that the picture is emty ???
0
 
team2005Author Commented:
Hi!

Tryed to call this in the browser

getsnap.php?id=951  -> shows the picture
0
 
team2005Author Commented:
Hi!

The problem was that $user.id was emty
Inserted $item.id insted, now the pictures are shown :)

Thanks so mutsh Eval :)

0
 
team2005Author Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.