BeZrespeKTA Posted March 27, 2013 Report Share Posted March 27, 2013 Помогите, пожалуйста, подключить комментарии Вконтакте. Страничка с кодом: http://vk.com/developers.php?p=Comments Никак не получается, вылеют ошибки.... Quote Link to post Share on other sites
koteyka Posted March 27, 2013 Report Share Posted March 27, 2013 Как вставляете? Куда вставляете? Какие ошибки?Больше информации, уважаемый. Quote Link to post Share on other sites
Rash Posted March 27, 2013 Report Share Posted March 27, 2013 это в head <!-- Put this script tag to the <head> of your page --> <script type="text/javascript" src="//vk.com/js/api/openapi.js?86"></script>остальную часть там где нужно <script type="text/javascript"> VK.init({apiId: API_ID, onlyWidgets: true}); </script> {literal} <!-- Put this div tag to the place, where the Comments block will be --> <div id="vk_comments"></div> <script type="text/javascript"> VK.Widgets.Comments("vk_comments", {limit: 10, width: "496", attach: "*"}); </script> {/literal} Quote Link to post Share on other sites
filth Posted March 27, 2013 Report Share Posted March 27, 2013 Я недавно себе подключил, нормально стало, страннопопробуйте так {literal} <script type="text/javascript"> VK.init({apiId: API_ID, onlyWidgets: true}); </script> {literal} <!-- Put this div tag to the place, where the Comments block will be --> <div id="vk_comments"></div> <script type="text/javascript"> VK.Widgets.Comments("vk_comments", {limit: 10, width: "496", attach: "*"}); </script> {/literal} {literal} ставим перед <script> Quote Link to post Share on other sites
maksam07 Posted March 27, 2013 Report Share Posted March 27, 2013 Сначало создай приложение а потом в виджете подключи егои вместо этогоapiId: API_IDдолжно бытьapiId: ид твоего приложенияhttps://vk.com/editapp?act=createВеб-сайт Quote Link to post Share on other sites
BeZrespeKTA Posted March 31, 2013 Author Report Share Posted March 31, 2013 Версия 2.1.5Шаблон product.tplВ самом верху прописывал: <!-- Put this script tag to the <head> of your page --><script type="text/javascript" src="//vk.com/js/api/openapi.js?86"></script>Дальше в шаблоне перед "Комментарии" вставлял остальное.(id естественно создал и вставил изначально). Пробовал как на сайте, пробовал через literal вставить, один фик вылезает целая куча ошибок вида:Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "W:\home\shop.ws\www\simpla//design/default_1/html\product.tpl" on line 8 "VK.init({apiId: 3*****9, onlyWidgets: true});" - Unexpected ": ", expected one of: "}" , " "' in W:\home\shop.ws\www\simpla\Smarty\libs\sysplugins\smarty_internal_templatecompilerbase.php:431 Stack trace: #0 W:\home\shop.ws\www\simpla\Smarty\libs\sysplugins\smarty_internal_templateparser.php(2855): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 W:\home\shop.ws\www\simpla\Smarty\libs\sysplugins\smarty_internal_templateparser.php(2920): Smarty_Internal_Templateparser->yy_syntax_error(2, ': ') #2 W:\home\shop.ws\www\simpla\Smarty\libs\sysplugins\smarty_internal_smartytemplatecompiler.php(51): Smarty_Internal_Templateparser->doParse(2, ': ') #3 W:\home\shop.ws\www\simpla\Smarty\libs\sysplugins\smarty_internal_templatecompilerbase.php(82): Smarty_Internal_SmartyTemplateCompiler->doCompile('{* ????????????...') #4 W:\home\shop.ws\www\simp in W:\home\shop.ws\www\simpla\Smarty\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 431 Quote Link to post Share on other sites
maksam07 Posted March 31, 2013 Report Share Posted March 31, 2013 BeZrespeKTA оберни в {literal}{literal}код вк{/literal} Quote Link to post Share on other sites
BeZrespeKTA Posted March 31, 2013 Author Report Share Posted March 31, 2013 пробовал, такая же фигня Quote Link to post Share on other sites
RodgerFox Posted March 31, 2013 Report Share Posted March 31, 2013 Что вы пробовали? Вы знаете что делает - {literal} ? Вы понимаете, что любой виджет от ВК делится на 2 части, подключаемый скрипт и вывод его на сайте? Вы понимаете, что такое личный идентификатор и зачем он нужен, от ВК? подключаем АПИ от вк, дальше идетификатор и подключаемый модуль, дальше блок где будет через айфрейм работать подключаемый модуль. В результате все делится на 2 части и осмысление, зачем нужен {literal}. Вы просто не внимательный. Пробуйте заново. Quote Link to post Share on other sites
BeZrespeKTA Posted March 31, 2013 Author Report Share Posted March 31, 2013 Лучше было бы не тратить время на такой длинный пост, а просто сказать еще раз точно какой код и куда конкретно вставить в product.tpl Не знаю внимательный или нет, но я пробовал и без этого и с ним.*я про literal Quote Link to post Share on other sites
maksam07 Posted March 31, 2013 Report Share Posted March 31, 2013 тебе проще скинуть сюда код вк Quote Link to post Share on other sites
BeZrespeKTA Posted March 31, 2013 Author Report Share Posted March 31, 2013 Так код одинаковый для любого сайта ( http://vk.com/developers.php?p=Comments ) , разница только в api_id и все... Quote Link to post Share on other sites
RodgerFox Posted March 31, 2013 Report Share Posted March 31, 2013 BeZrespeKTA, так какой смысл что вы пробовали, если не работает. Тут понимать нужно что делает этот тег, тогда и все получится. Вы попросили помощи, я помогаю вам разобраться. Quote Link to post Share on other sites
BeZrespeKTA Posted March 31, 2013 Author Report Share Posted March 31, 2013 Все, разобрался. тема закрыта. Парни чуть ошиблись и я тупо пропустил сначала Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.