Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-08-2008, 11:34 AM
DieselMinded's Avatar
DieselMinded DieselMinded is offline
 
Join Date: Mar 2007
Posts: 1,655
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need Conditional

I need a conditional for if this style id
Reply With Quote
  #2  
Old 07-08-2008, 11:48 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

STYLEID (the constant)
Reply With Quote
  #3  
Old 07-08-2008, 05:28 PM
DieselMinded's Avatar
DieselMinded DieselMinded is offline
 
Join Date: Mar 2007
Posts: 1,655
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Whats that Conditional look like for templates ?

--------------- Added [DATE]1215542138[/DATE] at [TIME]1215542138[/TIME] ---------------

How do i prevent certain mods from showing up on certain styles when theres nothing in the templetes to remove or Block ?
Reply With Quote
  #4  
Old 07-08-2008, 06:00 PM
sockwater's Avatar
sockwater sockwater is offline
 
Join Date: Apr 2008
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<if condition="$styleid == 3">show something here to style #3</if>
This will not work in templates that are evaluated in any scope other than the global scope unless $styleid is available in that scope.
Reply With Quote
  #5  
Old 07-08-2008, 08:07 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That if condition will always return true.

Code:
<if condition="STYLEID == 3">style 3</if>
Reply With Quote
  #6  
Old 07-09-2008, 04:57 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sockwater View Post
Code:
<if condition="$styleid = 3">show something here to style #3</if>
This will not work in templates that are evaluated in any scope other than the global scope unless $styleid is available in that scope.
As I've said, you can use the constant, STYLEID. Constants are not affected by scope. A implementation is demonstrated above this post by MoT3rror.
Reply With Quote
  #7  
Old 07-09-2008, 11:15 PM
DieselMinded's Avatar
DieselMinded DieselMinded is offline
 
Join Date: Mar 2007
Posts: 1,655
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just want to be able to edit all the fancys out of my Default Template to make a light weight version , Signatures is gone , Avatars are gone , ect...ect... But i have some things like Album photos on Forum home that dont have no code in the forum home template of my light weight style but is still showing on it , how do i have the mod not show on styleid5 ? , even if i knew the conditional at this point it wouldnt do me much good as i dont know how to edit auto templete mods to exclude items with a style id conditional UGH!
Reply With Quote
  #8  
Old 07-10-2008, 05:12 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You'll have to find the plugin where the template edit occurs and then wrap it with the conditional.
Reply With Quote
  #9  
Old 07-10-2008, 07:48 AM
DieselMinded's Avatar
DieselMinded DieselMinded is offline
 
Join Date: Mar 2007
Posts: 1,655
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cache_templates =

Code:
if (THIS_SCRIPT == "index")
{
global $globaltemplates;
$globaltemplates[] = 'afm_latestfm';
$globaltemplates[] = 'afm_picture';
}
forum home start

Code:
if (
	(
		$vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_albums']
		AND
		$permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canviewmembers']
		AND
		$permissions['albumpermissions'] & $vbulletin->bf_ugp_albumpermissions['canviewalbum']
		AND
		$vbulletin->options['afm_onoff']
	)
)
{
  $displayrecords = ($vbulletin->options['afm_sayi'] ? $vbulletin->options['afm_sayi'] : 4);
    switch ($vbulletin->options['afm_dt'])
    {
      case 1: $sorgu = "ORDER BY dateline DESC LIMIT 0, $displayrecords"; break;
      case 2: $sorgu = "ORDER BY rand(NOW()) DESC LIMIT 0, $displayrecords"; break;
    }  
  $lpictures = $db->query("
  SELECT albumpicture.*, album.*, user.username, user.usergroupid,
  IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid 
  FROM " . TABLE_PREFIX . "albumpicture AS albumpicture
  LEFT JOIN " . TABLE_PREFIX . "album AS album ON(album.albumid = albumpicture.albumid)
  LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = album.userid)
  WHERE album.state = 'public' 
  $sorgu  
  ");
  if ($db->num_rows($lpictures))
  {
	while ($lpicture = $db->fetch_array($lpictures))
	{
	$lpicture['musername'] = fetch_musername($lpicture);
	$lpicture['title'] = trim(strip_quotes($lpicture['title']));
	eval('$resimler .= "' . fetch_template('afm_picture') . '";');
	}
    switch ($vbulletin->options['afm_yer'])
    {
      case 1: $vbulletin->templatecache['navbar'] .= $vbulletin->templatecache['afm_latestfm']; break;
      case 2: $vbulletin->templatecache['FORUMHOME'] = str_replace('<!-- main -->', '<!-- what\'s going on box -->'.$vbulletin->templatecache['afm_latestfm'], $vbulletin->templatecache['FORUMHOME']); break;
      case 3: $vbulletin->templatecache['FORUMHOME'] = str_replace('<!-- what\'s going on box -->', '<!-- end what\'s going on box -->'.$vbulletin->templatecache['afm_latestfm'], $vbulletin->templatecache['FORUMHOME']); break;
      case 4: $vbulletin->templatecache['FORUMHOME'] = str_replace('<!-- end what\'s going on box -->', '<!-- end what\'s going on box -->'.$vbulletin->templatecache['afm_latestfm'], $vbulletin->templatecache['FORUMHOME']); break;
    }
  }
  $db->free_result($lpictures);
}
Where do i put the conditional ... Show me once and ill know for everything else

thanks
Reply With Quote
  #10  
Old 07-10-2008, 09:21 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Find:
PHP Code:
    switch ($vbulletin->options['afm_yer'])
    {
      case 
1$vbulletin->templatecache['navbar'] .= $vbulletin->templatecache['afm_latestfm']; break;
      case 
2$vbulletin->templatecache['FORUMHOME'] = str_replace('<!-- main -->''<!-- what\'s going on box -->'.$vbulletin->templatecache['afm_latestfm'], $vbulletin->templatecache['FORUMHOME']); break;
      case 
3$vbulletin->templatecache['FORUMHOME'] = str_replace('<!-- what\'s going on box -->''<!-- end what\'s going on box -->'.$vbulletin->templatecache['afm_latestfm'], $vbulletin->templatecache['FORUMHOME']); break;
      case 
4$vbulletin->templatecache['FORUMHOME'] = str_replace('<!-- end what\'s going on box -->''<!-- end what\'s going on box -->'.$vbulletin->templatecache['afm_latestfm'], $vbulletin->templatecache['FORUMHOME']); break;
    } 
Replace With (replace "X" with style id where it SHOULDN'T SHOW):
PHP Code:
if (STYLEID != X)
{
    switch (
$vbulletin->options['afm_yer'])
    {
      case 
1$vbulletin->templatecache['navbar'] .= $vbulletin->templatecache['afm_latestfm']; break;
      case 
2$vbulletin->templatecache['FORUMHOME'] = str_replace('<!-- main -->''<!-- what\'s going on box -->'.$vbulletin->templatecache['afm_latestfm'], $vbulletin->templatecache['FORUMHOME']); break;
      case 
3$vbulletin->templatecache['FORUMHOME'] = str_replace('<!-- what\'s going on box -->''<!-- end what\'s going on box -->'.$vbulletin->templatecache['afm_latestfm'], $vbulletin->templatecache['FORUMHOME']); break;
      case 
4$vbulletin->templatecache['FORUMHOME'] = str_replace('<!-- end what\'s going on box -->''<!-- end what\'s going on box -->'.$vbulletin->templatecache['afm_latestfm'], $vbulletin->templatecache['FORUMHOME']); break;
    }

It varies depending on the modification. While the replace will mostly be similar, the implementation before and after it varies.
Reply With Quote
Reply


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 04:41 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.05255 seconds
  • Memory Usage 2,279KB
  • 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
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete