Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Added Feature - WebSnapr

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
CertGuard Posted - 21 November 2007 : 12:02:02
Everyone is familiar with WebSnapr, correct?

Well, I was playing around this morning and decided to see if I could get the links inside posts to show the site images and I got it to work.

It's fairly simple once you know what you're looking for, I hope I explain it well enough for everyone, if not, maybe others can help.

First, you'll need to go to the site listed above, download the free Javascript and register to get your "Developer Key". Once you have your key, and you've got the code, follow their instructions to get the code implemented. (I'll help with some of the install in a sec)

Now that you have (almost) completed their installation instructions, you'll need to modify two Snitz files to get it to work.

The first file is <b>inc_header.asp</b>:
- There are two locations you'll need to edit. Both instances are directly above areas that the Snitz creators have designated for NON-MODIFICATION.

If you search for this string: <b>'## START - REMOVAL,</b>, you'll find areas I'm referring to by backing up a couple of lines.

1. Find both instances of this code:

 Response.Write "<html>" & vbNewLine & _
   "<head>" & vbNewline & _
   "<title>" & strForumTitle & "</title>" & vbNewline

and append this code to it:

 & _
   "<script type=""text/javascript"" src=""previewbubble.js""></script>" & vbNewline

<b>NOTE: Make sure you've added the <i>& _</i> to the end of the last line.</b>


Then, in <b>inc_func_common.asp</b> you'll need to find the following block of code, which is found at the very bottom of the file.

<script language="javascript1.2" runat="server">
function edit_hrefs(sURL, iType) {
 sOutput = new String(sURL);

 if (iType == 1) {
  sOutput = sOutput.replace(/\b(http\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
   "<a href=\"$1\" target=\"_blank\">$1<\/a>");
 } else if (iType == 2) {
  sOutput = sOutput.replace(/\b(https\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
   "<a href=\"$1\" target=\"_blank\">$1<\/a>");
 } else if (iType == 3) {
  sOutput = sOutput.replace(/\b(www\.[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
   "<a href=\"http://$1\" target=\"_blank\">$1<\/a>");
 } else if (iType == 4) {
  sOutput = sOutput.replace(/\b([\w+\-\'\#\%\.\_\,\$\!\+\*]+@[\w+\.?\-\'\#\%\~\_\.\;\,\$\!\+\*]+\.[\w+\.?\-\'\#\%\~\_\.\;\,\$\!\+\*]+)/gi,
   "<a href=\"mailto\:$1\">$1<\/a>");
 } else if (iType == 5) {
  sOutput = sOutput.replace(/\b(ftp\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
   "<a href=\"$1\" target=\"_blank\">$1<\/a>");
 } else if (iType == 6) {
  sOutput = sOutput.replace(/\b(file\:\/\/\/[\w+\:\/\\]+[\w+\/\w+\.\:\/\\\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
     "<a href=\"$1\" target=\"_blank\">$1<\/a>");
 }

 return sOutput;
}
</script>


Since you're only going to need to see images for HTTP, HTTPS, and WWW, what you're going to do is add the following information to 3 of the 6 lines.
class=\"previewlink\"


This is what your code should look like when you're done.

<script language="javascript1.2" runat="server">
function edit_hrefs(sURL, iType) {
 sOutput = new String(sURL);

 if (iType == 1) {
  sOutput = sOutput.replace(/\b(http\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
   "<a class=\"previewlink\" href=\"$1\" target=\"_blank\">$1<\/a>");
 } else if (iType == 2) {
  sOutput = sOutput.replace(/\b(https\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
   "<a class=\"previewlink\" href=\"$1\" target=\"_blank\">$1<\/a>");
 } else if (iType == 3) {
  sOutput = sOutput.replace(/\b(www\.[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
   "<a class=\"previewlink\" href=\"http://$1\" target=\"_blank\">$1<\/a>");
 } else if (iType == 4) {
  sOutput = sOutput.replace(/\b([\w+\-\'\#\%\.\_\,\$\!\+\*]+@[\w+\.?\-\'\#\%\~\_\.\;\,\$\!\+\*]+\.[\w+\.?\-\'\#\%\~\_\.\;\,\$\!\+\*]+)/gi,
   "<a href=\"mailto\:$1\">$1<\/a>");
 } else if (iType == 5) {
  sOutput = sOutput.replace(/\b(ftp\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
   "<a href=\"$1\" target=\"_blank\">$1<\/a>");
 } else if (iType == 6) {
  sOutput = sOutput.replace(/\b(file\:\/\/\/[\w+\:\/\\]+[\w+\/\w+\.\:\/\\\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
     "<a href=\"$1\" target=\"_blank\">$1<\/a>");
 }

 return sOutput;
}
</script>


I hope that was clear enough, if there are any questions, post them here for me and I will try to clarify.

Oh, if you want to see a working example, visit this post: http://certguard.com/forums/topic.asp?TOPIC_ID=342
10   L A T E S T    R E P L I E S    (Newest First)
philsbbs Posted - 25 December 2007 : 19:31:56
yep its working now and ive installed it at www.forum.philsbbs.com<
muzishun Posted - 25 December 2007 : 12:32:44
Seems to be working right now for me, though now is the first time I have gone to the site in a week or two.<
philsbbs Posted - 25 December 2007 : 07:02:05
Is it me or has websnapr.com been down for the last 3 days at least.
<
CertGuard Posted - 29 November 2007 : 11:47:11
Excellent suggestion muzishun, if I get a little extra time to play with it, I'll see if that will work.

balexandre, although they look similar I'm not sure if they're exactly the same or not. It is worth a shot though.
<
balexandre Posted - 21 November 2007 : 18:46:05
just wondering...

isn't that the same as www.snap.com ?

cause, if it is, all you need is to add the script that you get from them... simpler than the code in the 1st post right?


<
muzishun Posted - 21 November 2007 : 16:50:12
I would probably do this slightly differently. While I love the idea of having the WebSnapr integrated into the forum, I think I would probably rather not try and deal with having *every* link bring back a screenshot. One alternative would be to use the ExtraTags() function and have a new [websnapr][/websnapr] or [snap][/snap] tag that automatically converts the contained text to a link with the appropriate class. You could probably copy and modify the code for the [url][/url] tags to do this without a whole lot of extra work.

That aside, I think this is a great idea. And welcome to the forums!<
CertGuard Posted - 21 November 2007 : 16:31:19
I noticed also that this MOD affects any URLs you add below your forums. Basically it should affect anything that gets converted from [url] to "<a href="">"<
CertGuard Posted - 21 November 2007 : 12:57:18
Hmmm...good point, I'm not sure how yet, but I'll look into it. Thanks!<
phy1729 Posted - 21 November 2007 : 12:25:35
You may want to disable it on .doc links as those are forbidden by websnapr. But other than that it looks great.<
Etymon Posted - 21 November 2007 : 12:11:23
kewl! <

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000 Version 3.4.07