Adding a small newsbar like IPB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Darkblade
    Senior Member
    • Jul 2004
    • 690
    • 3.6.x

    Adding a small newsbar like IPB

    Is it possible to add the newsbar underneath the usercp link? The image below is more descriptive.



    Do not worry about the latest news because cinq has already created that as a hack. Thanks to him.
    Last edited by Darkblade; Fri 1 Jul '05, 2:54am.
    Metal Gear Forums - Discussion on the popular series of computer and console stealth-based games.

    My Mods: Coming Soon | My Tutorials: Coming Soon
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Where is the news coming from?

    You can add that box to the HTML layout by editing this template:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Navigation / Breadcrumb Templates -> navbar

    Add the red code between the two breaker tags:

    Code:
    			<td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&amp;u=$bbuserinfo[userid]" onclick="return log_out()">$vbphrase[log_out]</a></td>
    		</if>
    	</tr>
    	</table>
    </div>
    <!-- / nav buttons bar -->
    
    <br />
    
    [color=red]<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
    <tr>
    	<td class="alt1" width="100%">
    		YOUR CONTENT HERE
    	</td>
    </tr>
    </table>[/color]
    
    <br />
    
    <if condition="$show['popups']">
    <!-- NAVBAR POPUP MENUS -->
    	
    	<if condition="$show['searchbuttons']">
    	<!-- header quick search form -->
    	<div class="vbmenu_popup" id="navbar_search_menu" style="display:none">

    Comment

    • Darkblade
      Senior Member
      • Jul 2004
      • 690
      • 3.6.x

      #3
      It's coming from my general board. http://www.forumsinsider.com/index.php

      What to place in the content?
      Metal Gear Forums - Discussion on the popular series of computer and console stealth-based games.

      My Mods: Coming Soon | My Tutorials: Coming Soon

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        You can use a RSS feed to pull topics from a vBulletin forum. See this thread.

        Comment

        • Darkblade
          Senior Member
          • Jul 2004
          • 690
          • 3.6.x

          #5
          Thanks Jake. It's working fine on my test board. http://www.rpginsider.com/vb30/index.php?

          One more thing. Could you give me the variable name for members username & the last visit? Also, is there a way to make it hidden for guests? There is no reason to display the box for 'em y'know.
          Last edited by Darkblade; Sat 2 Jul '05, 3:41am.
          Metal Gear Forums - Discussion on the popular series of computer and console stealth-based games.

          My Mods: Coming Soon | My Tutorials: Coming Soon

          Comment

          • Jake Bunce
            Senior Member
            • Dec 2000
            • 46598
            • 3.6.x

            #6
            Originally posted by Snake
            Could you give me the variable name for members username & the last visit?
            Use these variables:

            Code:
            $bbuserinfo[username]
            
            $bbuserinfo[lastvisit]
            Note that the 'lastvisit' variable will return a date in unix timestamp format.

            Originally posted by Snake
            Also, is there a way to make it hidden for guests?
            Surround the code with this conditional:

            Code:
            <if condition="$bbuserinfo[userid]">
            
            </if>

            Comment

            • Darkblade
              Senior Member
              • Jul 2004
              • 690
              • 3.6.x

              #7
              Thank you very much Jake.
              Last edited by Darkblade; Sun 3 Jul '05, 3:21am.
              Metal Gear Forums - Discussion on the popular series of computer and console stealth-based games.

              My Mods: Coming Soon | My Tutorials: Coming Soon

              Comment

              • Darkblade
                Senior Member
                • Jul 2004
                • 690
                • 3.6.x

                #8
                Jake (or anyone else), I have a problem here. I am currently running v3.5 and I coudn't find the phpinclude_start template. So where exactly is it located? Has it been renamed or moved I wonder?
                Metal Gear Forums - Discussion on the popular series of computer and console stealth-based games.

                My Mods: Coming Soon | My Tutorials: Coming Soon

                Comment

                • Jake Bunce
                  Senior Member
                  • Dec 2000
                  • 46598
                  • 3.6.x

                  #9
                  Originally posted by Snake
                  Jake (or anyone else), I have a problem here. I am currently running v3.5 and I coudn't find the phpinclude_start template. So where exactly is it located? Has it been renamed or moved I wonder?
                  I haven't had a chance to look at 3.5 very closely, but I think that template was replaced with a hook location. Look in your hooks for the global scopes.

                  Comment

                  • Darkblade
                    Senior Member
                    • Jul 2004
                    • 690
                    • 3.6.x

                    #10
                    And where can I find my hook for global scopes? I am sorry but I'm completely new to 3.5. O.o
                    Metal Gear Forums - Discussion on the popular series of computer and console stealth-based games.

                    My Mods: Coming Soon | My Tutorials: Coming Soon

                    Comment

                    • Jake Bunce
                      Senior Member
                      • Dec 2000
                      • 46598
                      • 3.6.x

                      #11
                      Probably:

                      Admin CP -> Plugin System -> Add New Plugin

                      Hook Location = global_start

                      Comment

                      • Darkblade
                        Senior Member
                        • Jul 2004
                        • 690
                        • 3.6.x

                        #12
                        I get the following error.

                        Fatal error: Call to a member function on a non-object in /home/psi/public_html/forums/global.php(351) : eval()'d code on line 2
                        Any idea?
                        Metal Gear Forums - Discussion on the popular series of computer and console stealth-based games.

                        My Mods: Coming Soon | My Tutorials: Coming Soon

                        Comment

                        • Jake Bunce
                          Senior Member
                          • Dec 2000
                          • 46598
                          • 3.6.x

                          #13
                          What is the code?

                          Comment

                          • Darkblade
                            Senior Member
                            • Jul 2004
                            • 690
                            • 3.6.x

                            #14
                            Oh here's the code that I've inputted...

                            // GET NUMBER OF NEW POSTS
                            $newposts = $DB_site->query_first("SELECT count(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline > '$bbuserinfo[lastvisit]'");

                            // DETERMINE IF "POSTS" IS SINGULAR OR PLURAL
                            if ($newposts[count] == 1)
                            {
                            $newposts[plural] = "";
                            }
                            else
                            {
                            $newposts[plural] = "s";
                            }

                            // GET NUMBER OF NEW THREADS
                            $newthreads = $DB_site->query_first("SELECT count(*) AS count FROM " . TABLE_PREFIX . "thread WHERE dateline > '$bbuserinfo[lastvisit]'");

                            // DETERMINE IF "THREADS" IS SINGULAR OR PLURAL
                            if ($newthreads[count] == 1)
                            {
                            $newthreads[plural] = "";
                            }
                            else
                            {
                            $newthreads[plural] = "s";
                            }

                            $getnews = $DB_site->query_first("SELECT threadid, title FROM ".TABLE_PREFIX."thread WHERE forumid=2 ORDER BY lastpost DESC LIMIT 1");
                            Metal Gear Forums - Discussion on the popular series of computer and console stealth-based games.

                            My Mods: Coming Soon | My Tutorials: Coming Soon

                            Comment

                            • Jake Bunce
                              Senior Member
                              • Dec 2000
                              • 46598
                              • 3.6.x

                              #15
                              That is 3.0.x code. vB 3.5 has $DB_site within the $vbulletin class I believe. You should probably post on www.vbulletin.org for help with porting that code. I haven't yet had a chance to look at 3.5 very close.

                              Comment

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