Dodanie zmiennymi tekst do headerinclude

Założony przez  hasmen.

Jak mogę zmienić takowy kod na taki aby nie wyskakiwał mi błąd składni

Cytat:Błąd SQL
MyBB napotkało wewnętrzny błąd w zapytaniu SQL i nie może kontynuować.

Błąd SQL:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$loginModal input[name=\"url\"]').attr(\"value\", window.location); $('a[na' at line 3
Zapytanie:
INSERT INTO mybb_templates (tid,title,template,sid) VALUES ('NULL','rek_js',' ','-1')

$rek_jss '<script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js\" type=\"text/javascript\"></script>
<script type=\"text/javascript\">

jQuery.noConflict();

jQuery(document).ready(function($)
{

    $(\'$loginModal input[name=\"url\"]\').attr(\"value\", window.location);

    $(\'a[name=\"modal\"]\').on(\'click\', function(event)
    {
        event.preventDefault();
        
        var target = $(this).attr(\'rel\');
        
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();
        $(\'#mask\').css({\'width\': maskWidth, \'height\': maskHeight});
        $(\'#mask\').fadeIn(1000);    
        $(\'#mask\').fadeTo(\"slow\", 0.8);  
        
        var winH = $(window).height();
        var winW = $(window).width();
        $(target).css(\'top\',  (winH / 2) - ($(target).height() / 2));
        $(target).css(\'left\', (winW / 2) - ($(target).width() / 2));
        $(target).fadeIn(2000); 
    });
    
    $(\'.modalBox a[rel=\"closeModal\"]\').on(\'click\', function(event)
    {
        event.preventDefault();
        $(\'#mask, .modalBox\').hide();
    }); 
    
    $(\'#mask\').on(\'click\', function ()
    {
        $(this).hide();
        $(\'.modalBox\').hide();
    }); 
});
</script>'
;
    
    
$rek_js = array(
        
"tid" => "NULL",
        
"title" => "rek_js",
        
"template" => "$rek_jss",
        
"sid" => "-1",
        ); 

Próbowałem zrobić takie coś:

\'tekst\'
\"tekst\"
oraz bez \ i nic, dalej to samo, albo jakieś błędy typu ze znaleziono symbol $



Dodane te \'test\' gdyż wyskakiwały mi błędy w podstronie z pluginami.
Błąd jest w tym zapytaniu:
INSERT INTO mybb_templates (`tid`,`title`,`template`,`sid`) VALUES ('NULL','rek_js',' ','-1'

Czy Ty tworzysz nowy szablon?? Jeśli tak to powinno wyglądać tak:
$db->write_query("INSERT INTO `".TABLE_PREFIX."templates` VALUES (NULL, 'nazwa_szablonu', '".$db->escape_string($rek_jss)."', '-1', '1', '', '".time()."')"); 
Dobrze, zadziałało ale teraz wogóle mi nie działa ten skrypt, czemu? gdyż jest

<script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js\" type=\"text/javascript\"></script>
<script type=\"text/javascript\">

jQuery.noConflict();

jQuery(document).ready(function($)
{

    $(\'
$loginModal input[name=\"url\"]\').attr(\"value\", window.location);

    $(\'a[name=\"modal\"]\').on(\'click\', function(event)
    {
        event.preventDefault();
        
        var target = $(this).attr(\'rel\');
        
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();
        $(\'#mask\').css({\'width\': maskWidth, \'height\': maskHeight});
        $(\'#mask\').fadeIn(1000);    
        $(\'#mask\').fadeTo(\"slow\", 0.8);  
        
        var winH = $(window).height();
        var winW = $(window).width();
        $(target).css(\'top\',  (winH / 2) - ($(target).height() / 2));
        $(target).css(\'left\', (winW / 2) - ($(target).width() / 2));
        $(target).fadeIn(2000); 
    });
    
    $(\'.modalBox a[rel=\"closeModal\"]\').on(\'click\', function(event)
    {
        event.preventDefault();
        $(\'#mask, .modalBox\').hide();
    }); 
    
    $(\'#mask\').on(\'click\', function ()
    {
        $(this).hide();
        $(\'.modalBox\').hide();
    }); 
});
</script> 

Jest dużo nie potrzebnych \'tekst\', tylko jeżeli takie coś zmienie na 'tekst' odrazu dostaje błedy typu

Parse error: syntax error, unexpected T_VARIABLE in /home/hasciq/public_html/inc/plugins/rek_sms.php on line 47
Zamiast
'
na początku tego skryptu w pluginie daj
"
pousuwaj te wszystkie \ przed ' i dodaj je przed "



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

1 gości