Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 PDF MOD
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

leatherlips
Senior Member

USA
1838 Posts

Posted - 15 August 2009 :  14:31:33  Show Profile  Visit leatherlips's Homepage  Reply with Quote
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:

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>');
   }
}

Here is the tag 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 #####

Can anyone see why it stretches my forums width?

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 15 August 2009 14:37:51

leatherlips
Senior Member

USA
1838 Posts

Posted - 15 August 2009 :  15:27:08  Show Profile  Visit leatherlips's Homepage  Reply with Quote
Well, I just looked at it with the demo account and the page does not stretch. It seems it only widens the page if I'm logged on as the Admin. Any idea why?

Here it is as a regular member:



Here it is as the admin:


Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 15 August 2009 15:34:10
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 15 August 2009 :  15:44:03  Show Profile  Reply with Quote
It seems to be because of the added icons in the topic header when you logged in as an administrator.
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 15 August 2009 :  21:31:12  Show Profile  Visit leatherlips's Homepage  Reply with Quote
You're probably right. Why doesn't the file fill up the space under those admin icons? It instead seems to stretch the cell it is in.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

iane87
Starting Member

USA
42 Posts

Posted - 16 August 2009 :  01:03:16  Show Profile  Visit iane87's Homepage  Reply with Quote
HTML will stretch the cell if content is too big. It will NEVER stretch a single element across multiple cells. You need make a whole separate table inside the header row to achieve the result you are looking for.

When your done your HTML will be something like this.

<table>
<tr><td>Author</td><td><table><tr><td>Topic</td><td>Admin Icons</td></tr></table></td></tr>
<tr><td>Avatar</td><td>Message</td></tr>
</table>

Twitter MOD | Search Provider MOD | W3C Valid RSS MOD | Google Translate MOD

Edited by - iane87 on 16 August 2009 01:06:08
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 16 August 2009 :  08:45:46  Show Profile  Visit leatherlips's Homepage  Reply with Quote
Where in topic.asp would I find the cell that holds the message? Perhaps it needs a colspan=2 added to it for the admin?

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

iane87
Starting Member

USA
42 Posts

Posted - 16 August 2009 :  21:03:05  Show Profile  Visit iane87's Homepage  Reply with Quote
Look for

<span id="msg"

You should see the starting td tag not too far above it

Twitter MOD | Search Provider MOD | W3C Valid RSS MOD | Google Translate MOD
Go to Top of Page

Todd
New Member

USA
63 Posts

Posted - 05 November 2009 :  16:08:19  Show Profile  Visit Todd's Homepage  Reply with Quote
Hi,

I've been playing around with this a bit myself. I would love it if you could share more of this code. I imagine there is some work that needs to be done to post.asp also?

I've included the function in topic.asp and the tags in inc_func_common.asp

Any help is appreciated.

Thanks

Tyco Collector's Forum

<<< Link to your forum removed as the link back to Snitz Forums 2000 missing from the Image Forum code you are using. As part of the GPL you must have the link back to http://forum.snitz.com/ >>>


Admin for the Tyco Collector's Forum

Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 05 November 2009 :  16:58:56  Show Profile  Visit modifichicci's Homepage  Reply with Quote
It seems stopped working now..

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

Todd
New Member

USA
63 Posts

Posted - 07 November 2009 :  19:29:52  Show Profile  Visit Todd's Homepage  Reply with Quote
quote:
Originally posted by Todd

<<< Link to your forum removed as the link back to Snitz Forums 2000 missing from the Image Forum code you are using. As part of the GPL you must have the link back to http://forum.snitz.com/ >>>




Thank you for bringing that to my attention, has been fixed.


Admin for the Tyco Collector's Forum


Edited by - Todd on 07 November 2009 21:50:33
Go to Top of Page

Todd
New Member

USA
63 Posts

Posted - 07 November 2009 :  21:50:06  Show Profile  Visit Todd's Homepage  Reply with Quote
Here is some info I've found which is relevant but I honestly don't know if it would help with snitz or not.

http://www.ehow.com/how_5212195_open-pdf-file-aspnet.html


Admin for the Tyco Collector's Forum

Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 08 November 2009 :  03:57:55  Show Profile  Visit modifichicci's Homepage  Reply with Quote
pdfmenot tools is giving error. Someone knows a substitute?

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 19 February 2010 :  15:33:14  Show Profile  Visit modifichicci's Homepage  Reply with Quote
Changing

document.writeln('<script type="text/javascript" src="http://pdfmenot.com/embed/?url=' + URL + '&width=625&height=475" />');
document.writeln('</script>');




to


document.writeln('<iframe src="http://docs.google.com/viewer?url=' + URL + '%20&embedded=true" width="650" height="580" style="border: none;">');
document.writeln('</iframe>');


let it work by google docs

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

shaggy073077
Starting Member

29 Posts

Posted - 16 July 2013 :  08:40:02  Show Profile  Send shaggy073077 an AOL message  Send shaggy073077 a Yahoo! Message  Reply with Quote
I have a problem with this mod. Here is were it's been aggrivating on me.

Microsoft VBScript compilation error- Error '800a0401'

Expected end of statement

/inc_header_short.asp, line 77

Response.Write "<script type=""text/javascript"" src=""pdf.js""></script>" & vbNewLine 
---------------^


My line # 77 is:

Response.Write "<script type=""text/javascript"" src=""pdf.js""></script>"


Any help?
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 16 July 2013 :  11:04:43  Show Profile  Visit AnonJr's Homepage  Reply with Quote
The problem is most likely on the line above it. Post line 77 with the three lines above and below it for context.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07