vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   private messages backup hack (https://vborg.vbsupport.ru/showthread.php?t=37172)

Cano2 04-07-2002 10:00 PM

private messages backup hack
 
This hack allows users to backup their private messages to a local file.

I know that there exists allready a very similar hack (https://vborg.vbsupport.ru/showthrea...=&pagenumber=1 ) but it contains a serious bug, which allows every users to read everybodys private messages (details see link).

Aditionally this hack works with templates and has some enhanced functionality.

This hack is succesfully tested with a fresh install of vBulletin 2.2.4

I post it here, not as a full release, because of the unclear situation (im new to this board...).

@mods Please excuse me, and move this thread, if you think it's located better elsewhere

lates, Cano2

Erwin 04-08-2002 08:28 PM

Works well! I uninstalled the download PM hack, and changed to your.

Thanks!

MrLister 04-08-2002 10:25 PM

thanks, great job!

Admin 04-09-2002 11:26 AM

Still haven't tested it but looks promising. :) Will probably install this one here later.

You know what would be ever "awesomer"? If you could download AND upload your PM's. :D Just a thought tho.

LouChipher 04-09-2002 01:55 PM

nice. added. ;)

demo on cano2's board.. ;)

Cano2 04-09-2002 02:29 PM

@FireFly:

I thought about that too.. It's not trivial, because the format of the messages can be changed via template, but it's a nice challenge and not too difficult...

An other good idea is to add a new status symbol for PMs wich indicates, which messages are allready backed up. This prevents people from deleting messages by accident. (thx @ lou for this suggestion)

I will add these features, if i have the time..

Cano2

LouChipher 04-11-2002 05:19 PM

please move to full releases. thanks.

maverick1236 04-12-2002 12:49 PM

Problem
getting a parse error on this line

eval("dooutput(\"".gettemplate("privbackup")."\"); "); //and run everything through the template

Cano2 04-12-2002 01:17 PM

hm.. this line of code itself is syntacally correct...
Paste the exact error message, the 2-3 lines of code before this line and the code in the privbackup_header template please! Does the errmsg say, the error occured in "eval()'d code"???

Erwin 04-12-2002 02:08 PM

Working fine for me with no errors.

maverick1236 04-12-2002 02:15 PM

Parse error: parse error in c:\program files\nusphere\apache\htdocs\forums\private.php(18 1) : eval()'d code on line 1

Admin 04-12-2002 04:14 PM

The error is not in that line but in the code it's trying to evaluate (i.e the template).

Cano2 04-15-2002 03:25 PM

right.. the error is probably in the privbackup_header template (witch has to be valid phpcode)

Cano2

LouChipher 04-15-2002 04:29 PM

"Added a new status symbol for PMs wich indicates, which messages are allready backed up."

good work.. but can you add different graphics? (forward&save, replay&save)? this would be very useful...

Cano2 04-15-2002 04:51 PM

For those who are updating from the previous version:

********************
open private.php
********************
search for:

eval(gettemplate("privbackup_header",0));
eval("dooutput(\"".gettemplate("privbackup")."\"); "); //and run everything through the template
********************
after it insert:
//set status to "backed up"
$DB_site->query("UPDATE privatemessage SET messageread=4 WHERE $cond");
********************
search for:
eval(stripslashes(gettemplate("privbackup_header") );
********************
replace with:
eval(gettemplate("privbackup_header",0));
********************
download the new hack, and move pmbackedup.gif to /images

@lou thx.. to add the support for more icons is not a problem, but to create the icons ( 16x16 ist not much space ...). I'll do my best

lates Cano2

Erwin 04-15-2002 07:54 PM

Also, when updating from the previous version, make these changes too:

*********************************
search for:

PHP Code:

          case 3// forwarded message
            
$privatemessage[folder] = "{imagesfolder}/pmforwarded.gif";
            break; 

*********************************
right after it insert:

PHP Code:

          case 4//backed up message
            
$privatemessage[folder] = "{imagesfolder}/pmbackedup.gif";
            break; 

*********************************

Cano2 04-15-2002 08:25 PM

hoops.. thx. Dunno where I have lost my brain today.

r.cakir 04-15-2002 08:58 PM

Hi Cano2

I have just installed this great hack on my Board and it seems to work fine. I have just one little question:

I'm working with Mac OS X 10.1.3 and after I download my pm's, I find a file called "private.php" on my desktop, which contains the private messages. But before it can opened in a Browser, I must change the File-Extension every time manualy to "private.html". Is there a way to have the correct Extension (.html) after Download by default?

Cano2 04-16-2002 05:42 PM

hm. I doesn't have a mac, so I can't test it, but i'm sure its because of the headers in the "privbackup_header".. although the behaviour for the "Content-Disposition" header is clearly defined in the http-rfc, every browser behaves different. These headers were the best I found, but I will search again for a way to tweak these headers.

btw: which browser(s) are you using?

Cano2

r.cakir 04-16-2002 06:15 PM

First, thanks for your reply. I use OmniWeb 4.1 (a Mac OS X only Browser) and MS Internet Explorer 5.1.3 for Mac OS X.

Let me know, if you find a solution.

Harryli 04-17-2002 08:33 PM

One Problem, the text "Save as a HTML File" is not shown anywhere...

Cano2 04-18-2002 04:11 PM

I'm not sure if I understand your problem...

Did you used the optional "privbackup_header" template and now wondering about that message in the "privbackup" template?? It is included in the backup file and thus senseless (you can remove that messe form the template).

Its thought to be used, when you don't use the "privbackup_header" template then a simple html page containig the messaged shows up in the browser, and this message tells the user, what to do...

I think I schould correct the hacking instructions to make that more clear. thx

Cano2

elitetrader 05-01-2002 01:14 PM

I just want to say thanks for this hack. I have representatives of financial firms on my site who must comply with regulations that require them to keep a record of all correspondence with their clients, even private messages. This hack enabled them to do that. Thanks again!

mariochiosso 05-16-2002 01:12 AM

hi,
does it work with 2.2.5 release? :)

VirtueTech 05-16-2002 03:32 PM

One thing is that it does not change the icon in 2.2.5 after you back it up. I have looked through the code and it does not change the field "messageread" in the privatemessage table to "4" for case 4.

Any ideas?

I tried adding this to the while statement you added to private.php:
PHP Code:

$DB_site->query("UPDATE privatemessage SET messageread=4 WHERE privatemessageid=".intval($prevmessageid)); 


saibal 05-16-2002 10:08 PM

Hi,
I've a problem. I succefully install this hack on my backup-board but when I tried to install the same hack on my public vbulletin the page to download didn't work.

It trie to download named "private.php". The header's lines didn't work... why?

Note: in my backup-board i've only one template; in my "public" vbulletin i've 5 template...

N!ck 05-26-2002 05:54 AM

i have the same problem as saibal

Boofo 05-26-2002 08:46 AM

What does "von" mean in English? Here is the line of code i found it in.

May 9, 2002, 9:10 pm von Boofos Babe.

Boofo 05-26-2002 08:53 AM

Also, is there any way to have the messages save like they are written? Like using the same formatting. I saved a message tonight that had some quotes listed in it by numbers (1..2...3, etc) and the writing when it was saved was all run together in one paragrah.

Great hack, by the way! Uninstalled the buggy one and installed this one. :)

