• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
CTA Featured Threads User Preferences

Unmaintained CTA Featured Threads User Preferences 1.1.0

No permission to download
Compatible XF 1.x versions
1.2, 1.3, 1.4, 1.5
Additional requirements
This add-on requires CTA Featured Threads.
http://xenforo.com/community/resources/cta-featured-threads.2599/
This add-on is not affiliated with XenForo Ltd.

This guide will explain how to create custom user fields which will enable your users to remove the featured thread blocks from the forum list, forum view and new/recent posts pages.

Once completed they will have three additional check boxes on their account/preferences page, like so:


The attached file is for the automatic template modifications only.
The custom user fields must still be created manually as they cannot be attached to add-ons.



Custom User Fields
The first step is to create the custom user fields.
Rather than type it all out, I have attached screen shots which show what must be entered for each one.

You can edit the text to suit but you must keep the Field ID exactly as shown.
Failure to do so will render the check boxes inoperative.

Forum List
forum-list-01.png forum-list-02.png forum-list-03.png

Forum View
forum-view-01.png forum-view-02.png forum-view-03.png

New / Recent Posts
new-recent-01.png new-recent-02.png new-recent-03.png


Templates
The next step is to edit the templates.
There are three ways of doing so, which are explained below:
  1. Installing the attached add-on
  2. Manually editing the templates
  3. Creating template modifications
1. Installing the attached add-on
Simply download and unzip the attached file and then install it like a regular add-on.

2. Manually editing the templates
The three templates you need to edit are:
  • cta_featuredthreads_forum_list
  • cta_featuredthreads_forum_view
  • cta_featuredthreads_find_new_wrapper
Essentially you just wrap the relevant code in a conditional statement related to the custom user field.

cta_featuredthreads_forum_list
Code:
<xen:if is="!{$visitor.customFields.CtaFtForumList}">
    Template code to hide when checkbox is checked.
</xen:if>
cta_featuredthreads_forum_view
Code:
<xen:if is="!{$visitor.customFields.CtaFtForumView}">
    Template code to hide when checkbox is checked.
</xen:if>
cta_featuredthreads_find_new_wrapper
Code:
<xen:if is="!{$visitor.customFields.CtaFtNewRecent}">
    Template code to hide when checkbox is checked.
</xen:if>
3. Creating template modifications
In order to do this you must have debug mode enabled.
Once that is done, you must create three separate template modifications.

The find code for each one is the current template contents.
The replace code for each one is the current template contents wrapped in the corresponding custom user field conditional statement, as above.

forum-list-04.png forum-view-04.png new-recent-04.png
Related resources
Author
Brogan
Downloads
33
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Brogan

Latest updates

  1. Updated template modifications

    The template modifications have been updated to work with FT 2.11 and later.