vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   whats wrong with my if subscribed condition (https://vborg.vbsupport.ru/showthread.php?t=322307)

Dr.CustUmz 04-06-2016 12:27 PM

whats wrong with my if subscribed condition
 
whats wrong with this its not working =/

ive looked it over 10+ times
Code:

<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

Code:

<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 [DATE]1459967670[/DATE] at [TIME]1459967670[/TIME] ---------------

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

http://tracker.vbulletin.com/browse/VBIV-8931
Code:

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
Code:

$show['forumsubscription']
change the line to
Code:

$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 [DATE]1459968612[/DATE] at [TIME]1459968612[/TIME] ---------------

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 [DATE]1459971413[/DATE] at [TIME]1459971413[/TIME] ---------------

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


All times are GMT. The time now is 03:54 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.01056 seconds
  • Memory Usage 1,730KB
  • 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
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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