Boofo 05-26-2002 09:36 AM

Go to Post #15 in this thread and do the first find and replace step and the icon will appear after you have backed up the messages. :)


Quote:

Originally posted by VirtueTech
One thing is that it does not change the icon in 2.2.5 after you back it up. I have looked through the code and it does not change the field "messageread" in the privatemessage table to "4" for case 4.

Any ideas?

I tried adding this to the while statement you added to private.php:
PHP Code:

$DB_site->query("UPDATE privatemessage SET messageread=4 WHERE privatemessageid=".intval($prevmessageid)); 



JZarate 06-01-2002 10:45 PM

Great Hack! Thanks!

Angelus1753 06-08-2002 10:46 AM

Must say, this is an awsome hack.

Question (more of a request though): In the genereated HTML page, the PM's shown are in any order, so is there any way to show them in a more date/time oriented approach?

Boofo 06-08-2002 11:29 AM

Cano2,

Are you still supporting this hack? I'm still having a problem with the message format on saved messages.

Cano2 06-09-2002 11:12 AM

Of course im still supporting it.. Sry, I just have been away for a month, i will try to help you as soon as possible.

@Angelus1753 :
Yes it is possible and allready implemented in the next big release (hope it doesn't much time for me anymore to finish it).

Until then:
Replace
Code:

$msgs= $DB_site->query("SELECT
  privatemessage.*,
  IF(ISNULL(touser.username),'[Deleted User]',touser.username) AS tousername,
  IF(ISNULL(fromuser.username),'[Deleted User]',fromuser.username) AS fromusername
  FROM privatemessage
  LEFT JOIN user AS touser ON (touser.userid=privatemessage.touserid)
  LEFT JOIN user AS fromuser ON (fromuser.userid=privatemessage.fromuserid)
  WHERE $cond ORDER BY folderid");

with
Code:

$msgs= $DB_site->query("SELECT
  privatemessage.*,
  IF(ISNULL(touser.username),'[Deleted User]',touser.username) AS tousername,
  IF(ISNULL(fromuser.username),'[Deleted User]',fromuser.username) AS fromusername
  FROM privatemessage
  LEFT JOIN user AS touser ON (touser.userid=privatemessage.touserid)
  LEFT JOIN user AS fromuser ON (fromuser.userid=privatemessage.fromuserid)
  WHERE $cond ORDER BY folderid,dateline ");

lates, cano2

Cano2 06-09-2002 11:45 AM

@Boofoo:
There are two ways, it depends on what you want:

first find
Code:

eval("\$messages .= \"".gettemplate("privbackup_message")."\";");
right before it insert
Code:

$message[message]=nl2br($message[message]);
or
Code:

$message[message]=pmcodeparse($message[message],0,$allowsmilies);
With the first one, the Linebreaks would show up correctly, the second one shows the message as it would be shown in the board (with smillies, lists, ... ) (but the paths to images are relative, so you wont ?see the smilies, if you save it to disk)

Hope that helps you

Maybe I find a way to include the first one in the next release...

Cano2

saibal 06-09-2002 02:16 PM

hi cano2,

have you suggestions for my problem? :)

Cano2 06-09-2002 02:28 PM

Can you tell me plz what exactly happens after you click "backup" (and with witch Browserversion/OS of course)? Does the Download window popup, or is the page shown in the Browser? Which name has the file to download, if it shows up?

Boofo 06-09-2002 06:33 PM

Thank you very much. You are a gentleman and a scholar. :)

The only question I have now is which way is the better one to go? The first one only saves the smilie code, too (i.e. :eek:) And is there a way to have it save to the date in the filename instead of saying today? That way it won't overwrite any backups and you will know on which date you made the last backup.

Thanks for the quick fix. :)

