The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
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
|
Comments |
#12
|
|||
|
|||
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.
|
#13
|
|||
|
|||
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"); 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] |
#14
|
|||
|
|||
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)
|
#15
|
|||
|
|||
glad its working ok
|
#16
|
|||
|
|||
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.
|
#17
|
|||
|
|||
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 |
#18
|
|||
|
|||
Please close this thread Ed.
|
#19
|
|||
|
|||
Who install this hack ?
i want to see other demo . cos i am worry about editing the database . Thank you |
#20
|
|||
|
|||
I installed it and it was simple to work.
Not much editing to your database as it adds a few tables. |
#21
|
|||
|
|||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|