amemeber and phpbb messages

Discussion in 'Integration' started by jasondavis, Jul 2, 2004.

  1. jasondavis

    jasondavis New Member

    Joined:
    Aug 1, 2003
    Messages:
    85
    Is there anyway to show the (2) new messages from phpbb in the account area of amember?
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    I don't think it is possible.
  3. jasondavis

    jasondavis New Member

    Joined:
    Aug 1, 2003
    Messages:
    85
    I found this hack, I can do it with regualr pages, but not sure how I could add it in the templates since I can't have php in the templates, and ideas?

    Code:
    <?php
    
    //Dynamic phpBB template by AJ Quick
    //www.ajquick.com
    
    define('IN_PHPBB', true); 
    
    $site_root_path = '/home/jayhost/public_html'; //<-- Modify
    $phpbb_root_path2 = '/forums/'; //<-- Modify
    $phpbb_root_path = $site_root_path . $phpbb_root_path2;
    include($phpbb_root_path . 'extension.inc'); 
    include($phpbb_root_path . 'common.php'); 
    
    $userdata = session_pagestart($user_ip, PAGE_INDEX); 
    init_userprefs($userdata);
    
    
    
    //Private Message Throughout Site
    //By AJ Quick
    
    if($userdata['session_logged_in']){//logged in
    
    if ( $userdata['user_new_privmsg'] )//private messages
    	{
    		$l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms']; 
    		$l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']); 
    
    		if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] )
    		{
    			$sql = "UPDATE " . USERS_TABLE . "
    				SET user_last_privmsg = " . $userdata['user_lastvisit'] . " 
    				WHERE user_id = " . $userdata['user_id'];
    			if ( !$db->sql_query($sql) )
    			{
    				message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql);
    			}
    
    			$s_privmsg_new = 1;
    			$icon_pm = $images['pm_new_msg'];
    		}
    		else
    		{
    			$s_privmsg_new = 0;
    			$icon_pm = $images['pm_no_new_msg'];
    		}
    	}
    	else
    	{
    		$l_privmsgs_text = $lang['No_new_pm'];
    
    		$s_privmsg_new = 0;
    		$icon_pm = $images['pm_no_new_msg'];
    	}
    
    	if ( $userdata['user_unread_privmsg'] )
    	{
    		$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms']; 
    		$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']); 
    	}
    	else
    	{
    		$l_privmsgs_text_unread = $lang['No_unread_pm'];
    	}
    
    }// User Logged In
    
    ?>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <title>Site Name</title>
    <?php
    if ( !empty($userdata['user_popup_pm']) ){
    ?>
    <script language="Javascript" type="text/javascript">
    <!--
    	if (<?php echo $s_privmsg_new ?>)
    	{
    		window.open('<?php echo "$phpbb_root_pathprivmsg.".$phpEx."?mode=newpm" ?>', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
    	}
    //-->
    </script>
    
    <?php
    }
    ?>
    <body>
    
    <?php
    if($userdata['session_logged_in']){
    ?>
    		<a href="<?php echo $phpbb_root_path2 ?>privmsg.php?folder=inbox"><?php echo $l_privmsgs_text ?></a><br><br>
    
    
    
    <?php
    }
    
    //That's It! Go Back and look over what you don't need.
    //Written By AJ Quick, [email]aj@ajquick.com[/email]
    //Now Go Have Some Fun!
    ?>
    
    </body>
    </html>
    
  4. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021

Share This Page