News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

See PDF in Posts

Started by FaSan, May 13, 2005, 05:10:06 PM

Previous topic - Next topic

BHashman

#40
this works in 1.1.4 just fine

in the subs.php file you need to place what [unknown] has listed above
and here is mine:
// PDF [pdf]example.pdf[/pdf]
array(
'tag' => 'pdf',
'type' => 'unparsed_content',
'content' => '<object type="application/pdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" data="$1" width="640" height="480"><param name="src" value="$1" /><a href="$1" target="_blank">$1</a></object>',
'disabled_content' => '<div>PDF: $1</div>',
'block_level' => true,
),
// DWF [dwf]example.dwf[/dwf]
array(
'tag' => 'dwf',
'type' => 'unparsed_content',
'content' => '<object type="application/dwf" classid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" data="$1" width="640" height="480"><param name="src" value="$1" /><a href="$1" target="_blank">$1</a></object>',
'disabled_content' => '<div>PDF: $1</div>',
'block_level' => true,
),



I did declare the bbcode type [pdf] in the Subs-Post.php file but I did not declare the [dwf] tag.  Thus the declaration in the Subs-Post.php file is not necessary, as [unknown] had already mentioned above.

Please note that also included is the class id to embed a autodesk autocad DWF file.  This is a great tool if you are using drawings and need to zoom around them right in your page.
Also you can edit and create DWF files for free and it's embedded in ms Vista.
download stuff here:
http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=8824283 [nofollow]

next - I would like to see a pop up window - like the web page previewers out there - to show the thumbnail of a DWF or PDF file that is an attachment.

more later...


samvirtual

awesome! works like a charm. tried on smf 1.14

chinaren

Wow, this really works well!   Good one!  Thank-you.

(Works on my heavily modded 1.1.7 forum btw).
The Opus Path - The Next Generation of the Written Word

Mick.

Quote from: chinaren on December 02, 2008, 08:53:45 PM
Wow, this really works well!   Good one!  Thank-you.

(Works on my heavily modded 1.1.7 forum btw).

Yes indeed...

http://www.chevyavalancheclub.com/index.php?topic=2191.0

kizer

Wow that is sick to see that embeded like that. Man thats something I can tinker with myself.
Own a Jeep? Links4Jeeps.com

kizer

Wow, I just sent myself a PDF embeded in a PM and it worked perfectly. Man I can't tell you how many times I had to Link a PDF to somebody now I can just embed and call it done. If I could only figure out how to mask the URL in the source when somebody views it I would be in hog heaven.
Own a Jeep? Links4Jeeps.com

kizer

Seems to work perfectly in Internet Explorer is there a way to get Firefox to work?
Own a Jeep? Links4Jeeps.com

IchBin™

IchBin™        TinyPortal

Mick.

Quote from: kizer on December 03, 2008, 07:07:09 PM
Seems to work perfectly in Internet Explorer is there a way to get Firefox to work?

I use firefox and it works just as good on IE.

Upgrade your FF.

kizer

#50
Ok, when I use post #40 it works in Internet Explorer only

When I use post #24 I get an operation not allowed and it crashes Firefox on my forum and on BlueDevils

I'm using Firefox 3.04

I made sure the plugin was enabled and when it is it crashes
Options > Applications I have Adobe set to Adobe reader
Own a Jeep? Links4Jeeps.com

kizer

Ok, bizarre enough I had to update from Adobe 7.0 to 9.0 and it works just fine. Who would of thought.

Works with 9.0 installed, but crashes my browser with 7.0
Own a Jeep? Links4Jeeps.com

Smoky "Rider" Blue

anyway of hiding the url to the pdf ?? that would help out a lot of people..

* SmokyBlue crosses her fingers..  ;)
**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

leoist

Hello everybody,
I am really new user so sorry to ask some silly questions:(
Where should I write or paste those codes given above?
I don't know the logic of the forum how does it work etc? somebody built the forum for me but now i have to handle everything.
thank you so much for your patience.

Smoky "Rider" Blue

best thing to do is to start at the doc's and read:

http://docs.simplemachines.org/

good luck leoist!!

and bump with my question.. anyway to hide the url??  ;)
**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

Kermit

Quote from: leoist on January 03, 2009, 04:14:32 AM
Hello everybody,
I am really new user so sorry to ask some silly questions:(
Where should I write or paste those codes given above?
I don't know the logic of the forum how does it work etc? somebody built the forum for me but now i have to handle everything.
thank you so much for your patience.


You can install that here

http://custom.simplemachines.org/mods/index.php?mod=1468

Code changes will be automatically done  ;)
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Smoky "Rider" Blue

but if you have a custom theme you must apply the edits to it as well..

where you download the mod, there is a drop down box that tells you what to edit and where..  ;)

now Duncan, how can i hide the url for this mod?? i really dont want it to be easily seen..
**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

Kermit

Sources/Subs.php

Code (find) Select

// PDF [pdf]example.pdf[/pdf]
         array(
            'tag' => 'pdf',
            'type' => 'unparsed_content',
            'content' => ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'] ? '<object type="application/pdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" data="$1" width="800" height="600"><param name="src" value="$1"><embed src="$1" width="500" height="400" /><noembed><a href="$1" target="_blank">$1</a></noembed></object>' : '<embed type="application/pdf" src="$1" width="500" height="400" /><noembed><a href="$1" target="_blank">$1</a></noembed>'),
            'validate' => create_function('&$tag, &$data, $disabled', '
               if (isset($disabled[\'url\']))
                  $tag[\'content\'] = \'$1\';'),
            'disabled_content' => '<a href="$1" target="_blank">$1</a>',
         ),


Code (replace with) Select

// PDF [pdf]example.pdf[/pdf]
         array(
            'tag' => 'pdf',
            'type' => 'unparsed_content',
            'content' => $user_info['is_guest'] ? ' You should <a href="' . $scripturl . '?action=register">register</a> or <a href="' . $scripturl . '?action=login">login</a> to see PDF files' : (($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'] ? '<object type="application/pdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" data="$1" width="800" height="600"><param name="src" value="$1"><embed src="$1" width="500" height="400" /><noembed><a href="$1" target="_blank">$1</a></noembed></object>' : '<embed type="application/pdf" src="$1" width="500" height="400" /><noembed><a href="$1" target="_blank">$1</a></noembed>')),
            'validate' => create_function('&$tag, &$data, $disabled', '
               if (isset($disabled[\'url\']))
                  $tag[\'content\'] = \'$1\';'),
            'disabled_content' => '<a href="$1" target="_blank">$1</a>',
         ),
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Smoky "Rider" Blue

thanks Duncan, i gota feeling im going to love the mod..  ;)
**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

Kermit

Your welcome,glad to see that you like the mod  :)
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Advertisement: