Thread: Major Additions - Links and Downloads Manager
View Single Post
  #2445  
Old 10-04-2007, 09:32 PM
Alfa1's Avatar
Alfa1 Alfa1 is offline
 
Join Date: Dec 2005
Location: Netherlands
Posts: 3,537
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Since I have changed tabs some time ago, I am not using the tabbars hack, but have just put the conditionals in my navbar and have added the following to my additional CSS definitions:
Code:
td.tab a:link,td.tab a:visited,td.tab a:active,a.tab,
td.tab2 a:link,td.tab2 a:visited,td.tab2 a:active,a.tab2,a:link.tab2,a:active.tab2,a:visited.tab2{
background:transparent url(http://www.mysite.com/test/images/tabc.gif) top right no-repeat;
font:12px tahoma,sans-serif;
width:71px;
height:24px;
text-align:center;
padding:3px 0 0;
margin:0 1px;
text-decoration:none;
float:right;
position:relative;
top:3px
}
td.tab a:hover,img.tab a:hover,.tab a:hover,a:hover.tab,
td.tab2 a:link,td.tab2 a:visited,td.tab2 a:active,a.tab2,a:link.tab2,a:active.tab2,a:visited.tab2{
background:transparent url(http://www.mysite.com/test/images/tab2c.gif) top right no-repeat;
}
Quote:
Originally Posted by AndrewD View Post
Yes, there's a small problem with this approach, because the standard coding for the tabs hack sets up its display *before* LDM gets started. Consequently, standard LDM variables have not yet been set.

The following approach works:

1) Instead of putting $tabbars in the navbar template, put it in the links_header template, immediately after $navbar.
2) Create a new plugin tied to the *ldm_maindisplay_end* hook, and make its code identical to the code which the tabs hack ties to the *parse_templates* hook
3) You can code your in_array() check using the $viewcatid variable.

This will work for the main LDM displays. You will have to work out how to get this to work in other parts of vBulletin, i.e. which templates you can patch with $tabbars, etc.
- How would this translate to my current set up?

- Am I correct to use the $viewcatid variable like this? This is how I currently have conditionals in my navbar:
PHP Code:
<if condition="$show['member']">
 <
table cellpadding="$stylevar[cellpadding]cellspacing="0" border="0" width="100%" align="center" style="border-bottom-width:0px;color:white;">
  <
tr>
    <
td class="nowrap" align="right" valign="center" style="padding:0px 20px 0;color:white">

<if 
condition="in_array($viewcatid[catid], array(126,39, 43))"><a href="http://www.mysite.com/test/local_links.php?catid=126" title="Watch video's" id="mytab" class="tab2">Video</a><else /><a href="http://www.mysite.com/test/local_links.php?catid=126" title="Watch video's" id="mytab" class="tab">Video</a></if>
<if 
condition="in_array($viewcatid[catid], array(127,42, 61))"><a href="http://www.mysite.com/test/local_links.php?catid=127" title="Listen to podcasts, music" id="mytab" class="tab2">Audio</a><else /><a href="http://www.mysite.com/test/local_links.php?catid=127" title="Listen to podcasts, music " id="mytab" class="tab">Audio</a></if>
<if 
condition="in_array($viewcatid[catid], array(1 , 2, 3, 4 ,5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150))"><a href="http://www.mysite.com/test/local_links.php" title="Read research & information" id="mytab" class="tab2">Documents</a><else /><a href="http://www.mysite.com/test/local_links.php" title="Read research & information" id="mytab" class="tab">Documents</a></if>

  </
tr></table>
</if> 
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01243 seconds
  • Memory Usage 1,809KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete