14.12.2013, 12:17
wersja skryptu MyBB:1.6.11
adres forum:Link do forum
na czym polega problem :
Witam chce edytować plugin żeby wyglądał tak jak na ss lecz mi to nie wychodzi
ss:http: http://prntscr.com/2b1sjk
a u mnie wygląda tak http://prntscr.com/2b1t6f
Kod pluginu
adres forum:Link do forum
na czym polega problem :
Witam chce edytować plugin żeby wyglądał tak jak na ss lecz mi to nie wychodzi
ss:http: http://prntscr.com/2b1sjk
a u mnie wygląda tak http://prntscr.com/2b1t6f
Kod pluginu
Kod PHP:
<?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=\"margin-bottom: 10px;\">
<tr>
<td class=\"thead_p\"><strong>Ostatnio byli</strong></td>
</tr>
<tr>
<td class=\"trow_prof_stat1\">
{\$lastvisitor}
</td>
</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']);
$username = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
$username = build_profile_link($username, $row['uid']);
//$lastvisitor = $lastvisitor."<br><img style=\"margin-bottom: -8px;\" src=\"{$un['avatar']}\" width='30px' height='30px' alt=\"{$row['username']}\" title=\"{$row['username']}\"\/>";
$lastvisitor = $lastvisitor."<br><img style=\"margin-bottom: -8px;\" src=\"{$un['avatar']}\" width='30px' height='30px' alt=\"{$row['username']}\" title=\"{$row['username']}\"\/>".$username." <span style='font-size: 11px;'>".$date.", ".$time."</span> ";
}
}
eval("\$last_visit = \"".$templates->get("userprofile_lastvisit")."\";");
}
?>