Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 10-23-2000 Last Update: Never Installs: 0
 
No support by the author.

Ok my version of the save threads hack is now in beta. I would appreciate if you could test it by going to Favorites.

If you already have an account than please use it or create one (I dont mind!).

Features:

- Users can add a thread to their favorites by using a link on each thread page.
- Users can create folders to categorize their threads
- Users can open and close folders to hide/show their threads
- Users can move muliple threads in and out of folders
- Users can delete multiple threads
- Users can create a new folder at the time of adding a thread or can visit favorites and create folders.
- Folders can be deleted and re-named
- If a thread is deleted by an admin/mod then it won't show up in the users's favorites anymore
- the threads appear just as they would on the forumdisplay with hot/newfolders, thread icons, last poster, etc etc

Only thing missing is for me to break it into pages and any other ideas by you. Please test it out, try to break it and give me ideas for other features. Hopefully this is something that can be included into vB by default.

Caveats - "Invisible Threads" would show up as I don't use them and forgot to hide them in the favorites (will do).

[Edited by rangersfan on 10-23-2000 at 09:19 PM]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 10-24-2000, 01:46 PM
Guest
 
Posts: n/a
Default

Later today (hopefully) after I add the code to check if threads or invisible or unavailable to a user. The scenario is possible that a user adds a thread and then loses access to the forum the thread lives in or the thread is moved to a forum the user doesn't have access to.
Reply With Quote
  #13  
Old 10-24-2000, 04:20 PM
Guest
 
Posts: n/a
Default

Ok I hacked the hack so that if a thread is "invisible" it will not be shown in the users favorites.

Also it nows checks if a user has access to a thread before showing it in their favorites.

The idea is that a user may have added a thread and now has lost access to it for reasons shown in my previous post. The thread isn't actually removed from his/her list but is just not shown to them. This will allow it to "re-appear" to them if they are again given access to it. The thread table is very small as it only contains 3 id fields, the thread id, the id of the folder it goes in (if it has one) and the id of the field itself.

Below is my access checking code. My main goal has been as little database access as possible and I believe John needs to do this sort of thing in other places to help the optimization. I could have queried the database for every thread to decide to post it or not but that is bad design and something vB is very guilty of doing. My way of doing it is to build parts of your query using logic and then put your constructed query to work in the main query:

Code:
   // These usergroups really need to be re-done, this is a nightmare!
   // This gets the forums that our usergroup has SPECIFIC canview access to (0 or 1)
   $q_perms = $DB_site->query("SELECT forumid,canview FROM forumpermission
                               WHERE usergroupid = $bbusergroupid");
   // This gets our generic canview access
   // If we do not have a specific access defined in the first query than we use the second query
   // for our access to that forum.
   $q_uperms = $DB_site->query_first("SELECT canview FROM usergroup WHERE usergroupid = $bbusergroupid");
   $canview = $q_uperms[canview];  
   // $canview = 0 / We can't view any forums unless we have specific access to above
   // $canview = 1 / We can view all forums unless we have specific access not to above
   if ($canview == 1) // We view all forums by default, hide those we have explicit non access to
   {
      while ($query = $DB_site->fetch_array($q_perms))
      {
         $onethread = 0;
         if ($query[canview] == 0)
         {
            if ($onethread == 0)  
            {
               $forums .= " AND (forumid <> $query[forumid] ";
               $onethread = 1;
            }
            else
            {
               $forums .= " OR forumid <> $query[forumid] ";
            }
         }
      }
      if ($onethread == 1)
      {
         $forums .= ")";  
      }      
   }
   else // We can view no forums by default, show those we have explicit read access to
   {
      while ($query = $DB_site->fetch_array($q_perms))
      {
         $onethread = 0;
         if ($query[canview] == 1)
         {
            if ($onethread == 0)  
            {
               $forums .= " AND (forumid = $query[forumid] ";
               $onethread = 1;
            }
            else
            {
               $forums .= " OR forumid = $query[forumid] ";
            }
         }
      }
      if ($onethread == 1)
      {
         $forums .= ")";  
      }      
   }

   $q_thread = $DB_site->query("SELECT thread.iconid, icon.title AS icontitle, icon.iconpath, open, thread.title AS threadtitle,
                         lastpost, postusername,lastposter, views, replycount, fav_threads.userid, fav_threads.threadid,
                         fav_threads.folderid, folder                      
                         FROM fav_threads,thread
                         LEFT JOIN fav_folders ON (fav_threads.folderid = fav_folders.folderid)
                         LEFT JOIN icon ON (icon.iconid = thread.iconid)
                         WHERE fav_threads.userid = $bbuserid
                               AND thread.threadid = fav_threads.threadid
                               AND thread.visible = 1
                               $forums
                         ORDER by folder,thread.title");
I then take "$forums" and place it into my main query that retrieves the threads. Remember I only have one query that gets everything for showing the threads (it gets the icons, the posters, everything that is shown normally when you look at a list of threads in a normal forum). Can we say forumdisplay is need of a query optimization (I think so).

Let me put in page breaks for long pages and I will be done (which isn't easy as I like to make sure to return you to the page you were on from any function you may access)

[Edited by rangersfan on 10-24-2000 at 01:12 PM]
Reply With Quote
  #14  
Old 10-24-2000, 10:01 PM
Guest
 
Posts: n/a
Default

Ok I do believe the hack is finished. Pageing is in place and no problems so far. Give me time to convert the templates to the proper vB format and I will release it. (My templates are different as I put all the links and graphics in an include file so I can use them across other pages outside the actual forum)
Reply With Quote
  #15  
Old 10-24-2000, 10:14 PM
Guest
 
Posts: n/a
Default

glad its working ok
Reply With Quote
  #16  
Old 10-25-2000, 12:23 AM
Guest
 
Posts: n/a
Default

This is really cool.. I think though that TWTCommish deserves at least partial credit. If at least only for the Idea.. I can use this for another feature I wanted to do as well... Very Very Nice.
Reply With Quote
  #17  
Old 10-25-2000, 12:51 AM
Guest
 
Posts: n/a
Default

Wow! This is great! I feel like a kid on Christmas morning waiting to see what the great Rangersfan is gonna bring for presents!

Great job on the hack so far Rangersfan, and thanks for invoking the inspiration TWTCommish...You deserve a great deal of credit indeed.

Thanks for making a great product better guys! This hack should definately be looked at for inclusion in the default code. Bravo for the reduction in sql queries as well, mySQL DB would not be able to handle much more than she is.

rick
Reply With Quote
  #18  
Old 10-25-2000, 04:02 PM
Guest
 
Posts: n/a
Default

Please close this thread Ed.
Reply With Quote
  #19  
Old 12-30-2000, 05:26 PM
Guest
 
Posts: n/a
Default

Who install this hack ?

i want to see other demo .


cos i am worry about editing the database .


Thank you
Reply With Quote
  #20  
Old 12-30-2000, 06:34 PM
Guest
 
Posts: n/a
Default

I installed it and it was simple to work.

Not much editing to your database as it adds a few tables.
Reply With Quote
  #21  
Old 12-30-2000, 07:01 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by freddie
Please close this thread Ed.
Sorry 'bout that -- missed it If you need to discuss for whatever reason, use a new thread or something.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:29 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05229 seconds
  • Memory Usage 2,282KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete