Zmienna w html

Założony przez  Poftorek.

Dlaczego nie wywala mi błąd (Parse error: syntax error, unexpected 'plugin_nwm' (T_STRING) in /usr/home/Poftorek69/domains/poftorek69.ct8.pl/public_html/inc/plugins/plugin.php on line 95)
Cały plugin 
<?php


define
("IN_MYBB"1);

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

function 
plugin_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.0",
        
"compatibility" =>  "18*"
    
);
}

function 
plugin_activate() {
    global 
$db$mybb;
    
    
//nazwa pluginu w zakladce pluginow
    
$plugin_group_settings = array(
        
"gid"               => NULL,
        
"name"              => "plugin_option_category",
        
"title"             => "Kontakt w panelu bocznym",
        
"description"       => "Skonfiguruj swój panel kontaktu.",
        
"disporder"         => "50",
        
"isdefault"         => "no"
 
                       );
    
$db->insert_query("settinggroups"$plugin_group_settings);
    
    
$gid $db->insert_id();
    
// Włącz/Wyłącz
    
$option_1 = array(
 
       "sid"               => NULL,
 
       "name"              => "plugin_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)
                        );
                        
                        
// Miejsce na wpisanie tekstu, który się wyświetli.
    
$option_2 = array(
 
       "sid"               => NULL,
 
       "name"              => "plugin_nwm",
 
       "title"             => "Nazwa pierwszego administratora.",
 
       "description"       => "Wpisz nick właściciela forum.",
 
       "optionscode"       => "text",
 
       "value"             => 'Administrator',
        
"isdefault"         => "yes",
 
       "disporder"         => "2",
 
       "gid"               => intval($gid)
                        );
                        
                        
                        

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


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

function 
plugin_deactivate() {

    global 
$db$mybb;
    
    
$db->delete_query('settinggroups''name = "plugin_option_category"');
    
$db->delete_query('settings''name IN("plugin_enabled, plugin_nwm, ")');

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

function 
plugin() 
{
    global 
$db$mybb$templates$plugin;

    
    
        
            
$plugin '<table border="0" cellspacing="0" cellpadding="5" class="tborder"><tbody><tr><td class="thead">mybb->settings['plugin_nwm']</td></tr><tr><td class="trow1"><center>
<a href="member.php?action=profile&amp;uid=2">
<span class="wt" style="font-size: 18px;"><strong>Jajko</strong></span>
<p><span style="font-size: 11px;">Właściciel</span></p></a><p><a href="member.php?action=profile&amp;uid=2"></a></p><div class="gg"><a href="gg:60030790">
<img src="http://status.gadu-gadu.pl/users/status.asp?id=60030790&amp;styl=3" style="height: 32px; width:143;"></a></div>
<br class="clear">
<a href="member.php?action=profile&amp;uid=1">
<span class="wlasciciel" style="font-size: 18px;"><strong>Poftorek</strong></span>
<p><span style="font-size: 11px;">Właściciel</span></p></a><p><a href="member.php?action=profile&amp;uid=1"></a></p><div class="gg"><a href="gg:50524013">
<img src="http://status.gadu-gadu.pl/users/status.asp?id=50524013&amp;styl=3" style="height: 32px; width:143;"></a></div>
<br />
</center></td>
</tr>
</tbody></table>'
;
            }
        
?>

Chodzi o ten kawałek kodu (linijka 8)
function plugin() 
{
    global 
$db$mybb$templates$plugin;

    
    
        
            
$plugin '<table border="0" cellspacing="0" cellpadding="5" class="tborder"><tbody><tr><td class="thead">mybb->settings['plugin_nwm']</td></tr><tr><td class="trow1"><center>
<a href="member.php?action=profile&amp;uid=2">
<span class="wt" style="font-size: 18px;"><strong>Jajko</strong></span>
<p><span style="font-size: 11px;">Właściciel</span></p></a><p><a href="member.php?action=profile&amp;uid=2"></a></p><div class="gg"><a href="gg:60030790">
<img src="http://status.gadu-gadu.pl/users/status.asp?id=60030790&amp;styl=3" style="height: 32px; width:143;"></a></div>
<br class="clear">
<a href="member.php?action=profile&amp;uid=1">
<span class="wlasciciel" style="font-size: 18px;"><strong>Poftorek</strong></span>
<p><span style="font-size: 11px;">Właściciel</span></p></a><p><a href="member.php?action=profile&amp;uid=1"></a></p><div class="gg"><a href="gg:50524013">
<img src="http://status.gadu-gadu.pl/users/status.asp?id=50524013&amp;styl=3" style="height: 32px; width:143;"></a></div>
<br />
</center></td>
</tr>
</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
$plugin = '<table border="0" cellspacing="0" cellpadding="5" class="tborder"><tbody><tr><td class="thead">mybb->settings[\'plugin_nwm\']</td></tr><tr><td class="trow1"><center>
<a href="member.php?action=profile&amp;uid=2">
<span class="wt" style="font-size: 18px;"><strong>Jajko</strong></span>
<p><span style="font-size: 11px;">Właściciel</span></p></a><p><a href="member.php?action=profile&amp;uid=2"></a></p><div class="gg"><a href="gg:60030790">
<img src="http://status.gadu-gadu.pl/users/status.asp?id=60030790&amp;styl=3" style="height: 32px; width:143;"></a></div>
<br class="clear">
<a href="member.php?action=profile&amp;uid=1">
<span class="wlasciciel" style="font-size: 18px;"><strong>Poftorek</strong></span>
<p><span style="font-size: 11px;">Właściciel</span></p></a><p><a href="member.php?action=profile&amp;uid=1"></a></p><div class="gg"><a href="gg:50524013">
<img src="http://status.gadu-gadu.pl/users/status.asp?id=50524013&amp;styl=3" style="height: 32px; width:143;"></a></div>
<br />
</center></td>
</tr>
</tbody></table>';
}
"Try not. Do... or do not. There is no try."
Poświęć 5 minut. Nie bądź ignorantem!  -  Jak zbadać element?
Ale to zwraca MYBB->SETTINGS['PLUGIN_NWM'] zamiast Poftorek (wpisany w ustawieniach).
http://poftorek69.ct8.pl/
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
$plugin = '<table border="0" cellspacing="0" cellpadding="5" class="tborder"><tbody><tr><td class="thead">'.$mybb->settings['plugin_nwm'].'</td></tr><tr><td class="trow1"><center>
<a href="member.php?action=profile&amp;uid=2">
<span class="wt" style="font-size: 18px;"><strong>Jajko</strong></span>
<p><span style="font-size: 11px;">Właściciel</span></p></a><p><a href="member.php?action=profile&amp;uid=2"></a></p><div class="gg"><a href="gg:60030790">
<img src="http://status.gadu-gadu.pl/users/status.asp?id=60030790&amp;styl=3" style="height: 32px; width:143;"></a></div>
<br class="clear">
<a href="member.php?action=profile&amp;uid=1">
<span class="wlasciciel" style="font-size: 18px;"><strong>Poftorek</strong></span>
<p><span style="font-size: 11px;">Właściciel</span></p></a><p><a href="member.php?action=profile&amp;uid=1"></a></p><div class="gg"><a href="gg:50524013">
<img src="http://status.gadu-gadu.pl/users/status.asp?id=50524013&amp;styl=3" style="height: 32px; width:143;"></a></div>
<br />
</center></td>
</tr>
</tbody></table>';

Ciężko by pokazywało co innego jak stringa gdy wstawiasz stringa. Zmienne mają na początku "$"
"Try not. Do... or do not. There is no try."
Poświęć 5 minut. Nie bądź ignorantem!  -  Jak zbadać element?



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

1 gości