Hover preview of post message.

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/66271?pagenum=1
05 November 2025, 09:00

Topic


TAF
Hover preview of post message.
11 January 2008, 15:52


I have completed what I think is a great adjustment to Snitz.
The code adjustment allows users to hover over a topic title and view the first 200 characters of the post (or however many characters you want) in a 'title' box.
It works as a html title="Message of the Post..." in the <a> tag.
It adds about 4 snips of code to forum.asp, active.asp, and search.asp.
I will be happy to provide line numbers/code or full page code if anyone is interested in this. Please Email me if you would like the code posted.<

 

Replies ...


weeweeslap
11 January 2008, 16:12


why not post the code here for everyone to use? smile<
bobby131313
11 January 2008, 16:17


LOL, If the base Snitz had that, I'd have removed it withing the first 5 minutes. I think it's annoying as hell. Amazing how people think differently.<
TAF
11 January 2008, 16:30


I like it, since it keeps me from having to go into every post that is titled 'Help!' just to see if it is a problem I can help with or not.
I just hover and move on to the next if it isn't related to something I know about.
Here is the full code: http://www.2000webdesign.com/CodeShare/forum.txt http://www.2000webdesign.com/CodeShare/active.txt http://www.2000webdesign.com/CodeShare/search.txt
It would be easy to copy and paste it this way into your .asp files. Or, you can find the code changes by searching for ****** since I marked comments with this to find the changes easily.<
TAF
11 January 2008, 16:32


I think it would be REALLY cool if the base Snitz had an admin option to turn this on or off... or even better, a member's option to show it or not.<
texanman
11 January 2008, 17:24


Just 6 lines total to be added? If I am seeing this right.<
TAF
11 January 2008, 18:09


Should be 4 lines added/adjusted per asp page. Total of 16.
A couple areas just adjust what is already on a line.<
MaD2ko0l
11 January 2008, 19:37


this has already been created as a mod. i cannot recall what it was called, but it showed x ammount of chaaracters when hovered over the topic title.<
NiteOwl
11 January 2008, 21:30


Really a very nice addition, thank you
<
MarkJH
12 January 2008, 07:52


Great MOD!
One minor problem, though. When somebody puts a "'" in their post (i.e. I'm) it puts an "A" before it (i.e. IA'm). Any ideas?<
kmac
12 January 2008, 10:14


If the post begins with something other than text, i.e. a quote or image, the preview shows the HTML. Is this correct, or did I make a mistake somewhere? Perhaps a conflict with one of my other mods?<
TAF
14 January 2008, 15:24


This is the row that does the work getting the ' and " replaced with a character that doesn't try to break off the title="blablabla" area of the html. (example is the row from active.asp)

Topic_Message = LEFT(Replace(Replace("" & allActiveTopics(fT_MESSAGE,RowCount) & "","'","´"),"""","´´"),200) & "..."
In this area it replaces ' with ´ and " with ´´. I have never had a problem with it showing an 'A' in these areas, so I am thinking it must have something to do with poor font support in these cases. I am sure you could tell it to replace these with ` or with nothing.
The '200' in the line is what tells it how many characters to show. You could tell it to show more or less.
It uses the raw data from the post to create a html title block... that is why it shows the html and/or forum code. You could add to the replace functions and get it to remove these, but I didn't bother since it doesn't bother me to have a little html coding in there.<
MarkJH
14 January 2008, 16:24


I replaced the line

Topic_Message = LEFT(Replace(Replace("" & allActiveTopics(fT_MESSAGE,RowCount) & "","'","´"),"""","´´"),200) & "..."
with

Topic_Message = LEFT(Replace(Replace("" & allActiveTopics(fT_MESSAGE,RowCount) & "","'","#39;"),"""","#34;"),200) & "..."
and all seems fine now. It must have been some sort of encoding issue. question<
TAF
15 January 2008, 19:44


I like that!
::Grabs code line and runs away with it::<
Andy Humm
20 January 2008, 09:02


TAF Could you embold all the code in your three .txt files that have been changed for this great mod idea. It would be easier to see the changes. Thank you andy<
TAF
01 May 2008, 14:04


My program doesn't mark bold for stuff, but you can find the changes by doing a search for ***** (since I marked the lines with comments that way)<
Carefree
01 May 2008, 17:04


Here, for those who wanted the code in color/bold:

http://98.25.191.199/changes.htm<
Andy Humm
01 May 2008, 18:55


cool<
texanman
01 May 2008, 22:54


Originally posted by Carefree
Here, for those who wanted the code in color/bold:

http://24.168.209.249/changes.htm

active.asp"

L264: Remove strSql = strSql & (better yet remover all that line altogether). I thought that was part of the new code and it gave me errors when accessing new messages from active.asp.
Otherwise excellent job.<
texanman
02 May 2008, 10:23


This Mod Screws up search.
Microsoft OLE DB Provider for SQL Server error '80040e14'
The ntext data type cannot be selected as DISTINCT because it is not comparable.
/search.asp, line 351

Line 351: rs.open strSql & strSql2 & strSql3 & strSql4, my_Conn, adOpenStatic


Did anyone else encounter similar error?<
Carefree
19 May 2008, 04:35


Is there a simple call we can insert in this that would use the code cleaner from func_common? All the forum code makes this unusable for me.<
AnonJr
19 May 2008, 15:33


If memory serves, it should be FormatStr() - which I believe is in inc_func_common.asp

I'm short on time at the moment, or I'd double-check.<
SiSL
19 May 2008, 17:08


I did it earlier for www.chip.com.tr/forum but thought getting entire post would be memory and CPU inefficient if long...
So I used that method:
1. CAST
2. RemoveHTML and forum codes

CAST is good feature in MS SQL (not sure if would work with others) such as:

Code:
 CAST(T.T_MESSAGE AS nvarchar(100)) AS PREVMSG "

strSql2 = " FROM " & strMemberTablePrefix & "MEMBERS M, "

etc.
Then I get this into a function of removing HTML's inside along with quotes... Voila...
http://www.chip.com.tr/forum/CHIP-Online-Haber_f95.html

Edit: Interesting this URL is parsed weird...<
© 2000-2021 Snitz™ Communications