MyBB.de Forum

Normale Version: Gruppen Legende
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Seiten: 1 2 3 4 5
(15.05.2009, 00:14)Michael schrieb: [ -> ]http://mods.mybboard.net/view/usergroup-legends-1.4.3

Hallo

Ich glaub ich wurde missverstanden das plugin ansich habe ich ja schon installiert. Nur finde ich nicht die dazu bearbeitbaren dateien wie sie hier im thema erläutert werden.

Lg
Hallo Sandzange,

bearbeite hierzu das Template "Globale Template > usergroup_legend".
hallo

Und wo kommt das bitte hin ??

Code:
$query = $db->query("SELECT gid, title, namestyle FROM ".TABLE_PREFIX."usergroups WHERE gid NOT IN(X,Y,Z)");
In der usergroup legend steht nur das drin.
Code:
<tr><td class="tcat"><strong>Group Legend</strong></td></tr>
<tr><td class="trow1">{$usertitles}</td></tr>

Habs rausgefunden man brauch nur die gids der Gruppen unter Konfiguration => User group legends als zahl mit einem Komma eingeben.

Danke Trozdem für die Hilfe.

Lg
Das kommt in den PHP-Datei des Plugins.
Die Datei liegt im Order inc/plugins/.
Hallo und schönen 4. Advent,

habe mir soeben dieses Plugin eingebaut funktioniert auch nur das es bei mir an der linken Seite hochkannt ist

kann mir jemand sagen wie ich das normal hin bekomme.

Hier ganz unten zu finden

Ich danke schon mal
Das kommt daher, dass bei dem Theme in dem gesamten Bereich "Foren-Statistiken" eine zusätzliche Tabellen-Spalte für die Grafiken hinzugefügt wurde.

Du müsstest also für die korrekte Anzeige des Plugins, das ebenfalls machen oder die Anweisung colspan="2" hinzufügen (entweder in der Plugin-Datei oder im Template).

Poste doch bitte einen Link zum Plugin, dann kann ich die Stellen heraussuchen und schreibe, welche Lösung du möchtest ... zusätzliche Grafik-Spalte oder die erweiterte Version.
Hy en-gedi,
ich hab dir hier mal den Code aus dem Plugin angehangen

Die erweiterte Version kenne ich nicht.
Das beste und Optimale was würdest du empfehlen.
http://www.deutschland-basis.de/index.php
ganz unten auf der seite

PHP-Code:
<?php
/**
 *    Copyright © 2006-2008 CraKteR, crakter [at] gmail [dot] com
 *
 *    This program is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *    @version $Id: usergrouplegends.php 35 2008-08-14 19:14:12Z CraKteR $
 *    @copyright $LastChangedDate: 2008-08-14 21:14:12 +0200 (to, 14 aug 2008) $
 *    @author CraKteR <crakter@gmail.com>
 */

if(!defined("IN_MYBB"))
{
    die(
"This file cannot be accessed directly.");
}

$plugins->add_hook("index_start""do_legend");

function 
usergrouplegends_info()
{
    return array(
        
"name"                => "Usergroup legends",
        
"description"        => "Shows Usergroups legends on the index.",
        
"website"            => "",
        
"author"            => "CraKteR",
        
"authorsite"        => "mailto:crakter@gmail.com",
        
"version"            => "2.0",
        
"guid"                => "d912aad6bc509657d0691d31ae8038a6",
        
"compatibility"     => "14*",
    );
}

function 
usergrouplegends_activate()
{
    global 
$db;

    
$setting_group = array(
        
"gid" =>            NULL,
        
"name" =>            "uot",
        
"title" =>            "User group legends",
        
"description" =>    "",
        
"disporder" =>        "35",
        
"isdefault" =>        "no"
    
);
    
$db->insert_query("settinggroups"$setting_group);
    
$gid $db->insert_id();

    
$s_1 = array(
        
"sid"            => NULL,
        
"name"            => "legendsdontshow",
        
"title"            => "Groups to not show",
        
"description"    => "Groups not to be shown on usersgroup legends. Seperate with \',\'.",
        
"optionscode"    => "text",
        
"value"            => "",
        
"disporder"        => "2",
        
"gid"            => intval($gid)
    );
    
$db->insert_query("settings"$s_1);

    
$template = array(
        
"tid"        => NULL,
        
"title"        => "usergroup_legend",
        
"template"    => "<tr><td class=\"tcat\"><strong>Group Legend</strong></td></tr>
<tr><td class=\"trow1\">{\$usertitles}</td></tr>"
,
        
"sid"        => "-1"
    
);
    
$db->insert_query("templates"$template);
    
    require 
MYBB_ROOT."/inc/adminfunctions_templates.php";
    
find_replace_templatesets("index_boardstats"'#{\$whosonline}#'"{\$whosonline}\n{\$user_legend}");
}

function 
usergrouplegends_deactivate()
{
    global 
$db;

    
$db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='usergroup_legend'");
    
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='uot'");
    
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='legendsdontshow'");

    require 
MYBB_ROOT."/inc/adminfunctions_templates.php";
    
find_replace_templatesets("index_boardstats"'#(\n?){\$user_legend}#'''0);
}

function 
do_legend()
{
    global 
$db$mybb$user_legend$templates$groupscache$cache$theme;

    if(!
is_array($groupscache))
    {
        
$groupscache $cache->read("usergroups");
    }

    
$usertitles "";
    
$dontshow explode(','$mybb->settings['legendsdontshow']);

    foreach(
$groupscache as $usertitle)
    {
        if(!
in_array($usertitle['gid'], $dontshow))
        {
            
$format $usertitle['namestyle'];
            
$userin substr_count($format"{username}");
            if(
$userin == 0)
            {
                
$format "{username}";
            }

            
$format stripslashes($format);
            
$plugincache $cache->read("plugins");
            
$usergroup str_replace("{username}"$usertitle['title'], $format);

            if(
$plugincache['active']['showgroup'])
            {
                
$usergroup "<a href=\"./groups.php?gid=".$usertitle['gid']."\">".$usergroup."</a>";
            }

            
$usertitles .= "[".$usergroup."] ";
        }
    }
    eval(
"\$user_legend = \"".$templates->get("usergroup_legend")."\";"); 
}
?>
Du musst das Template usergroup_legend bearbeiten.
Ersetze in dem von dir geposteten Code (Zeilen 71-78):

PHP-Code:
$template = array(
        
"tid"        => NULL,
        
"title"        => "usergroup_legend",
        
"template"    => "<tr><td class=\"tcat\"><strong>Group Legend</strong></td></tr>
<tr><td class=\"trow1\">{\$usertitles}</td></tr>"
,
        
"sid"        => "-1"
    
);
    
$db->insert_query("templates"$template); 

durch:

PHP-Code:
$template = array(
        
"tid"        => NULL,
        
"title"        => "usergroup_legend",
        
"template"    => "<tr><td class=\"tcat\" colspan=\"2\"><strong>Group Legend</strong></td></tr>
<tr>
<td width=\"35\" class=\"trow1\"><img src=\"{\$theme[\'imgdir\']}/index_legend.gif\" border=\"0\" alt=\"\" /></td>
<td class=\"trow1\">{\$usertitles}</td>
</tr>"
,
        
"sid"        => "-1"
    
);
    
$db->insert_query("templates"$template); 

Du musst dann nur noch eine passende Grafik mit dem Namen index_legend.gif in das images-Verzeichnis deines Themes hochladen.

Dann das Plugin de- und gleich wieder aktivieren, dann sollte alles stimmen.
Seiten: 1 2 3 4 5