View Full Version : Download a PalmDoc Version

29 Jul 2001, 20:17
I have an old Palm Pilot Professional; it's like the original beetle. It doesn't surf the 'net, or do the cool stuff the latest palms do, but I can keep my address book on it, and read PalmDoc files. :cool:

I came up with this script about 6 months ago when one of my subscribers, a "palm fanatic" requested a means to get stories from my site in PalmDoc format. (The most common means of reading documents on a palm)

The palmlib script for converting text to PalmDoc is not my own (I don't even understand it!), I just "tweaked" the original VB printthread.php to return a string instead of printing it out to the browser, then pass it through the "Palm Converter"

No PHP changes are required, just 3 template changes...

Included are 2 images:

- palmpilot.gif (The VB 2.0.1 default graphic theme)
- palmpilot_transparent.gif (A transparent .gif with a palm icon, to use on your own graphics)

See a working demo at http://www.coffeeintherain.com/forums, or see the attached screenshot.

(Download .zip: http://www.coffeeintherain.com/scripts/palm_hack.zip)


30 Jul 2001, 07:08
As I was driving to work this morning, I realised that including a hacked version of printthread.php (as palmthread.php), was probably against the hacking rules. (VB source)

I removed the source from the zipfile, and included instructions on manually hacking printthread, line-by-line :)

Sorry 'bout that!

30 Jul 2001, 16:55
First of all....nice hack...I'll give this one a shot.
Second, awesome set of forums!!!!!! A community dedicated to my most favored beverage!!!!! Life does not begin without a good cup of java! :D :D

30 Jul 2001, 17:02
Three sips for coffee!! :D

31 Jul 2001, 01:38
Not sure why, but all I get, is a blank page when I click on the "Download PalmDoc Version" link.

31 Jul 2001, 08:57
Try this:

Change the final line in palmthread.php from:
onTheFlyPalmDoc($output, "$output", $pdbname);


If that gives you some garbled rubbish when you click on the "Download" link, then we know it's palmlib that's giving you trouble.

Also, are you running PHP in safe mode?
(I am, and occasionally palmlib makes my server burp about safe mode, but it still runs)

31 Jul 2001, 14:03
nice hack, very handy!

31 Jul 2001, 14:39
I made the code change to palmthread.php, but I still get a blank page. My site doesn't run in safe mode.

31 Jul 2001, 17:33
Evidently something went wrong while making the PHP changes... hmm

-- Contemplative expression -- :rolleyes:

Next thing I'd try is starting afresh.

- Delete palmthread.php, make a copy of printthread.php

- Run the link without any PHP changes. It should look identical to the printer-friendly version (duh!)

- Then make the template changes, testing after each change. (The text displayed will look progressively uglier)

- Finally, the last output change.

Let me know where it croaks! :)

11 Aug 2001, 19:32
...or try to disable gzip output in admincp. now it works for me! thx for support from author!

02 Sep 2001, 16:49
Hello CoffeeMugdude,

Just wanted to tell you that I really love this hack! I'm the chairman of the Dutch Palm User Group (http://www.palmclub.nl and http://www.pdaclub.nl/forums - different server to spread bandwidth) and this hack comes in really handy when users want to preserve tips, nice utils or whatever comes around in our threads.
Very nice documentation and overall a winner!

Kind regards,
Jean-Paul Horn

26 Jan 2002, 19:58
As the Coffee In The Rain site is down, and you could only download the attachment at the site itself, I hereby resubmit it to the community.

This is not my hack!

I'm just a happy user of this hack and I think it could be usefull to others, so here you go.

06 Feb 2002, 06:04
Okay, there's a typo in the install instructions that caused me some probs

for palmthread.php the instructions say
eval("\$palmbits .= \"".gettemplate("palmthreadbit")."\";");

change palmthreadbit to palmthread_bit to match the template change given earlier in the instructions.

Things work great now, though. My users love it.

28 Jun 2002, 13:50
Just installed this hack and it's a FANTASTIC one at that! It is the perfect hack for my new board.

Thanks DJR for posting the hack here since coffeeintherain is down.

The only thing that I've noticed is that it doesn't work with the Opera browser. I've noticed that with other attachement style links, so I don't think it's a problem with the hack per se, just more with how Opera handles certain links. It works just fine in other browsers.

29 Jun 2002, 16:51
:bump: this hack is no longer there. it seems the site it was hosted at has shut down :(

29 Jun 2002, 18:00
Hmmmm... wake up and smell the coffee :-)


- djr

Jared Press
04 Jul 2002, 14:16
I tried setting this up but it came back with a safe made restriction error. Is there a way around this problem?

Chris M
04 Jul 2002, 14:37
Turn of safe mode in your vBulletin options...

Nice hack:)


Jared Press
04 Jul 2002, 15:04
Tried that but my server is runing in safe mode so I guess it will have no effect?

05 Jul 2002, 19:11
@ Jared: Leave 'Safe mode ON' in vB and then change this line in palmlib.php:

$tempfile = tempnam("palm", "palm");

into this:

$tempfile = tempnam("images/tmp", "palm");

By hardcoding the path the hack should work. It's working at our board and we're also running vB in safe mode.

Remember: the tmp directory should be world-writable, e.g. chmod to 777!!!

Good luck,
- djr

Jared Press
05 Jul 2002, 23:25

Should I create this temp folder and put it in my site set to 777?

Should this temp folder be located in my root as www/site/images/temp



Thanks for your reply, I am relaly looking forward to having this hack.

05 Jul 2002, 23:36

We've set it up like this:


where tmp is chmod 777

In other words: the tmp dir is a directory under your forum's images folder.

Good luck!

p.s. What kind of forum you got?

Jared Press
05 Jul 2002, 23:47
We ahve a PAlm OS developers support site for developers using PDA Toolbox as a development tool. Great group of people and thankfully a very successful site and rapdily gaining a name for it self. We are one of the few "software distributors" who have ever gotten free advertising out of Palmgear (I think) but then we are an affiliate.

Here is the URL if you wnat ot check it out. http://www.pdatnutsandbolts.com

Some times it is referedd to as PDATN&B sometimes simply "The Nuts&Bolts"

It is only the end of our first year (6/22) and as you can imagine some part of the site is under construction all the time. 350 pages worth. But it is getting there...where ever there is ;)

Stop by and have a look around if you like.

Thanks for your help...wish I had known about this site a year ago...but then I would have had no clue what to do with it ;)

06 Jul 2002, 00:17
I registered at your board and am awaiting confirmation :-)

I'm the president of the Dutch Palm User Group, but let's not be off-topic and do further chit-chat on your board.

- djr

Jared Press
06 Jul 2002, 01:36
I got the hack installed and not kicking out out of the server. However all I am getting in the doc is the thread ID and the copy right notice no thread content.

I noticed that after I did the convert no new file is in the tmp folder. Should there be?

should the palm.lib files have this in the line:


I believe right now it is


Jared Press
06 Jul 2002, 03:17
I guess the problem is that the hack is creating invalid characters in the title. Did you have that problems?

I come up with a title that looks like "[] [] []_ _ _ _ _ _ _"

BTW thanks for stopping buy our forum...hope you'll keep coming back.

I stopped by yours but I can't read it ...bummer.

Jared Press
06 Jul 2002, 04:37

I've attached a copy of the palmthread file I have uplaoded to server. Maybe you can see something wrong with the code. If anything?

Maybe the palm.lib file is not CHMOD right? Should it have a particular setting?

06 Jul 2002, 17:55

I'm not at my own PC right now,m but when I get home i'll post my files here with full instructions.
The hack is not really difficult, but it's probably not really updated for vB 2.2.x.

- djr

Jared Press
07 Jul 2002, 01:20
Thanks I appreciate you taking the time to help me out.

Like I said I think it might actually be a problem with the palm.lib. I get the tempalet header and footer but none of the stuff the palm lib is supposed to convert.

Does this need to be CHMOD to work...thought about trying that but figured I might as well wait.

05 Feb 2003, 20:25
Originally posted by djr

I'm not at my own PC right now,m but when I get home i'll post my files here with full instructions.
The hack is not really difficult, but it's probably not really updated for vB 2.2.x.

- djr

Will this work in 2.2.9?

06 Feb 2003, 14:24

- djr

16 Feb 2003, 16:28
I just get a blank page....

11 Mar 2003, 15:04
Although I've had it installed on my board for quite some time, I finally started using it recently and I've noticed a glitch.

For some reason I don't receive the full text of the post. It cuts off shortly after the copyright section, which is about one page of copy

Anyone else run into this and have a fix?