View Single Post
  #87  
Old 10-16-2005, 08:11 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NexDog
Hi Logician,

I have had this hack working great on our VB2 board for two years but now we are finally upgrading to vb 3.5.0 and this hack is integral to our design. What we do is show a message on the left menu that either displays user info for members or a "Sign Up" messgae for visitors. See here - http://nexusportal.net.

I'm having trouble getting this to work in VB 3.5.0 though. We don't need the pop-up or separate table - we need to keep the current integration. Therefore your step 2 maybe shouldn't apply? In the forumhome template on vb2 I put:

<!-- Begin Conditional Hack-->
[[($bbuserinfo[userid]!=0)]]
Stuff here
[[/($bbuserinfo[userid]!=0)]]
[[($bbuserinfo[userid]==0)]]
Other stuff here
[[/($bbuserinfo[userid]==0)]]
<!-- /End Conditional Hack-->

I put $dfh_announcement in the forumhome template where I want the message to show and then put the code in the box in the vbulletin settings section which is:

Code:
<!-- Begin Conditional Hack-->
[[($bbuserinfo[userid]!=0)]]

                                  <td align="center"><font color="#3A3D65" size="1" face="verdana,arial,helvetica"><strong>USER 
                                    INFORMATION </strong></font></td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr> 
                            <td width="185" height="100%" align="left" valign="top" background="nexica_01/main/sidebar_bg.jpg"><table width="162" border="0" cellpadding="1" cellspacing="1" valign="top">
                                <tr> 
                                  <td height="3" valign="top"></td>
                                </tr>
                                <tr>
                                  <td valign="top"><smallfont> 
                                    <p> 
                                      <center>
                                        $avatarimage</a> 
                                      </center>
                                      <br>
                                      $welcometext<strong><br>
                                      <br>
                                      Total Posts: <font color="#3A3D65">$bbuserinfo[posts]</font><br>
<b>Credits:</b> <font color="#3A3D65">$storepoints</font>
                                      <br>

                                      
<br>
                                      You Last Visited:</strong><br>
                                      $bbuserinfo[lastvisitdate].<br>
                                      <br>
                                      <strong>Time Now:</strong> $timenow.<br>
<br>
                                      <img src="nexica_01/customicons/arrow01.gif" width="9" height="9"> 
                                      <a href="store.php?s=$session[sessionhash]&action=main">Your Store</a><br>                                      
<br>
                                      <img src="nexica_01/customicons/arrow01.gif" width="9" height="9"> 
                                      $newposts<br><br>                          
</smallfont>
</p></td>
                                </tr>
                                <tr id="cat"> 
                                  <td height="19" align="center" background="nexica_01/main/side_title.gif"><font color="#3A3D65" size="1" face="verdana,arial,helvetica"><strong>PRIVATE 
                                    MESSAGES </strong></font></td>
                                </tr>
                                <tr> 
                                  <td valign="top"><p><smallfont> <b>$bbuserinfo[username]</b> 
                                      - You have <b>$newpm[messages]</b> new message(s) 
                                      since your last visit.<br>
                                      <b>Unread Messages:</b> $unreadpm[messages] 
                                      <br>
                                      <b>Total Messages:</b> $allpm[messages]<br>
                                      <br>
                                      <font face="verdana,arial,helvetica" size="1"><img src="nexica_01/customicons/arrow01.gif" width="9" height="9"> 
                                      </font><a href="private.php?s=$session[sessionhash]">Open 
                                      Your PM Inbox</a><br>
                                      <br>
                                      </smallfont></p></td>
                                </tr>
                                [[/($bbuserinfo[userid]!=0)]] [[($bbuserinfo[userid]==0)]] 
                                  <td align="center"><font color="#3A3D65" size="1" face="verdana,arial,helvetica"><strong>THE 
                                    NEXUSPORTAL! </strong></font></td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr> 
                            <td width="185" height="100%" align="left" valign="top" background="nexica_01/main/sidebar_bg.jpg"><table width="162" border="0" cellpadding="1" cellspacing="1" valign="top">
                                <tr> 
                                  <td valign="top"><smallfont> <p> <strong>Welcome 
                                      to NexusPortal!</strong> This site is open 
                                      to all current and prospective Nexus members. 
                                      Take full advantage of this site! Register 
                                      now to gain:<br>
                                      <br>
                                      <b><img src="nexica_01/customicons/bullet02.gif" width="6" height="6"> 
                                      Full Posting Privileges.<img src="nexica_01/customicons/menuspacer.gif" width="1" height="15"><br>
                                      <img src="nexica_01/customicons/bullet02.gif" width="6" height="6"> 
                                      Access to all areas.<img src="nexica_01/customicons/menuspacer.gif" width="1" height="15"><br>
                                      <img src="nexica_01/customicons/bullet02.gif" width="6" height="6"> 
                                      Community Support.<img src="nexica_01/customicons/menuspacer.gif" width="1" height="15"><br>
                                      <img src="nexica_01/customicons/bullet02.gif" width="6" height="6"> 
                                      Ability to Interact.<img src="nexica_01/customicons/menuspacer.gif" width="1" height="15"></b></p>
                                    <p align="center"><img src="nexica_01/customicons/arrow01.gif" width="9" height="9">&nbsp;<img src="nexica_01/customicons/arrow01.gif" width="9" height="9"> 
                                      <a href="register.php?s=$session[sessionhash]&action=signup"><strong>REGISTER 
                                      NOW!</strong></a> <img src="nexica_01/customicons/arrow02.gif" width="9" height="9">&nbsp;<img src="nexica_01/customicons/arrow02.gif" width="9" height="9"></p>
                                    <p>$newposts<br>
                                      <br>
                                    </p></td>
                                </tr>
                                [[/($bbuserinfo[userid]==0)]] 
                                <!-- /End Conditional Hack-->
This is one of our testbeds:

http://test.nexusportal.net/index.php?styleid=4

You can see the USER INFORMATION on the top of the left menu but after that it's all a mess. Can you not put HTML in there?

The vb2 version was so simple.
I think you confuse this hack with my vb2 template conditionals hack.

This hack is for putting an announcement to forum home (with conditionals if you like) and the other hack was to use conditionals in any vb template you like.

If you need to put a fixed conditional to your forumhome template, you don't need this hack, you can use built-in conditionals of vb3.x: (In other words my vb2 template conditionals hack is now a built-in feature in vb 3.0.x and above)

IE.
<if condition = "$bbuserinfo[userid]>0">
Stuff to display to members
</if>
<if condition = "$bbuserinfo[userid]==0">
Stuff to display to guests
</if>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01032 seconds
  • Memory Usage 1,825KB
  • 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_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