The Forum has been Updated
        The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
    
                        I'm working on a PDF mod.  This mod will let you embed a pdf file into your post via the PDFMENOT website.  I have it working OK but when embedded, it widens the width of the forum.  I can't figure out why.
Here is my test page with an embedded PDF file:
http://www.mangionemagic.com/forumtest/topic.asp?TOPIC_ID=901
If you want to try out the feature login as demo/demo. Just either link to a pdf file and place it in the pdf tags - [pdf] [/pdf] or simply upload a pdf file (which will automatically insert the pdf tags for you).
Here is the code for my tag. Note that I do not write code. I simply am a good "copy and paste" kind of guy. I copied some code from the video mod and modified it for this PDF mod. There is probably a better way to do it but this for now is working.
Here is the function:
Here is the tag code:
Can anyone see why it stretches my forums width?
                            
                    
                Here is my test page with an embedded PDF file:
http://www.mangionemagic.com/forumtest/topic.asp?TOPIC_ID=901
If you want to try out the feature login as demo/demo. Just either link to a pdf file and place it in the pdf tags - [pdf] [/pdf] or simply upload a pdf file (which will automatically insert the pdf tags for you).
Here is the code for my tag. Note that I do not write code. I simply am a good "copy and paste" kind of guy. I copied some code from the video mod and modified it for this PDF mod. There is probably a better way to do it but this for now is working.
Here is the function:
Code:
function EmbedPDF(URL,autostart){
   if(autostart != true && autostart != "true" && autostart != "1" && autostart != 1){
      autostart = 0; //Replace with default. Default = 0 (false).
      }else{
      autostart = 1; //Replace with 1, being zero.
   }//See if we can continue.
   if(URL == null || URL == "illegal"){
      //Nope, we can't.
      document.writeln(" error: illegal use of pdf tag! ");
   }else{
      //Add the code to the document.
      document.writeln('<script type="text/javascript" src="http://pdfmenot.com/embed/?url=' + URL + '&width=625&height=475" />');
      document.writeln('</script>');
   }
}Code:
'##### PDF Begin #####
Function ReplacePDFTags(fString)
   Dim oTag, cTag
   Dim roTag, rcTag
   Dim oTagPos, cTagPos
   Dim nTagPos
   Dim counter1, counter2
   Dim strCodeText
   Dim Tagcount
   Dim strTempString, strResultString
   TagCount = 2
   Dim CodeTags(2,2,2)
   Dim strArray, strArray2
   CodeTags(1,1,1) = "[pdf]"
   CodeTags(1,2,1) = "[/pdf]"
   CodeTags(1,1,2) = "<div class=""media""><script language=""javascript"">EmbedPDF("""
   CodeTags(1,2,2) = """,625,475,false)</script></div><div class=""break""></div>"
   CodeTags(2,1,1) = "[pdf]"
   CodeTags(2,2,1) = "[/pdf]"
   CodeTags(2,1,2) = CodeTags(1,1,2)
   CodeTags(2,2,2) = CodeTags(1,2,2)
   strResultString = ""
   strTempString = fString
   for counter1 = 1 to TagCount
      oTag   = CodeTags(counter1,1,1)
      roTag  = CodeTags(counter1,1,2)
      cTag   = CodeTags(counter1,2,1)
      rcTag  = CodeTags(counter1,2,2)
      oTagPos = InStr(1, strTempString, oTag, 1)
      cTagPos = InStr(1, strTempString, cTag, 1)
      if (oTagpos > 0) and (cTagPos > 0) then
         strArray = Split(strTempString, oTag, -1)
         for counter2 = 0 to Ubound(strArray)
            if (Instr(1, strArray(counter2), cTag) > 0) then
               strArray2 = split(strArray(counter2), cTag, -1)
               strCodeText = trim(strArray2(0))
               if instr(strCodeText,",") > 0 or _
                  instr(strCodeText,")") >0 or _
                  instr(strCodeText,"(") >0 or _
                  instr(strCodeText,";") >0 or _
                  instr(strCodeText,"""") >0 or _
                  instr(strCodeText,"<") >0 or _
                  instr(strCodeText,">") >0 or _
                  instr(strCodeText,"[") >0 or _
                  instr(strCodeText,"]") >0 or _
                  instr(strCodeText,",") >0 then
               strCodeText = "illegal"
               end if
               strResultString = strResultString & roTag & strCodeText & rcTag & strArray2(1)
            else
               strResultString = strResultString & strArray(counter2)
            end if
         next
         strTempString = strResultString
         strResultString = ""
      end if
   next
   ReplacePDFTags = strTempString
end function
'##### PDF End #####