Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
johnnycard
New Member
New Member



Joined: Oct 25, 2003
Posts: 19

PostPosted: Fri Nov 05, 2004 10:14 am Reply with quote

I've been trying to get the 2 hacks - PM Export and PM Review to work with my phpnuke 6.5 with PHPBB 2.08 but to no avail.

The 2 hacks are from phphacks.com

PM Export:
This hack makes it so that if you are replying to a private message, you will see the message you are replying to below the text box.
[ Only registered users can see links on this board! Get registered or login! ]

PM Review:
Exports all sent and received private messages. Great feature for administrators with a lot of PMs who want a hard copy backup.
[ Only registered users can see links on this board! Get registered or login! ]

Is there anybody who is able to help? I think they are really useful hacks and would be useful to other Nuke users.

It may be that these hacks have been modified to work with phpnuke but I haven't found them yet - if you know where I can get them from please let me know. Any help would be greatly appreciated.

JohhnyCard
 
View user's profile Send private message
CurtisH
Life Cycles Becoming CPU Cycles



Joined: Mar 15, 2004
Posts: 638
Location: West Branch, MI

PostPosted: Fri Nov 05, 2004 12:18 pm Reply with quote

Look at [ Only registered users can see links on this board! Get registered or login! ] the have those ported to work with nuke

_________________
Those who dream by day are cognizant of many things which escape those who dream only by night. ~Poe 
View user's profile Send private message Visit poster's website Yahoo Messenger
chatserv
Member Emeritus



Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico

PostPosted: Fri Nov 05, 2004 12:24 pm Reply with quote

Here's one of them, it looks like it should work.
Code:
############################################################## 

##
## MOD Title:        Private Message Review
##
## MOD Author:        aUsTiN => [ Only registered users can see links on this board! Get registered or login! ]
##
## MOD Description:       A Very Much Needed Upgrade.
##
## MOD Version:           1.0.1
##
## MOD Help:        http://phpbb-amod.com/
##
## Installation Level:    Easy
##
## Installation Time:     2 Minutes
##
## Files To Edit:         3
##
## Included Files:        0
##
##############################################################
##############################################################
##
## Author Notes:
##
##
##   Copyright © aUsTiN-Inc, 2003/4
##
##   If you add anything or want anything added, please visit
##      http://phpbb-amod.com/   
##
##   ALL FILES WERE DOWNLOADED DIRECTLY FROM MY SITE TO BUILD THIS INSTALL.
##
##   Tested versions:
##
##   phpBB:
##
##      2.0.4 - 2.0.10
##
##   phpMyAdmin Versions:
##
##      2.5.6-rc1
##
##   MySql Versions:
##
##      4.0.18-standard
##
##   PHP Versions:
##
##      4.3.3 - 4.3.4
##
##   Feel free to see it in action at http://phpbb-amod.com/
##
##############################################################
##
## MOD History:
##
##   ??? ???? 2004 - Version 1.0.0
##         - Beta
##
##   Aug 28th 2004 - Version 1.0.1
##         - Final
##
##############################################################
##
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##
##############################################################
##
##   Definitions:
##
##      Root: Folder your config.php is located
##      templates/*/: Your template folder (All template folders are suggested)
##      lang_*/: Your current language folder (All lang folders are suggested)
##
##############################################################

-----------------------------------
----[ OPEN ]-----------------------
-----------------------------------

modules/Private_Messages/index.php

-----------------------------------
----[ FIND ]-----------------------
-----------------------------------

   //
   // Send smilies to template
   //

-----------------------------------
----[ ADD, BEFORE ]----------------
-----------------------------------

/* Start Private Message Review By aUsTiN */
   $post_to_review = $HTTP_GET_VARS['p'];
   
   $q = "SELECT privmsgs_text , privmsgs_bbcode_uid
        FROM  ". PRIVMSGS_TEXT_TABLE ."
        WHERE privmsgs_text_id  = '". $post_to_review ."'";
   $r      = $db -> sql_query($q);
   $row    = $db -> sql_fetchrow($r);
   
   $post_to_add_beneath          = $row['privmsgs_text'];
   $post_to_add_beneaths_bbcode    = $row['privmsgs_bbcode_uid'];
   
   $prv_msg_review_1 = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($post_to_add_beneath, $post_to_add_beneaths_bbcode) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $post_to_add_beneath);         
   $prv_msg_review_2 = make_clickable($prv_msg_review_1);
   
   if($board_config['allow_smilies'])
      {
   $prv_msg_review_3 = smilies_pass($prv_msg_review_2);
      }
   else
      {
   $prv_msg_review_3 = $prv_msg_review_2;
      }
      
   if(!$prv_msg_review_3)
      {
   $prv_msg_review_3 = $lang['private_msg_review_error'];
      }
      
   $prv_msg_review = $prv_msg_review_3;
   
   if($HTTP_GET_VARS['mode'] == "reply")
      {
   $block_var_switch = "switch_prv_msg_review";
      }
   else
      {
   $block_var_switch = "";      
      }
      
   $template->assign_block_vars($block_var_switch, array(      
      'PRIVATE_MSG_REVIEW' => $prv_msg_review,
      'PRIVATE_MSG_TITLE'  => $lang['private_msg_review_title'])
         );         
/* End Private Message Review By aUsTiN */

-----------------------------------
----[ CLOSE & SAVE ]---------------
-----------------------------------

-----------------------------------
----[ OPEN ]-----------------------
-----------------------------------

modules/Forums/language/lang_*/lang_main.php

-----------------------------------
----[ FIND ]-----------------------
-----------------------------------

?>

-----------------------------------
----[ ADD, BEFORE ]----------------
-----------------------------------

/* Start Private Message Review By aUsTiN */
$lang['private_msg_review_title'] = 'Message You\'re Replying To';
$lang['private_msg_review_error'] = 'Error Finding Private Message!';
/* End Private Message Review By aUsTiN */

-----------------------------------
----[ CLOSE & SAVE ]---------------
-----------------------------------

themes/your_theme/forums/posting_body.tpl

-----------------------------------
----[ FIND ]-----------------------
-----------------------------------

{POLLBOX}

-----------------------------------
----[ ADD, BEFORE ]----------------
-----------------------------------

<!-- BEGIN switch_prv_msg_review -->
   <tr>
      <th class="thHead" colspan="2">
         <b>
            {switch_prv_msg_review.PRIVATE_MSG_TITLE}
         </b>
      </th>
   </tr>
   <tr>   
      <td align="left" valign="top" colspan="2" width="65%" class="row2">
           <span class="gensmall">
            {switch_prv_msg_review.PRIVATE_MSG_REVIEW}
         </span>
      </td>
   </tr>
<!-- END switch_prv_msg_review -->

-----------------------------------
----[ CLOSE & SAVE ]---------------
-----------------------------------

-----------------------------------
----[ EoM ]------------------------
-----------------------------------
 
View user's profile Send private message Visit poster's website
chatserv







PostPosted: Fri Nov 05, 2004 12:33 pm Reply with quote

Here's the other:

install instructions file:
Code:
#####################################################################################

##
##     MOD Title:          PM Export
##
##     MOD Author:         FR (www.php-styles.com - [ Only registered users can see links on this board! Get registered or login! ])
##
##     MOD Description:    Displays an extra link in the private-messages area.
##                         Exports all sent and received private messages.
##
##     MOD Version:        1.0 - 7th June 2004
##
##     Installation Level: (Easy)
##
##     Installation Time:  5 Minutes
##
##     Files To Edit:       privmsg.php
##             /templates/subSilver/privmsgs_body.tpl
##             /templates/subSilver/subSilver.cfg
##            /lanaguage/lang_english/lang_main.php
##
#####################################################################################
##
##     If you dont like the place of the added esport-link, just change it
##     how you want. Need help with it? --> [ Only registered users can see links on this board! Get registered or login! ]
##
#####################################################################################
##
##     This hack is released under the GPL License.
##     This hack can be freely used, but not distributed, without permission.
##     Intellectual Property is retained by the author listed above.
##
#####################################################################################
##
##     Credits: Leuchte (mail@leuchte.net) for beta-testing
##
#####################################################################################

#####################################################################################
##
##     Before Adding This MOD To Your Forum,
##     you Should Back Up All Files Related To This MOD
##
#####################################################################################


Copy privmsg_export.php into the root directory of your phpBB
     msg_export.gif into themes/your_theme/forums/images

#
#-----[ OPEN ]------------------------------------------
#

modules/Private_Messages/index.php

#
#-----[ FIND ]-------------------------------------------------
#

// Dump vars to template
//
$template->assign_vars(array(
   'BOX_NAME' => $l_box_name,
   'INBOX_IMG' => $inbox_img,
   'SENTBOX_IMG' => $sentbox_img,
   'OUTBOX_IMG' => $outbox_img,
   'SAVEBOX_IMG' => $savebox_img,
   'INBOX' => $inbox_url,
   'SENTBOX' => $sentbox_url,
   'OUTBOX' => $outbox_url,
   'SAVEBOX' => $savebox_url,

#
#-----[ AFTER, ADD ]----------------------------------------
#

   'EXPORT' => "<a href='" . append_sid("privmsg_export.php") . "' target='_new'>" . $lang['Export'] . " </a>",
        'EXPORT_IMG' => "<a href='" . append_sid("privmsg_export.$phpEx") . "'><img src='" . $images['pm_export'] . "' border='0' alt='" . $lang['Export'] . "' /></a>",

#
#-----[ OPEN ]------------------------------------------
#

themes/your_theme/forums/privmsgs_body.tpl

#
#-----[ FIND ]-------------------------------------------------
#

        <td>{SAVEBOX_IMG}</td>
        <td><span class="cattitle">{SAVEBOX} &nbsp;</span></td>

#
#-----[ AFTER, ADD ]----------------------------------------
#

        <td>{EXPORT_IMG}</td>
        <td><span class="cattitle">{EXPORT} &nbsp;</span></td>


#
#-----[ OPEN ]------------------------------------------
#

themes/your_theme/forums/your_theme.cfg or themes/your_theme/forums/forums.cfg

#
#-----[ FIND ]-------------------------------------------------
#

$images['pm_readmsg'] = "$current_template_images/folder.gif";

#
#-----[ AFTER, ADD ]----------------------------------------
#

$images['pm_export'] = "$current_template_images/msg_export.gif";


#
#-----[ OPEN ]------------------------------------------
#

modules/Forums/language/lang_english/lang_main.php

#
#-----[ FIND ]-------------------------------------------------
#

//
// That's all, Folks!
// -------------------------------------------------

#
#-----[ AFTER, ADD ]----------------------------------------
#

$lang['export_pm_from'] = 'From: ';
$lang['export_pm_to'] = 'To: ';
$lang['export_pm_subject'] = 'Subject: ';
$lang['export_pm_time'] = 'Time: ';
$lang['export_pm_text'] = 'Text: ';
$lang['Export'] = 'Export';
$lang['sign_in_to_export'] = 'You need to login to export your pms';
 
 
#
#       OR GERMAN
#
#-----[ AFTER, ADD ]----------------------------------------
#

$lang['export_pm_from'] = 'Von: ';
$lang['export_pm_to'] = 'An: ';
$lang['export_pm_subject'] = 'Betreff: ';
$lang['export_pm_time'] = 'Zeit: ';
$lang['export_pm_text'] = 'Text: ';
$lang['Export'] = 'Exportieren';
$lang['sign_in_to_export'] = 'Du musst dich einloggen, um PN exportieren zu k&ouml;nnen.';

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#

#####################################################################################
##
##    FR - [ Only registered users can see links on this board! Get registered or login! ]
##
#####################################################################################


privmsg_export.php file:
Code:
<?php

/***************************************************************************
 *                            privmsg_export.php
 *                            -------------------
 *   begin                :   June 2004
 *   copyright            :   (C) FR
 *   email                :   fr@php-styles.com
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This hack is released under the GPL License.
 *   This hack can be freely used, but not distributed, without permission.
 *   Intellectual Property is retained by the author listed above.
 *
 ***************************************************************************/

if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
    die ("You can't access this file directly...");
}
if ($popup != "1"){
    $module_name = basename(dirname(__FILE__));
    require("modules/".$module_name."/nukebb.php");
}
else
{
    $phpbb_root_path = 'modules/Forums/';

}

define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
     include('includes/bbcode.'.$phpEx);
     include('includes/functions_post.'.$phpEx);

     // Start session management
     $userdata = session_pagestart($user_ip, PAGE_PRIVMSGS, $nukeuser);
     init_userprefs($userdata);
     // End session management

     // Start Include language file
     $language = $board_config['default_lang'];
     if( !file_exists($phpbb_root_path . 'language/lang_' . $language . '/lang_main.'.$phpEx) )
          {
               $language = 'english';
          } // if
         
     if ( $userdata['user_id'] < 1 )
          {
      message_die(GENERAL_ERROR, $lang['sign_in_to_export'], '', __LINE__, __FILE__, $sql);
          }

     include($phpbb_root_path . 'language/lang_' . $language . '/lang_main.' . $phpEx);
     // end include language file

   $sql = "SELECT u.username AS username_1, u.user_id AS user_id_1, u2.username AS username_2, u2.user_id AS user_id_2, u.user_sig_bbcode_uid, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_avatar, pm.*, pmt.privmsgs_bbcode_uid, pmt.privmsgs_text, pmt.privmsgs_bbcode_uid
      FROM (" . PRIVMSGS_TABLE . " pm
                   LEFT JOIN " . PRIVMSGS_TEXT_TABLE . " pmt ON pmt.privmsgs_text_id = pm.privmsgs_id
                   LEFT JOIN " . USERS_TABLE . " u ON pm.privmsgs_from_userid = u.user_id
                   LEFT JOIN " . USERS_TABLE . " u2 ON pm.privmsgs_to_userid = u2.user_id)
      WHERE pmt.privmsgs_text_id = pm.privmsgs_id
         AND ( u.user_id = " . $userdata['user_id'] . "
         OR u2.user_id = " . $userdata['user_id'] . ")
                ORDER BY pm.privmsgs_date DESC";
         
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not query private message post information', '', __LINE__, __FILE__, $sql);
   }

     $total_messages = 0;
     while( $row = $db->sql_fetchrow($result) )
     {
         $messages_rowset[] = $row;
         $total_messages++;
     } // while

     echo "<html><body>";
     for($i = 0; $i < $total_messages; $i++)
             {
                 echo "###################################################################################################<br>";
                 echo "<b>" . $lang['export_pm_from'] . " </b>" .  $messages_rowset[$i]['username_1'] . "<br>";
                 echo "<b>" . $lang['export_pm_to'] . " </b>" . $messages_rowset[$i]['username_2'] . "<br>";
                 echo "<b>" . $lang['export_pm_subject'] . " </b>" . $messages_rowset[$i]['privmsgs_subject'] . "<br>";
                 echo "<b>" . $lang['export_pm_time'] . " </b>" . create_date("m/d/Y - h:i:s", $messages_rowset[$i]['privmsgs_date'], $board_config['board_timezone']) . "<br>";
                 echo "<b>" . $lang['export_pm_text'] . " </b><br>" . bbencode_second_pass($messages_rowset[$i]['privmsgs_text'], $messages_rowset[$i]['privmsgs_bbcode_uid']) . "<br>";
                 echo "###################################################################################################<br><br>";
             }
             
    echo "</body></html>";
?>
 
johnnycard







PostPosted: Sat Nov 06, 2004 8:47 am Reply with quote

Thanks Chatserve, that's great. You're a star!

I'm not actually sure though whether the Export is what I am looking for - what it does is do a mass export of all the PMs - what I could do with is to be able to select individual PMs and either export to a text file or forward to email. Does anybody know of a hack to do this?
 
johnnycard







PostPosted: Sat Nov 06, 2004 9:47 am Reply with quote

Actually thinking over it a bit more the PM Export might work fine if it exported the contents of the PMs to a text file which is saved to the local drive.

You see the problem is many of my members aren't very good at the simple stuff eg. copy and paste - they like things nice and easy. I reckon this would go down well but I have't got a clue how to go about hacking hte hack to do this. Again any help would be greatly appreciated.

JC
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©