【问题标题】:PHP Tubepress pro with Smarty, plugin issue带有 Smarty 的 PHP Tubepress pro,插件问题
【发布时间】:2012-03-09 04:33:19
【问题描述】:

我需要一个带有 embed 的 Youtube 缩略图列表。我已经有了 Tubepress,我正在尝试将它与 Prestashop 的 Smarty 模板集成,但出了点问题。

我在 tpl 中有一个已初始化且正确的变量:

{$searchvideo = $product->name|escape:'htmlall':'UTF-8'} 
{searchvid} 

$searchvideo 是产品名称的字符串。 searchvid 是从function.searchvid.php 进入 Prestashop 的 plugins 目录。

function.searchvid.php:

<?php 
function smarty_function_searchvid($params, $template) { 
$tubepress_base_url = "http://domain.com/folder/tubepress_pro_2_2_9"; 
include "/home/folder/www/tubepress_pro_2_2_9/sys/classes/TubePressPro.class.php"; 
$searchvideo = $template->getTemplateVars("searchvideo"); 
print TubePressPro::getHtmlForHead(true); 
print TubePressPro::getHtmlForShortcode('mode="tag" tagValue="intitle:'. $searchvideo .'" thumbHeight="100" thumbWidth="100" embeddedHeight="325" embeddedWidth="534" embeddableOnly="true" resultsPerPage="5"'); 
} 
?>

问题是,即使在我调用{searchvid} 之后,页面也没有加载任何内容。任何帮助将不胜感激。

【问题讨论】:

    标签: php plugins smarty tubepress


    【解决方案1】:

    插件函数应该返回它的字符串,而不是打印它。你试过吗?那个tubepress类甚至可以正确加载吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多