Webboard

Pełna wersja: Top 5 shouterów
Aktualnie przeglądasz uproszczoną wersję forum. Kliknij tutaj, by zobaczyć wersję z pełnym formatowaniem.
Witam,mam błąd z pluginem Top Shouterów (1.4.0) od supryka i gibonaPL(o ile się nie mylę)
Problem taki jak na ss:
[attachment=13769]
Co zrobić? usunąć sexpaltext i tą ikonkę zdjęcia
zmienić czcionkę na tą domyślną z forum czyli np "top 5 piszących" i np liczba 0(chodzi o przykład o jaką czcionkę chodzi
i jak dodać np prefiks do top 5 piszących top 5 reputacji tak jak prefiks "on"
I czemu nie czyta domyślnych avatarów? jak widać u sharkk jest normalnie bo ma swój avatar zmieniony reszta ma domyślny i nie czyta
Kod:
<?php
if(!defined('IN_MYBB'))
{
die('This file cannot be accessed directly.');
}

$plugins->add_hook("index_end", "topshout_show");
$plugins->add_hook("portal_end", "topshout_show");

function topshout_info()
{
   global $lang, $mybb, $db;
   $lang->load("topshout");

return array(
"name" => $lang->name,
"description" => $lang->desc,
"website" => "http://www.mybboad.pl",
"author" => "GiboneKPL & Supryk",
"authorsite" => "http://www.rashownia.pl",
"version" => "1.4.0",
"guid" => "*",
"compatibility" => "18*"
);
}


function topshout_install()
{
global $mybb, $db, $lang;
$lang->load("topshout");

$settinggroups = array(
'name' => 'topshout',
'title' => $db->escape_string($lang->name),
'description' => $db->escape_string($lang->settings_desc),
'disporder' => 100,
'isdefault' => 0
);
$gid = $db->insert_query("settinggroups", $settinggroups);
$disporder = 0;

$setting = array(
"sid" => NULL,
"name" => "topshoutlimit",
"title" => $db->escape_string($lang->settings_limit),
"description" => $db->escape_string($lang->settings_limit_desc),
"optionscode" => "text",
"value" => '5',
"disporder" => $disporder++,
"gid" => $gid
);
$db->insert_query("settings", $setting);

$setting = array(
"sid" => NULL,
"name" => "topshoutshoutbox",
"title" => $db->escape_string($lang->settings_shoutbox),
"description" => $db->escape_string($lang->settings_shoutbox_desc),
"optionscode" => "select
dvzshoutbox=DVZ Shoutbox
myshoutbox=MyShoutbox
sfshoutbox=SpiceFuse Shoutbox",
"value" => 'dvzshoutbox',
"disporder" => $disporder++,
"gid" => $gid
);
$db->insert_query("settings", $setting);

   $setting = array(
           'sid' => 'NULL',
           'name' => 'topshoutignore',
           'title' => $db->escape_string($lang->settings_ignore_groups),
           'description' =>  $db->escape_string($lang->settings_ignore_groups_desc),
           'optionscode' => 'text',
           'value' => '5,7',
           'disporder' => $disporder++,
           'gid' => $gid
   );
   $db->insert_query('settings', $setting);

$setting = array(
"sid" => NULL,
"name" => "topshoutcolor",
"title" => $db->escape_string($lang->settings_color),
"description" => $db->escape_string($lang->settings_color_desc),
"optionscode" => "text",
"value" => '#7ba60d',
"disporder" => $disporder++,
"gid" => $gid
);
$db->insert_query("settings", $setting);

$setting = array(
"sid" => NULL,
"name" => "topshoutcoll",
"title" => $db->escape_string($lang->settings_collapse),
"description" => $db->escape_string($lang->settings_collapse_desc),
"optionscode" => "yesno",
"value" => '1',
"disporder" => $disporder++,
"gid" => $gid
);
$db->insert_query("settings", $setting);

rebuild_settings();

$template = array(
"tid" => "NULL",
"title" => "topshout",
"template" => $db->escape_string('<style type="text/css">
.top_shout {
display: inline-block;
height: 16px;
line-height: 16px;
padding: 0 5px;
font-size: 9px;
font-weight: bold;
text-transform: uppercase;
color: #fff;
text-shadow: rgba(0,0,0,0.2) 0px -1px 0px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-image: url(images/highlight.png);
background-repeat: repeat-x;
background-position: 0 -1px;
}
</style>
 
<table border="0" cellspacing="{$theme[borderwidth]}" cellpadding="{$theme[tablespace]}" class="tborder" style="clear: both; border-bottom-width: 0;">
<tr>
<td class="thead" colspan="2">
{$collapse}
<strong>{$lang->name}</strong>
</td>
</tr>
<tbody style="{$expdisplay}" id="shouters_e">
{$topshout_row}
</tbody>
</table>
<br />'),
"sid" => "-1",
);
   $db->insert_query("templates", $template);

$template = array(
"tid" => "NULL",
"title" => "topshout_row",
"template" => $db->escape_string('<tr><td class="trow2">
{$shout[\'avatar\']}
{$shout[\'profilelink\']}
<span style="float: right;margin-right: 5px;margin-top: 7px;background: {$color}" class="top_shout">{$shout[\'shouts\']}</span>
</td></tr'),
"sid" => "-1",
);
   $db->insert_query("templates", $template);
}


function topshout_is_installed()
{
   global $db, $lang, $mybb;
$lang->load("topshout");

$q = $db->simple_select('settinggroups', '*', 'name=\'topshout\'');
$group = $db->fetch_array($q);
if($group === null || empty($group))
return false;
return true;
}

function topshout_uninstall()
{
global $mybb, $db, $lang;
$lang->load("topshout");

$db->delete_query("settinggroups", "name = 'topshout'");
$db->delete_query('settings', 'name LIKE \'%topshout%\'');
$db->delete_query('templates', 'title LIKE (\'%topshout%\')');
}

function topshout_show()
{
global $db, $mybb, $page, $topshout, $theme, $templates, $shout, $topshout_row, $lang;
   $lang->load("topshout");

$gibek_pinek = FALSE;

$ignore_groups = $mybb->settings['topshoutignore'];
   if($ignore_groups == '')
   {
           $ignore_groups = '9999999';
   }

if($mybb->settings['topshoutshoutbox'] == 'dvzshoutbox')
{
   if (!$db->table_exists("dvz_shoutbox"))
   {
$topshout_row = '<tr><td class="trow2">'.$lang->install_dvz.'</td></tr>';
}
else
{
$gibek_pinek = TRUE;
       $query = $db->query("SELECT s.uid, u.username, u.usergroup, u.displaygroup, u.uid, u.avatar, count(*) as totalshouts
                                FROM ".TABLE_PREFIX."dvz_shoutbox s
                  LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=s.uid)
WHERE usergroup NOT IN(".$ignore_groups.")
GROUP BY s.uid
ORDER BY totalshouts
DESC LIMIT " . $mybb->settings['topshoutlimit']);
    }

}
elseif($mybb->settings['topshoutshoutbox'] == 'myshoutbox')
   {
   if (!$db->table_exists("mysb_shouts"))
   {
$topshout_row = '<tr><td class="trow2">'.$lang->install_mysb.'</td></tr>';
}
else
{
$gibek_pinek = TRUE;
   $query = $db->query("SELECT s.uid, u.username, u.usergroup, u.displaygroup, u.uid, u.avatar, count(*) as totalshouts
                                FROM ".TABLE_PREFIX."mysb_shouts s
                LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=s.uid)
WHERE usergroup NOT IN(".$ignore_groups.")
                                GROUP BY s.uid
ORDER BY totalshouts
DESC LIMIT " . $mybb->settings['topshoutlimit']);
}
}
   elseif($mybb->settings['topshoutshoutbox'] == 'sfshoutbox')
{
   if (!$db->table_exists("sf_shouts"))
   {
   $topshout_row = '<tr><td class="trow2">'.$lang->install_sfsb.'</td></tr>';
}
else
{
   $gibek_pinek = TRUE;
   $query = $db->query("SELECT s.uid, u.username, u.usergroup, u.displaygroup, u.uid, u.avatar, count(*) as totalshouts
                                FROM ".TABLE_PREFIX."sf_shouts s
                LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=s.uid)
WHERE usergroup NOT IN(".$ignore_groups.")
                                GROUP BY s.uid
    ORDER BY totalshouts
    DESC LIMIT " . $mybb->settings['topshoutlimit']);
}
}

if( $gibek_pinek == TRUE )
{
   while($shout = $db->fetch_array($query))
   {
$shout['username'] = format_name($shout['username'], $shout['usergroup'], $shout['displaygroup']);
$shout['profilelink'] = build_profile_link($shout['username'], $shout['uid']);
$shout['shouts'] = $shout['totalshouts'];
$shout['avatar'] = '<img src="'.htmlspecialchars_uni($shout['avatar']).'" width="35" height="35" style="margin-right: 5px;float: left;"/>';
       
$color = $mybb->settings['topshoutcolor'];

           eval('$topshout_row .= "'.$templates->get("topshout_row").'";');
   }
}
if($mybb->settings['topshoutcoll'] == '1')
{
$collapse = '<div class="expcolimage"><img src="images/collapse.gif" id="shouters_img" class="expander" alt="{$expaltext}" title="{$expaltext}" /></div>';
}

eval('$topshout = "'.$templates->get('topshout').'";');
}
?>


Forum: CS-420.PL