michal1997
- Bywalec
- 90 45 0 1
wersja skryptu MyBB:1.8.4
adres forum: http://cs-gamers.cba.pl/
na czym polega problem (screen, opis, komunikaty, nazwa i wersja wtyczki):
Witam mam problem jak odsunąć avatar od nicku znalazłem tutaj wątek na forum https://webboard.pl/thread-58876.html , ale nie pomaga.
adres forum: http://cs-gamers.cba.pl/
na czym polega problem (screen, opis, komunikaty, nazwa i wersja wtyczki):
Witam mam problem jak odsunąć avatar od nicku znalazłem tutaj wątek na forum https://webboard.pl/thread-58876.html , ale nie pomaga.
<?php
//*************************************//
//*************************************//
//*********** Last Visitors ************//
//*************************************//
//*************************************//
// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$plugins->add_hook("member_profile_end", "lastvisitors_profile");
function lastvisitors_info()
{
return array('name' => 'Last Visitors in Profile',
'description' => 'Add a Box in Users Profiles with Last 10 Users Have Visit It',
'website' => '',
'author' => 'LLNN',
'authorsite' => '',
'version' => '1.1',
'compatibility' => '1*',
'guid' => '9e2233dc1d258ae05ecba084c4b0dda6'
);
}
function lastvisitors_activate()
{
global $mybb, $db, $templates;
require MYBB_ROOT.'/inc/adminfunctions_templates.php';
$sql ="CREATE TABLE `".TABLE_PREFIX."lastvisitor` (
`uid` VARCHAR( 10 ) NOT NULL ,
`vid` VARCHAR( 10 ) NOT NULL ,
`time` VARCHAR( 50 ) NOT NULL
) ENGINE = MYISAM ;";
$db->write_query($sql);
$template1 = array("title" => "userprofile_lastvisit",
"template" => "<br />
<table border=\"0\" cellspacing=\"{\$theme\[\'borderwidth\'\]}\" cellpadding=\"{\$theme\[\'tablespace\'\]}\" class=\"tborder\" style=\"border: #393939 solid 1px;\">
<tr>
<td colspan=\"2\" style=\"width: 100%;\"class=\"tcat\"><strong>Ostatnio byli</strong></td>
{\$lastvisitor}
</tr>
</tr>
</table>","sid" => -1);
$db->insert_query("templates", $template1);
find_replace_templatesets('member_profile', '#{\$modoptions}#', "{\$modoptions}
{\$last_visit}");
}
function lastvisitors_deactivate()
{
global $mybb, $db, $templates;
$sql ="DROP TABLE `mybb_lastvisitor`;";
$db->write_query($sql);
require MYBB_ROOT.'/inc/adminfunctions_templates.php';
find_replace_templatesets('member_profile', '#\{\$last_visit\}#', '', 0);
$db->delete_query("templates","title IN('userprofile_lastvisit')");
}
function lastvisitors_profile(){
global $mybb, $db, $templates, $theme, $lastvisitor, $memprofile, $last_visit ;
$myuid = $memprofile['uid'];
$vuid = $mybb->user['uid'];
$query = $db->simple_select('lastvisitor', '*', "uid='".$myuid."' and vid='".$vuid."'");
$nr = $db->num_rows($query);
IF($vuid != "0" and $vuid != $myuid ){
$tt = time();
IF($nr<1){
$db->write_query("INSERT INTO `".TABLE_PREFIX."lastvisitor` VALUES ('$myuid', '$vuid','$tt')");
}else{
$db->update_query("lastvisitor", array('time' => $tt), "uid='".$myuid."' and vid='".$vuid."'");
}
}
$query = $db->query('SELECT * FROM ' . TABLE_PREFIX . 'lastvisitor,' . TABLE_PREFIX . 'users WHERE ' . TABLE_PREFIX . 'users.uid=' . TABLE_PREFIX . 'lastvisitor.vid AND ' . TABLE_PREFIX . 'lastvisitor.uid='.$myuid.' ORDER BY ' . TABLE_PREFIX . 'lastvisitor.time DESC LIMIT 10;');
while($row = $db->fetch_array($query)){
$u = $row['vid'];
$un = get_user($u);
if($un!=""){
$date = my_date($mybb->settings['dateformat'], $row['time']);
$time = my_date($mybb->settings['timeformat'], $row['time']);
$avatar = format_avatar($row['avatar'], "35x35", "35x35");
$username = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
$username = build_profile_link($username, $row['uid']);
$lastvisitor = $lastvisitor." <tr><td class=\"ostatnio_podglad\"><img src='" . $avatar['image'] . "' alt='' title='' style='width: 30px; height: 30px; ' /> ".$username." <br />".$date.", ".$time."</td></tr> ";
}
}
eval("\$last_visit = \"".$templates->get("userprofile_lastvisit")."\";");
}
?>