Link To Reply MOD - Postet den (2251 Views)
Senior Member
leatherlips
Innlegg: 1838
1838
I made a new little mod that I use on my forum. It is called Link To Reply.
This mod allows the users of your forum to click an icon that displays the link to any topic or reply which they can then copy and paste.
This gives your users the ability to link to the exact reply they were referring to rather than linking to the topic and then trying to explain which reply they were talking about.
If interested you can download it from SnitzBitz.<
   
 Sidestørrelse 
Postet den
Forum Admin
HuwR
Innlegg: 20611
20611
isn't that the same as marcels permalink MOD ?<
Postet den
Senior Member
leatherlips
Innlegg: 1838
1838
No. His does not give you a pop up with the URL in it. Also, mine uses just the normal reply and topic links, not permalinks.
I could never get his to work on my forum.<
Postet den
Junior Member
Massimo
Innlegg: 125
125
The mods use .swf file? i use firefox and addon block flash if not autorizated<
Massimo Farieri
Snitz Italian Community
===============
http://www.snitz.it
http://www.superdeejay.net/forum/

Postet den
Senior Member
MaD2ko0l
Innlegg: 1053
1053
swf file is needed to allow the website to send the contents of the text box to your clipboard.<
© 1999-2010 MaD2ko0l
Postet den
Senior Member
leatherlips
Innlegg: 1838
1838
It was very difficult to find a cross browser select and copy script. This was the only one I could find. It does it through the .swf file. All other scripts I found were only workable for IE. I wanted it to be easy for people to copy. This way lets them do it with one click. They don't have to first highlight it and then right click to select copy.
I thought this was the best and easiest way to do it. smile<
Postet den
Advanced Member
Carefree
Innlegg: 4224
4224
topic.asp requires the code to be changed in two places (for topics and for replies). Here's what I did to make everything work.

Replace pop_link_reply.asp with this:
Code:

<%
'#################################################################################
'## Snitz Forums 2000 v3.4.05
'#################################################################################
'## Copyright (C) 2000-05 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or (at your option) any later version. '##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet. '##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details. '##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. '##
'## Support can be obtained from our support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## manderson@snitz.com
'##
'#################################################################################
'#################################################################################
'# Link To Reply MOD by Leatherlips
'# Thanks Goes To MaD2ko0l For Helping Getting The Reply URL To Show
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_header_short.asp" -->
<%
strQSY = right(Request.QueryString,20)
For i = 2 to 20
strQy=mid(strQSY,i,2)
strQS=mid(strQSY,i+3) ' Note: Everything after final = sign
if strQy = "ID" then exit for
next
For j = 1 to len(strQS)
strQt=mid(strQs,j,1)
strTopic=left(strQS,j-1)
strReply=right(strQS, len(strQS)-j)
if strQt="R" then exit for
next
Response.Write "<table border=""0"" width=""95%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center"" bgcolor=""" & strHeadCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b>Link Directly To This Reply</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>To link directly to this reply, copy and paste the entire url below.</font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""#FFFFFF"" valign=""top"" align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine
Response.Write "<center>Clicking the button below will automatically select and copy the link to your clipboard.<br><br><form name=""replylink"" action="""">" & vbNewLine
Response.Write "<textarea name=""results"" cols=""70"" rows=""2"">" & strForumURL & "topic.asp?" & ArchiveLink & "whichpage=-1&TOPIC_ID=" & strTopic & "#" & strReply &"</textarea><br><br>" & vbNewLine
Response.Write "<input type=""button"" value=""Click To Select & Copy This Reply Link"" onclick=""copy(document.replylink.results.value);"">" & vbNewLine
Response.Write "</form></center>" & vbNewLine & _
"</td></tr></table></td></tr></table>" & vbNewLine
WriteFooterShort
Response.End
%>

In topic.asp, look for the following lines (appx 585-586):

Code:

			' DEM --> End of Code added for moderation.
			Response.Write	"                       " & profileLink(getCurrentIcon(strIconProfile,"Show Profile","align=""absmiddle"" hspace=""6"""),Reply_MemberID) & vbNewLine


