Jump to content
View in the app

A better way to browse. Learn more.

IPBMafia.ru - поддержка Invision Community, релизы, темы, плагины и приложения

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Сломалась функция "отписаться от рассылок"

Featured Replies

Posted

Возможно давно, не обращал внимания, пока пользователи не начали жаловаться. Подписаться на тему могут, а отписаться нет. Один из пользователей прислал ошибку в js, но что дальше делать мне, к сожалению, не понятно :(

[20.05.2015 9:23:51] JavaScript - http://roads.ru/foru...c=20580&page=57
Unknown thread
Uncaught exception: ReferenceError: Undefined variable: FAVE_TEMPLATE
Error thrown at line 124, column 189 in <anonymous function>(value, index) in http://roads.ru/foru...a55e227053&g=js:
throw $break;
called from line 116, column 290 in each(iterator, context) in http://roads.ru/foru...a55e227053&g=js:
this._each(iterator,context);
called from line 124, column 45 in detect(iterator, context) in http://roads.ru/foru...a55e227053&g=js:
this.each(function(value,index){if(iterator.call(context,value,index,this)){result=value;throw $break;}},this);
called from line 43, column 32 in <anonymous function: initialize>(e) in http://roads.ru/foru.../js/ips.like.js:
var target=ipb.delegate.store.find(function(item){elem=e.findElement(item['selector']);if(elem){handler=item;return true;}else{return false;}});
called via Function.prototype.call() from line 732, column 215 in <anonymous function>(event) in http://roads.ru/foru...a55e227053&g=js:
Event.extend(event,element);
Error initially occurred at line 2077, column 36 in <anonymous function: dialogueUnset>(e, elem) in http://roads.ru/foru.../js/ips.like.js:
var _content=FAVE_TEMPLATE.evaluate();
called from line 2065, column 1 in <anonymous function: clicked>(e, elem) in http://roads.ru/foru.../js/ips.like.js:
ipb.like.dialogueUnset(e,elem);
called from line 45, column 66 in <anonymous function: initialize>(e) in http://roads.ru/foru.../js/ips.like.js:
handler['callback'](e,elem,handler['params']);
called via Function.prototype.call() from line 732, column 215 in <anonymous function>(event) in http://roads.ru/foru...a55e227053&g=js:
Event.extend(event,element);

  • Author

У меня этот шаблон выглядит так:

{parse js_module="like"}
<div class='__like right' data-app="{$data['app']}" data-area="{$data['area']}" data-relid="{$relId}" data-isfave="{$data['iLike']}">
	{parse template="likeSummaryContents" group="forum" params="$data, $relId, $opts"}
</div>
<script type="text/javascript">
	var FAVE_TEMPLATE = new Template( "<h3>{parse expression="sprintf( $this->lang->words['unset_fave_title'], $this->lang->words['like_ucfirst_un' . $data['vernacular'] ])"}</h3><div class='ipsPad'><span class='desc'>{parse expression="sprintf( $this->lang->words['unset_fave_words'], $this->lang->words['like_un' . $data['vernacular'] ])"}</span><br /><p class='ipsForm_center'><input type='button' value='{parse expression="sprintf( $this->lang->words['unset_button'], $this->lang->words['like_ucfirst_un' . $data['vernacular'] ])"}' class='input_submit _funset' /></p></div>");
</script>

 

У меня этот шаблон выглядит так:

{parse js_module="like"}
<div class='__like right' data-app="{$data['app']}" data-area="{$data['area']}" data-relid="{$relId}" data-isfave="{$data['iLike']}">
	{parse template="likeSummaryContents" group="forum" params="$data, $relId, $opts"}
</div>
<script type="text/javascript">
	var FAVE_TEMPLATE = new Template( "<h3>{parse expression="sprintf( $this->lang->words['unset_fave_title'], $this->lang->words['like_ucfirst_un' . $data['vernacular'] ])"}</h3><div class='ipsPad'><span class='desc'>{parse expression="sprintf( $this->lang->words['unset_fave_words'], $this->lang->words['like_un' . $data['vernacular'] ])"}</span><br /><p class='ipsForm_center'><input type='button' value='{parse expression="sprintf( $this->lang->words['unset_button'], $this->lang->words['like_ucfirst_un' . $data['vernacular'] ])"}' class='input_submit _funset' /></p></div>");
</script>

 

​В ipb минимум 3 шаблона likeSummary.

Вы привели код для подписки на темы форума, для конкретной темы ищите в группе Topic View

  • Author

Ошибка найдена и уничтожена! Спасибо одному из пользователей. В общем я немного правил под себя перевод (язык) и по невнимательности бахнул обычные кавычки. Убрал - все замечательно работает. Правда испортились цитирования теперь :( Пойду почитаю сначала форум, потом буду спрашивать.

Guest
This topic is now closed to further replies.

Последние посетители 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.