Announcement

Collapse
No announcement yet.

[3.5] Add 'Latest Active Threads' on the What's Going On - box

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

  • [3.5] Add 'Latest Active Threads' on the What's Going On - box

    Latest Active Threads on What's Going On

    This template modification will add the latest x active threads on your forumhome 'What's going on' box. You can change the number from 10 to anything you want. The threads link to the full thread, and the header links to getnew.

    Step #1
    Admin Control Panel > vBulletin Options > vBulletin Options > External Data Provider > Enable External Javascript > Make sure this is set to 'Yes'.

    Step #2
    Admin Control Panel > Styles & Templates > Style Manager > Dropdown: Edit Templates > Select the 'Forum Home Templates Group' and click on the 'Expand / Collapse' button to expand it > Select the template 'FORUMHOME' and click on the 'Customize' (or 'Edit') button to open it.

    Find this code:
    Code:
    <if condition="$show['loggedinusers']">
    and above this code, on a new line, add the following code:
    Code:
    <if condition="$vbulletin->options['externaljs']">
    <!-- show latest active threads -->
    <tbody>
    <tr>
    <td class="thead" colspan="2">
    <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_external')"><img id="collapseimg_forumhome_external" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_external].gif" alt="" border="0" /></a>
    <a href="search.php?$session[sessionurl]do=getnew">$vbphrase[latest_active_threads]</a>
    </td>
    </tr>
    </tbody>
    <tbody id="collapseobj_forumhome_external" style="$vbcollapse[collapseobj_forumhome_external]">
    <tr>
    <td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_new.gif" alt="" border="0" /></td>
    <td class="alt1" width="100%">
    <div class="smallfont">
    <script type="text/javascript" src="external.php?type=js"></script> 
    <script language="" type="text/javascript">
    <!--
    for (i = 0; i < 10; i++)
    {
    document.writeln("<img class=\"inlineimg\" src=\"$stylevar[imgdir_button]/lastpost.gif\" alt=\"\" border=\"0\" /> <a href=\"showthread.php?t="+threads[i].threadid+"\">"+threads[i].title+"</a>&nbsp;<span class=\"time\">($vbphrase[posted_by]: "+threads[i].poster+")</span><br />");
    }
    //-->
    </script>
    </div>
    </td>
    </tr>
    </tbody>
    <!-- show latest active threads -->
    </if>
    and click the 'save' button to save the template.

    Step #3
    Admin Control Panel > Languages & Phrases > Phrase Manager > 'Add New Phrase' button > and add a new phrase:

    Phrase Type: GLOBAL
    Varname: latest_active_threads
    Text: Latest Active Threads
    (and add any translations if required)

    Press the 'save' button.

    You're done, that's it.
    Attached Files

  • #2
    Is it possible to modify this as to show latest active threads, per your usergroup's viewing permissions? Since I have many hidden forums, their posts won't show up on this when I log in...

    Comment


    • #3
      As this uses the external.php file to fetch data, it won't work.

      You'd have to rewrite it completely and most likely use plugins or code modification to get what you'd like.
      Best Regards
      Colin Frei

      Please don't contact me per PM.

      Comment


      • #4
        Sweet !! Thanks

        Comment


        • #5
          Would it be possible for this modification to become compliant with vBSEO.
          As for some reason the showthread.php URLs are not being converted to content relevant format.

          Comment


          • #6
            As the URLs are passed through the JavaScript feed of external.php, these aren't converted.

            You'd have to edit the external.php file, I'd guess.
            Best Regards
            Colin Frei

            Please don't contact me per PM.

            Comment


            • #7
              Originally posted by Colin F
              As the URLs are passed through the JavaScript feed of external.php, these aren't converted.

              You'd have to edit the external.php file, I'd guess.
              Nevermind a vb.org modification plugin has been released which doesnt make use of the external.php file allowing vB SEO to work its magic.

              Comment


              • #8
                Thanks the code is great.

                I am wondering why is it that if someone adds a new thread or post, it takes a while when the thread moves or changes (in the Latest Active Threads box)?

                Is it possible that the changes will appear right after they are made (so it doesn't take that long anymore) ??

                Thanks in advance

                Saman -

                Comment


                • #9
                  1. Does it wotk with 3.6 with no problem (since it was created on Jul 5th 2005, 6:54am) ?
                  2. Does it show private forums threads to everybody ?!
                  3. Is there a way to show the latest threads not active ones ?
                  thanks in advance.
                  http://www.al-jarodiah.com/vb/
                  Arabic Village Social forums

                  Comment


                  • #10
                    I have it working with 3.6.4.

                    I haven't test for your questions 2 and 3 but I'd let you know once I do it.
                    Alexis Bellido
                    Ventanazul, a forum for Spanish and English speaking web developers

                    Comment


                    • #11
                      Originally posted by mgurain View Post
                      1. Does it wotk with 3.6 with no problem (since it was created on Jul 5th 2005, 6:54am) ?
                      2. Does it show private forums threads to everybody ?!
                      3. Is there a way to show the latest threads not active ones ?
                      thanks in advance.
                      1. Yes
                      2. It only shows what is visible to guests
                      3. That is what it does. It shows the latest threads created.
                      Kerry-Anne :)

                      Twitter Blog

                      www.peterska2.com www.worldnewszone.com www.popularusenetgroups.com www.superclickers.co.uk www.forumsforchrist.com www.browsergameplanet.com

                      Comment


                      • #12
                        This worked great and much better then the previous post that added this to top of forum.
                        Last edited by fusion2; Fri 24 Nov '06, 11:44am.

                        Comment


                        • #13
                          &quot;undefined&quot; thread

                          I have a problem with this.

                          The first thread listed right right now says:
                          "undefined Posted By: undefined"
                          The URL is pointing to showthread.php?t=undefined

                          The remaining threads listed are fine.
                          Vote for these issues:

                          Comment


                          • #14
                            Every is ok, but, the legend if condition="Array['externaljs']"> can see in my forum whit text...

                            My forum is www.forocabiado.com.ar
                            at the bottom

                            Comment


                            • #15
                              Originally posted by malmazan View Post
                              I have a problem with this.

                              The first thread listed right right now says:
                              "undefined Posted By: undefined"
                              The URL is pointing to showthread.php?t=undefined

                              The remaining threads listed are fine.
                              Seems fixed by changing the number of threads to 10. I guess there might not have been enough new threads before
                              Vote for these issues:

                              Comment

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