Between them, add the following:

Code:

				Response.Write "           <a href=""JavaScript:openWindowLink('pop_link_reply.asp?url=" & strForumURL & "topic.asp?TOPIC_ID=" & Topic_ID & "R" & Reply_ReplyID & "')"">" & getCurrentIcon(strIconLinkTo,"Link directly to this topic","align=""absmiddle"" hspace=""3""") & "</a>" & vbNewLine
<
Postet den
Advanced Member
Etymon
Innlegg: 2396
2396
Hi LL!
I don't want to sound like a dufus here, but in your travels did you find whether or not it was possible to make the code do the visual cue of highlighting the link in the textbox. I ask because the MOD worked on your site (using FireFox) as it should, just I did not know that anything had happened until I pasted the link into notepad. Is it supposed to show the link as highlighted after you click the "Click To Select & Copy This Topic Link" button.
Thanks for the MOD. I think it will be very useful! bigsmile<
Postet den
Development Team Leader
Classicmotorcycling
Innlegg: 2085
2085
Carefree,

I had to change your code a little for the pop_link_reply.asp, I hope that you don't mind.
Code:
<%
'#################################################################################
'## Snitz Forums 2000 v3.4.06
'#################################################################################
'## Copyright (C) 2000-05 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or (at your option) any later version. '##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet. '##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details. '##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. '##
'## Support can be obtained from our support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## manderson@snitz.com
'##
'#################################################################################
'#################################################################################
'# Link To Reply MOD by Leatherlips
'# Thanks Goes To MaD2ko0l, Carefree and Classicmotorcycling For Helping Getting
'# The Reply URL To Show
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_header_short.asp" -->
<%
Response.Write " <script type=""text/javascript""> " & vbNewLine & _
" function copy(what) {" & vbNewLine & _
" window.clipboardData.setData('Text',what.value);" & vbNewLine & _
" }" & vbNewLine & _
" function paste(what) {" & vbNewLine & _
" what.value = window.clipboardData.getData('Text');" & vbNewLine & _
" }" & vbNewLine & _
" </script>" & vbNewLine

strQSY = right(Request.QueryString,20)
For i = 2 to 20
strQy=mid(strQSY,i,2)
strQS=mid(strQSY,i+3) ' Note: Everything after final = sign
if strQy = "ID" then exit for
next
For j = 1 to len(strQS)
strQt=mid(strQs,j,1)
strTopic=left(strQS,j-1)
strReply=right(strQS, len(strQS)-j)
if strQt="R" then exit for
next
Response.Write "<table border=""0"" width=""95%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center"" bgcolor=""" & strHeadCellColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b>Link Directly To This Reply</b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center"" bgcolor=""" & strCategoryCellColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>To link directly to this reply, copy and paste the entire url below.</font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""#FFFFFF"" valign=""top"" align=""left"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
" <center>Clicking the button below will automatically select and copy the link to your clipboard.<br><br>" & vbNewLine & _
" <form>" & vbNewLine & _
" <textarea name=""data"" cols=""70"" rows=""2"">" & strForumURL & "topic.asp?" & ArchiveLink & "whichpage=-1&TOPIC_ID=" & strTopic & "#" & strReply &"</textarea>" & vbNewLine & _
" <br />" & vbNewLine & _
" <input type=""button"" value=""Click To Select & Copy This Reply Link"" onclick=""copy(this.form.data)"">" & vbNewLine & _
" </form>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine

WriteFooterShort
Response.End
%>
Seems to work with a slight change.<
Cheers,

David Greening
Postet den
Advanced Member
Carefree
Innlegg: 4224
4224
I don't mind at all, if you find a better way of making things work, feel free.
However, there's a better way of listing code here using just the code/code or just the scrollbox/scrollbox methods (which list the contents in a single line of type when you copy/paste).
Instead enclose the code within the scrollboxes. Like this: [ scrollbox ][ code ] blah blah blah [/ code ] [/ scrollbox ]. Then the code can be copied/pasted properly.<
Du må legge inn en melding