Little Tips ;)
<search>
// Match a table... hopefully with everything in the right place.
'~\[table\](?:\s|\xA0|<br />| )*((?:\[tr\](?:\s|\xA0|<br />| )*\[td\]).*?(?:(?:\s|\xA0|<br />| )*\[/td\]\[/tr\])*)(?:\s|\xA0|<br />| )*\[/table\](?:\s|\xA0|<br />| )?~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>
Use with tag [pdf]example.pdf[/pdf]
It's work if you have in your browser the appropriate plugin (adobe acrobat o similar)
FaSan
Thank you, very usefull!
I 'read' the Italian post, it's supposed to be added in Subs.php?
Yes ! Excuse Me :)
On file Sub.php ;)
anyone to make it work for smf 1.1 beta 3 ?
i couldnt find the given strings in Subs.php
Before this:
array(
'tag' => 'pre',
'before' => '<pre>',
'after' => '</pre>',
),
Add:
array(
'tag' => 'pdf',
'type' => 'unparsed_content',
'content' => '<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>',
'disabled_content' => '<div>PDF: $1</div>',
'block_level' => true,
),
Then, in Subs-Post.php (this may be Beta 4 and after, though...) find:
// [flash]http://...[/flash]
array(
'tag' => 'flash',
'protocols' => array('http', 'https'),
'embeddedUrl' => false,
'hasEqualSign' => false,
'hasExtra' => true,
),
Add after:
// [pdf]http://...[/pdf]
array(
'tag' => 'pdf',
'protocols' => array('http', 'https'),
'embeddedUrl' => false,
'hasEqualSign' => false,
),
-[Unknown]
thanks [unknown] but it give parse error :(
Parse error: parse error, unexpected ',' in /home/elmacik/public_html/forum/Sources/Subs-Post.php on line 303
Quote from: elmacik on September 03, 2005, 09:47:38 AM
thanks [unknown] but it give parse error :(
Parse error: parse error, unexpected ',' in /home/elmacik/public_html/forum/Sources/Subs-Post.php on line 303
Can you post 5 lines above and below your change to that file?
-[Unknown]
here are the lines above, lines themselves, lines below;
// [flash]http://...[/flash]
array('tag' => 'flash', 'protocol' => 'http', 'embeddedUrl' => false, 'hasEqualSign' => false, 'hasExtra' => true)
);
// [pdf]http://...[/pdf]
array(
'tag' => 'pdf',
'protocols' => array('http', 'https'),
'embeddedUrl' => false,
'hasEqualSign' => false,
),
// Fix each type of tag.
Quote from: elmacik on September 04, 2005, 05:06:48 PM
here are the lines above, lines themselves, lines below;
// [flash]http://...[/flash]
array('tag' => 'flash', 'protocol' => 'http', 'embeddedUrl' => false, 'hasEqualSign' => false, 'hasExtra' => true)
);
// [pdf]http://...[/pdf]
array(
'tag' => 'pdf',
'protocols' => array('http', 'https'),
'embeddedUrl' => false,
'hasEqualSign' => false,
),
// Fix each type of tag.
Should that last comma not be a semicolon?
That semicolon should be a comma
Don't add the code in Subs-Post.php. As I described, it doesn't apply to your version.
-[Unknown]
Quote from: OIDanTheManIO on September 04, 2005, 05:45:38 PM
Should that last comma not be a semicolon?
no, as i tried replacing the semicolong that is placed at the end of [flash] and i put a semicolon instead of the comma in the codes that [unknown] gave. its no use.
Quote from: groundup on September 04, 2005, 05:45:38 PM
That semicolon should be a comma
i tried but not to make [unknown] say "you havent done like i said" i just didnt post it.
Quote from: [Unknown] on September 04, 2005, 05:51:15 PM
Don't add the code in Subs-Post.php. As I described, it doesn't apply to your version.
-[Unknown]
please look above, i asked for 1.1 beta 3, you gave the codes and now you say "it doesnt apply to your version" not weird in your opinion too? :)
Quote from: [Unknown] on September 03, 2005, 03:57:40 AM
Then, in Subs-Post.php (this may be Beta 4 and after, though...) find:
As I said.
It will still work, just don't make that change.
-[Unknown]
which change?
you mean even if i DONT put the codes (i dont use anywhere..) still pdf will work?
how can it if there isnt a [pdf] description tag in subs-post.php?
i couldnt get the point can you please clarify?
Looking at my copy of beta 3 / 4 ...
// [ftp=ftp://...]name[/ftp]
array(
'tag' => 'ftp',
'protocols' => array('ftp', 'ftps'),
'embeddedUrl' => true,
'hasEqualSign' => true,
),
// [flash]http://...[/flash]
array(
'tag' => 'flash',
'protocols' => array('http', 'https'),
'embeddedUrl' => false,
'hasEqualSign' => false,
'hasExtra' => true,
),
// [pdf]http://...[/pdf]
array(
'tag' => 'pdf',
'protocols' => array('http', 'https'),
'embeddedUrl' => false,
'hasEqualSign' => false,
),
);
You should probably grab a new copy or maybe it is only for Beta 4.
you mean [pdf] [/pdf] tags are already included in beta 3? so why are the codes given when i asked for 1.1 beta 3 ???
your codes are beta 4 i think and public dont have it.
No. As I said, you make the change to Subs.php, but not the change to Subs-Post.php. That's all you need to do. That is what I said.
-[Unknown]
i made the change in subs.php and didnt touch subs.post.php
now it shows the exact words i typed. while posting, i write [pdf]http://something/something.pdf[/pdf]
it shows what i type just like; [pdf]http://something/something.pdf[/pdf]
if there is no need, why did you sent that codes for subs.post.php .. ? sorry for my dumbness but couldnt still understand.
Would be if someone let me know how to make this work for smf 1.0.7 and 1.0.5.
Thanks!
Any chance for smf1.1.3 ?
Thanks!
This would be a totally awesome feature. The ability to embed and then print pdfs would be huge for my community.
Any chances to make this work for 1.1.4? Anyone?
Perhaps you should post in the request board for someone to make a mod for it.
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.
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
I'll test it out and post back later.
Thanks.
is this mod available.
Quote from: falguni1 on December 21, 2007, 03:19:09 AM
is this mod available.
Have you tried searching or trying the suggestions above? ;)
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:
(http://macworld.idg.se/polopoly_fs/1.128327!imageManager/399578767.png)
Does anybody know of something similar to this?
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
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
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?
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?
Firefox version 2.0.0.11
Can you confirm if this is old?
....I think he needs to update his acrobat reader.
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?
First question is did he install the Acrobat Reader and did he enable the plugin for it in the firefox? :)
Bye
DIN1031
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? :)
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 ???
No, I'm simply reasking BlueDevil :)
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
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
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...
someone have images of this trick???
awesome! works like a charm. tried on smf 1.14
Wow, this really works well! Good one! Thank-you.
(Works on my heavily modded 1.1.7 forum btw).
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
Wow that is sick to see that embeded like that. Man thats something I can tinker with myself.
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.
Seems to work perfectly in Internet Explorer is there a way to get Firefox to work?
Works in firefox for me.
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.
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
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
anyway of hiding the url to the pdf ?? that would help out a lot of people..
/me crosses her fingers.. ;)
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.
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?? ;)
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 ;)
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..
Sources/Subs.php
// 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>',
),
// 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>',
),
thanks Duncan, i gota feeling im going to love the mod.. ;)
Your welcome,glad to see that you like the mod :)
might just help display my 1gig+ pdf collection..
lol.. :P
Thank you so much it's very useful especially for me...
when i can get some time, will set up a permenant link for anyone to view from my site..
thanks again Duncan85 ;)
works on rc1?
You try it? Tell us if it works. :)
Quote from: adp on February 12, 2009, 11:27:32 AM
works on rc1?
Yep,this mod works with RC1 as well
http://custom.simplemachines.org/mods/index.php?mod=1468
http://custom.simplemachines.org/mods/index.php?mod=1468 move to Now Available board please.
Any chance of getting this updated to work on SMF 2.0 RC2?
Anybody get this working on RC3 yet?
Why is it that when I click on the very first page of this thread, I get this:
See Here (http://whereitestmystuff.com/images/auth.jpg)
Authentication required (and by the thread starter)? Why is that showing up here at SMF?
:-\
Because the avatar of the thread starter is behind a site that requires login. Admins should fix that, I think.
Getting it to work in RC3 probably isn't that hard, but I don't think I'd do it like that if it were me. Then again I don't really like the idea of embedding PDF into the page given the amount of Acrobat vulns doing the rounds at the moment.
For the 2.0 RC4
Follow the instrutions here: http://custom.simplemachines.org/mods/index.php?mod=1468
and then select the Manual Install Instructions for SMF 2.0 RC4 on the rigth side and the hit "Parse"
Do all of the instrutions there,
BUT!!! On the "./Sources/Subs-Editor.php" don't do that!!
On the "./Sources/Subs-Editor.php" You must do this exacly:
Find this:
'description' => $txt['image']
And add this after:
'pdf' => array(
'image' => 'pdf',
'code' => 'pdf', 'before' => '[pdf]', 'after' => '[/pdf]', 'description' => $txt['pdf']),
Cheers!
Is there a way to widen the screen.. See my link at www.ccdsg.com/index.php?topic=9.0.
I want to expand or widen from left to right... any ideas? Or is this an ID from adobe?
that is a wordpress install, you will not get support here for that.
Quote from: Illori on December 13, 2010, 08:45:34 AM
that is a wordpress install, you will not get support here for that.
any support for the same question on SMF forum?
(http://www.outofstate.us/redemption-theory/points/pdf.jpg)
If you look at the code you inserted, do you see the width and height settings in it?
Quote from: IchBin™ on December 21, 2010, 12:51:50 PM
If you look at the code you inserted, do you see the width and height settings in it?
[pdf][/pdf] is all that shows
Great tool but a little problem
It works in Firefox and IE but NOT in Google-Chroom maybe somebody knows witch extension has to be downloaded so it also works in Chroom
Thanks
Please help me
I got these errors in my errorlog
8: Undefined index: pdf
Bestand: /home/xxxxxx/public_html/forum2/Themes/default/languages/Post.dutch.php (main sub template - eval?)
Regel: 778
What is the course of this error and how can I correct this
I found the course of the error
../Themes/default/languages/Modifications.dutch.php
I ad this and the problem was solved
$txt['pdf'] = 'Add PDF';
I found it in ../Themes/default/languages/Modifications.english.php
I did the modifications as in the Parse code for 2.0 RC5 and now am unable to use my forum.
I get this error message
Fatal error: Call to undefined function call_integration_hook() in /home/affordab/public_html/smf/Sources/Load.php on line 307
I have even reversed the edits and I still cant get in - have no idea whats going on. Can anybody help.
call_integration_hook is a 2.0 RC4+ only function.
I have to use this trick in work so thanks, you saved me a lot of time!
Update the mod, please.
Quote from: esmus on July 12, 2011, 06:00:14 PM
Update the mod, please.
If you follow the instructions here (http://www.simplemachines.org/community/index.php?topic=35851.msg2841022#msg2841022), it should work fine with 2.0 final.
Beloved friends,
Is there any setting to change the pdf size in the mod, the size looks smaller in my forum...
Hi!
How can I stretch the embedded PDF to 1024 x 768?
After a quick glance at the source for this mod I just went ahead and modified all widths and heights in ./Sources/Subs.php from their current values to 1024 and 768 respectively. This appears to have had the desired effect for me.
How can I modify it too?
Quote from: newage on September 27, 2012, 09:41:11 AM
How can I modify it too?
Follow the instructions dude, unless you mean the previous post.
I did not get it but anyway...
./Sources/Subs.php
// 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>',
),
// 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="1024" height="768"><param name="src" value="$1"><embed src="$1" width="1024" height="768" /><noembed><a href="$1" target="_blank">$1</a></noembed></object>' : '<embed type="application/pdf" src="$1" width="1024" height="768" /><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>',
),
Is there a way to disable it on the iPad (perhaps display an error message that it's not compatible with iPads?). The iPad doesn't like files within frames, you can't scroll down.
I applied your code and find this is amazing.
after a long time you provide me exact code.
Rather than going by the width and hiegh as shown i made mine like
Width = 100% and Height = 1000
With the width set at 100% you will get the PDF box go the full width of whatever size display your using
http://welderfab.co.uk/index.php/topic,10545.0.html
Enjoy ;)
I really want to use this MOD but it seems that this MOD is not compatible with SMF 2.0.2. Can anyone update this MOD, please? Thank you.
that should be ideal for me specially since i am sharing pdf files a lot in my forum :)
Google bot scan pdf or not? I mean article inside the Pdf file
Quote from: humbleworld on November 13, 2012, 05:42:31 AM
I really want to use this MOD but it seems that this MOD is not compatible with SMF 2.0.2. Can anyone update this MOD, please? Thank you.
Should be, i'm using it with 2.0.3
I don't understand the part , how to get the PDF to put it in the BBC code. From your computer or web site? How can I do that? I installed the mod and seem like working, but I don't know how can I embed a PDF file.
The PDF file must be online somewhere already, you just put the link to it inside the pdf tag.
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?
I got it! Finally from youtube.
http://www.youtube.com/watch?v=NPveEjP00RE
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.
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.
It was just a recommendation for novice users with little php knowledge, Arantor.
Except it's *right* there...
<search>
// Match a table... hopefully with everything in the right place.
'~\[table\](?:\s|\xA0|<br />| )*((?:\[tr\](?:\s|\xA0|<br />| )*\[td\]).*?(?:(?:\s|\xA0|<br />| )*\[/td\]\[/tr\])*)(?:\s|\xA0|<br />| )*\[/table\](?:\s|\xA0|<br />| )?~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?
I thought, V1 and V2 modifications are different after reading the whole topic, maybe it was my mistake/misunderstanding, sorry.
The only differences in the posted code are for putting an editor button in, which IS different across SMF versions.
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.
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.
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 :)
how can we does not allow user to save that pdf in post
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?
Does it work? Any updates?
Quote from: teos55 on January 16, 2013, 10:34:33 AM
http://custom.simplemachines.org/mods/index.php?mod=1468
Seems to work fine in 2.0.9.
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.
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
// 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>',
),
Why this code does not work for 1.1.3 version?
Because it wasn't designed for it?
The better question is, why not upgrade to 2.0.14?
Does anyone know the best way to show PDF's on their forum post I'm using 2.0.17 I installed PDF tag but not its working where it show show it is just blank ??