![]() |
Well after attempting to do this before I found that it was making too much of a load on the server so I redid it.
After getting advice from Chen, bira and wluke I have finally gotten this done. It allows a member to preview the first post in a thread, in your forumdisplay page, by putting their mouse pointer on the thread title. A separate box pops up with the first 500 characters of that post in it so you can preview the message before going into the rest of the thread. This only works with IE and Opera. It works partially with Netscape (what else is new!). Upload the attached .php file to your main forum directory and run it. Then read the included readme.txt file for instructions on the modifications needed to your files and templates. (I have updated the file and put in a later post) Parker [high]The hack's zip file can be found in post #7 of this thread[/high] |
Parker Clark, I love this. I am going to install it now on my BB - thank you.
|
Thanks Parker. Works super. Nice Idea.
|
Hope you don't mind, Parker, but this hack got me so excited, I wrote a little script that updates the preview for existing threads since whichever date you select.
Upload the attachment to your admin directory and run it there. Select the date limit for activity -- all threads which were updated since (note: UPDATED, not just CREATED) will have their preview added. It's very quick. I ran it on my BB and it took some 8 seconds in all to update 8,000 active threads. I won't bother updating the rest cos they are inactive anyway. |
ooops, forgot to attach :D
oh, and by the way, here's what it looks like: http://www.atlasf1.com/personal/bira...re-preview.gif (I love this hack Parker, you can't imagine how much time it will save me!!!) |
bira:
Thanks for the kudos and the additions. I will add them to the upload. It is really wild as the edit function that you wrote is the exact one that I just got thru doing. Thanks again for all your help. Parker |
Here is the updated .zip file with all the latest additions and bira's update_preview.php file.
Parker |
Parker, I agree with Bira. This is a wonderful hack. My users love it! :)
|
Can that be used with those threads grabber (last 10 posts) hacks that we place on site homepage?
|
Damn, what a great idea! I almost couldn't stop myself from installing it! :D
The only problem with it is that it increases the pages size significantly. In my tests, it doubled the page size, and that's pretty significant for modem users, like myself. How about making it optional, on a per-user basis, in the control panel? BTW: You should trim() the text before storing it in the database, and also maybe get rid of repeating spaces and line breaks. Oh, and how about previewing redirects as well? ;) Great job everybody! |
on a 40-threads page, the addition on my Bulletin Board was 10-15 kb.
The total page, with images and all, without the preview is 129kb; with the preview it's 144kb -- total of 15 kb more. Using gzip compression (which I do), the difference is more significant and at the same time less so: without the preview the page (without images) is 8106 bytes (8 kb). With the preview, the page is 14,323 bytes (14 kb). Maybe because we use gzip compression, no one has so far complained about the page loading slower. But it is a point to think about if you are trying to cut down on bandwidth. I might suggest, though, that those users who connect with modems should edit their own options to include less topics per page. If they are on a particularly slow connection, they ought to go for 10 topics per page. |
Lionel:
I didn't write that hack so you would have to ask the author about doing that. Good idea though. Tommy Boy: If you want to make this an option to use on your board click on the below .zip file and follow the instructions. The default is set to off so if a member wants to use it they will have to turn it on. Also, if you know how to change the tables around alter the preview add on to the thread table, that you just made, from 500 to 250 and change it from medium text to varchar(250) then change the 500 count in the .php files you just changed to 250. Bira: Look this new .zip over and if you see anything that needs changing let me know. Thanks. Parker |
Parker I downloaded it and had a look. What is fundementally missing, is the code that is needed to be added to the user's Edit Options template :)
Likewise, you might want to expand it and add the same thing to user.php for the Admin CP user page. Otherwise it looks good (though I've not tried it yet) :up: |
Doh!
I guess that would be necessary eh? In your modifyoptions template you need to look for $maxpostsoptions </select></smallfont></td> </tr> and just below this add: <tr> <td bgcolor="yourcolorhere"><normalfont><b>Thread Preview Option On?</b></normalfont><br> <smallfont>Selecting yes will allow you to preview the first post in a thread by putting your mouse pointer on the thread title.</smallfont></td> <td bgcolor="yourcolorhere"><normalfont> <input type="radio" name="threadpreview" value="yes" $threadpreviewchecked> yes <input type="radio" name="threadpreview" value="no" $threadpreviewnotchecked> no </normalfont></td> </tr> I will work on the Admin CP bit. Thanks, Parker |
Great hack ... I love it. Thanks Parker. Bira, thank you for that update_preview. I was wondering why an existing link didn't show a preview waahoooo :D .
|
This is so great!
One (stupid) question - should I now delete the threadpreview.php file? :) |
[QUOTE]Originally posted by Sadie Frost
One (stupid) question - should I now delete the threadpreview.php file? :) |
Thank you! Just didn't want to totally screw it up after I got it working lol :)
|
Sadie:
Yeah, you can delete the previewthread.php and the previewthreadoptions.php files as they just make the mods to the database. Thanks for the kudos guys and gals and I appreciate the fact that your members get something out of it. I know ours do. Thank God there are people around here that know what they are doing though as the first version of this that I wrote was a real resource hog. This version works well on our board with over 22,000 registered and 6 million page views a month. Parker |
great work guys!!!
Now, could one of you outline the steps one more time just to be sure users dont screw things up? :) |
Just fyi - this hack conflicts with the custom post prefix hack, so you have to be careful to combine the two hacks or whichever you did first will stop working :)
|
Parker Clark's zip file with the hack and the instructions can be found on post #7, as the first post of the thread states.
|
Great hack, i luv it ;):D
|
Sadie:
How does it conflict with the cost post preview hack? I mean what does it do when you use both of these together? Parker |
What I was talking about was the hack to make custom prefixes like "Important:" or "Sticky:".
I had done this one first, and then did the custom post prefex one. But you're editing the same section of forumdisplay.php, so when I changed forumdisplay, it made the preview first post stop working. Quote:
I hope that's what you were asking :) |
Sadie:
Oh, I see. Yep. That happens when you have a hack that the other person doesn't. Thanks for pointing that out. Parker |
Well, I just thought that for other newbies like me who don't think to check whether they've changed something in there already lol, it might save some headache :)
|
Is there a way to make the popup title box stay there for as long as the mouse is over the text? I ahve IE 6 and the box only stays there for a little bit and then disappears again, and if you want to continue to read, you need to move your mouse a little bit to bring the window back up. Any way to fix this?
Any help is greatly appreciated. Thanks! |
My users and mods love this! Thank you!
|
Would it work on vB 2.0.3?
|
Works on 2.2.2 but take your time on the install.
Can be a little tricky. Just a little :eek: |
This is perfect for a content-based site like mine. Thanks Parker!!!
|
Quick question - is there any way for the preview to "skip" HTML/vB Code tags?
Hold the mouse over thread links in my News forum to see what I mean... http://x-mencomics.com/xfan/forums/f...p?s=&forumid=2 |
X Fan:
This does not strip the HTML or vB code from the information that is put into the title for the URL. I don't know the coding that would be required to do this. Gutspiller: Unfortunately the timout for the mouse pointer is controlled by your browser. IE does the same thing with anything that you point your mouse to. Opera on the other hand leaves the box up as long as the mouse is on the link. Netscape has a timout period too. Parker |
is there anyway for it to display the last post???
|
Does the 'preview' field in the database just keep on getting bigger and bigger? Is it ok to empty it once old threads are deleted?
|
I'm sorry. The strip code is in the hack. I am not sure if it strips the vB code or HTML. I think it is the HTML codes.
The previews will be deleted when the thread is deleted. So if you delete threads to prune your boards the previews will be deleted too. The previews are copies to the first post made in a thread and will not change in size with subsequent posts in a thread. I am sure you could set it up to display the last post but I am not sure how to do this. Parker |
great hack...will be using:)
|
why don't you just use substr() to take the first five hundred characters directly from the post rather than storing the same data twice?
|
nick:
So how would you write that? I am open to any suggestion to streamline the code any. Parker |
All times are GMT. The time now is 04:46 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|