• Welcome to Simple Machines Community Forum. Please login or sign up.
November 28, 2021, 01:45:03 PM

News:

SMF 2.1 RC4 has been released! Try it out and help us test! :) Read more.


See PDF in Posts

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

Previous topic - Next topic

Arantor

The PDF file must be online somewhere already, you just put the link to it inside the pdf tag.
No good deed goes unpunished
All helpful urges should be circumvented

KTN

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?

KTN


teos55

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.


Arantor

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.
No good deed goes unpunished
All helpful urges should be circumvented

teos55

It was just a recommendation for novice users with little php knowledge, Arantor.

Arantor

Except it's *right* there...


<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?
No good deed goes unpunished
All helpful urges should be circumvented

teos55

I thought,  V1 and V2 modifications are different after reading the whole topic, maybe it was my mistake/misunderstanding, sorry.

Arantor

The only differences in the posted code are for putting an editor button in, which IS different across SMF versions.
No good deed goes unpunished
All helpful urges should be circumvented

teos55

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.

Shapewear

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.

NanoSector

Quote from: Shapewear 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.
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."

miloaikido

how can we does not allow user to save that pdf in post

dand

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?


margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

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

jarin001

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.

me_raul

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.

Quote from: BlackAbbot on September 27, 2012, 07:31:08 PM
./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>',
         ),




ross003

Why this code does not work for 1.1.3 version?

Steve

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.

Advertisement: