Tytuł w kontakcie

Założony przez  Poftorek.

Tytuł użytkownika jest dodawany tylko dla ID 1 i userów, którym zmienię tytuł.
<?php


define
("IN_MYBB"1);

$plugins->add_hook('index_start''firstf');

function 
firstf_info() {



    return array(
        
"name"            =>    "Kontakt w panelu bocznym",
        
"description"    =>    "Dodaje przyjemną tabelę kontaktu do panelu bocznego.",
        
"website"        =>    "https://webboard.pl/",
        
"author"        =>    "Poftorek",
        
"authorsite"    =>    "https://webboard.pl/",
        
"version"        =>    "1.2",
        
"compatibility" =>  "18*"
    
);
}

function 
firstf_activate() {
    global 
$db$mybb;
    
    
//nazwa firstfu w zakladce firstfow
    
$firstf_group_settings = array(
        
"gid"               => NULL,
        
"name"              => "firstf_option_category",
        
"title"             => "Kontakt w panelu bocznym",
        
"description"       => "Skonfiguruj swój panel kontaktu.",
        
"disporder"         => "50",
        
"isdefault"         => "no"
                        
);
    
$db->insert_query("settinggroups"$firstf_group_settings);
    
    
$gid $db->insert_id();
    
    
// Włącz/Wyłącz
    
$option_1 = array(
        
"sid"               => NULL,
        
"name"              => "firstf_enabled",
        
"title"             => "Włączyć/Wyłączyć wtyczkę?",
        
"description"       => "Włącz lub wyłącz kontakt w panelu bocznym.",
        
"optionscode"       => "yesno",
        
"value"             => "yes",
        
"isdefault"         => "yes",
        
"disporder"         => "1",
        
"gid"               => intval($gid)
                        );
                        
    
// Nazwa panelu kontaktu
    
$option_2 = array(
        
"sid"               => NULL,
        
"name"              => "nazwa_kontaktu",
        
"title"             => "Nazwa panelu kontaktu",
        
"description"       => "Wpisz nazwą swojego panelu kontaktu.",
        
"optionscode"       => "text",
        
"value"             => 'Kontakt',
        
"isdefault"         => "yes",
        
"disporder"         => "2",
        
"gid"               => intval($gid)
                        );
                        
                        
                        
                        
// ID pierwszego administratora
    
$option_3 = array(
        
"sid"               => NULL,
        
"name"              => "firstf_nwm2",
        
"title"             => "ID użytkownika i numer GG",
        
"description"       => "Wzór: <b>ID_użytkownika Numer_GG</b> - Jeśli jest więcej niż 1, na końcu umieść przecinek: <b>ID_Użytkownika Numer_GG,</b>",
        
"optionscode"       => "textarea",
        
"value"             => '1',
        
"isdefault"         => "yes",
        
"disporder"         => "3",
        
"gid"               => intval($gid)
                        );
            
                        
                        
                        
                
                        

    
$db->insert_query("settings"$option_1);
    
$db->insert_query("settings"$option_2);
    
$db->insert_query("settings"$option_3);
    
$db->insert_query("settings"$option_6);


    
                           
    require 
MYBB_ROOT."/inc/adminfunctions_templates.php";
    
}

function 
firstf_deactivate() {

    global 
$db$mybb;
    
    
$db->delete_query('settinggroups''name = "firstf_option_category"');
    
$db->delete_query('settings''name IN("firstf_enabled, firstf_nwm, firstf_nwm2, firstf_nwm5, firstf_nwm6")');

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

function 
firstf()
{
    global 
$mybb$firstf;

    
$firstf '<table border="0" cellspacing="0" cellpadding="5" class="tborder">
    <tbody><tr><td class="thead">'
.$mybb->settings['firstf_nwm'].'</td></tr>';

$DaneAdminow explode(","$mybb->settings['firstf_nwm2']);

    foreach(
$DaneAdminow as $DaneAdmina)
    {
        
$Admin explode(" "$DaneAdmina);

        
$user get_user($Admin[0]);
        
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
        
$user['profilelink'] = build_profile_link($user['username'], $user['uid']);
        
$user['usertitle'] = $user['usertitle'];

        
$firstf .= '<tr><td class="trow1"><center><span style="font-size:18px;">'.$user['profilelink'].'</span>
        <br />'
.$user['usertitle'].'    
    <div class="gg"><a href="gg:'
.$Admin[1].'">
    <img src="http://status.gadu-gadu.pl/users/status.asp?id='
.$Admin[1].'&amp;styl=3" style="height: 32px; width:143;"></a></div><br>
    </center></td>
    </tr>'
;
    }


    
$firstf .= '</tbody></table>';
}    
?>

Jeśli się komuś chce to proszę o posta, na razie zamieniłem tytuł na numer GG.
<?php


define
("IN_MYBB"1);

$plugins->add_hook('index_start''firstf');

function 
firstf_info() {



    return array(
        
"name"            =>    "Kontakt w panelu bocznym",
        
"description"    =>    "Dodaje przyjemną tabelę kontaktu do panelu bocznego.",
        
"website"        =>    "https://webboard.pl/",
        
"author"        =>    "Poftorek",
        
"authorsite"    =>    "https://webboard.pl/",
        
"version"        =>    "1.2",
        
"compatibility" =>  "18*"
    
);
}

function 
firstf_activate() {
    global 
$db$mybb;
    
    
//nazwa firstfu w zakladce firstfow
    
$firstf_group_settings = array(
        
"gid"               => NULL,
        
"name"              => "firstf_option_category",
        
"title"             => "Kontakt w panelu bocznym",
        
"description"       => "Skonfiguruj swój panel kontaktu.",
        
"disporder"         => "50",
        
"isdefault"         => "no"
                        
);
    
$db->insert_query("settinggroups"$firstf_group_settings);
    
    
$gid $db->insert_id();
    
    
// Włącz/Wyłącz
    
$option_1 = array(
        
"sid"               => NULL,
        
"name"              => "firstf_enabled",
        
"title"             => "Włączyć/Wyłączyć wtyczkę?",
        
"description"       => "Włącz lub wyłącz kontakt w panelu bocznym.",
        
"optionscode"       => "yesno",
        
"value"             => "yes",
        
"isdefault"         => "yes",
        
"disporder"         => "1",
        
"gid"               => intval($gid)
                        );
                        
    
// Nazwa panelu kontaktu
    
$option_2 = array(
        
"sid"               => NULL,
        
"name"              => "nazwa_kontaktu",
        
"title"             => "Nazwa panelu kontaktu",
        
"description"       => "Wpisz nazwą swojego panelu kontaktu.",
        
"optionscode"       => "text",
        
"value"             => 'Kontakt',
        
"isdefault"         => "yes",
        
"disporder"         => "2",
        
"gid"               => intval($gid)
                        );
                        
                        
                        
                        
// ID pierwszego administratora
    
$option_3 = array(
        
"sid"               => NULL,
        
"name"              => "firstf_nwm2",
        
"title"             => "ID użytkownika i numer GG",
        
"description"       => "Wzór: <b>ID_użytkownika Numer_GG</b> - Jeśli jest więcej niż 1, na końcu umieść przecinek: <b>ID_Użytkownika Numer_GG,</b>",
        
"optionscode"       => "textarea",
        
"value"             => '1',
        
"isdefault"         => "yes",
        
"disporder"         => "3",
        
"gid"               => intval($gid)
                        );
            
                        
                        
                        
                
                        

    
$db->insert_query("settings"$option_1);
    
$db->insert_query("settings"$option_2);
    
$db->insert_query("settings"$option_3);
    
$db->insert_query("settings"$option_6);


    
                           
    require 
MYBB_ROOT."/inc/adminfunctions_templates.php";
    
}

function 
firstf_deactivate() {

    global 
$db$mybb;
    
    
$db->delete_query('settinggroups''name = "firstf_option_category"');
    
$db->delete_query('settings''name IN("firstf_enabled, firstf_nwm, firstf_nwm2, firstf_nwm5, firstf_nwm6")');

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

function 
firstf()
{
    global 
$mybb$firstf;

    
$firstf '<table border="0" cellspacing="0" cellpadding="5" class="tborder">
    <tbody><tr><td class="thead">'
.$mybb->settings['firstf_nwm'].'</td></tr>';

$DaneAdminow explode(","$mybb->settings['firstf_nwm2']);

    foreach(
$DaneAdminow as $DaneAdmina)
    {
        
$Admin explode(" "$DaneAdmina);

        
$user get_user($Admin[0]);
        
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
        
$user['profilelink'] = build_profile_link($user['username'], $user['uid']);
        
$user['usertitle'] = $user['usertitle'];

        
$firstf .= '<tr><td class="trow1"><center><span style="font-size:18px;">'.$user['profilelink'].'</span>
        <br /><span style="font-size:11px;">GG: '
.$Admin[1].'</span>
    <div class="gg"><a href="gg:'
.$Admin[1].'">
    <img src="http://status.gadu-gadu.pl/users/status.asp?id='
.$Admin[1].'&amp;styl=3" style="height: 32px; width:143;"></a></div><br>
    </center></td>
    </tr>'
;
    }


    
$firstf .= '</tbody></table>';
}    
?>
Cytat:w pół dnia stałeś się lepszym pytonistą niż kawenanowo kiedykolwiek programisto :3 ~ Riess 13.11.2018 16:28
Cytat:ale z tą nazwą to fyeem ma racje  ~ Divir 29.07.2019 16:08
musisz to wyczytac z cache grup



Użytkownicy przeglądający ten wątek:

1 gości