IncWolf
07-20-2015, 11:50 AM
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:
<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:
{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.
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:
<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:
{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.