Advertisement:

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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,009
    • Arantor on GitHub
Re: See PDF in Posts
« Reply #100 on: January 08, 2013, 11:33:18 PM »
The PDF file must be online somewhere already, you just put the link to it inside the pdf tag.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

Offline KTN

  • Semi-Newbie
  • *
  • Posts: 14
Re: See PDF in Posts
« Reply #101 on: January 09, 2013, 12:14:22 AM »
Can I upload my PDF file to a folder ( such as Attachment or Public html or somewhere ) and get a link and embed between PDF code? But when I try a few time and when member click the link,  it ask user name and password. I am missing some knowledge right? Please advise me how can I do it?

Offline KTN

  • Semi-Newbie
  • *
  • Posts: 14
Re: See PDF in Posts
« Reply #102 on: January 10, 2013, 01:53:14 AM »
I got it! Finally from youtube.

http://www.youtube.com/watch?v=NPveEjP00RE [nofollow]

Offline teos55

  • Jr. Member
  • **
  • Posts: 376
  • Gender: Male
    • Culturel heritage photography blog
Re: See PDF in Posts
« Reply #103 on: January 16, 2013, 09:27:44 AM »
A very nice mod indeed, but the first topic should clearly indicate ;

for sm1....      add this    replace this
for smf2..       add this    replace this

format ?


Other then that, it's puzzling to find the proper code within the topic to your version. 

It's just a tidying (maybe time consuming) process but helpfull to everybody, thanks in advance.


Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,009
    • Arantor on GitHub
Re: See PDF in Posts
« Reply #104 on: January 16, 2013, 09:33:21 AM »
The format it is using is perfectly normal for 2005 back in the days when what was called boardmod format was how SMF modding worked.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

Offline teos55

  • Jr. Member
  • **
  • Posts: 376
  • Gender: Male
    • Culturel heritage photography blog
Re: See PDF in Posts
« Reply #105 on: January 16, 2013, 09:43:22 AM »
It was just a recommendation for novice users with little php knowledge, Arantor.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,009
    • Arantor on GitHub
Re: See PDF in Posts
« Reply #106 on: January 16, 2013, 09:49:07 AM »
Except it's *right* there...

Code: [Select]
<search>
// Match a table... hopefully with everything in the right place.
'~\[table\](?:\s|\xA0|<br />|&nbsp;)*((?:\[tr\](?:\s|\xA0|<br />|&nbsp;)*\[td\]).*?(?:(?:\s|\xA0|<br />|&nbsp;)*\[/td\]\[/tr\])*)(?:\s|\xA0|<br />|&nbsp;)*\[/table\](?:\s|\xA0|<br />|&nbsp;)?~i' => '<table>$1</table>',
</search>


<add after>
// PDF [pdf]example.pdf[/pdf]
'~\[pdf\](?:<br />)*([^<>]+?)(?:<br />)*\[/pdf\]~i' => isset($disabled['pdf']) ? 'PDF: $1' : '<object type="application/pdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" data="$1" width="500" height="400"><param name="src" value="$1"><a href="$1" target="_blank">$1</a></object>',
</add after>

That's what the post says. What more is needed? I see no reason why it shouldn't work without alterations in SMF 2.0, though it was for SMF pre 1.1.x... that part of the code has not significantly changed.

It has 'find this, after it add this'... isn't that what you wanted?
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

Offline teos55

  • Jr. Member
  • **
  • Posts: 376
  • Gender: Male
    • Culturel heritage photography blog
Re: See PDF in Posts
« Reply #107 on: January 16, 2013, 09:58:50 AM »
I thought,  V1 and V2 modifications are different after reading the whole topic, maybe it was my mistake/misunderstanding, sorry.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,009
    • Arantor on GitHub
Re: See PDF in Posts
« Reply #108 on: January 16, 2013, 10:00:12 AM »
The only differences in the posted code are for putting an editor button in, which IS different across SMF versions.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

Offline teos55

  • Jr. Member
  • **
  • Posts: 376
  • Gender: Male
    • Culturel heritage photography blog
Re: See PDF in Posts
« Reply #109 on: January 16, 2013, 10:34:33 AM »
Didnt check beforehand, (my fault) there is already a mod for this, by Kermit.

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

 I used the mod,  and works on the fly.

please forget my recommendation, 2005 to 2013 still works, great ....

Thanks to all, participated.

Offline Shapewear

  • Newbie
  • *
  • Posts: 8
Re: See PDF in Posts
« Reply #110 on: February 05, 2013, 05:19:06 AM »
You can easily see Pdf in post. Within the Edit Post page, use the Add Media option (near the Add Image button) to upload pdf files.

Offline NanoSector

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 10,388
  • Gender: Male
    • Yoshi2889 on GitHub
Re: See PDF in Posts
« Reply #111 on: February 05, 2013, 01:37:21 PM »
You can easily see Pdf in post. Within the Edit Post page, use the Add Media option (near the Add Image button) to upload pdf files.
That button is not there by default :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline miloaikido

  • Newbie
  • *
  • Posts: 5
Re: See PDF in Posts
« Reply #112 on: May 28, 2013, 10:21:22 AM »
how can we does not allow user to save that pdf in post

Offline dand

  • Semi-Newbie
  • *
  • Posts: 64
Re: See PDF in Posts
« Reply #113 on: October 10, 2014, 05:09:06 AM »
I just noticed that this mod doesn't work anymore in my SMF. It worked great for some time, but then I updated from 1.1.17 to 1.1.18 to 1.1.19. Now I am on latest 1.1.20 and it still doesn't work. (Tested in Firefox and IE).

Any help?

Offline ephman

  • Semi-Newbie
  • *
  • Posts: 26
  • Gender: Male
    • Webpicked
Re: See PDF in Posts
« Reply #114 on: October 20, 2014, 11:23:13 PM »
Does it work? Any updates?

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,762
  • Gender: Male
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline jarin001

  • Newbie
  • *
  • Posts: 3
Re: See PDF in Posts
« Reply #116 on: December 11, 2014, 07:18:41 AM »
I must commend this great mod, I found another solution, and this is exactly what I need. I edited my only window size in Subs.php, default (500x400) unnecessarily small. Visitors forum quickly left the link to the PDF file, this mod is the correct solution. Thank you to the author.

Offline me_raul

  • Newbie
  • *
  • Posts: 1
Re: See PDF in Posts
« Reply #117 on: June 02, 2016, 02:44:09 PM »
Hello,

Is there a way to modify the code below (which put pdf tags) in order to have parse the bbcode only after a click action or a key pressed?
I mean having like:
[pdf]example.pdf[/pdf] and then when I do a click on the pdf link only then the tags to be parsed and the pdf content to be loaded.
 I know is an old topic, but for me is a new question.

./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>',
         ),



Offline ross003

  • Newbie
  • *
  • Posts: 4
Re: See PDF in Posts
« Reply #118 on: May 16, 2017, 03:38:17 AM »
Why this code does not work for 1.1.3 version?

Offline Steve

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 3,389
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: See PDF in Posts
« Reply #119 on: May 16, 2017, 09:16:33 AM »
Because it wasn't designed for it?

The better question is, why not upgrade to 2.0.14?
Please do not PM me for support.