Вот обьясняю.
Сейчас у меня это http://s59.radikal.ru/i166/1211/d9/1c5479f39c99.png
Надо вот, чтобы работало.
Вот у меня есть PHP. Он работает.
Code:
<?php
/* $Id: user_friends.php 42 2009-01-29 04:55:14Z john $ */
///////////////////////////////////////////////////////
include "header.php";
#-------------------------------------------------------------------------------------------------
$act = $_REQUEST['act'];
$smarty->assign('act', $act);
$page = "like";
//////////////////////////////////////////////////////////////
if($act == 'a_do_like' || $act == 'a_do_unlike'){
$chash = $_REQUEST['hash'];
$object = $_REQUEST['object'];
$wall = $_REQUEST['wall'];
$object = str_replace("_reply", "", $object);
preg_match('/wall([0-9]+)_([0-9]+)/i', $object, $like_info);
if($wall == '1'){
$type = '1';
$total_my_like = $database->database_num_rows($database->database_query("SELECT like_id FROM likes WHERE like_user_id='".$user->user_info[user_id]."' AND like_object_id='".$like_info[2]."' AND like_type='".$type."'"));
$total_likes = $database->database_num_rows($database->database_query("SELECT like_id FROM likes WHERE like_object_id='".$like_info[2]."' AND like_type='".$type."'"));
if($act == 'a_do_like'){
if($total_my_like == 0){
$database->database_query("INSERT INTO likes (like_user_id, like_object_id, like_type) VALUES ('".$user->user_info[user_id]."', '".$like_info[2]."', '1')");
$total_likes = $total_likes+1;
}
}
if($act == 'a_do_unlike'){
$database->database_query("DELETE FROM likes WHERE like_user_id='".$user->user_info[user_id]."' AND like_object_id='".$like_info[2]."' AND like_type='1'");
$total_likes = $total_likes-1;
}
}
echo '4658<!><!>0<!>4250<!>0<!>'.$total_likes.'<!>Понравилось '.$total_likes.' человеку';
exit;
}
else if($act == 'a_get_stats'){
$object = $_REQUEST['object'];
preg_match('/([0-9]+)_([0-9]+)/i', $object, $like_info);
$total_likes = $database->database_num_rows($database->database_query("SELECT like_id FROM likes WHERE like_object_id='".$like_info[2]."' AND like_type='1'"));
function like_list($start, $limit, $id, $type = '1') {
global $database;
$like_array = Array();
$like_query = " select se_users.user_id, se_users.user_photo, se_users.user_username, se_users.user_fname, se_users.user_lname
from likes
LEFT JOIN se_users ON likes.like_user_id = se_users.user_id
WHERE likes.like_object_id = $id ORDER BY likes.like_id DESC LIMIT $start, $limit";
$likes = $database->database_query($like_query);
while($like_info = $database->database_fetch_assoc($likes)) {
$myuser = new se_user();
$myuser->user_info[user_id] = $like_info[user_id];
$myuser->user_info[user_username] = $like_info[user_username];
$myuser->user_info[user_fname] = $like_info[user_fname];
$myuser->user_info[user_lname] = $like_info[user_lname];
$myuser->user_info[user_photo] = $like_info[user_photo];
$like_array[] = Array('user' => $myuser);}
return $like_array;
}
$likes = like_list(0, 6, $like_info[2]);
echo '4658<!>tooltips.css<!>0<!>4250<!>0<!><div class="header" onclick="showTabbedBox(\'like.php\', {act: \'a_get_members\', object: \'wall'.$like_info[0].'\', wall: 1}, {cache: 1})"><div class="like_head_wrap"><span id="like_title_wall'.$like_info[0].'">Понравилось '.$total_likes.' людям</span></div></div>
<div class="wrap">
<input type="hidden" id="like_real_count_wall'.$like_info[0].'" value="'.$total_likes.'" />
<div class="content"><div class="hider"><table cellspacing="0" cellpadding="0" id="like_table_wall'.$like_info[0].'" class="like_stats" style="left: 0px"><tr>';
foreach($likes as $like_infos){
echo '<td><a title="'.$like_infos[user]->user_info[user_fname].' '.$like_infos[user]->user_info[user_lname].'" href="id'.$like_infos[user]->user_info[user_id].'"><img src="'.$like_infos[user]->user_photo("./images/nophoto.gif", "1").'" /></a></td>';
}
echo '</tr></table></div></div>
</div><!>var count = intval(ge(\'like_real_count_wall'.$like_info[0].'\').value);
if (count) {
addClass(tip.container, \'\');
if (!tip.inited) {
tip.onClean = function() {
tip.inited = false;
if (tip.over) removeEvent(tip.container, \'mouseover\', tip.over);
if (tip.out) removeEvent(tip.container, \'mouseout\', tip.out);
}
if (tip.over) addEvent(tip.container, \'mouseover\', tip.over);
if (tip.out) addEvent(tip.container, \'mouseout\', tip.out);
tip.inited = true;
}
}
return count > 0; ';
exit;
}else if($act == 'a_get_members'){
$object = $_REQUEST['object'];
preg_match('/([0-9]+)_([0-9]+)/i', $object, $like_info);
$total_likes = $database->database_num_rows($database->database_query("SELECT like_id FROM likes WHERE like_object_id='".$like_info[2]."' AND like_type='1'"));
function like_list($start, $limit, $id, $type = '1') {
global $database;
$like_array = Array();
$like_query = " select se_users.user_id, se_users.user_photo, se_users.user_username, se_users.user_fname, se_users.user_lname
from likes
LEFT JOIN se_users ON likes.like_user_id = se_users.user_id
WHERE likes.like_object_id = $id ORDER BY likes.like_id DESC LIMIT $start, 500";
$likes = $database->database_query($like_query);
while($like_info = $database->database_fetch_assoc($likes)) {
$myuser = new se_user();
$myuser->user_info[user_id] = $like_info[user_id];
$myuser->user_info[user_username] = $like_info[user_username];
$myuser->user_info[user_fname] = $like_info[user_fname];
$myuser->user_info[user_lname] = $like_info[user_lname];
$myuser->user_info[user_photo] = $like_info[user_photo];
$like_array[] = Array('user' => $myuser);}
return $like_array;
}
$likes = like_list(0, 6, $like_info[2]);
$smarty->assign('likes', $likes);
$smarty->assign('like_info', $like_info);
$smarty->display('al_m.tpl');
exit;
}
include "footer.php";
?>
А вот кривой *.tpl, который нужно мне исправить.
Code:
4658<!>boxes.css<!>0<!>4250<!>0<!>Люди, которым это понравилось<!><div class="tabbed_box">
<div class="summary_tabs clear_fix"></div>
<div class="tabbed_sh tabbed_sh1"></div>
<div class="tabbed_sh tabbed_sh2"></div>
<div class="tabbed_sh tabbed_sh3"></div>
<div class="tabbed_sh tabbed_sh4"></div>
<div class="tabbed_container clear_fix " style="height:310px;"><div style="padding: 7px 5px 5px;">
<div class="fl_r" style="padding:0 5px;width:200px;"></div><h4 style="border-bottom: 1px solid #DAE1E8;margin:0 5px 10px;padding:5px 0 2px;">Понравилось {$user_username[dj_loop]} человеку</h4>
<table cellpadding="0" cellspacing="0">
<tr> {section name=likes_loop loop=$likes}<td> <div class="liked_box_row">
<div class="liked_box_thumb">
<a href="/id'.$like_infos[user]->user_info[user_id].'" onclick="return nav.go(this, event)"><img src=".$like_infos[user]->user_photo("./images/nophoto.gif", "1")." /></a>
</div>
<div>
<a href="/id'.$like_infos[user]->user_info[user_id].'" onclick="return nav.go(this, event)">{$likes[likes_loop].myuser->user_info.user_fname}</a>
</div>
</div></td>{/section}</tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
</table>
</div></div>
<div class="tabbed_sh tabbed_sh4"></div>
<div class="tabbed_sh tabbed_sh3"></div>
<div class="tabbed_sh tabbed_sh2"></div>
<div class="tabbed_sh tabbed_sh1"></div>
<div class="tabbed_sh tabbed_sh0"></div>
</div><!>{literal}setUpTabbedBox(box, 478, [{"label":"Оценили","url":"like.php","data":{"act":"a_get_members","object":"wall40297585_2309"}},{"label":"Поделились","url":"like.php","data":{"act":"a_get_members","object":"wall40297585_2309","published":1}}], '0', ["Люди, которым это понравилось","<div style=\"padding: 7px 5px 5px;\">\n<div class=\"fl_r\" style=\"padding:0 5px;width:200px;\"><\/div><h4 style=\"border-bottom: 1px solid #DAE1E8;margin:0 5px 10px;padding:5px 0 2px;\">Понравилось 1 человеку<\/h4>\n<table cellpadding=\"0\" cellspacing=\"0\">\n<tr><td><div class=\"liked_box_row\">\n <div class=\"liked_box_thumb\">\n \n <a href=\"\/mistik31\" onclick=\"return nav.go(this, event)\"><img src=\"http:\/\/cs4272.vkontakte.ru\/u40297585\/e_e3183ab5.jpg\" \/><\/a>\n <\/div>\n <div>\n <a href=\"\/mistik31\" onclick=\"return nav.go(this, event)\">Ярослав<\/a>\n <\/div>\n<\/div><\/td><td><\/td><td><\/td><td><\/td><td><\/td><td><\/td><td><\/td><td><\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td><\/td><td><\/td><td><\/td><td><\/td><td><\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td><\/td><td><\/td><td><\/td><td><\/td><td><\/td><\/tr>\n<\/table>\n<\/div>","box.tabContent.className = 'tabbed_container clear_fix ';\nvar st = 'height:310px;';\nvar items = st.split(';');\nfor (var i = 0; i < items.length; ++i) {\n var name_value = items[i].split(':');\n if (name_value.length > 1 && name_value[0].length) {\n box.tabContent.style[trim(name_value[0])] = trim(name_value[1]);\n }\n}cur.likesBox = box;box.setControlsText('');"], arguments[0], arguments[1]);cur.likesBox = box;box.setControlsText('');{/literal}
Заранее спасибо