vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   If condition question (https://vborg.vbsupport.ru/showthread.php?t=213563)

Ogmuk 05-13-2009 05:25 AM

If condition question
 
Hi,

Is there any way to check inside postbit_legacy whether the thread is posted in a private forum? In SHOWTHREAD I'm using <if condition="$bookmarksites"> and I'm looking for something similar.

Lynne 05-13-2009 02:51 PM

If you are wanting to check for a particular private forum, you could just check the forumid:
HTML Code:

<if condition="$foruminfo['forumid'] == 'x'">
stuff
</if>

Or several forums:
HTML Code:

<if condition="in_array($foruminfo['forumid'], array(x,y,z))">
stuff
</if>


Ogmuk 05-13-2009 03:27 PM

Ok, but that doesn't check whether the forum is viewable to the public like $bookmarksites does. So no condition is possible but this manual work-around?

Lynne 05-13-2009 03:31 PM

I think you will have to look into what is done with the 'options' column in the query for the forum. I'm sure that splits up into permissions and your answer most likely lies in there. I don't have a short answer for you because I've never looked into what you are trying to do.

Ogmuk 05-13-2009 06:03 PM

I'm pretty much trying to add a tiny bookmarks button per post but only for posts which are accessible to the public. hence the reference to <if condition="$bookmarksites"> :)

Lynne 05-13-2009 06:33 PM

I don't think there is going to be an easy way for you to do this. What you need to do is determine the forum permission for a guest for that forum. You can look in the showthread.php page for the variable bf_ugp_forumpermissions that is used and perhaps you can find out how to get what you want from tracing that variable. (You also will have to figure out which permissions you are looking at - canview? canviewothers? canviewthreads?)

ProSkinner.com 05-14-2009 06:22 AM

If you only want to show the social bookmarking submit button to guests, use this conditional:

<if condition="$show['guest']">

<!-- social bookmarking code goes here -->

</if>


All times are GMT. The time now is 10:27 AM.

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.01061 seconds
  • Memory Usage 1,718KB
  • 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_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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