Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 04-06-2016, 12:27 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 04-06-2016, 02:16 PM
In Omnibus's Avatar
In Omnibus In Omnibus is offline
 
Join Date: Apr 2010
Location: Inside A Blade Server
Posts: 840
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The single forward slash on the else doesn't appear correct.

In php a single forward slash is a division operator.
Reply With Quote
  #3  
Old 04-06-2016, 02:21 PM
TheLastBatman's Avatar
TheLastBatman TheLastBatman is offline
 
Join Date: Apr 2016
Location: Gotham
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats how if else statements work in vb3

<if condition="something">
do something
<else />
do something else
</if>
Reply With Quote
Благодарность от:
Dr.CustUmz
  #4  
Old 04-06-2016, 02:44 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks fine to me. Are you sure those $show array keys are usable in the forumbit templates?
Reply With Quote
Благодарность от:
Dr.CustUmz
  #5  
Old 04-06-2016, 03:46 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Благодарность от:
MarkFL
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:09 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03958 seconds
  • Memory Usage 2,213KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (3)post_thanks_box_bit
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete