Мод выводит последние 5 фото юзера в блоке слева.
найти в profile.php
PHP:
// GET PROFILE VIEWS
$profile_views = 0;
$view_query = $database->database_query("SELECT profileview_views, profileview_viewers FROM se_profileviews WHERE profileview_user_id='{$owner->user_info['user_id']}'");
if($database->database_num_rows($view_query) == 1)
{
$views = $database->database_fetch_assoc($view_query);
$profile_views = $views['profileview_views'];
}
ниже добавить:
PHP:
// LAST USER'S UPLOADED PHOTOS
$output = 5; // Сколько показывать фоток
$t_uid = $owner -> user_info[user_id];
$t_uname = $owner -> user_info[user_username];
$result = $database -> database_query("SELECT `album_id` FROM `se_albums` WHERE `album_user_id` = '$t_uid'");
$t_albums = array();
$t_media_ids = array();
$last_photos_array = array();
while( list($t_albums[]) = $database -> database_fetch_array($result) )
{
}
foreach($t_albums as $t_album)
{
$result = $database -> database_query("SELECT `media_id`, `media_date` FROM `se_media` WHERE `media_album_id` = '$t_album'");
while( list($t_media_id, $t_media_date) = $database -> database_fetch_array($result) )
{
$t_media_ids[$t_media_date] = $t_media_id;
}
}
arsort($t_media_ids);
reset($t_media_ids);
$t_amount = count($t_media_ids);
$output = ($t_amount < $output) ? $t_amount : $output;
for($i = 0; $i < $output; $i++)
{
$t_arr = array();
$t_id = current($t_media_ids);
$result = $database -> database_query("SELECT * FROM `se_media` WHERE `media_id` = '$t_id'");
$t_arr = $database -> database_fetch_assoc($result);
$t_arr['user_id'] = $t_uid;
$t_arr['user_username'] = $t_uname;
$t_arr['media_path'] = $url->url_userdir( $t_uid ). $t_arr['media_id'].'.'. $t_arr['media_ext'];
$last_photos_array[] = $t_arr;
@next($t_media_ids);
}
$smarty->assign('last_photos', $last_photos_array);
// END OF LAST USER'S UPLOADED PHOTOS
найти в templates/profile.tpl
PHP:
{* BEGIN STATS *}
<table cellpadding='0' cellspacing='0' width='100%' style='margin-bottom: 10px;'>
<tr><td class='header'>{lang_print id=24}</td></tr>
<tr>
<td class='profile'>
<table cellpadding='0' cellspacing='0'>
<tr><td width='80' valign='top'>{lang_print id=1120}</td><td><a href='search_advanced.php?cat_selected={$owner->profilecat_info.profilecat_id}'>{lang_print id=$owner->profilecat_info.profilecat_title}</a></td></tr>
<tr><td valign='top'>{lang_print id=1119}</td><td>{lang_print id=$owner->subnet_info.subnet_name}</td></tr>
<tr><td>{lang_print id=846}</td><td>{lang_sprintf id=740 1=$profile_views}</td></tr>
{if $setting.setting_connection_allow != 0}<tr><td>{lang_print id=847}</td><td>{lang_sprintf id=848 1=$total_friends}</td></tr>{/if}
{if $owner->user_info.user_dateupdated != ""}<tr><td>{lang_print id=1113}</td><td>{assign var='last_updated' value=$datetime->time_since($owner->user_info.user_dateupdated)}{lang_sprintf id=$last_updated[0] 1=$last_updated[1]}</td></tr>{/if}
{if $owner->user_info.user_signupdate != ""}<tr><td>{lang_print id=850}</td><td>{$datetime->cdate("`$setting.setting_dateformat`", $datetime->timezone("`$owner->user_info.user_signupdate`", $global_timezone))}</td></tr>{/if}
</table>
</td>
</tr>
</table>
{* END STATS *}
ниже добавить:
PHP:
{* BEGIN LAST PHOTOS *}
{if $last_photos|@count != 0}
<table cellpadding='0' cellspacing='0' width='100%' style='margin-bottom: 10px;'>
<tr><td class='header'>Last Photo</td></tr>
<tr>
<td class='profile'>
{section name=last_photos_loop loop=$last_photos}
{if $last_photos[last_photos_loop].media_title != ""}
{assign var="photo_title" value=$last_photos[last_photos_loop].media_title}
{else}
{assign var="photo_title" value='Без названия'}
{/if}
<table cellpadding='0' cellspacing='0'>
<tr>
<td width='1' style='padding: 5px 5px 5px 0px;' valign='top'>
<a href='{$url->url_create("album_file", $last_photos[last_photos_loop].user_username, $last_photos[last_photos_loop].media_album_id,$last_photos[last_photos_loop].media_id)}' style="display:block;">
{if $last_photos[last_photos_loop].media_ext == "jpg" OR
$last_photos[last_photos_loop].media_ext == "jpeg" OR
$last_photos[last_photos_loop].media_ext == "gif" OR
$last_photos[last_photos_loop].media_ext == "png" OR
$last_photos[last_photos_loop].media_ext == "tif" OR
$last_photos[last_photos_loop].media_ext == "bmp"}
<img src='{$last_photos[last_photos_loop].media_path}' class='photo' style="border:none; margin:3px;" border='0' width='{$misc->photo_size($last_photos[last_photos_loop].media_path,"116","116","w")}'>
{else}
<img src='./images/icons/file_big.gif' valign="center" class='photo' border='0' width='{$misc->photo_size("./images/icons/file_big.gif","96","96","w")}'>
{/if}
</a>
</td>
<td valign='top' style='padding: 2px 0px 0px 0px;'>
<b><a href='{$url->url_create("album_file", $last_photos[last_photos_loop].user_username, $last_photos[last_photos_loop].media_album_id,$last_photos[last_photos_loop].media_id)}'>{$photo_title|truncate:17:"...":true}</b><br>
{if $last_photos[last_photos_loop].media_desc != ""}{$last_photos[last_photos_loop].media_desc|truncate:30:"...":true}<br>{/if}</a>
</td>
</tr>
</table>
{/section}
</td>
</tr>
</table>
{/if}
{* END LAST PHOTOS *}