PDA

View Full Version : whats wrong with my if subscribed condition


Dr.CustUmz
04-06-2016, 12:27 PM
whats wrong with this its not working =/

ive looked it over 10+ times
<if condition="$show['member']">
<if condition="$show['forumsubscription']">
<li class="forumactionlink unsubslink">
<a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]" rel="nofollow" title="$vbphrase[unsubscribe_from_this_forum]">$vbphrase[unsubscribe_from_this_forum]</a>
</li>
<else />
<li class="forumactionlink subslink">
<a href="subscription.php?$session[sessionurl]do=addsubscription&amp;f=$forum[forumid]" rel="nofollow" title="$vbphrase[subscribe_to_forum]">$vbphrase[subscribe_to_forum]</a>
</li>
</if>
</if>

trying to use it on forumbit lvl 2 post

In Omnibus
04-06-2016, 02:16 PM
The single forward slash on the else doesn't appear correct.

In php a single forward slash is a division operator.

TheLastBatman
04-06-2016, 02:21 PM
Thats how if else statements work in vb3

<if condition="something">
do something
<else />
do something else
</if>

Dave
04-06-2016, 02:44 PM
Looks fine to me. Are you sure those $show array keys are usable in the forumbit templates?

Dr.CustUmz
04-06-2016, 03:46 PM
<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]" rel="nofollow">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>

is in the template by default, even without the member condition it still doesn't function =/

and i haven't found an option for subscriptions anywhere... i may have overlooked it

--------------- Added 1459967670 at 1459967670 ---------------

after searching a crap ton of different things, i finally came across this

http://tracker.vbulletin.com/browse/VBIV-8931
Create a subforum.
Go to it's parent forum.
Note that there is a green checkmark icon in the forum bit (see screenshot 1)
Click on this to subscribe to the forum
Return to parent forum
Note that there is still a green checkmark icon inviting you to subscribe to the forum.

The initial issue is caused by a flag that does not appear to be set correctly in the forum generation code
around line 453 of functions_forumlist.php change
$show['forumsubscription'] = ($subsonly ? true : false);
to
$show['forumsubscription'] = !empty($forum['subscribeforumid']);

This will expose some additional problems (see screenshot 2)
There is a fairly unattractive unsubscribe link next to the forum title. There is also supposed to be an unsubscribe to replace the subscribe link with the action icons (under the rss icon in the screenshot). The link is actually present, however the background image – images/misc/unsubscribed_40b.png – doesn't exist.

Recommend creating the image and removing the text link.

no it wasnt issued as a bug for vb3 but I said ok ill give it a shot since it was exactly my issue

so i first double checked my code in forumbit lvl 1 & lvl 2 post (since thats where the if condition im trying to get to work is)

I open up functions forumlist.php

quick search for
$show['forumsubscription']

change the line to
$show['forumsubscription'] = !empty($forum['subscribeforumid']);

and presto it now works =)

so this is an issue that needs to be addressed in an update i take it, since i am on the latest vb3 and this problem is still here.

why have a default template conditional if the code doesnt even function properly...

--------------- Added 1459968612 at 1459968612 ---------------

looking into it further, this only fixed forumdisplay. forumhome still is not functioning properly, this has also caused other issues that may or may not be my template messing it up lol.

but the default code in lvl1 & lvl 2 post i have not yet found any other way to make it actually show the unsubscribe if subscribed.

--------------- Added 1459971413 at 1459971413 ---------------

ok the other errors were in my templates, but the fix for this only applies to forumdisplay, im going through files now to see i can get it to work on forumhome. ....its supposed to, by default... so it shouldnt be too hard... right?

its just bugging me now lol