Subscribe buttons and subscribed forums on index.

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
Asusak
Registered User
Posts: 3
Joined: Thu Aug 24, 2017 11:21 am

Subscribe buttons and subscribed forums on index.

Post by Asusak » Thu Aug 24, 2017 11:54 am

Hello all,
Sorry I am new here and just started with phpBB. I need someone to help me with little extension:
  1. Add subscribe button to index on every forum.
  2. Add to index user subscribed forums (something like in User Control Panel - Manage subscriptions)
I started with first 1:
Template file - forumlist_body_subforums_after :

Code: Select all

<li data-last-responsive="true">
<a href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="toggle_link" data-toggle-class="icon <!-- IF S_WATCHING_FORUM -->fa-check-square-o<!-- ELSE -->fa-square-o<!-- ENDIF --> fa-fw" data-toggle-text="{S_WATCH_FORUM_TOGGLE}" data-toggle-url="{U_WATCH_FORUM_TOGGLE}">
<i class="icon <!-- IF S_WATCHING_FORUM -->fa-square-o<!-- ELSE -->fa-check-square-o<!-- ENDIF --> fa-fw" aria-hidden="true"></i><span>{S_WATCH_FORUM_TITLE}</span>
</a>
</li>
Main listener file inspirated from vievforum.php:

Code: Select all

	public function display_forums_modify_template_vars($event)
	{
	 /**
	 * Wath topic link
	 */
	 // Forum rules and subscription info
$s_watching_forum = array(
	'link'			=> '',
	'link_toggle'	=> '',
	'title'			=> '',
	'title_toggle'	=> '',
	'is_watching'	=> false,
);	 
	$this->template->assign_vars(array(
				'U_WATCH_FORUM_LINK'	=> $s_watching_forum['link'],
				'U_WATCH_FORUM_TOGGLE'	=> $s_watching_forum['link_toggle'],
				'S_WATCH_FORUM_TITLE'	=> $s_watching_forum['title'],
				'S_WATCH_FORUM_TOGGLE'	=> $s_watching_forum['title_toggle'],
				'S_WATCHING_FORUM'		=> $s_watching_forum['is_watching'],
		));
		
	}
But it doesn't work, URL is not generated and only icon appears. I don't know how to move to step 2 = subscribed forums on index.

Sorry again, I am not programmer, just trying to create something :D. Thanks for help.

Asusak
Registered User
Posts: 3
Joined: Thu Aug 24, 2017 11:21 am

Re: Subscribe buttons and subscribed forums on index.

Post by Asusak » Sun Sep 03, 2017 3:24 pm

Bump :(

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests

cron