небольшой хак для плагина wall
Надеюсь если кому-то понравилось не забудет поставить "Спасибо"
Создаем фаил(ну или просто копируем wall_action.php) wall_like.php
PHP:
<?php
$page = "wall_like";
include "header.php";
if (isset($_POST['id'])) $action_id = $_POST['id']; elseif (isset($_GET['id'])) $action_id = $_GET['id'];
$where_clause = he_database::placeholder("se_actions.action_id=?", $action_id);
$wall_action = he_wall::actions_display(0, $setting['setting_actions_actionsonprofile'], $where_clause);
$wall_action = $wall_action[0];
if ( !$setting['setting_he_wall_guest_view'] && $user->level_info['level_wall_allowed'] == 0 ){
$page = "error";
$smarty->assign('error_header', 639);
$smarty->assign('error_message', 690706102);
$smarty->assign('error_submit', 641);
include "footer.php";
}
if ( !$wall_action ){
$page = "error";
$smarty->assign('error_header', 639);
$smarty->assign('error_message', 690706081);
$smarty->assign('error_submit', 641);
include "footer.php";
}
$query = "SELECT
WL.user_id,
WL.like_stamp,
U.user_displayname,
U.user_username
FROM se_he_wall_like WL
JOIN se_users U
ON WL.user_id = U.user_id
WHERE WL.action_id='".$action_id."' ORDER BY WL.like_stamp DESC";
$rows = $database->database_query( $query );
// GET THEM INTO AN ARRAY
$dummy_user = new se_user();
$wall_like_array = Array();
while($row = $database->database_fetch_assoc($rows)) {
$wall_like_array[] = $row;
}
$smarty->assign('wall_like', $wall_like_array);
include "footer.php";
?>
Создаем wall_like.tpl
PHP:
{include file='header_global.tpl'}
<div align='left'>
{section name=wall_like_loop loop=$wall_like}
{assign var='timestamp' value=$datetime->time_since($wall_like[wall_like_loop].like_stamp)}
<a href="{$url->url_create('profile',$wall_like[wall_like_loop].user_username)}">{$wall_like[wall_like_loop].user_displayname}</a> - {lang_sprintf id=$timestamp[0] 1=$timestamp[1]}<br/>
{sectionelse}
This wall post not any like post
{/section}
</div>
Открываем include/class_he_wall.php
там ищем
PHP:
function format_like( $user_ids, $user_arr )
{
if ( !$user_ids )
{
return false;
}
global $user, $url;
$count = count($user_ids);
$cur_user_likes = ( $user->user_exists ) ? in_array($user->user_info['user_id'], $user_ids) : false;
if ( $count == 1 )
{
if ( $cur_user_likes )
{
$owner_str = SE_Language::get(690706005);
$value = SE_Language::get(690706003, array( $owner_str ));
}
else
{
$owner_id = $user_ids[0];
$owner = $user_arr[$owner_id];
$owner_url = $url->url_create('profile', $owner->user_info['user_username']);
$owner_str = '<a href="' . $owner_url . '">' . $owner->user_displayname . '</a>';
$value = SE_Language::get(690706004, array( $owner_str ));
}
}
elseif ( $count == 2 )
{
if ( $user_ids[0] == $user->user_info['user_id'] )
{
$other_user_id = $user_ids[1];
}
elseif ( $user_ids[1] == $user->user_info['user_id'] )
{
$other_user_id = $user_ids[0];
}
if ( $cur_user_likes )
{
$first_str = SE_Language::get(690706005);
$second_user = $user_arr[$other_user_id];
$second_user_url = $url->url_create('profile', $second_user->user_info['user_username']);
$second_str = '<a href="' . $second_user_url . '">' . $second_user->user_displayname . '</a>';
}
else
{
$first_id = $user_ids[0];
$first_user = $user_arr[$first_id];
$first_user_url = $url->url_create('profile', $first_user->user_info['user_username']);
$first_str = '<a href="' . $first_user_url . '">' . $first_user->user_displayname . '</a>';
$second_id = $user_ids[1];
$second_user = $user_arr[$second_id];
$second_user_url = $url->url_create('profile', $second_user->user_info['user_username']);
$second_str = '<a href="' . $second_user_url . '">' . $second_user->user_displayname . '</a>';
}
$owners = SE_Language::get(690706006, array( $first_str, $second_str ));
$value = SE_Language::get(690706003, array( $owners ));
}
elseif ( $count > 2 )
{
$owners = SE_Language::get(690706007, array( $count ));
$value = SE_Language::get(690706003, array( $owners ));
}
return array( 'like' => $cur_user_likes, 'value' => $value );
}
заменить на
PHP:
function format_like( $user_ids, $user_arr, $action_id )
{
if ( !$user_ids )
{
return false;
}
global $user, $url;
$count = count($user_ids);
$cur_user_likes = ( $user->user_exists ) ? in_array($user->user_info['user_id'], $user_ids) : false;
if ( $count == 1 )
{
if ( $cur_user_likes )
{
$owner_str = SE_Language::get(690706005);
$value = SE_Language::get(690706003, array( $owner_str ));
}
else
{
$owner_id = $user_ids[0];
$owner = $user_arr[$owner_id];
$owner_url = $url->url_create('profile', $owner->user_info['user_username']);
$owner_str = '<a href="' . $owner_url . '">' . $owner->user_displayname . '</a>';
$value = SE_Language::get(690706004, array( $owner_str ));
}
}
elseif ( $count == 2 )
{
if ( $user_ids[0] == $user->user_info['user_id'] )
{
$other_user_id = $user_ids[1];
}
elseif ( $user_ids[1] == $user->user_info['user_id'] )
{
$other_user_id = $user_ids[0];
}
if ( $cur_user_likes )
{
$first_str = SE_Language::get(690706005);
$second_user = $user_arr[$other_user_id];
$second_user_url = $url->url_create('profile', $second_user->user_info['user_username']);
$second_str = '<a href="' . $second_user_url . '">' . $second_user->user_displayname . '</a>';
}
else
{
$first_id = $user_ids[0];
$first_user = $user_arr[$first_id];
$first_user_url = $url->url_create('profile', $first_user->user_info['user_username']);
$first_str = '<a href="' . $first_user_url . '">' . $first_user->user_displayname . '</a>';
$second_id = $user_ids[1];
$second_user = $user_arr[$second_id];
$second_user_url = $url->url_create('profile', $second_user->user_info['user_username']);
$second_str = '<a href="' . $second_user_url . '">' . $second_user->user_displayname . '</a>';
}
$owners = SE_Language::get(690706006, array( $first_str, $second_str ));
$value = SE_Language::get(690706003, array( $owners ));
}
elseif ( $count > 2 )
{
$countURL = '<a href="javascript:TB_show(\'Who Likes This\', \'../wall_like.php?id='.$action_id.'&TB_iframe=true&height=100&width=300\', \'\', \'./images/trans.gif\');">'.$count.'</a>';
$owners = SE_Language::get(690706007, array( $countURL ));
$value = SE_Language::get(690706003, array( $owners ));
}
return array( 'like' => $cur_user_likes, 'value' => $value );
}
Тестировалось на плагине he_wall 3.22
Скрин предлагается
Кто сможет сделайте и выложите сюда чтобы отображало фотки как вконтакте