簡體   English   中英

Joomla 2.5插件在文章中包含組件和Direct PHP沖突

[英]Joomla 2.5 Plugin Include Component and Direct PHP conflict in articles

因此,我正在使用Plugin Include Component和Direct PHP插件構建一個Joomla 2.5站點。 我正在嘗試在文章視圖中執行以下操作:

    $lstart = $_GET['lstart'];
    $limitstart = $_GET['limitstart'];

    if($lstart == 1) { ?>
       {component url='index.php?option=com_content&view=category&layout=blog&id=15&news_check=1&limitstart=4'}
    <?php } else { ?>
       {component url='index.php?option=com_content&view=category&layout=blog&id=15&news_check=1&limitstart=0'}
    <?php } ?>

我收到以下錯誤:

    Parse error: syntax error, unexpected $end in /nfs/c06/h06/mnt/157252/domains/bigideaadv.com/html/wright_specialty2_OLD/plugins/content/DirectPHP/DirectPHP.php(56) : eval()'d code on line 4

我不能混合使用Plugin Include Component和Direct PHP代碼嗎?

任何幫助,將不勝感激。

如果此PHP是精確副本,那么問題可能出在第一個echo語句中,該語句具有一個額外的單引號,即'',右括號之前。

因此,如果$limitstart = 10 ,則第一個echo將產生:

{component url='index.php?option=com_content&view=category&layout=blog&id=15&news_check=1&limitstart='10''}

這可能會導致“包含組件”插件出現問題。 他們應該能夠一起運行,唯一的保證就是在訂購其他插件之前,先訂購Direct PHP插件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM