vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=262)
-   -   How can I add 'unfollow' button to the 'my following' page (https://vborg.vbsupport.ru/showthread.php?t=319571)

IncWolf 07-20-2015 11:50 AM

How can I add 'unfollow' button to the 'my following' page
 
Hello, everyone.
I'm a novice PHP-developer and recently I started to work with vBulletin 5. My task is to create 'unfollow' button in the 'my following' tab and I didn't find any other solution, as to copy the same button from the 'conversationdisplay' widget. And it isn't work correctly. Can u just help me to understand, how to create new functionals on the page?
So, my goal: make button on the 'my following' page. When is clicked, it must to unfollow me from theme. For that:
1) I placed that button to the 'my following' tab:

Code:

<button type="button" data-node-id="{vb:raw conversation.parentid}" data-owner-id="{vb:raw user.userid}" class="is-topic custom button follow-btn uppercase h-left<vb:if condition="$isSubscribed"> isSubscribed unfollow-btn</vb:if>"><vb:if condition="$isSubscribed"><span class="button-icon"></span></vb:if></button>
I thought, that it will be enough just to add:

Code:

{vb:js js/conversation-rollup.js}
for adding ajax query that will use "delete"-method of the "Follow" class, like it is doing at the 'conversationdisplay' widget, but I misunderstood something.

So, what I need, just to understand how can I use delete-method from Follow class in my code and how can I attach that to the button. I only used {vb:data} for that kind of calls, but it is not suitable for me in that situation.

For now, I just have the button that can work correctly only after I subscribe to the channel.


All times are GMT. The time now is 01:43 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01007 seconds
  • Memory Usage 1,707KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete