еще одна проблемка. хочу вывести список компаний на отдельной странице через
На выходе получается у всех пользователей отсутствуют лого
PHP:
<?php $user = User::newInstance()->listAll(); ?>
<?php if (osc_total_users()>0) { ?>
<table background="#E71B1F" align="center" width="80%" cellspacing="0" cellpadding="6" style="solid grey;">
<tr>
<th width="30%" background="#red">Company</th>
<th width="20%" bgcolor="#E8E8E8">Phone Land</th>
<th width="25%" bgcolor="#E8E8E8"><em>City</em></th>
<th width="25%" bgcolor="#E8E8E8"><em>Country</em></th>
</tr>
<?php foreach ($user as $u) { ?>
<?php if($u["b_company"]==1) {?>
<tr>
<?php View::newInstance()->_exportVariableToView('user', $user_keep); ?>
<th> <?php
$conn = getConnection();
$result=$conn->osc_dbFetchResult("SELECT user_id, pic_ext FROM %st_profile_picture WHERE user_id = '%d' ", DB_TABLE_PREFIX, $user_id);
$maxwidth = NULL;
$what = NULL;
$maxheight = NULL;
if($maxwidth == '') { $maxwidth = '120'; }
if($result>0) //if picture exists
{
$upload_path = osc_plugins_path().'profile_picture/images/';
list($width, $height, $type, $attr)= getimagesize($upload_path.'profile'.$user_id.$result['pic_ext']);
alculate display heigh/width based on max size specified
$ratio = $width/$height;
$height = $maxwidth/$ratio;
if($maxheight <> '') { $height = $maxheight; $maxwidth = 'auto'; }
$modtime = filemtime($upload_path.'profile'.$user_id.$result['pic_ext']); //ensures browser cache is refreshed if newer version of picture exists
// This is the picture HTML code displayed on page
echo '<img id="profile_picture_img" src="'.osc_base_url() . 'oc-content/plugins/profile_picture/images/profile'.$user_id.$result['pic_ext'].'?'.$modtime.'" width="'.$maxwidth.'" height="'.$height.'">'; // display picture
}
else{
if($maxheight <> '') { $height = $maxheight; $maxwidth = 'auto'; }
echo '<img id="profile_picture_img" src="'.osc_base_url() . 'oc-content/plugins/profile_picture/no-user.png" width="'.$maxwidth.'" height="'.$height.'">';
}
?></th>
<th> <a href="<?php echo osc_base_url(true).'?page=user&action=pub_profile&id='.$u['pk_i_id']; ?>" ><?php echo $u['s_name']; ?></a></th>
<th> <?php echo $u['s_phone_land'] ;?> </th>
<th> <?php echo $u['s_city'] ;?> </th>
<th> <?php echo $u['s_country'] ;?> </th>
</tr>
<?php } ?><?php } ?>
</table><?php } ?>