Announcement

Collapse
No announcement yet.

[Release vB 2.0.3] Different Stuff When Logged In/Out

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Release vB 2.0.3] Different Stuff When Logged In/Out

    This hack was done by FireFly and I am just re-posting it here just in case anybody needs it.

    This hack is a very simple idea, yet can be very useful in getting new members to register.

    When you go onto a VB board, there is a welcome message for unregistered users, right? Well what I wanted to do was setup like a personal features box like www.sitepointforums.com, but I didn't want it to show up when you are an unregistered user. So basically I needed the same sort of thing, a "welcome message" that showed up only to registered users.

    Here's the hack:

    In index.php, replace:

    PHP Code:
    $unregwelcomemessage='';
    if (
    $bbuserinfo['userid']==0) {
      eval(
    "\$unregwelcomemessage = \"".gettemplate('forumhome_unregmessage')."\";");

    with:

    PHP Code:
    $welcomemessage='';
    if (
    $bbuserinfo['userid']==0) {
      eval(
    "\$welcomemessage = \"".gettemplate('forumhome_unregmessage')."\";");
    } else {
      eval(
    "\$welcomemessage = \"".gettemplate('forumhome_regmessage')."\";");

    Then in your forumhome template, replace $unregwelcomemessage with $welcomemessage

    Then make a new template called forumhome_regmessage.

    Then just use the forumhome_regmessage template for your message for registered users and your forumhome_unregmessage template for unregistered users.

    You can view a live demo at http://www.systemlogic.net/boards, notice the top when you are unregistered, and then feel free to register and notice the top now has a "Your Personal Features" box (Which is the code in my forumhome_regmessage template).

    Here's a screenshot of both just in case you don't feel like taking the time to register:
    20
    Yes
    65.00%
    13
    Maybe
    25.00%
    5
    No
    10.00%
    2
    Last edited by SystemLogic; Wed 26 Sep '01, 11:29pm.

  • #2
    Finally someone is doing the job for me. Thanks.
    Chen Avinadav
    Better to remain silent and be thought a fool than to speak out and remove all doubt.

    גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

    Comment


    • #3
      umm i cant get it to work.. when i did it the first time the same opening was there just what i put was in the middles of it all. and then i tryed to edit the new temp and nothing showed up. can someone help

      Comment


      • #4
        nevermind that last message i figured it out. but i would like to know if i can have to member and non-member messages. i would like to keep the top one and use a stats area in a different place. would i be able to do that

        Comment


        • #5
          Can you repeat that, I'm sure I understand you.
          Chen Avinadav
          Better to remain silent and be thought a fool than to speak out and remove all doubt.

          גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

          Comment


          • #6
            Yeah I'm a little confused too....member and non-member messages.....is that not the same thing as a registered/non-registered person?

            Comment


            • #7
              yes. and nevermind i figured it out. i guess i was to lazy to do it myself

              Comment


              • #8
                I looked for the original hack from FireFly, but couldn't find it. Where is the code for the box and options once logged in?
                Rob

                Comment


                • #9
                  That was just something I did on my own.....Basically whatever you want to show up for registered users goes into the temple forumhome_unregmessage and anything you want to show to your logged in/registered users goes to forumhome_regmessage

                  If anybody is interested in me posting how I did the personal features box let me know. Also if you want that code for the not logged in users, let me know (personally I think it is more effective and looks better than the standard welcome text).

                  Comment


                  • #10
                    I think your examples look awesome. Would you mind posting the code if it isn't too much trouble?
                    Rob

                    Comment


                    • #11
                      Sure, not a problem.

                      Alright in forumhome_regmessage I have this (Note: you may have to edit some of the colors and stuff to fit your site accordingly):

                      PHP Code:
                      <table border="0" cellspacing="0" cellpadding="2" width="100%">
                          <
                      tr>
                              <
                      td><normalfont>Welcome to our newest member, <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid"><b>$newusername</b></a></normalfont></td>
                              <
                      td align="right"><smallfont><b>$newposts</b></smallfont></td>
                          </
                      tr>
                      </
                      table>
                      <
                      table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="#000000"><tr><td>
                      <
                      table border="0" cellspacing="1" cellpadding="4" width="100%">
                          <
                      tr bgcolor="#537290">
                              <
                      td colspan="5"><font color="#FFFFFF"><b>SLBoards Stats</b></font></td>
                          </
                      tr>
                          <
                      tr bgcolor="#E9E9E9">
                              <
                      td colspan="5">
                              <
                      table border="0" cellspacing="0" cellpadding="0" width="100%">
                                  <
                      tr>
                                      <
                      td>
                                      <
                      smallfont>
                                      
                      Registered Members: <b>$numbermembers</b><br>
                                      
                      Total Threads: <b>$totalthreads</b> | Total Posts: <b>$totalposts</b> | Total Views: <b>$totalviews</b>
                                      </
                      smallfont>
                                      </
                      td>
                                  </
                      tr>
                              </
                      table>
                              </
                      td>
                          </
                      tr>
                          <
                      tr bgcolor="#8CAECF">
                              <
                      td colspan="5">
                              <
                      table border="0" cellspacing="0" cellpadding="0" width="100%">
                                  <
                      tr>
                                      <
                      td><b>Your Personal Features</b></td>
                                      <
                      td align="right"><smallfont>Logged in as $bbuserinfo[username] <a href="member.php?s=$session[sessionhash]&action=logout">[logout]</a></smallfont></td>
                                  </
                      tr>
                              </
                      table>
                              </
                      td>
                          </
                      tr>
                          <
                      tr bgcolor="#E9E9E9">
                              <
                      td align="center"><smallfont><a href="usercp.php?s=$session[sessionhash]title="Click Here to Open Your Control Panel">Control Panel</a></smallfont></td>
                              <
                      td align="center"><smallfont><a href="private.php?s=$session[sessionhash]title="Click Here to Open Your Private Messages $inboxname">Private Messages</a><br>
                              
                      $newpm[messages] new ($allpm[messagestotal)</smallfont></td>
                              <
                      td align="center"><smallfont><a href="#" onclick="popup('buddy.php', 'Window', 200, 260);" title="Click Here to Launch Your Buddy List">Launch Buddy List</a></smallfont></td>
                              <
                      td align="center"><smallfont><a href="member2.php?s=$session[sessionhash]&action=viewsubscription" title="Click Here to View Your Subscribed Threads">Subscribed Threads</a></smallfont></smallfont></td>
                              <
                      td align="center"><smallfont>$bbuserinfo[postsSLPoints<br><a href="memberlist.php?s=$session[sessionhash]&what=topposters&perpage=50">View top 50</a></smallfont></td>
                          </
                      tr>
                      </
                      table>
                      </
                      td></tr></table
                      For the forumhome_unregmessage I used this code:

                      PHP Code:
                      <table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="#000000"><tr><td>
                      <
                      table border="0" cellspacing="1" cellpadding="4" width="100%">
                          <
                      tr bgcolor="#8CAECF">
                              <
                      td colspan="5"><b>You Are Not Registered Or Not Logged In - <font color="red">ImportantRead Below</font></b></td>
                          </
                      tr>
                          <
                      tr bgcolor="#E9E9E9">
                              <
                      td width="65%" valign="top"><smallfont>If you are not registered logged inyou may still postbut with limited features.  You may register by <a href="register.php?s=$session[sessionhash]">clicking here</a>.  If you have questions be sure to check out our <a href="misc.php?s=$session[sessionhash]&action=faq">FAQ</a>.</smallfont></td>
                              <
                      td align="right" width="45%">
                                  <
                      table border="0" cellpadding="0" cellspacing="0">
                                  <
                      form action="member.php" method="post">
                                  <
                      tr>
                                      <
                      td nowrap><input type="hidden" name="s" value="$session[sessionhash]">
                                      <
                      input type="hidden" name="action" value="login">
                                      <
                      input type="text" class="bginput" name="username" size="7">
                                      <
                      input type="password" class="bginput" name="password" size="7">
                                      <
                      input type="submit" class="bginput" value="Login"></td>
                                  </
                      tr>
                                  </
                      form>
                                  </
                      table>
                              </
                      td>
                          </
                      tr>
                      </
                      table>
                      </
                      td></tr></table>

                      <
                      br>

                      <
                      table border="0" cellspacing="0" cellpadding="2" width="100%">
                          <
                      tr>
                              <
                      td><normalfont>Welcome to our newest member, <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid"><b>$newusername</b></a></normalfont></td>
                              <
                      td align="right"><smallfont><b>$newposts</b></smallfont></td>
                          </
                      tr>
                      </
                      table>
                      <
                      table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="#000000"><tr><td>
                      <
                      table border="0" cellspacing="1" cellpadding="4" width="100%">
                          <
                      tr bgcolor="#537290">
                              <
                      td colspan="5"><font color="#FFFFFF"><b>SLBoards Stats</b></font></td>
                          </
                      tr>
                          <
                      tr bgcolor="#E9E9E9">
                              <
                      td colspan="5">
                              <
                      table border="0" cellspacing="0" cellpadding="0" width="100%">
                                  <
                      tr>
                                      <
                      td>
                                      <
                      smallfont>
                                      
                      Registered Members: <b>$numbermembers</b><br>
                                      
                      Total Threads: <b>$totalthreads</b> | Total Posts: <b>$totalposts</b> | Total Views: <b>$totalviews</b>
                                      </
                      smallfont>
                                      </
                      td>
                                  </
                      tr>
                              </
                      table>
                              </
                      td>
                          </
                      tr>
                      </
                      table>
                      </
                      td></tr></table
                      Also, for the Launch Buddy List feature, you need to install the popup buddy list hack...I'm not exactly sure where it is in here, but if you search you'll be able to find it.

                      Also, for the Total Thread Views thing I have, you need to install that hack as well. I posted it in this forum, so just search for posts by me, and you'll be able to find that.

                      That's about it

                      If you have any questions, let me know.

                      Comment


                      • #12
                        would you know how to add a users ava to the members login stuff when logged in and the admins ava to the non-registered area?

                        Comment


                        • #13
                          Thanks! This works very well!
                          Rob

                          Comment


                          • #14
                            Hey, what's up with the javascript link to launch the buddies list? The link doesn't work for me...I suspect there is additional code that needs to go somewhere else to get that to work. Can you share that as well?
                            -Justin "JJR512" Rebbert
                            JJR512.com: Chat about anything!

                            Comment


                            • #15
                              I think it's a part of this hack:
                              http://www.vbulletin.com/forum/showt...threadid=14079
                              Chen Avinadav
                              Better to remain silent and be thought a fool than to speak out and remove all doubt.

                              גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X