View Full Version : [RELEASE] Save Threads Version 1.0
Hi There!
This thread (as the name implies) allows registered users to "save" threads that interest them, and go back and view them all on one page whenever they want. It's sort of like "bookmarking" their favorite threads. :)
Took awhile, but it works just fine. Did a clean install, followed my own readme instruction and it works! It's not amazing by any means, but I think it came out surprisingly well.
Here's all I need from you all:
- Please report any bugs to me ASAP.
- Please make suggestions for future editions.
- Please feel free to tell me what aspects of it you think I should lose.
-------------------------------
Download
-------------------------------
http://www.movieforums.com/hacks/
-------------------------------
Demo
-------------------------------
http://www.spunkyjunk.com/testboard/
Here are some things I have planned for future versions:
- Ability to create folders to sort the saved threads.
- Searching the saved threads.
- Having it slip over into multiple pages with larger totals.
- Having the saved threads page reflect topics with new posts, just as the forums do when you're logged in.
I also know that Ed or rangersfan could create a better hack that does the same things in about a day - but I hope they won't have to now :) Thanks to the programmers here to also answered some of my questions about the script.
Please let me know what you think, and list your boards here so I can see it in use! :D
[Edited by TWTCommish on 09-30-2000 at 09:47 PM]
Oh, I found a small bug shortly after posting this...it's fixed now and the ZIP file has been updated. Woohoo. :)
Questions to ponder for you:
What if a thread is deleted by the poster/admin, will it still show in your list or did you modify editpost.php and postings.php to take care of this potential problem
What if I save 100 threads, did you put in code to break the list in to multiple
pages?
I'm going to hold out installing this until some of the issues rangersfan pointed out are taken care of.
Nice job :)
Nope...as a I mentioned, I simply do not know how to split it over into multiple pages. :( I'd be willing to try though.
As for deletion of threads...good point. If that's a major issue for everyone, I can probably make the change if needed.
TWTCommish
Anyway of making this so the member can have only those messages that have been posted since they last logged on saved to his/her list?
Parker
You mean automatically saved? No, no.
Doesn't the "View New Posts" link produce what you want?
TWT making pages is not very hard to do. You can dl my avatar hack and copy the code it uses to make pages and adapt it to yours.
It just does like:
1 2 3 4 5 6 7 8 9 10 11
Nothing fancy but it works.
Very nice TWT! I'm sure my users will dig this.. much of our board is used as "reference" material and now they can have their own folder of it. Excellent work, I was going to write something like this myself. I'm gonna give you a few days to work in the page-splits before I install it. We don't delete threads so that part doesn't matter.
Thanks !
nice.. can't wait to see the finished hack ;)
Got the hack...looked through it, but I'm really not sure which code to use. :( My apologies...I'm good at what I'm used to, but new things like this always confuse me at first.
This is truly an awesome idea, I've had many users complaining they can't read all the new posts lately and wanted something like this to "save" their place so to speak....great idea!
Hope it works with the new release - If it's not in there already ;)
Thanks. :)
I just want to say that it TOTALLY makes my day when someone tells me they like the hack/idea. I think this hack has a lot of potential...I can think of maybe 5 major features I can try to add in the next release.
In :
savethread.php
addsaved.php
the last line that says:
eval("echo savethread_footer(\"".gettemplate("savethread_footer")."\");")
is missing a ; at the end
I think it should be:
eval("echo savethread_footer(\"".gettemplate("savethread_footer")."\");");
also:
I deleted the redundant </td></tr></table> at the top of the footer template and in the deletesaved.php file. It seemed redundant the way I have my headers/footers set up and messed them up- it seems to work fine my way - go figure :)
also - If you alter your icon id's anything from standard 1- 14 id = icon1.gif and so on - they'll be screwed up since the $iconid replaces the id number instead of the path. How could I call the path instead??? Then I think I could make it work.
I really want to get the icon part of this working....please help anyone
[Edited by rjav8r on 10-02-2000 at 03:04 AM]
I don't know if the semicolon goes there or not...works fine without it! :)
As for the icon path...I can probably correct that if need be...
Are you sure some of the table tags are pointless? Could you elaborate a bit?
As far as the table tags, I used the original templates and got a corrupted table ( I use a border in my header and footer around my table) maybe that's why - nobiggie ;)
the semicolon thingy was just a guess, I get an echo savethread footer blah blah message if I don't have it and it can't complete the table properly, again, don't know if this is due to may use of tables within tables on my vbulletin header and footers
The icon path would be nice instead of the icon id :D
Alright...give me a week or two...tons of offline work has been thrown on me. :(
no pressure - I'm not that way! I think it's great what you've already done, just some suggestions, that's all! :)
Lil' help rangersfan? I'd love to add multi-page support, but can't really determine which code to use, and how. :(
*BUMP* to get rangersfan's attention. :)
¡Hello!
What happend here?
Please, make something to release this hack, is wonderfull.
Im interesting, but it have to be:
1. Setup of the limit # of saved thread by the admin
2. I create one thread, save it, delete the thread and when i go to the saved thread, i have two of the previous saved thread?
I click on it and then: Invalid thread specified. If you followed a valid link, please notify the webmaster.
3. Time limit maybe. If the user dont come anymore to the board, the saved threads continue there. Maybe you can implment time limit, of one week, or something, the thing of the script is if you have many thread you can select some of them and follow it withow search everytime where is.
Or maybe the option to delete saved thread, if the user dont answer an message, email or something every X time.
I thing this are all you have to make.
I don't understand #2 exactly...could you try to re-phrase it? I might work on 1 and 3...right now the biggest concern is splitting more than, say, 10 or 15 saved threads onto multiple pages, and adding custom folders...
#2 - if you save a thread, then delete the thread, it shows two of the previous thread.
I still don't understand. Previous to what?
If you have this on the saved folder.
THREAD 1
THREAD 2
THREAD TO DELETE
and you delete THREAD TO DELETE
Then you can see:
THREAD 1
THREAD 2
THREAD 2
But, if yo click on the las THREAD 2 (after THREAD to delete) the script show the las message i post here.
Thanks.
You sure? This doesn't happen on my copy at all. Has this happened to anyone else? If it hasn't, then it might be a problem with your board...if it has, then I guess I've got another project. :D
TWT, i dont install it, im using YOUR TEST BOARD.
Oh...well then that is REALLY odd, because I just tried it there and everything works fine.
Originally posted by JohnM
#2 - if you save a thread, then delete the thread, it shows two of the previous thread.
He see the same.
I'll have to look into this - it works just fine and dandy for me, and has since I released it...:(
JohnM: did you have the same problem, or were you just explain it to me?
I just registered under "TWTCommish2" and saved some threads and deleted them without ANY problem at all...no idea what's wrong.
Anyone else have this problem?
OK, i thing this is a great hack and i want it for my site, but i wait until this have a limit of saved thread, and some way to delete saved thread of user that dont com in X time or reply some advice.
Maybe i dont speak well.
If you have in the SAVED FOLDER
THREAD 1
THREAD 2
THREAD 3
and then in THE FORUM, the autor or webmaster delete THREAD 3
When you go back to the SAVED FOLDER you have:
THREAD 1
THREAD 2
THREAD 2
The last THREAD 2 IS THREAD 3, but the same name than the last saved thread.
If you follow the las thread 2, you have an error, like i send in the other post.
Try it please.
How could you know that if I havn't deleted any threads on the forum? I also still don't see why it would happen that way...
Sorry for any problems with the hack, but so far it seems fine to me. Only thing I'm rushing to add is multi-page support...and then possible folders.
you try it??????
maybe if you do it yo can see the same i see.
Yes, I did...and I see the problem, but it isn't exactly how you described it. You didn't answer the question though: how'd you run into it if I've never deleted a thread on that testboard?
Originally posted by TWTCommish
Yes, I did...and I see the problem, but it isn't exactly how you described it. You didn't answer the question though: how'd you run into it if I've never deleted a thread on that testboard?
"how'd you run into it if I've never deleted a thread on that testboard?"
I dont understand your question:
1. I thing you are asking if you dont delete threads... then i cant see this error?
2. Or what happend if you dont allow your user to delete thread, then they can see this error?
If the first is the question: I create 2 more thread, then add two of the existing threads + my 2 thread and then delete one of my threads. And the result is the error i write here.
2. If the user cant delete threads, then thats ok, but the problem is not fixed, and if i as the webmaster i delete one, then if some user have that thread in the saved folder, can see the same error.
Thanks.
I didn't know you can delete your own threads...thought only mods could.
Hello
I dont know what happend here. Im talk you about a serious error and you ask me if i can or cant delete threads. Obiously i TRY in YOUR BOARD and i CREATE and DELETE the threads as i say to you.
Now, if you dont want to see what happen is OK.
But if im talking with you about the problem is because i FOUND IT, im not kidding with this or playing with you. I think this can be a good hack.
If you dont want to believe me, is ok, but i thing this:
1. You dont try it, and dont see the problem,
2. Maybe You dont WANT to see the problem (i dont know why).
I try THREE time the same think with THE SAME RESULT on YOUR TEST BOARD.
Your answer by now are:
1. The problem is you forum (But i use YOUR TEST FORUM)
2. Oh...well then that is REALLY odd, because I just tried it there and everything works fine (But JohnM see the same problem).
3. How could you know that if I havn't deleted any threads on the forum? I also still don't see why it would happen that way... (and i explain you I DELETE THREAD on YOUR TEST BOARD).
4. I didn't know you can delete your own threads...thought only mods could. (I TRY THREE TIMES, with the same error; but NOW the TEST BOARD is DOWN).
Thanks
Alright, calm down. You're not understanding me correctly at all.
I didn't not tell you the problem was with your board, I ASKED you if it might be...your English seems akward and it was not clear that you were using my forum...perhaps I missed something, but your posts have seriously confused me nontheless.
Also, I didn't realize that you could delete your own threads - RELAX! I'm not being a jerk because I didn't realize it. I'm having a very hard time understanding what you're saying, that's all. Stop taking it personally.
Yes, as I said before now, I now see the problem and do not know what is wrong, but will have to deal with it later.
And please stop with the CAPS - unless you're angry or something. In such a discussion it implies anger.
Hello
I know my english is bad, i know that.
Im not angy, i only want you understand me.
I use the CAPS to make you pay me attention on some works i think are important, i know the rules of the forum and the CAPS.
Thats all.
I think this is a good hack, only needs some work.
Thanks for your help. ;)
All is forgotten - glad we're clear on everything. Hopefully I'll be able to exterminate this bug. :)
in the third post in this thread I brought up the potential for this sort of behavior to occur :)
Sometimes you just don't want to release hacks because of the negativity that can be directed towards you.
Yeah, I know...working on it.
Did you get my email? I need help with the code from your avatar hack - can't figure out for sure what to use to get the saved threads to split onto multiple pages...
Please help! :)
I will when I have time but if you go to http://www.phpbuilder.com there is an article on creating pages,
Database error in vBulletin: Invalid SQL: SELECT COUNT(*) AS totalcount FROM savethreads WHERE saveuser='IFLY737's'
mysql error: You have an error in your SQL syntax near 's'' at line 1
mysql error number: 1064
Date: Saturday 07th of October 2000 07:36:05 PM
Script: /******/savethread.php
Referer: http://**********/showthread.php?threadid=379
The problem is the username...the username has a single quote around it, and in it...take off the single quotes around it and it should work.
TWT did you use addslashes on the data being used in your queries? That would prevent the problem with the apostrophe from above.
Yes, I know...just didn't think of it. But hey, that's what Version 2.0 is for. :)
Originally posted by rangersfan
in the third post in this thread I brought up the potential for this sort of behavior to occur :)
I read it, and try it, because you post that.
Sometimes you just don't want to release hacks because of the negativity that can be directed towards you.
If you write that because me, im sorry, the problem was we can understand us (TWT and me). Apologies to TWT if he feels its the case and for my bad english again.
Maybe this help:
I thing the best way to make the limit of # saved thread is:
Set one variable for that in the script:
IF #savedthreads = #maxsavedthreads
THEN
Show message "You have the limit of tread... delete some... and then add more..."
ELSE
Add new savedthread.
I dont know php or mysql, but i thing this is the quiz. Then the webmaster can set #maxsavedthreads.
Thanks again.
Hi fenix,
Absolutely - that would definetly work...and I think I'll add it to the next version...my main goal though, has been to split a high number of saved threads over to a new page...IE...page 1 has saved threads 1-10, page 2 has 11-20, etc.
I tried searching on PHP.net and PHPBuilder.com but just couldn't get the hang of it. :(
Use MySQL's LIMIT feature:
LIMIT 0,10 <-- will get 10 records, starting from the first one (0)
LIMIT 10,20 <-- will get 20 records, starting from the 11th
just add something like:
if (!$limitstart) {
$limitstart = 0;
}
$limitquery = "LIMIT $limitstart,25";
And reference $limitquery in your MySQL query.
Showing the paging mechanisms involves counting how many threads there actually are, then running a loop. Here's the code I used in mArticle to do it:
$acount=$DB_site->query_first("SELECT COUNT(id) AS id FROM $table[articlemain] WHERE section=$sec AND (notes NOT LIKE '%U%')");
$count=$acount[id];
$amntpages = ceil($count/$maxperpage);
if ($amntpages==0) { $amntpages = 1; }
$i = 0;
$pages = "";
while($i<$amntpages) {
$i2 = $i + 1;
$limit = $maxperpage * $i;
if ($limit==$limitstart) {
eval("\$pages .= \"".usetemplate("browsesec_pagecur")."\";");
} else {
eval("\$pages .= \"".usetemplate("browsesec_pageother")."\";");
}
$i++;
} //end while $i<=$amntpagesObviously, you'll have to change the variable names and change the references to "usetemplate"
Commish : I am working on my own thread saving hack at the moment. It is going to have pages (of course) and have a folder system where you can categorize your threads. It will also allow for you to sort the list via a few different criteria.
Here is my monster SQL statement at the moment (all I really have right now)
$q = $DB_site->query("SELECT title, favorites.userid, favorites.threadid, folder
FROM favorites,thread
LEFT JOIN favorites_folders ON (favorites.folderid = favorites_folders.folderid)
WHERE favorites.userid = $bbuserid AND thread.threadid = favorites.threadid
ORDER by folder,title");
In that case I'll probably dispose of mine - was fun while it lasted. :) Glad to turn it over to someone with more experience.
Good luck.
Here is my updated query:
$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 = 1 AND thread.threadid = fav_threads.threadid
ORDER by folder,thread.title");
I have come up with an optimization for forumdisplay. Did you know that vB runs a query for each thread shown on forumdisplay to retrieve the Name and Path to the message icon (if the thread has one). Using a simple LEFT JOIN you can get that info with the query that retrieves all the threads to begin with. I have incorporated it into my favorites hack.
Please refer to thread http://www.vbulletin.com/forum/showthread.php?postid=37193#post37193 for the beta release of my hack. Will update this thread when I declare it final.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.