Quote:

Originally posted by Cano2
@Boofoo:
There are two ways, it depends on what you want:

first find
Code:

eval("\$messages .= \"".gettemplate("privbackup_message")."\";");
right before it insert
Code:

$message[message]=nl2br($message[message]);
or
Code:

$message[message]=pmcodeparse($message[message],0,$allowsmilies);
With the first one, the Linebreaks would show up correctly, the second one shows the message as it would be shown in the board (with smillies, lists, ... ) (but the paths to images are relative, so you wont ?see the smilies, if you save it to disk)

Hope that helps you

Maybe I find a way to include the first one in the next release...

Cano2


saibal 06-09-2002 10:27 PM

Quote:

Originally posted by Cano2
Can you tell me plz what exactly happens after you click "backup" (and with witch Browserversion/OS of course)? Does the Download window popup, or is the page shown in the Browser? Which name has the file to download, if it shows up?

thanks for the attention cano2 :)


i have two forums: one is to test the hacks and the other is "public". the only difference between these two forums is that the public forum has 4 template while the test forum has only one.

when i installed your hack on test forum it works good but when i install it on public forum it doesn't work.

it try to download a page named "private.php".
this page contains the right html code with all messages but the name adn the extension of the file is wrong (it may be like "some_date.html" no?) :)


p.s.
excuse me for me bad english :)

Boofo 06-10-2002 12:15 AM

Cano2,

I'm still curious as to what "von" means. :) You have it in the code for "at" or "von".


All times are GMT. The time now is 09:48 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04916 seconds
  • Memory Usage 1,827KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete