vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Add prefix conditional to line of code (https://vborg.vbsupport.ru/showthread.php?t=293413)

SBlueman 12-29-2012 09:40 PM

Add prefix conditional to line of code
 
Quote:

// Set if only Sticky threads are shown
$stickysql = ($instance['options'][$cfg_type . '_sticky'] ? "AND thread.sticky = 1 " : '');
Is it possible to make this line of code call up threads that are sticky AND with a specific prefix ID?

kh99 12-29-2012 10:12 PM

I think you could just add "AND thread.prefixid = 'id' ".

SBlueman 12-30-2012 03:35 AM

Thank you for your reply. Just in the sake of being thorough, where would I put that code exactly? Like so?
Quote:

// Set if only Sticky threads are shown
$stickysql = ($instance['options'][$cfg_type . '_sticky'] ? "AND thread.sticky = 1 " : '' "AND thread.prefixid = 'id' ".);

kh99 12-30-2012 11:18 AM

Well, that line of code adds a check for stick or not depending on the value of an option. So I'm not sure if you always want to check the prefix, or only if you're also checking for sticky. In the first case, you could do this:
Code:

// Set if only Sticky threads are shown
$stickysql = ($instance['options'][$cfg_type . '_sticky'] ? "AND thread.sticky = 1 " : '');
$stickysql .= " AND thread.prefixid = 'id' ";


or if you only want to check the prefix if it's also sticky, do this:
Code:

// Set if only Sticky threads are shown
$stickysql = ($instance['options'][$cfg_type . '_sticky'] ? "AND thread.sticky = 1 AND thread.prefixid = 'id' " : '');


SBlueman 12-30-2012 11:28 PM

Thank you so much, I'll know if this works once I can fix a big with DBTech's Pro Slider modification.


All times are GMT. The time now is 04:32 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.01626 seconds
  • Memory Usage 1,717KB
  • 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_code_printable
  • (2)bbcode_quote_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