vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   ViewPosts -- View unanswered threads, threads you've started, you're own posts etc. (https://vborg.vbsupport.ru/showthread.php?t=66768)

Jordeh 07-01-2004 10:00 PM

ViewPosts -- View unanswered threads, threads you've started, you're own posts etc.
 
This is my first hack ever, I hope everything goes well. I called it ViewPosts.

Latest version: 1.0

What does it do?: It replaces the 'New Posts' button in the navigation bar with a popup menu (for those that have it enabled) containing extra functionality to search for threads or posts with one click of a button.

What are these new functions?:
- Your Posts -- This will return a list of all of your own posts, call it an ego search.
- Unanswered Threads -- This will give you a list of all those threads that have 0 replies. Could be useful for support forums.
- Threads you've started -- A list of threads you've created. Made a thread last night and it's all the way at page 6 at a fast moving forum? In that case, this would be really useful.

Install Instructions:
Installing is easy, it only takes a couple of template modifications and a few new phrases. There's also a file you need to upload in your forum root directory, it's called viewposts.php (attached).

Template modifications:
In template navbar find the first occurrence of:
Code:

<td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
Replace it with:
Code:

<td id="viewposts" class="vbmenu_control"><a href="#viewposts">$vbphrase[view_posts_nav]</a> <script type="text/javascript"> vbmenu_register("viewposts"); </script></td>
In template navbar find the following:
Code:

</if>
<!-- / NAVBAR POPUP MENUS -->
</if>

Add the following before:
Code:

  <!-- view posts menu -->
  <div class="vbmenu_popup" id="viewposts_menu" style="display:none">
    <table cellpadding="4" cellspacing="1" border="0">
      <tr><td class="thead">$vbphrase[view_posts_nav]</td></tr>
      <tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getnew">$vbphrase[new_posts_nav]</a></td></tr>
      <tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=finduser&userid=$bbuserinfo[userid]">$vbphrase[your_posts_nav]</a></td></tr>
      <tr><td class="vbmenu_option"><a href="viewposts.php?$session[sessionurl]do=getunanswered">$vbphrase[unanswered_posts_nav]</a></td></tr>
      <tr><td class="vbmenu_option"><a href="viewposts.php?$session[sessionurl]do=getownthreads">$vbphrase[own_threads_nav]</a></td></tr>
    </table>
  </div>

In template search_results find:
Code:

<if condition="$action == 'getnew'">$vbphrase[new_posts_nav]<else />$vbphrase[posts_from_last_day]</if>
Replace it with:
Code:

<if condition="$action == 'getnew'">
                $vbphrase[new_posts_nav]
        <else />
                <if condition="$action == 'getunanswered'">
                        $vbphrase[unanswered_posts_nav]
                <else />
                        <if condition="$action == 'getownthreads'">
                                $vbphrase[own_threads_nav]
                        <else />
                                $vbphrase[posts_from_last_day]
                        </if>
                </if>
        </if>

Add the following phrases to the phrase group GLOBAL (phrase name: phrase):
your_posts_nav: Your Posts
view_posts_nav: View Posts

unanswered_posts_nav: Unanswered Threads
own_threads_nav: Threads you've started

Works like a charm on 3.0.1, I think it'll work on 3.0.0 too but haven't tested this myself.

Polo 07-01-2004 10:58 PM

Nice Hack, Thanks for sharing it with the community...will install it

alkatraz 07-01-2004 11:22 PM

Great idea! I'll install it soon

ryancooper 07-01-2004 11:24 PM

I notice you said: If you have it enabled. . . I followed youinstructions but nothinghappened. Do i have to enable it somewhere?

colicab-d 07-01-2004 11:53 PM

oooh thats a nice wee hack that :D thnx

Tradjick 07-02-2004 12:26 AM

Damn good idea! Thanks for sharing it! :)

Jordeh 07-02-2004 09:35 AM

Quote:

Originally Posted by ryancooper
I notice you said: If you have it enabled. . . I followed youinstructions but nothinghappened. Do i have to enable it somewhere?

Well, you have to have search enabled for starters. Also you have to be able to see the other popup menus (like search, quick links) otherwise you'll just see a New Posts button.

ryancooper 07-02-2004 12:12 PM

Quote:

Originally Posted by Jordeh
Well, you have to have search enabled for starters. Also you have to be able to see the other popup menus (like search, quick links) otherwise you'll just see a New Posts button.

I have both enabled but the drop down box does not show? Any Ideas what could be worng.

Jordeh 07-02-2004 12:52 PM

Quote:

Originally Posted by ryancooper
I have both enabled but the drop down box does not show? Any Ideas what could be worng.

That's strange, I just registered to your site and didn't see it either. Are you 100% sure you made the template modifications in the navbar template? If you are, could you please pm me the contents of your navbar template, then I can look into it.

ryancooper 07-02-2004 03:13 PM

Quote:

Originally Posted by Jordeh
That's strange, I just registered to your site and didn't see it either. Are you 100% sure you made the template modifications in the navbar template? If you are, could you please pm me the contents of your navbar template, then I can look into it.

Will Do thanks a million!! ;)


All times are GMT. The time now is 07:47 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01161 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete