Advertisement:

Author Topic: See PDF in Posts  (Read 149949 times)

Offline weightman

  • Sr. Member
  • ****
  • Posts: 700
Re: See PDF in Posts
« Reply #20 on: August 08, 2007, 06:04:41 PM »
This would be a totally awesome feature. The ability to embed and then print pdfs would be huge for my community.

Offline Mick.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,673
  • Gender: Male
  • Premium SMF Themes
    • idesign360 on Facebook
    • @idesign360 on Twitter
Re: See PDF in Posts
« Reply #21 on: November 21, 2007, 04:33:41 PM »
Any chances to make this work for 1.1.4?  Anyone?

Offline IchBin™

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,115
  • Gender: Male
  • I don't speak German.
    • IchBin.us
Re: See PDF in Posts
« Reply #22 on: December 09, 2007, 11:42:25 PM »
Perhaps you should post in the request board for someone to make a mod for it.
Brad "IchBin™" Grow        TinyPortal        Themes
Coding Guidelines       

Offline Mick.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,673
  • Gender: Male
  • Premium SMF Themes
    • idesign360 on Facebook
    • @idesign360 on Twitter
Re: See PDF in Posts
« Reply #23 on: December 10, 2007, 09:34:24 PM »
Perhaps you should post in the request board for someone to make a mod for it.

Thanx Ich.

Offline ディン1031

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,599
  • Gender: Male
  • はるひ! :P
    • ~DIN1031
Re: See PDF in Posts
« Reply #24 on: December 11, 2007, 07:47:43 AM »
In $sourcedir/Subs.php change follow things
Code: [Select]
<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
« Last Edit: December 11, 2007, 08:27:55 AM by ディン1031 »
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

Offline weightman

  • Sr. Member
  • ****
  • Posts: 700
Re: See PDF in Posts
« Reply #25 on: December 11, 2007, 11:08:07 AM »
I'll test it out and post back later.

Thanks.

Offline falguni1

  • Full Member
  • ***
  • Posts: 652
  • Gender: Female
  • http://beautymakeupdivas.com/
Re: See PDF in Posts
« Reply #26 on: December 21, 2007, 03:19:09 AM »
is this mod available.

Offline Fiery

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,209
  • Gender: Male
  • Community Builder
Re: See PDF in Posts
« Reply #27 on: January 11, 2008, 01:13:10 AM »
is this mod available.

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

Offline Paracelsus

  • Sr. Member
  • ****
  • Posts: 874
  • Gender: Male
Re: See PDF in Posts
« Reply #28 on: January 16, 2008, 07:08:56 AM »
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?

Offline Mick.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,673
  • Gender: Male
  • Premium SMF Themes
    • idesign360 on Facebook
    • @idesign360 on Twitter
Re: See PDF in Posts
« Reply #29 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 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
« Last Edit: November 24, 2008, 10:36:02 PM by BlueDevil »

Offline ディン1031

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,599
  • Gender: Male
  • はるひ! :P
    • ~DIN1031
Re: See PDF in Posts
« Reply #30 on: January 20, 2008, 04:52:19 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

Offline Mick.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,673
  • Gender: Male
  • Premium SMF Themes
    • idesign360 on Facebook
    • @idesign360 on Twitter
Re: See PDF in Posts
« Reply #31 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?

Offline Fiery

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,209
  • Gender: Male
  • Community Builder
Re: See PDF in Posts
« Reply #32 on: January 20, 2008, 06:35:20 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?

Offline Mick.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,673
  • Gender: Male
  • Premium SMF Themes
    • idesign360 on Facebook
    • @idesign360 on Twitter
Re: See PDF in Posts
« Reply #33 on: January 20, 2008, 06:55:28 PM »
Firefox version 2.0.0.11

Can you confirm if this is old? 


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

Offline Fiery

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,209
  • Gender: Male
  • Community Builder
Re: See PDF in Posts
« Reply #34 on: January 20, 2008, 07:59:18 PM »
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?

Offline ディン1031

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,599
  • Gender: Male
  • はるひ! :P
    • ~DIN1031
Re: See PDF in Posts
« Reply #35 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? :)

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

Offline Sarge

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,209
  • Gender: Male
    • Zëri YT!
Re: See PDF in Posts
« Reply #36 on: February 04, 2008, 07:16:17 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

Offline ディン1031

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,599
  • Gender: Male
  • はるひ! :P
    • ~DIN1031
Re: See PDF in Posts
« Reply #37 on: February 04, 2008, 08:12:42 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

Offline Sarge

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,209
  • Gender: Male
    • Zëri YT!
Re: See PDF in Posts
« Reply #38 on: February 04, 2008, 08:25:51 AM »
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

Offline dannbass

  • Sr. Member
  • ****
  • Posts: 768
  • Ex.php?erto
Re: See PDF in Posts
« Reply #39 on: February 23, 2008, 11:13:08 PM »
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...

Code: [Select]
<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
« Last Edit: February 24, 2008, 12:17:42 PM by dannbass »