Author Topic: Private nachrichten  (Read 15607 times)

0 Members and 1 Guest are viewing this topic.

Offline hoelzlmani

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://www.smssprueche.net
Private nachrichten
« on: March 18, 2003, 04:31:32 PM »
is es möglich einem registrierten user eine private nachricht zukommen zu lassen. so wie z.b. hier im board ?

Offline party-cam.org

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • http://www.party-cam.org
private nachrichten auf jeder seite
« Reply #1 on: March 19, 2003, 07:06:47 PM »
geht, wenn man es mit z.B. phpBB verbindet

Da hab ich auch grad ein Prob:
Ich würde gern ein PN pop up auf allen seiten haben.
dafür gibt's dieses Mod:

Code: [Select]
#
#-----[ You Must Have Something Like This: ]------------------------------------------
#

<?php
define
&#40;'IN_PHPBB', true&#41;; 

$site_root_path '/';//site path
$phpbb_root_path '/forums/'//forums path 
include&#40;$phpbb_root_path . 'extension.inc'&#41;; 
include&#40;$phpbb_root_path . 'common.php'&#41;; 
include&#40;$phpbb_root_path . 'config.php'&#41;; 

$userdata session_pagestart&#40;$user_ip, PAGE_INDEX&#41;; 
init_userprefs&#40;$userdata&#41;;
?>


#
#-----[ //end of example ]------------------------------------------

#



#
#-----[ Add This Above Your Head Tags: ]------------------------------------------
#


<?php
if&#40;$userdata['session_logged_in'&#93;&#41;&#123;//logged in

if &#40; $userdata['user_new_privmsg'&#93; &#41;//private messages
&#123;
$l_message_new = &#40; $userdata['user_new_privmsg'&#93; == 1 &#41; ? $lang['New_pm'&#93; &#58; $lang['New_pms'&#93;; 
$l_privmsgs_text sprintf&#40;$l_message_new, $userdata['user_new_privmsg'&#93;&#41;; 

if &#40; $userdata['user_last_privmsg'&#93; > $userdata['user_lastvisit'&#93; &#41;
&#123;
$sql "UPDATE " USERS_TABLE "
SET user_last_privmsg = " 
$userdata['user_lastvisit'&#93; . " 
WHERE user_id " . $userdata['user_id'&#93;;
if &#40; !
$db->sql_query&#40;$sql&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, 
$sql&#41;;
&#125;

$s_privmsg_new = 1;
$icon_pm = $images['pm_new_msg'&#93;;
&#125;
else
&#123;
$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'&#93;;
&#125;
&#125;
else
&#123;
$l_privmsgs_text = $lang['No_new_pm'&#93;;

$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'&#93;;
&#125;

if &#40; 
$userdata['user_unread_privmsg'&#93; &#41;
&#123;
$l_message_unread = &#40; $userdata['user_unread_privmsg'&#93; == 1 &#41; ? $lang['Unread_pm'&#93; &#58; $lang['Unread_pms'&#93;; 
$l_privmsgs_text_unread = sprintf&#40;$l_message_unread$userdata['user_unread_privmsg'&#93;&#41;; 
&#125;
else
&#123;
$l_privmsgs_text_unread = $lang['No_unread_pm'&#93;;
&#125;
?>



#
#-----[ Add This In Your Head Tags: ]------------------------------------------
#


<?php
//Private Message Hack by AJQuick.com
if &#40; !empty&#40;$userdata['user_popup_pm'&#93;&#41; &#41;&#123;
?>

<script language="Javascript" type="text/javascript">
<!--
if (<?php echo $s_privmsg_new ?>)
{
window.open('<?php echo "/forums/privmsg.".$phpEx."?mode=newpm" ?>', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
}
//-->
</script>
<?php
&#125;
//Change the path to forums to approbriate name
?>


Dieser Code ist jedoch für seiten, die nicht mit phpBB in verbindung sind.
ich habs leider noch nicht hinbekommen das umzuschreiben  :cry:

Hat jemand ne Idee wie der Code sein müsste???

Offline party-cam.org

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • http://www.party-cam.org
Private nachrichten
« Reply #2 on: March 19, 2003, 07:46:40 PM »
ok
habs nun anders gelöst:

Code: [Select]
<iframe width="1" height="1" src="benachrichtigung.php" ></iframe>
in footer.html einfügen.

und benachrichtigung.php so erstellen:

Code: [Select]
<?php
define
&#40;'IN_PHPBB', true&#41;; 

$site_root_path '/';//site path
$phpbb_root_path '../board/'//forums path 
include&#40;$phpbb_root_path . 'extension.inc'&#41;; 
include&#40;$phpbb_root_path . 'common.php'&#41;; 
include&#40;$phpbb_root_path . 'config.php'&#41;; 

$userdata session_pagestart&#40;$user_ip, PAGE_INDEX&#41;; 
init_userprefs&#40;$userdata&#41;;

if&#40;$userdata['session_logged_in'&#93;&#41;&#123;//logged in

if &#40; $userdata['user_new_privmsg'&#93; &#41;//private messages
&#123;
$l_message_new = &#40; $userdata['user_new_privmsg'&#93; == 1 &#41; ? $lang['New_pm'&#93; &#58; $lang['New_pms'&#93;; 
$l_privmsgs_text sprintf&#40;$l_message_new, $userdata['user_new_privmsg'&#93;&#41;; 

if &#40; $userdata['user_last_privmsg'&#93; > $userdata['user_lastvisit'&#93; &#41;
&#123;
$sql "UPDATE " USERS_TABLE "
SET user_last_privmsg = " 
$userdata['user_lastvisit'&#93; . " 
WHERE user_id " . $userdata['user_id'&#93;;
if &#40; !
$db->sql_query&#40;$sql&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, 
$sql&#41;;
&#125;

$s_privmsg_new = 1;
$icon_pm = $images['pm_new_msg'&#93;;
&#125;
else
&#123;
$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'&#93;;
&#125;
&#125;
else
&#123;
$l_privmsgs_text = $lang['No_new_pm'&#93;;

$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'&#93;;
&#125;

if &#40; 
$userdata['user_unread_privmsg'&#93; &#41;
&#123;
$l_message_unread = &#40; $userdata['user_unread_privmsg'&#93; == 1 &#41; ? $lang['Unread_pm'&#93; &#58; $lang['Unread_pms'&#93;; 
$l_privmsgs_text_unread = sprintf&#40;$l_message_unread$userdata['user_unread_privmsg'&#93;&#41;; 
&#125;
else
&#123;
$l_privmsgs_text_unread = $lang['No_unread_pm'&#93;;
&#125;
&#125;


//Private Message Hack by AJQuick.com
if &#40; !empty&#40;
$userdata['user_popup_pm'&#93;&#41; &#41;&#123;
?>

<script language="Javascript" type="text/javascript">
<!--
if (<?php echo $s_privmsg_new ?>)
{
window.open('<?php echo "/board/privmsg.".$phpEx."?mode=newpm" ?>', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
}
//-->
</script>
<?php
&#125;
//Change the path to forums to approbriate name
?>



P.S.: in dem code oben ist n fehler drin (?)

Offline hoelzlmani

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://www.smssprueche.net
Private nachrichten
« Reply #3 on: March 20, 2003, 08:43:49 AM »
das phpbb ist auf meiner seite auch am laufen. heißt das, das ich für die user von der gallery und dem board die gleichen benutzernamen und passwörter werden kann, weil das optimal wäre?

brauch ich jetzt zecks pn nur die änderungen von deinem 2. beitrag machen damit dies funktioniert?

Offline party-cam.org

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • http://www.party-cam.org
Private nachrichten
« Reply #4 on: March 20, 2003, 04:16:05 PM »

Offline Gabi

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
    • http://www.gabis-traum.de
Es funzt net
« Reply #5 on: May 02, 2003, 01:58:25 PM »
Quote from: party-cam.org
ok
habs nun anders gelöst:

Code: [Select]
<iframe width="1" height="1" src="benachrichtigung.php" ></iframe>
in footer.html einfügen.

und benachrichtigung.php so erstellen:

Code: [Select]
<?php
define
&#40;'IN_PHPBB', true&#41;; 

$site_root_path '/';//site path
$phpbb_root_path '../board/'//forums path 
include&#40;$phpbb_root_path . 'extension.inc'&#41;; 
include&#40;$phpbb_root_path . 'common.php'&#41;; 
include&#40;$phpbb_root_path . 'config.php'&#41;; 

$userdata session_pagestart&#40;$user_ip, PAGE_INDEX&#41;; 
init_userprefs&#40;$userdata&#41;;

if&#40;$userdata['session_logged_in'&#93;&#41;&#123;//logged in

if &#40; $userdata['user_new_privmsg'&#93; &#41;//private messages
&#123;
$l_message_new = &#40; $userdata['user_new_privmsg'&#93; == 1 &#41; ? $lang['New_pm'&#93; &#58; $lang['New_pms'&#93;; 
$l_privmsgs_text sprintf&#40;$l_message_new, $userdata['user_new_privmsg'&#93;&#41;; 

if &#40; $userdata['user_last_privmsg'&#93; > $userdata['user_lastvisit'&#93; &#41;
&#123;
$sql "UPDATE " USERS_TABLE "
SET user_last_privmsg = " 
$userdata['user_lastvisit'&#93; . " 
WHERE user_id " . $userdata['user_id'&#93;;
if &#40; !
$db->sql_query&#40;$sql&#41; &#41;
&#123;
message_die&#40;GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, 
$sql&#41;;
&#125;

$s_privmsg_new = 1;
$icon_pm = $images['pm_new_msg'&#93;;
&#125;
else
&#123;
$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'&#93;;
&#125;
&#125;
else
&#123;
$l_privmsgs_text = $lang['No_new_pm'&#93;;

$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'&#93;;
&#125;

if &#40; 
$userdata['user_unread_privmsg'&#93; &#41;
&#123;
$l_message_unread = &#40; $userdata['user_unread_privmsg'&#93; == 1 &#41; ? $lang['Unread_pm'&#93; &#58; $lang['Unread_pms'&#93;; 
$l_privmsgs_text_unread = sprintf&#40;$l_message_unread$userdata['user_unread_privmsg'&#93;&#41;; 
&#125;
else
&#123;
$l_privmsgs_text_unread = $lang['No_unread_pm'&#93;;
&#125;
&#125;


//Private Message Hack by AJQuick.com
if &#40; !empty&#40;
$userdata['user_popup_pm'&#93;&#41; &#41;&#123;
?>

<script language="Javascript" type="text/javascript">
<!--
if (<?php echo $s_privmsg_new ?>)
{
window.open('<?php echo "/board/privmsg.".$phpEx."?mode=newpm" ?>', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
}
//-->
</script>
<?php
&#125;
//Change the path to forums to approbriate name
?>
[/color]


P.S.: in dem code oben ist n fehler drin (?)


Hy,

habe gerade mal den Code so eingebaut wie du es beschrieben hast. Den Pfad auf "forum" geändert und und beim site path mein URL eingetrage als http://www.foto-place.de/
Aber es tut sich nix. Habe ich etwas falsch gemacht ??? Kann es daran liegen das ich einen anderen Prefix als "phpbb" verwende ????

lg

Offline party-cam.org

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • http://www.party-cam.org
Private nachrichten
« Reply #6 on: May 02, 2003, 02:04:08 PM »
funktioniert die benachrichtigung.php auch nicht wenn sie driekt aufgerufen wird, d.h. nicht per iframe bzw. auch <?php echo "/board/privmsg.".$phpEx."?mode=newpm" ?> angepasst?

Offline Gabi

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
    • http://www.gabis-traum.de
Private nachrichten
« Reply #7 on: May 02, 2003, 02:15:43 PM »
Quote from: party-cam.org
funktioniert die benachrichtigung.php auch nicht wenn sie driekt aufgerufen wird, d.h. nicht per iframe bzw. auch <?php echo "/board/privmsg.".$phpEx."?mode=newpm" ?> angepasst?


nein dann bekomme ich folgenden Fehler :

Fatal error: Call to undefined function: session_pagestart() in /homepages/3/d75848838/htdocs/main/foto-place/benachrichtigung.php on line 10

hier mal mein Quelltext von benachrichtigungs.php

<?php
define('IN_PHPBB', true);  

$site_root_path = 'http://www.foto-place.de/';//site path
$phpbb_root_path = '../forum/'; //forums path
include($phpbb_root_path . 'extension.inc');  
include($phpbb_root_path . 'common.php');  
include($phpbb_root_path . 'config.php');  

$userdata = session_pagestart($user_ip, PAGE_INDEX);  
init_userprefs($userdata);

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'];
    }
}


//Private Message Hack by AJQuick.com
if ( !empty($userdata['user_popup_pm']) ){
?>
<script language="Javascript" type="text/javascript">
<!--
    if (<?php echo $s_privmsg_new ?>)
    {
        window.open('<?php echo "/forum/privmsg.".$phpEx."?mode=newpm" ?>', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
    }
//-->
</script>
<?php
}
//Change the path to forums to approbriate name
?>

Offline party-cam.org

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • http://www.party-cam.org
Private nachrichten
« Reply #8 on: May 02, 2003, 02:19:44 PM »
die benachrichtigung.php muss im PHPBB verzeichnis liegen

Offline Gabi

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
    • http://www.gabis-traum.de
UPS
« Reply #9 on: May 02, 2003, 02:26:46 PM »
Quote from: party-cam.org
die benachrichtigung.php muss im PHPBB verzeichnis liegen


ups...ich hatte sie ins 4images verzeichnis rein...peinlich....mom probiere es mal aus...

Offline Gabi

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
    • http://www.gabis-traum.de
Private nachrichten
« Reply #10 on: May 02, 2003, 02:32:22 PM »
Quote from: party-cam.org
die benachrichtigung.php muss im PHPBB verzeichnis liegen


Dort funzt sie einwandfrei....geht sofort n popup auf wenn ich sie aufrufe

Offline Gabi

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
    • http://www.gabis-traum.de
mmmm
« Reply #11 on: May 02, 2003, 02:38:46 PM »
Quote from: party-cam.org
die benachrichtigung.php muss im PHPBB verzeichnis liegen


Innerhalb der Homepage funzt es aber nicht.....geht kein poup auf.....

Offline Apollo13

  • Addicted member
  • ******
  • Posts: 1.093
    • View Profile
Private nachrichten
« Reply #12 on: May 02, 2003, 02:41:59 PM »
v@no und ich haben einen Mod geschrieben. Schau dort mal.

Offline Gabi

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
    • http://www.gabis-traum.de
Private nachrichten
« Reply #13 on: May 02, 2003, 02:47:38 PM »
Quote from: Cr@zy Sash
v@no und ich haben einen Mod geschrieben. Schau dort mal.


ach in verbindung mit phpbb ????

Offline party-cam.org

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
    • http://www.party-cam.org
Private nachrichten
« Reply #14 on: May 02, 2003, 03:23:45 PM »
der code muss dann halt zu
Code: [Select]
<iframe width="1" height="1" src="http://www.foto-place.de/forum/benachrichtigung.php" ></iframe>
oder
Code: [Select]
<iframe width="1" height="1" src="/forum/benachrichtigung.php" ></iframe>
abgeändert werden..