vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   [not a bug] Private Messages Clutter-- (https://vborg.vbsupport.ru/showthread.php?t=14356)

Jason Hung 04-17-2001 03:08 AM

I think that the private messages are missing the paging feature... perhaps add << < 1 2 ... > >> feature?

Kier 04-17-2001 03:19 AM

Most administrators won't allow you to have more than 50-100 private messages, which is why the multipage nav feature is not currently implemented.

Jason Hung 04-17-2001 04:49 AM

Time for a hack? :D

chrispadfield 04-17-2001 08:58 AM

yeah please, i would like it as an admin as i stored lots of pms myself and hate waiting for 200 to load.... until a "download pm thing" comes along..

bira 04-17-2001 09:48 AM

Chris,

Here's a simple and dirty download hack for you. I've had this running on my BB since 1.1.3:

1) Open private.php. Find:

Code:

  if ($delete!="") {
    $what="delete";
  }

Immediately under it put:

Code:

  if ($download!="") {
    $what="download";
  }

Find:

Code:

    eval("standardredirect(\"".gettemplate("redirect_pmdelete")."\",\"private.php?s=$session[sessionhash]&folderid=$thisfolder\");");
  }

immediately under it put:

PHP Code:

  if ($what=="download") {
      
    if (
is_array($privatemessage)) {
        
header("Content-disposition: filename=messages.txt");
        
header("Content-type: application/octetstream");
        
header("Pragma: no-cache");
        
header("Expires: 0");

          while(list(
$key,$val)=each($privatemessage)) {
            
$downloads mysql_query("SELECT * FROM privatemessage WHERE privatemessageid='$key' AND userid=$bbuserinfo[userid]");
            
$mydownload mysql_fetch_array($downloads);
            
$tousername mysql_query("SELECT username FROM user WHERE userid='$mydownload[touserid]'");
            
$mytousername mysql_fetch_array($tousername);
            
$fromusername mysql_query("SELECT username FROM user WHERE userid='$mydownload[fromuserid]'");
            
$myfromusername mysql_fetch_array($fromusername);
            
$msgdt vbdate($dateformat,$mydownload[dateline]);
            
$msgtm vbdate($timeformat,$mydownload[dateline]);

                    
                    print(
"Date/Time Sent: $msgdt$msgtm\r\n");
                    
printf("From: %s\r\n"$myfromusername["username"]);
                    
printf("To: %s\r\n"$mytousername["username"]);
                    
printf("Subject: %s\r\n\r\n"$mydownload["title"]);
                    
printf("%s\r\n"$mydownload["message"]);
                    print(
"=======================================================================\r\n\r\n\r\n");


        } 
//end while
    
    
} else {
      eval(
"standarderror(\"".gettemplate("error_pmnoselected")."\");");
      exit;
    }
  } 

Upload to server.

2. Open template privfolder. Find:

Code:

<input type="submit" class="bginput" name="move" value="Move" style="background-color:#6C6081;color:#F5D300;font-size:10px;font-weight:bold">
        $massforwardlink
        or <input type="submit" class="bginput" name="delete" value="Delete" style="background-color:#6C6081;color:#F5D300;font-size:10px;font-weight:bold">

change to (change in red):

Code:

<input type="submit" class="bginput" name="move" value="Move" style="background-color:#6C6081;color:#F5D300;font-size:10px;font-weight:bold">
or <input type="submit" class="bginput" name="download" value="Download" style="background-color:#6C6081;color:#F5D300;font-size:10px;font-weight:bold">
$massforwardlink
or <input type="submit" class="bginput" name="delete" value="Delete" style="background-color:#6C6081;color:#F5D300;font-size:10px;font-weight:bold">

That's it. Now, upon selecting message(s) and clicking on "Download", you will be prompted to save the file with the selected messages in it, sorted by descending chronological order. You can then save the file under any name you like.


This can be tested on my Bulletin Board.

Cheers,

Bira

Kier 04-17-2001 09:58 AM

I've moved this thread out of the vB2 Bug reports forum, as it has turned into more of a hacks thread than a bug report.

bira 04-17-2001 10:02 AM

Kier, why don't you take my proposal above here and improve it? I don't have your skills and knowledge

chrispadfield 04-17-2001 10:36 AM

than's bira, that is very useful.

cheers

bira 04-17-2001 10:42 AM

if people are interested in this, I can improve this code to use a template (rather than hard-coded format) and a little less code lines.

Let me know if you are.

chrispadfield 04-17-2001 11:11 AM

i am definitely interested, going to test it on your forum as well soon....


All times are GMT. The time now is 10:08 PM.

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.01477 seconds
  • Memory Usage 1,752KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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