News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

See PDF in Posts

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

Previous topic - Next topic

weightman

This would be a totally awesome feature. The ability to embed and then print pdfs would be huge for my community.

Mick.

Any chances to make this work for 1.1.4?  Anyone?

IchBin™

Perhaps you should post in the request board for someone to make a mod for it.
IchBin™        TinyPortal

Mick.

Quote from: IchBin™ on December 09, 2007, 11:42:25 PM
Perhaps you should post in the request board for someone to make a mod for it.

Thanx Ich.

ディン1031

#24
In $sourcedir/Subs.php change follow things
<search>
array(
'tag' => 'pre',
'before' => '<pre>',
'after' => '</pre>',
),
</search>

<add before>
// 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="500" height="400"><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>',
),
</add before>


Normal this should work in SMF 1.1.x but it's untested and i think it will not work in each browser...

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

weightman

I'll test it out and post back later.

Thanks.

falguni1


Fiery

Quote from: falguni1 on December 21, 2007, 03:19:09 AM
is this mod available.

Have you tried searching or trying the suggestions above? ;)

Paracelsus

I was searching for something similar but don't know if it's possible with SMF and PHP...

... something that looks like that new Leopard feature for PDF's, the Quick Look, which allows to see a "preview" of the PDF without actually opening it:


Does anybody know of something similar to this?

Mick.

#29
I used reply #24 and it works on IE but havent tested it on other browsers. Also changed the viewing size to 800x600.

All we need now is a standard button in the post window for a pdf tag.

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

Ok on FF & IE

ディン1031

Quote from: BlueDevil on January 20, 2008, 12:42:08 PM
I used reply #24 and it works on IE but havent tested it on other browsers. Also changed the viewing size to 750x500.

All we need now is a standard button in the post window for a pdf tag.

Demo:

http://www.midwestavalancheclub.com/suggestions-and-feedback/test-t2057/new/

Confirmed....it doesnt work on FireFox.
Firefox deppend on the settings, in my version it work.

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Mick.

Yeah...i just found that out.

One members claims to see it just fine with Firefox but another member using Firefox cant.

I would think  he uses an older version of Firefox?

Fiery

Quote from: BlueDevil on January 20, 2008, 05:03:26 PM
Yeah...i just found that out.

One members claims to see it just fine with Firefox but another member using Firefox cant.

I would think  he uses an older version of Firefox?

He very well could be using an older version of FF.  Can you check?

Mick.

Firefox version 2.0.0.11

Can you confirm if this is old? 


....I think he needs to update his acrobat reader.

Fiery

That is the most recent stable version of FF, you could have him try to upgrade his reader.

Does anyone else have the same problems?

ディン1031

First question is did he install the Acrobat Reader and did he enable the plugin for it in the firefox? :)

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Sarge

Quote from: ディン1031 on January 21, 2008, 02:46:19 AM
First question is did he install the Acrobat Reader and did he enable the plugin for it in the firefox? :)

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

ディン1031

Quote from: Sarge on February 04, 2008, 07:16:17 AM
Quote from: ディン1031 on January 21, 2008, 02:46:19 AM
First question is did he install the Acrobat Reader and did he enable the plugin for it in the firefox? :)
Do i need to understand this ???
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Sarge

No, I'm simply reasking BlueDevil :)

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

dannbass

#39
I've been working with the idea of that groups can have the permission to show or post pdfs, and I'm working on a mod, but I need a little help here, so far I've done everything I can, and I'm doing the mod based on one of the spoilers that have permissions, so far everything in the manage permissions is showing, the checkboxes, the $txt, but not working...

Could someone look and see what I'm missing or should I change? Please...

<file name="$sourcedir/Subs.php">
<operation>
<search>
array(
'tag' => 'pre',
'before' => '<pre>',
'after' => '</pre>',
),
</search>

<add before>
// 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="500" height="400"><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>',
),
</add before>
</operation>
</file>

<file name="$boarddir/Themes/default/languages/ManagePermissions.english.php">
<operation>
<search position="before"><![CDATA[
$txt['permissiongroup_general'] = 'General';
$txt['permissionname_view_stats'] = 'View forum statistics';
]]></search>
<add><![CDATA[
$txt['permissionname_pdf_show'] = 'Show PDFs';
$txt['permissionhelp_pdf_show'] = 'Allow the user to show pdfs included in posts';
$txt['permissionname_pdf_post'] = 'Post PDFs';
$txt['permissionhelp_pdf_post'] = 'Allow the user to post new PDFs';
]]></add>
</operation>
</file>

<file name="$boarddir/Themes/default/languages/Errors.english.php">
<operation>
<search position="before"><![CDATA[
// Version: 1.1.2; Errors
]]></search>
<add><![CDATA[
$txt['cannot_pdf_post'] = 'Sorry - you don\'t have the proper permissions to post pdfs.';
]]></add>
</operation>
</file>

<file name="$sourcedir/ManagePermissions.php">
<operation>
<search position="before"><![CDATA[
'modify_replies' => false,
'delete_replies' => false,
'announce_topic' => false,]]></search>
<add><![CDATA[
'pdf_show' => false,
'pdf_post' => false,]]></add>
</operation>
</file>



<file name="$sourcedir/Post.php">
<operation>
<search position="before"><![CDATA[
// Remove any nested quotes, if necessary.
if (!empty($modSettings['removeNestedQuotes']))
$form_message = preg_replace(array('~\n?\[quote.*?\].+?\[/quote\]\n?~is', '~^\n~', '~\[/quote\]~'), '', $form_message);
]]></search>
<add><![CDATA[
// remove pdfs if not allowed to see them or post them
if(!allowedTo('pdf_show') || !allowedTo('pdf_post'))
$form_message = preg_replace(array('~\n?\[pdf.*?\].+?\[/pdf\]\n?~is', '~^\n~', '~\[/pdf\]~'), '', $form_message);
]]></add>
</operation>
</file>

<file name="$sourcedir/Subs-Post.php">
<operation>
<search position="after"><![CDATA[
// Limit the size of images posted?
if (!empty($modSettings['max_image_width']) || !empty($modSettings['max_image_height']))
{
]]></search>
<add><![CDATA[
// Are we allowed to post pdfs?
if(preg_match('~\[pdf\](.+?)\[/pdf\]~ise',$message))
isAllowedTo('pdf_post');
]]></add>
</operation>
</file>


Thanks :D

Advertisement: