Beitrag Autor: punkerwelle
Beitrag ID: 284
Dieser Beitrag ist Gepinnt
Dieser Beitrag ist gepinnt und könnte wichtige Informationen enthalten.
Thema ansehen
fusion-mods » PHP-Fusion 7.02.xx » Mods 7.02
AnfangDu befindest dich auf Seite 12Vorblättern
 Thema drucken
PM / E-Mail bei zufügen zu einer Benutzergruppe
punkerwelle
hallo, ist es irgendwie umzusetzen, das ein user eine PN am besten auch noch eine E-mail bekommt,
sobald ich diesen über das Admin Menü zu einer Benutzergruppe hinzufüge?

mfg
 
http://punkerwelle.com/
matze
Meinst bestimmt so wie hier wie bei mir. Ja geht, ist bei mir hier zwar etwasanders aber sollte auch so gehen.
Gehe in ROOT/administration/user_groups.php und suche:


Download Code
  Optionen:

Code markieren
$result2 = dbquery(\"UPDATE \".DB_USERS.\" SET user_groups='$user_groups' WHERE user_id='\".$data['user_id'].\"'\");


Darunter fügst du:


Download Code
  Optionen:

Code markieren
//GROUP PN
dbquery(\"INSERT INTO \".DB_MESSAGES.\" VALUES('', '1,', '1', 'DEIN TEXT', '  \".$userdata['user_name'].\"  DEIN TEXT \".$data['group_name'].\" DEIN TEXT ', '0', '0', '\".time().\"', '0')\");


Das erst genannte ist für die SA. Der andere hier ist für die Mitglieder das sie eine Messages bekommen.


Download Code
  Optionen:

Code markieren

dbquery(\"INSERT INTO \".DB_MESSAGES.\" VALUES('', '\".$userdata['user_id'].\"', '1', 'DEIN TEXT', '  \".$userdata['user_name'].\"   Deine Anfrage auf \".$data['group_name'].\" wird geprüft und von einem Administrator in kürze freigeben.', '0', '0', '\".time().\"', '0')\");
//GROUP PN ENde


Das musste mal testen ob du $userdata die variable setzen musst oder nur $data, aber glaube es ist $data. Bei mir hier ist es ein wenig anders da die PN funktion bei mir hier aus dem groups_portal ausgelösst wird.

Der genannte Code oben ist erst mal nur für die Prinatnachricht, die E-mail funktion ist nehmlich von jeden User beeinflussbar durch die Options einstellungen in Den Privatnachrichten.
fusion-mods.de/userbar/userbar-1.png
 
https://fusion-mods.de
punkerwelle
es gibt bei mir übrigens 3 stellen mit


Download Code
  Optionen:

Code markieren
$result2 = dbquery(\"UPDATE \".DB_USERS.\" SET user_groups='$user_groups' WHERE user_id='\".$data['user_id'].\"'\");


hab alle drei ausproboert. klappt bei mir leider nicht. weder übers Admin menü noch über das Profiel.

es soll nur der user ne PM bekommen, welcher in die gruppe von mir über das userProfiel zu einer Usergruppe zugefügt wurde.
ich hab nicht das user group System. was bei ihnen im einsatz ist.
bei mir ist das so verbaut, das ich über das user Profiel die user einer usergruppe zuteilen kann


Spoiler :: Text anzeigen


Download Code
  Optionen:

Code markieren
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: user_groups.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once \\"../maincore.php\\";

if (!checkrights(\\"UG\\") || !defined(\\"iAUTH\\") || !isset($_GET['aid']) || $_GET['aid'] != iAUTH) { redirect(\\"../index.php\\"); }

require_once THEMES.\\"templates/admin_header.php\\";
include LOCALE.LOCALESET.\\"admin/user_groups.php\\";

if (isset($_POST['group_id']) && isnum($_POST['group_id'])) { $_GET['group_id'] = $_POST['group_id']; }

if (isset($_GET['status']) && !isset($message)) {
   if ($_GET['status'] == \\"su\\") {
      $message = $locale['400'];
   } elseif ($_GET['status'] == \\"sn\\") {
      $message = $locale['401'];
   } elseif ($_GET['status'] == \\"remsel\\") {
      $message = $locale['402'];
   } elseif ($_GET['status'] == \\"remall\\") {
      $message = $locale['403'];
   } elseif ($_GET['status'] == \\"addsel\\") {
      $message = $locale['404'];
   } elseif ($_GET['status'] == \\"deln\\") {
      $message = $locale['405'].\\"
\n\\".$locale['406'].\\"\\";
   } elseif ($_GET['status'] == \\"dely\\") {
      $message = $locale['407'];
   }
   if ($message) {   echo \\"
\\".$message.\\"
\n\\"; }
}

if (isset($_POST['save_group'])) {
   $group_name = stripinput($_POST['group_name']);
   $group_description = stripinput($_POST['group_description']);
   if ($group_name) {
      if (isset($_GET['group_id']) && isnum($_GET['group_id'])) {
         $result = dbquery(\\"UPDATE \\".DB_USER_GROUPS.\\" SET group_name='$group_name', group_description='$group_description' WHERE group_id='\\".$_GET['group_id'].\\"'\\");

[b]///HIER CODE REIN      [/b]
redirect(FUSION_SELF.$aidlink.\\"&status=su\\");
      } else {
         $result = dbquery(\\"INSERT INTO \\".DB_USER_GROUPS.\\" (group_name, group_description) VALUES ('$group_name', '$group_description')\\");
         redirect(FUSION_SELF.$aidlink.\\"&status=sn\\");
      }
   } else {
      redirect(FUSION_SELF.$aidlink);
   }
} elseif (isset($_POST['add_sel']) && isnum($_GET['group_id'])) {
   $user_ids = \\"\\"; $check_count = 0;
   if (isset($_POST['add_check_mark'])) {
      if (is_array($_POST['add_check_mark']) && count($_POST['add_check_mark']) > 1) {
         foreach ($_POST['add_check_mark'] as $thisnum) {
            if (isnum($thisnum)) {
               $user_ids .= ($user_ids ? \\",\\" : \\"\\").$thisnum;
               $check_count++;
            }
         }
      } else {
         if (isnum($_POST['add_check_mark'][0])) {
            $user_ids = $_POST['add_check_mark'][0];
            $check_count = 1;
         }
      }

   }
   if ($check_count > 0) {
      $result = dbquery(\\"SELECT user_id,user_name,user_groups FROM \\".DB_USERS.\\" WHERE user_id IN($user_ids)\\");
      while ($data = dbarray($result)) {
         $user_id = $data['user_id'];
          if (!preg_match(\\"(^\.{$_GET['group_id']}$|\.{$_GET['group_id']}\.|\.{$_GET['group_id']}$)\\", $data['user_groups'])) {
            $user_groups = $data['user_groups'].\\".\\".$_GET['group_id'];
            $result2 = dbquery(\\"UPDATE \\".DB_USERS.\\" SET user_groups='$user_groups' WHERE user_id='\\".$data['user_id'].\\"'\\");
         }
         unset($user_id);
      }
      redirect(FUSION_SELF.$aidlink.\\"&status=addsel\\");
   } else {
      redirect(FUSION_SELF.$aidlink);
   }
} elseif (isset($_POST['remove_sel']) && isnum($_GET['group_id'])) {
   $user_ids = \\"\\"; $check_count = 0;
   if (isset($_POST['rem_check_mark'])) {
      if (is_array($_POST['rem_check_mark']) && count($_POST['rem_check_mark']) > 1) {
         foreach ($_POST['rem_check_mark'] as $thisnum) {
            if (isnum($thisnum)) {
               $user_ids .= ($user_ids ? \\",\\" : \\"\\").$thisnum;
               $check_count++;
            }
         }
      } else {
         if (isnum($_POST['rem_check_mark'][0])) {
            $user_ids = $_POST['rem_check_mark'][0];
            $check_count = 1;
         }
      }

   }
   if ($check_count > 0) {
      $result = dbquery(\\"SELECT user_id,user_name,user_groups FROM \\".DB_USERS.\\" WHERE user_id IN($user_ids) AND user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$')\\");
      while ($data = dbarray($result)) {
         $user_groups = preg_replace(array(\\"(^\.{$_GET['group_id']}$)\\",\\"(\.{$_GET['group_id']}\.)\\",\\"(\.{$_GET['group_id']}$)\\"), array(\\"\\",\\".\\",\\"\\"), $data['user_groups']);
         $result2 = dbquery(\\"UPDATE \\".DB_USERS.\\" SET user_groups='$user_groups' WHERE user_id='\\".$data['user_id'].\\"'\\");
//
dbquery(\\"INSERT INTO \\".DB_MESSAGES.\\" VALUES('', '\\".$userdata['user_id'].\\"', '1', 'DEIN TEXT', '  \\".$userdata['user_name'].\\"   Deine Anfrage auf \\".$data['group_name'].\\" wird geprüft und von einem Administrator in kürze freigeben.', '0', '0', '\\".time().\\"', '0')\\");
//GROUP PN ENde
      }
      redirect(FUSION_SELF.$aidlink.\\"&status=remsel\\");
   } else {
      redirect(FUSION_SELF.$aidlink);
   }
} elseif (isset($_POST['remove_all']) && isnum($_GET['group_id'])) {
   $result = dbquery(\\"SELECT user_id,user_name,user_groups FROM \\".DB_USERS.\\" WHERE user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$')\\");
   while ($data = dbarray($result)) {
      $user_groups = $data['user_groups'];
      $user_groups = preg_replace(array(\\"(^\.{$_GET['group_id']}$)\\",\\"(\.{$_GET['group_id']}\.)\\",\\"(\.{$_GET['group_id']}$)\\"), array(\\"\\",\\".\\",\\"\\"), $user_groups);
      $result2 = dbquery(\\"UPDATE \\".DB_USERS.\\" SET user_groups='$user_groups' WHERE user_id='\\".$data['user_id'].\\"'\\");




   }
   redirect(FUSION_SELF.$aidlink.\\"&status=remall\\");
} elseif (isset($_POST['delete']) && isnum($_GET['group_id'])) {
   if (dbcount(\\"(user_id)\\", DB_USERS, \\"user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$')\\")) {
      redirect(FUSION_SELF.$aidlink.\\"&status=deln\\");
   } else {
      $result = dbquery(\\"DELETE FROM \\".DB_USER_GROUPS.\\" WHERE group_id='\\".$_GET['group_id'].\\"'\\");
      redirect(FUSION_SELF.$aidlink.\\"&status=dely\\");
   }
} else {
   $result = dbquery(\\"SELECT group_id, group_name FROM \\".DB_USER_GROUPS.\\" ORDER BY group_name\\");
   if (dbrows($result)) {
      opentable($locale['420']);
      echo \\"
\n\\";
      echo \\"
\n\n\n\\";
      echo \\">\n\\";
      echo \\"
\n
\n\\";
      closetable();
   }
   if (isset($_GET['group_id']) && isnum($_GET['group_id'])) {
      $result = dbquery(\\"SELECT group_name, group_description FROM \\".DB_USER_GROUPS.\\" WHERE group_id='\\".$_GET['group_id'].\\"'\\");
      if (dbrows($result)) {
         $data = dbarray($result);
         $group_name = $data['group_name'];
         $group_description = $data['group_description'];
         $form_action = FUSION_SELF.$aidlink.\\"&group_id=\\".$_GET['group_id'];
         opentable($locale['430']);
      } else {
         redirect(FUSION_SELF.$aidlink);
      }
   } else {
      $group_name = \\"\\";
      $group_description = \\"\\";
      $form_action = FUSION_SELF.$aidlink;
      opentable($locale['431']);
   }
   echo \\"
\n\\";
   echo \\"\n\\";
   echo \\"\n\n\\";
   echo \\"\n\\";
   echo \\"\n\n\n\\";
   echo \\"\n\\";
   echo \\"\n\n\n\\";
   echo \\"\n
\\".$locale['432'].\\"
\\".$locale['433'].\\"

\n\\";
   echo \\"
\n
\\";
   closetable();
   if (isset($_GET['group_id']) && isnum($_GET['group_id'])) {
      opentable($locale['440']);
      if (!isset($_POST['search_users'])) {
         echo \\"
\n\\";
         echo \\"\n\\";
         echo \\"\n\n\\";
         echo \\"\n\n\n\\";
         echo \\"\n\n\n\\";
         echo \\"\n
\\".$locale['441'].\\"
\\".$locale['442'].\\"

\n\\";
         echo \\"\n
\n\\";
         echo \\"\n\\";
         echo \\"
\n
\n\\";
      }
      if (isset($_POST['search_users']) && isset($_POST['search_criteria'])) {
         $search_items = explode(\\",\\", $_POST['search_criteria']);
         $search_ids = \\"\\"; $search_names = \\"\\"; $mysql_search = \\"\\";
         foreach ($search_items as $item) {
            if ($_POST['search_type'] == \\"user_id\\" && isnum($item)) {
               $search_ids .= ($search_ids != \\"\\" ? \\",\\" : \\"\\").$item;
            } elseif ($_POST['search_type'] == \\"user_name\\" && preg_match(\\"/^[-0-9A-Z_@\s]+$/i\\", $item)) {
               $search_names .= ($search_names != \\"\\" ? \\" OR user_name LIKE '\\" : \\"'\\").$item.\\"%'\\";
            }
         }
         if ($_POST['search_type'] == \\"user_id\\" && $search_ids) {
            $mysql_search .= \\"user_id IN($search_ids) \\";
         } elseif ($_POST['search_type'] == \\"user_name\\" && $search_names) {
            $mysql_search .= \\"user_name LIKE $search_names \\";
         }
         if ($search_ids || $search_names) {
            $result = dbquery(\\"SELECT user_id,user_name,user_groups,user_level FROM \\".DB_USERS.\\" WHERE \\".$mysql_search.\\" ORDER BY user_level DESC, user_name\\");
         }
         if (isset($result) && dbrows($result)) {
            echo \\"
\n\\";
            echo \\"\n\\";
            $i = 0; $users = \\"\\";
            while ($data = dbarray($result)) {
               if (!preg_match(\\"(^\.{$_GET['group_id']}$|\.{$_GET['group_id']}\.|\.{$_GET['group_id']}$)\\", $data['user_groups'])) {
                  $row_color = ($i % 2 == 0 ? \\"tbl1\\" : \\"tbl2\\"); $i++;
                  $users .= \\"\n\n\n\\";
               }
            }
            if ($i > 0) {
               echo \\"\n\n\\";
               echo \\"\n\n\\";
               echo $users.\\"\n\n\n\n\n\n\\";
            } else {
               echo \\"\n\n\n\\";
            }
            echo \\"
\\".getuserlevel($data['user_level']).\\"
\\".$locale['446'].\\"\\".$locale['447'].\\"
\n\\";
               echo \\">\\".$locale['448'].\\" |\n\\";
               echo \\">\\".$locale['449'].\\"\n\\";
               echo \\"
\n\\";
               echo \\"\n\\";
               echo \\"
\\".$locale['451'].\\"

\n\\";
               echo \\"\\".$locale['452'].\\"\n
\n
\n\\";
         } else {
            echo \\"

\n\\".$locale['451'].\\"
\n\\";
            echo \\"\\".$locale['452'].\\"
\n
\n\\";
         }
      }
      closetable();

      opentable($locale['460']);
      echo \\"
\n\\";
      echo \\"\n\\";
      $rows = dbcount(\\"(user_id)\\", DB_USERS, \\"user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$')\\");
      if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
      if ($rows) {
         $i = 0;
         $result = dbquery(\\"SELECT user_id,user_name,user_level FROM \\".DB_USERS.\\" WHERE user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$') ORDER BY user_level DESC, user_name LIMIT {$_GET['rowstart']},500\\");
         echo \\"\n\n\\";
         echo \\"\n\n\\";
         while ($data = dbarray($result)) {
            $row_color = ($i % 2 == 0 ? \\"tbl1\\" : \\"tbl2\\"); $i++;
            echo \\"\n\n\n\\";
         }
         echo \\"\n\n\n\n\n\n\\";
      } else {
         echo \\"\n\n\n\\";
      }
      echo \\"
\\".$locale['446'].\\"\\".$locale['447'].\\"
\\".getuserlevel($data['user_level']).\\"
\n\\";
         echo \\">\\".$locale['448'].\\" |\n\\";
         echo \\">\\".$locale['449'].\\"\n\\";
         echo \\"
\n\\";
         echo \\"\n\\";
         echo \\"\n\\";
         echo \\"
\\".$locale['463'].\\"
\n
\n\\";
      if ($rows > 500) { echo \\"
\n\\".makePageNav($_GET['rowstart'],500,$rows,3,FUSION_SELF.$aidlink.\\"&group_id=\\".$_GET['group_id'].\\"&\\").\\"\n
\n\\"; }
      closetable();
      echo \\"\n\\";
   }
}
echo \\"\n\\";

require_once THEMES.\\"templates/footer.php\\";
?>

Bearbeitet von matze am 22.12.2015 um 17:03
 
http://punkerwelle.com/
matze
Sag es doch gleich #Post 3 anschauhen Spoilertext. Entweder under dem UPDATE oder unter dem INSERT INTO.

[b]STOP[/b]


Ich brauche den Code aus dem ROOT.
Bearbeitet von matze am 22.12.2015 um 17:10
fusion-mods.de/userbar/userbar-1.png
 
https://fusion-mods.de
punkerwelle
kann es sein das es in die profiel.php muss?
weil ich die user ja immer über das profiel zuweise.
 
http://punkerwelle.com/
punkerwelle
Spoiler :: Text anzeigen

Download Code
  Optionen:

Code markieren
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: groups.php
| Author: Ankur Thakur
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once \\"maincore.php\\";
if(!iMEMBER){redirect(\\"\\".BASEDIR.\\"login.php\\"); exit;}
require_once THEMES.\\"templates/header.php\\";
require_once INCLUDES . \\"bbcode_include.php\\";
include LOCALE.LOCALESET.\\"groups.php\\";
if (isset($_GET['group_id']) && isnum($_GET['group_id'])) {

// Gruppen Beschreibung
$result = dbquery(\\"SELECT * FROM \\".DB_USER_GROUPS.\\" WHERE group_id='\\".$_GET['group_id'].\\"'\\");
if (dbrows($result)) {
   $data = dbarray($result);
   // Page Title
   add_to_title($locale['global_200'].$locale['ug101'].$locale['global_200'].$data['group_name']);
   // BreadCrumbs
   opentable($locale['ug100a']);
   echo \\"\\".$locale['ug100'].\\"»»
    \\".$data['group_name'].\\"»»
\\";
   closetable();
   // Breadcrumb End here

   // Join / Un-Join Group
   if (isset($_POST['joingroup']))   {
      if ($data['group_status'] == 0)   {   // If Group is Open
         if (!preg_match(\\"(^\.{$_GET['group_id']}$|\.{$_GET['group_id']}\.|\.{$_GET['group_id']}$)\\", $userdata['user_groups'])) {
            if (($data['group_moderate'] == 1) && !in_array($userdata['user_id'], explode(\\".\\", $data['group_requests'])))   {   // If Request is to be Moderated first
               $result = dbquery(\\"UPDATE \\".DB_USER_GROUPS.\\" SET group_requests='\\".$data['group_requests'].\\".\\".$userdata['user_id'].\\"' WHERE group_id='\\".$_GET['group_id'].\\"'\\");
               if (!$result)   {   redirect(FUSION_SELF.\\"?group_id=\\".$_GET['group_id'].\\"&action=error\\");   }
               else   {   redirect(FUSION_SELF.\\"?group_id=\\".$_GET['group_id'].\\"&action=pending\\");   }
            }
            elseif($data['group_moderate'] == 0) {   // Do not Moderate and Add automatically
               $result = dbquery(\\"UPDATE \\".DB_USERS.\\" SET user_groups='\\".$userdata['user_groups'].\\".\\".$_GET['group_id'].\\"' WHERE user_id='\\".$userdata['user_id'].\\"'\\");
               if (!$result)   {   redirect(FUSION_SELF.\\"?group_id=\\".$_GET['group_id'].\\"&action=error\\");   }
               else   {   redirect(FUSION_SELF.\\"?group_id=\\".$_GET['group_id'].\\"&action=subscribe\\");   }
            }
         }
      }
   }
   if (isset($_POST['unjoingroup']))   {
      if ($data['group_unsubscription'] == 0)   {   // If Users are allowed to Unsubscribe
         $user_groups = preg_replace(array(\\"(^\.{$_GET['group_id']}$)\\",\\"(\.{$_GET['group_id']}\.)\\",\\"(\.{$_GET['group_id']}$)\\"), array(\\"\\",\\".\\",\\"\\"), $userdata['user_groups']);
         $result = dbquery(\\"UPDATE \\".DB_USERS.\\" SET user_groups='$user_groups' WHERE user_id='\\".$userdata['user_id'].\\"'\\");
         if (!$result)   {   redirect(FUSION_SELF.\\"?group_id=\\".$_GET['group_id'].\\"&action=error\\");   }
         else   {   redirect(FUSION_SELF.\\"?group_id=\\".$_GET['group_id'].\\"&action=unsubscribe\\");   }
      }
   }

// User Actions
if (isset($_GET['action'])) {
   if ($_GET['action'] == \\"subscribe\\") {
      $message = $locale['ug108a_action'];
   }
   if ($_GET['action'] == \\"unsubscribe\\") {
      $message = $locale['ug108b_action'];
   }
   if ($_GET['action'] == \\"pending\\") {
      $message = $locale['ug108c_action'];
   }
   if ($_GET['action'] == \\"error\\") {
      $message = $locale['ug108_error'];
   }
   if (isset($message)) {
      echo \\"
\\".$message.\\"
\n\\";
   }
}

// Admin Actions
if (iADMIN && checkrights(\\"UG\\")) {

   // Add Selected Users to Group by Admin
   if (isset($_POST['add_selected']))   {
      if (isset($_POST['user_check_mark'])) {
         $users_ids = is_array($_POST['user_check_mark']) ? implode(\\",\\", $_POST['user_check_mark']) : $_POST['user_check_mark'][0];
         $users_to_add = dbquery(\\"SELECT user_id,user_name,user_groups FROM \\".DB_USERS.\\" WHERE user_id IN(\\".$users_ids.\\")\\");
         $total_requests = explode(\\".\\", substr($data['group_requests'],1));
         while ($add_user_data = dbarray($users_to_add)) {
            $user_id = $add_user_data['user_id'];
             if (!preg_match(\\"(^\.{$_GET['group_id']}$|\.{$_GET['group_id']}\.|\.{$_GET['group_id']}$)\\", $add_user_data['user_groups'])) {
               $user_groups = $add_user_data['user_groups'].\\".\\".$_GET['group_id'];
               if (in_array($user_id, $total_requests))   {
                  $key_to_delete = array_search($user_id, $total_requests);
                  unset($total_requests[$key_to_delete]);
               }
               $result = dbquery(\\"UPDATE \\".DB_USERS.\\" SET user_groups='$user_groups' WHERE user_id='\\".$add_user_data['user_id'].\\"'\\");
               if (!$result)   {   redirect(FUSION_SELF.\\"?group_id=\\".$_GET['group_id'].\\"&action=error\\");   }
            }
            unset($user_id);
         }
         $group_requests = !empty($total_requests) ? \\".\\".implode(\\".\\", $total_requests) : \\"\\";
         $result2 = dbquery(\\"UPDATE \\".DB_USER_GROUPS.\\" SET group_requests='\\".$group_requests.\\"' WHERE group_id='\\".$_GET['group_id'].\\"'\\");
         if (!$result2)   {   redirect(FUSION_SELF.\\"?group_id=\\".$_GET['group_id'].\\"&action=error\\");   }
         else   {   redirect(FUSION_SELF.\\"?group_id=\\".$_GET['group_id']);   }
      }
   }

   // Remove selected Users requests
   if (isset($_POST['remove_selected']))   {
      if (isset($_POST['user_check_mark'])) {
         $total_requests = $data['group_requests'] != \\"\\" ? explode(\\".\\", substr($data['group_requests'],1)) : \\"\\";
         foreach($_POST['user_check_mark'] as $key=>$value)
         {
            if (in_array($value, $total_requests))   {
               $key_to_delete = array_search($value, $total_requests);
               unset($total_requests[$key_to_delete]);
            }
         }
         $group_requests = !empty($total_requests) ? \\".\\".implode(\\".\\", $total_requests) : \\"\\";
         $result = dbquery(\\"UPDATE \\".DB_USER_GROUPS.\\" SET group_requests='\\".$group_requests.\\"' WHERE group_id='\\".$_GET['group_id'].\\"'\\");
         if (!$result)   {   redirect(FUSION_SELF.\\"?group_id=\\".$_GET['group_id'].\\"&action=error\\");   }
         else   {   redirect(FUSION_SELF.\\"?group_id=\\".$_GET['group_id']);   }
      }
   }
}
      $result = dbquery(
         \\"SELECT user_id, user_name, user_level, user_status
         FROM \\".DB_USERS.\\"
         WHERE user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$')
         ORDER BY user_level DESC, user_name\\"
      );
      opentable($locale['ug101'].$locale['global_200'].$data['group_name']);
      #$users = dbcount(\\"(user_id)\\", DB_USERS, \\"user_status = 0\\");
      #$prozent = 100/$users;
      echo \\"\n\\";
      echo \\"\n\n\\";
      echo \\"\n\n\\";
      echo \\"\n\n\\";
      echo \\"\n\n\\";
      echo \\"\n\n\\";
      echo \\"\n\n\\";
      echo \\"\n\n\\";
      echo \\"\n\n\\";
      if (iMEMBER && in_array($_GET['group_id'], explode(\\".\\", iUSER_GROUPS)) && ($data['group_unsubscription'] == 0))   {
         echo \\"\n\n\\";
         echo \\"\n\n\\";
      }
      elseif(iMEMBER && ($data['group_status'] == 0) && !in_array($_GET['group_id'], explode(\\".\\", iUSER_GROUPS)) && !in_array($userdata['user_id'], explode(\\".\\", $data['group_requests'])))   {
         echo \\"\n\n\\";
         echo \\"\n\n\\";
      }
      echo \\"
\\".$locale['ug101'].\\" \\".$data['group_name'].\\"
\\".$locale['ug102'].\\"\\".$data['group_description'].\\"
\\".$locale['ug103'].\\"Von \\".$users.\\" angemeldeten Mitgliedern befinden sich \\".sprintf((dbrows($result) == 1 ? $locale['ug104'] : $locale['ug105']), dbrows($result)).\\"
       in der Gruppe \\".$data['group_name'].\\"
\\".(($data['group_status'] == 0) ? $locale['ug105a'] : $locale['ug107']).\\"\\".(($data['group_status'] == 0) ? $locale['ug106a'] : $locale['ug107a']).\\"
\n\\";
         echo \\"
\n\\";
         echo \\">\\";
         echo \\"
\n
\n\\";
         echo \\"
\n\\";
         echo \\">\\";
         echo \\"
\n
\n
\n\\";

      if (iADMIN && checkrights(\\"UG\\")) {
         $users_requests = $data['group_requests'] != \\"\\" ? explode(\\".\\", substr($data['group_requests'],1)) : \\"\\";
         if (!empty($users_requests))   {
            $users_info = dbquery(\\"SELECT user_id, user_name, user_status, user_level FROM \\".DB_USERS.\\" WHERE user_id IN(\\".implode(\\",\\", $users_requests).\\")\\");
            if (dbrows($users_info))   {
               echo \\"
\n\\";
               echo \\"
\n\\".$locale['ug113'].\\"\n
\n\\";
               echo \\"\n\\";
               echo \\"\n\n\\";
               echo \\"\n\n\\";
               $i=0;
               while ($users_data = dbarray($users_info))   {
               $cell_color = ($i % 2 == 0 ? \\"tbl1\\" : \\"tbl2\\"); $i++;                 
               echo \\"\n\n\\";
               echo \\"\n\n\\";
               }
               echo \\"\n\n\n\\";
               echo \\"\n\n\n\\";
               echo \\"\n
\\".$locale['ug109'].\\"\\".$locale['ug110'].\\"
\n\\".getuserlevel($users_data['user_level']).\\"
\n>\\".$locale['ug111'].\\" |\n\\";
               echo \\">\\".$locale['ug112'].\\"\n
\n\n\\";
               echo \\"\n
\n
\n\\";
               echo \\"\n\\";
            }
         }
      }

      if (dbrows($result)) {
         echo \\"\n\\";
         echo \\"\n\n\\";
         #echo \\"\n\\";
         echo \\"\n\n\\";
         $i=0;
         while ($data = dbarray($result)) {
            $cell_color = ($i % 2 == 0 ? \\"tbl1\\" : \\"tbl2\\"); $i++;
            echo \\"\n\n\\";
            #echo \\"\n\\";
            echo \\"\n\n\\";
         }
         echo \\"
\\".$locale['ug109'].\\"Status\\".$locale['ug110'].\\"
\n\\".profile_link($data['user_id'], $data['user_name'], $data['user_status']).\\"
\\".$locale['ug106'].\\"\\".getuserlevel($data['user_level']).\\"
\n\\";
      }
      closetable();
   
   } else {
      redirect(\\"index.php\\");
   }
} else {
   add_to_title($locale['global_200'].$locale['ug100']);

   // Pending Requests
   if (iADMIN && checkrights(\\"UG\\")) {
      $result = dbquery(\\"SELECT group_id, group_name, group_image, group_requests FROM \\".DB_USER_GROUPS.\\" WHERE group_requests<>''\\");

      if (dbrows($result))
      {
         opentable($locale['ug117']);

         echo \\"\n\\";
         echo \\"\n\n\\";
         echo \\"\n\n\\";
         $i=0;
         while ($data = dbarray($result))      {
            $cell_color = ($i % 2 == 0 ? \\"tbl1\\" : \\"tbl2\\"); $i++;
            $num_of_req = count(explode(\\".\\", substr($data['group_requests'], 1)));
            echo \\"\n\n\\";
            echo \\"\n\n\\";
         }
         echo \\"
\\".$locale['ug101'].\\"\\".$locale['ug118'].\\"
\\".$data['group_name'].\\"\\".sprintf($locale['ug119'], $num_of_req).\\"
\n\\";

         closetable();
      }
   }
   opentable($locale['ug100']);

   $result = dbquery(\\"SELECT group_id, group_name, group_image, group_description, group_status FROM \\".DB_USER_GROUPS.\\" ORDER BY group_name\\");

   if (dbrows($result))   {
      echo \\"\n\\";
      #echo \\"\n\\";
      echo \\"\n\\";
      echo \\"\n\\";
      echo \\"\n\n\\";
      $i=0;
      while ($data = dbarray($result))      {
         $cell_color = ($i % 2 == 0 ? \\"tbl1\\" : \\"tbl2\\"); $i++;
         echo \\"\n\\";
         echo \\"\n\\";
         echo \\"\n\\";
         echo \\"\n\n\\";
      }
      echo \\"
Legende\\".$locale['ug101'].\\"\\".$locale['ug116'].\\"\\".$locale['ug102'].\\"
\\".$data['group_name'].\\"\\".($data['group_status'] == 0 ? $locale['ug105a'] : $locale['ug107']).\\"\\".trimlink($data['group_description'],100).\\"
\n\\";
   }
   else   {
      echo \\"

\n\\".$locale['ug120'].\\"

\n
\n\\";
   }
   closetable();
}

require_once THEMES.\\"templates/footer.php\\";
?>


 
http://punkerwelle.com/
matze
Ich markiere die Stelle in Rot da siehst du es wo der Code reinkommt.


Download Code
  Optionen:

Code markieren
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: groups.php
| Author: Ankur Thakur
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once \"maincore.php\";
if(!iMEMBER){redirect(\"\".BASEDIR.\"login.php\"); exit;}
require_once THEMES.\"templates/header.php\";
require_once INCLUDES . \"bbcode_include.php\";
include LOCALE.LOCALESET.\"groups.php\";
if (isset($_GET['group_id']) && isnum($_GET['group_id'])) {

// Gruppen Beschreibung
$result = dbquery(\"SELECT * FROM \".DB_USER_GROUPS.\" WHERE group_id='\".$_GET['group_id'].\"'\");
if (dbrows($result)) {
   $data = dbarray($result);
   // Page Title
   add_to_title($locale['global_200'].$locale['ug101'].$locale['global_200'].$data['group_name']);
   // BreadCrumbs
   opentable($locale['ug100a']);
   echo \"\".$locale['ug100'].\"»»
    \".$data['group_name'].\"»»
\";
   closetable();
   // Breadcrumb End here

   // Join / Un-Join Group
   if (isset($_POST['joingroup']))   {
      if ($data['group_status'] == 0)   {   // If Group is Open
         if (!preg_match(\"(^\.{$_GET['group_id']}$|\.{$_GET['group_id']}\.|\.{$_GET['group_id']}$)\", $userdata['user_groups'])) {
            if (($data['group_moderate'] == 1) && !in_array($userdata['user_id'], explode(\".\", $data['group_requests'])))   {   // If Request is to be Moderated first
               $result = dbquery(\"UPDATE \".DB_USER_GROUPS.\" SET group_requests='\".$data['group_requests'].\".\".$userdata['user_id'].\"' WHERE group_id='\".$_GET['group_id'].\"'\");
//MOD PN
               dbquery(\"INSERT INTO \".DB_MESSAGES.\" VALUES('', '1,', '1', 'Anfrage auf Gruppe', '  \".$userdata['user_name'].\"   hat eine Anfrage auf \".$data['group_name'].\" gestellt, und erbittet eine Freischaltung.', '0', '0', '\".time().\"', '0')\");
               dbquery(\"INSERT INTO \".DB_MESSAGES.\" VALUES('', '\".$userdata['user_id'].\"', '1', 'Anfrage auf Gruppe', '  \".$userdata['user_name'].\"   Deine Anfrage auf \".$data['group_name'].\" wird geprüft und von einem Administrator in kürze freigeben.', '0', '0', '\".time().\"', '0')\");
               //MOD PN ENde

               if (!$result)   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=error\");   }
               else   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=pending\");   }
            }
            elseif($data['group_moderate'] == 0) {   // Do not Moderate and Add automatically
               $result = dbquery(\"UPDATE \".DB_USERS.\" SET user_groups='\".$userdata['user_groups'].\".\".$_GET['group_id'].\"' WHERE user_id='\".$userdata['user_id'].\"'\");
               if (!$result)   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=error\");   }
               else   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=subscribe\");   }
            }
         }
      }
   }
   if (isset($_POST['unjoingroup']))   {
      if ($data['group_unsubscription'] == 0)   {   // If Users are allowed to Unsubscribe
         $user_groups = preg_replace(array(\"(^\.{$_GET['group_id']}$)\",\"(\.{$_GET['group_id']}\.)\",\"(\.{$_GET['group_id']}$)\"), array(\"\",\".\",\"\"), $userdata['user_groups']);
         $result = dbquery(\"UPDATE \".DB_USERS.\" SET user_groups='$user_groups' WHERE user_id='\".$userdata['user_id'].\"'\");
         if (!$result)   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=error\");   }
         else   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=unsubscribe\");   }
      }
   }

// User Actions
if (isset($_GET['action'])) {
   if ($_GET['action'] == \"subscribe\") {
      $message = $locale['ug108a_action'];
   }
   if ($_GET['action'] == \"unsubscribe\") {
      $message = $locale['ug108b_action'];
   }
   if ($_GET['action'] == \"pending\") {
      $message = $locale['ug108c_action'];
   }
   if ($_GET['action'] == \"error\") {
      $message = $locale['ug108_error'];
   }
   if (isset($message)) {
      echo \"
\".$message.\"
\n\";
   }
}

// Admin Actions
if (iADMIN && checkrights(\"UG\")) {

   // Add Selected Users to Group by Admin
   if (isset($_POST['add_selected']))   {
      if (isset($_POST['user_check_mark'])) {
         $users_ids = is_array($_POST['user_check_mark']) ? implode(\",\", $_POST['user_check_mark']) : $_POST['user_check_mark'][0];
         $users_to_add = dbquery(\"SELECT user_id,user_name,user_groups FROM \".DB_USERS.\" WHERE user_id IN(\".$users_ids.\")\");
         $total_requests = explode(\".\", substr($data['group_requests'],1));
         while ($add_user_data = dbarray($users_to_add)) {
            $user_id = $add_user_data['user_id'];
             if (!preg_match(\"(^\.{$_GET['group_id']}$|\.{$_GET['group_id']}\.|\.{$_GET['group_id']}$)\", $add_user_data['user_groups'])) {
               $user_groups = $add_user_data['user_groups'].\".\".$_GET['group_id'];
               if (in_array($user_id, $total_requests))   {
                  $key_to_delete = array_search($user_id, $total_requests);
                  unset($total_requests[$key_to_delete]);
               }
               $result = dbquery(\"UPDATE \".DB_USERS.\" SET user_groups='$user_groups' WHERE user_id='\".$add_user_data['user_id'].\"'\");
               if (!$result)   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=error\");   }
            }
            unset($user_id);
         }
         $group_requests = !empty($total_requests) ? \".\".implode(\".\", $total_requests) : \"\";
         $result2 = dbquery(\"UPDATE \".DB_USER_GROUPS.\" SET group_requests='\".$group_requests.\"' WHERE group_id='\".$_GET['group_id'].\"'\");
         if (!$result2)   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=error\");   }
         else   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id']);   }
      }
   }

   // Remove selected Users requests
   if (isset($_POST['remove_selected']))   {
      if (isset($_POST['user_check_mark'])) {
         $total_requests = $data['group_requests'] != \"\" ? explode(\".\", substr($data['group_requests'],1)) : \"\";
         foreach($_POST['user_check_mark'] as $key=>$value)
         {
            if (in_array($value, $total_requests))   {
               $key_to_delete = array_search($value, $total_requests);
               unset($total_requests[$key_to_delete]);
            }
         }
         $group_requests = !empty($total_requests) ? \".\".implode(\".\", $total_requests) : \"\";
         $result = dbquery(\"UPDATE \".DB_USER_GROUPS.\" SET group_requests='\".$group_requests.\"' WHERE group_id='\".$_GET['group_id'].\"'\");
         if (!$result)   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=error\");   }
         else   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id']);   }
      }
   }
}
      $result = dbquery(
         \"SELECT user_id, user_name, user_level, user_status
         FROM \".DB_USERS.\"
         WHERE user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$')
         ORDER BY user_level DESC, user_name\"
      );
      opentable($locale['ug101'].$locale['global_200'].$data['group_name']);
      #$users = dbcount(\"(user_id)\", DB_USERS, \"user_status = 0\");
      #$prozent = 100/$users;
      echo \"\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      if (iMEMBER && in_array($_GET['group_id'], explode(\".\", iUSER_GROUPS)) && ($data['group_unsubscription'] == 0))   {
         echo \"\n\n\";
         echo \"\n\n\";
      }
      elseif(iMEMBER && ($data['group_status'] == 0) && !in_array($_GET['group_id'], explode(\".\", iUSER_GROUPS)) && !in_array($userdata['user_id'], explode(\".\", $data['group_requests'])))   {
         echo \"\n\n\";
         echo \"\n\n\";
      }
      echo \"
\".$locale['ug101'].\" \".$data['group_name'].\"
\".$locale['ug102'].\"\".$data['group_description'].\"
\".$locale['ug103'].\"Von \".$users.\" angemeldeten Mitgliedern befinden sich \".sprintf((dbrows($result) == 1 ? $locale['ug104'] : $locale['ug105']), dbrows($result)).\"
       in der Gruppe \".$data['group_name'].\"
\".(($data['group_status'] == 0) ? $locale['ug105a'] : $locale['ug107']).\"\".(($data['group_status'] == 0) ? $locale['ug106a'] : $locale['ug107a']).\"
\n\";
         echo \"
\n\";
         echo \">\";
         echo \"
\n
\n\";
         echo \"
\n\";
         echo \">\";
         echo \"
\n
\n
\n\";

      if (iADMIN && checkrights(\"UG\")) {
         $users_requests = $data['group_requests'] != \"\" ? explode(\".\", substr($data['group_requests'],1)) : \"\";
         if (!empty($users_requests))   {
            $users_info = dbquery(\"SELECT user_id, user_name, user_status, user_level FROM \".DB_USERS.\" WHERE user_id IN(\".implode(\",\", $users_requests).\")\");
            if (dbrows($users_info))   {
               echo \"
\n\";
               echo \"
\n\".$locale['ug113'].\"\n
\n\";
               echo \"\n\";
               echo \"\n\n\";
               echo \"\n\n\";
               $i=0;
               while ($users_data = dbarray($users_info))   {
               $cell_color = ($i % 2 == 0 ? \"tbl1\" : \"tbl2\"); $i++;                 
               echo \"\n\n\";
               echo \"\n\n\";
               }
               echo \"\n\n\n\";
               echo \"\n\n\n\";
               echo \"\n
\".$locale['ug109'].\"\".$locale['ug110'].\"
\n\".getuserlevel($users_data['user_level']).\"
\n>\".$locale['ug111'].\" |\n\";
               echo \">\".$locale['ug112'].\"\n
\n\n\";
               echo \"\n
\n
\n\";
               echo \"\n\";
            }
         }
      }

      if (dbrows($result)) {
         echo \"\n\";
         echo \"\n\n\";
         #echo \"\n\";
         echo \"\n\n\";
         $i=0;
         while ($data = dbarray($result)) {
            $cell_color = ($i % 2 == 0 ? \"tbl1\" : \"tbl2\"); $i++;
            echo \"\n\n\";
            #echo \"\n\";
            echo \"\n\n\";
         }
         echo \"
\".$locale['ug109'].\"Status\".$locale['ug110'].\"
\n\".profile_link($data['user_id'], $data['user_name'], $data['user_status']).\"
\".$locale['ug106'].\"\".getuserlevel($data['user_level']).\"
\n\";
      }
      closetable();
   
   } else {
      redirect(\"index.php\");
   }
} else {
   add_to_title($locale['global_200'].$locale['ug100']);

   // Pending Requests
   if (iADMIN && checkrights(\"UG\")) {
      $result = dbquery(\"SELECT group_id, group_name, group_image, group_requests FROM \".DB_USER_GROUPS.\" WHERE group_requests<>''\");

      if (dbrows($result))
      {
         opentable($locale['ug117']);

         echo \"\n\";
         echo \"\n\n\";
         echo \"\n\n\";
         $i=0;
         while ($data = dbarray($result))      {
            $cell_color = ($i % 2 == 0 ? \"tbl1\" : \"tbl2\"); $i++;
            $num_of_req = count(explode(\".\", substr($data['group_requests'], 1)));
            echo \"\n\n\";
            echo \"\n\n\";
         }
         echo \"
\".$locale['ug101'].\"\".$locale['ug118'].\"
\".$data['group_name'].\"\".sprintf($locale['ug119'], $num_of_req).\"
\n\";

         closetable();
      }
   }
   opentable($locale['ug100']);

   $result = dbquery(\"SELECT group_id, group_name, group_image, group_description, group_status FROM \".DB_USER_GROUPS.\" ORDER BY group_name\");

   if (dbrows($result))   {
      echo \"\n\";
      #echo \"\n\";
      echo \"\n\";
      echo \"\n\";
      echo \"\n\n\";
      $i=0;
      while ($data = dbarray($result))      {
         $cell_color = ($i % 2 == 0 ? \"tbl1\" : \"tbl2\"); $i++;
         echo \"\n\";
         echo \"\n\";
         echo \"\n\";
         echo \"\n\n\";
      }
      echo \"
Legende\".$locale['ug101'].\"\".$locale['ug116'].\"\".$locale['ug102'].\"
\".$data['group_name'].\"\".($data['group_status'] == 0 ? $locale['ug105a'] : $locale['ug107']).\"\".trimlink($data['group_description'],100).\"
\n\";
   }
   else   {
      echo \"

\n\".$locale['ug120'].\"

\n
\n\";
   }
   closetable();
}

require_once THEMES.\"templates/footer.php\";
?>






fusion-mods.de/userbar/userbar-1.png
 
https://fusion-mods.de
punkerwelle
hab es genau so gemacht. es kommt keine PM an
 
http://punkerwelle.com/
matze
Teste mal den Code under jedem INSERT INTO und unter jedem SELECT bzw. UPDATE feld.
fusion-mods.de/userbar/userbar-1.png
 
https://fusion-mods.de
punkerwelle
INSERT INTO gibt es nicht und select und update habe ich alles Probiert. nix
Bearbeitet von punkerwelle am 22.12.2015 um 17:35
 
http://punkerwelle.com/
matze
Aber das gibt es:

Download Code
  Optionen:

Code markieren
$result = dbquery(\"UPDATE \".DB_USER_GROUPS.\" SET group_requests='\".$data['group_requests'].\".\".$userdata['user_id'].\"' WHERE group_id='\".$_GET['group_id'].\"'\");

fusion-mods.de/userbar/userbar-1.png
 
https://fusion-mods.de
punkerwelle
hab ich alle durch Probiert. nix
oder ist evtl der code falsch?
 
http://punkerwelle.com/
matze
Normaler weisse nicht bei mir kommen PN,s durch so wie sich einer anmeldet bzw. sich in der Gruppe bewirbt.

Ich teste es nachhermal durch......ok




Teste mal das hier:

Download Code
  Optionen:

Code markieren
///TESTPN
         function pm_send($pmtoid, $subject, $pmfromid, $message){
         $pmtoid = stripinput($pmtoid);
         $subject = stripinput($subject);
         $pmfromid = stripinput($pmfromid);
         $message = descript($message);
         dbquery(\"INSERT INTO \".DB_MESSAGES.\" (message_id, message_to, message_from, message_subject, message_message, message_smileys, message_read, message_datestamp, message_folder) VALUES ('', '\".$pmtoid.\"', '\".$pmfromid.\"', '\".$subject.\"', '\".$message.\"', '0', '0', '\".time().\"', '0')\");
         }
         $pn_result = dbquery(\"SELECT user_id FROM \".DB_USERS.\" WHERE user_level='103'\");
         while($data = dbarray($pn_result)){
         pm_send($data['user_id'], 'TESTPN', '1', '  DAS IST EIN TEST');
         }
         //TESTPN ENDE

Bearbeitet von matze am 22.12.2015 um 17:46
fusion-mods.de/userbar/userbar-1.png
 
https://fusion-mods.de
punkerwelle
wie gesagt das gruppen bewerbungssystem habe ich nicht.
bei mir wird das alles vom Admin gemacht.
 
http://punkerwelle.com/
matze
#post 13 Testen. Wenn du nicht die Nummer eins bist auf deiner Seite musst du natürlich auch die ID,s des betreffenden definieren wer die Nachricht bekommen soll. Bei dem User musst du es auf $userdata['user_id'] definieren.
fusion-mods.de/userbar/userbar-1.png
 
https://fusion-mods.de
punkerwelle
wo kommt der code aus Post 13 hin? ich bin ID 1
 
http://punkerwelle.com/
matze
Den Code mal, dasist deiner:

Download Code
  Optionen:

Code markieren
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: groups.php
| Author: Ankur Thakur
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once \"maincore.php\";
if(!iMEMBER){redirect(\"\".BASEDIR.\"login.php\"); exit;}
require_once THEMES.\"templates/header.php\";
require_once INCLUDES . \"bbcode_include.php\";
include LOCALE.LOCALESET.\"groups.php\";
if (isset($_GET['group_id']) && isnum($_GET['group_id'])) {

// Gruppen Beschreibung
$result = dbquery(\"SELECT * FROM \".DB_USER_GROUPS.\" WHERE group_id='\".$_GET['group_id'].\"'\");
if (dbrows($result)) {
   $data = dbarray($result);
   // Page Title
   add_to_title($locale['global_200'].$locale['ug101'].$locale['global_200'].$data['group_name']);
   // BreadCrumbs
   opentable($locale['ug100a']);
   echo \"\".$locale['ug100'].\"»»
    \".$data['group_name'].\"»»
\";
   closetable();
   // Breadcrumb End here

   // Join / Un-Join Group
   if (isset($_POST['joingroup']))   {
      if ($data['group_status'] == 0)   {   // If Group is Open
         if (!preg_match(\"(^\.{$_GET['group_id']}$|\.{$_GET['group_id']}\.|\.{$_GET['group_id']}$)\", $userdata['user_groups'])) {
            if (($data['group_moderate'] == 1) && !in_array($userdata['user_id'], explode(\".\", $data['group_requests'])))   {   // If Request is to be Moderated first
               $result = dbquery(\"UPDATE \".DB_USER_GROUPS.\" SET group_requests='\".$data['group_requests'].\".\".$userdata['user_id'].\"' WHERE group_id='\".$_GET['group_id'].\"'\");
///TESTPN
         function pm_send($pmtoid, $subject, $pmfromid, $message){
         $pmtoid = stripinput($pmtoid);
         $subject = stripinput($subject);
         $pmfromid = stripinput($pmfromid);
         $message = descript($message);
         dbquery(\"INSERT INTO \".DB_MESSAGES.\" (message_id, message_to, message_from, message_subject, message_message, message_smileys, message_read, message_datestamp, message_folder) VALUES ('', '\".$pmtoid.\"', '\".$pmfromid.\"', '\".$subject.\"', '\".$message.\"', '0', '0', '\".time().\"', '0')\");
         }
         $pn_result = dbquery(\"SELECT user_id FROM \".DB_USERS.\" WHERE user_level='103'\");
         while($data = dbarray($pn_result)){
         pm_send($data['user_id'], 'TESTPN', '1', '  DAS IST EIN TEST');
         }
         //TESTPN ENDE

               if (!$result)   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=error\");   }
               else   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=pending\");   }
            }
            elseif($data['group_moderate'] == 0) {   // Do not Moderate and Add automatically
               $result = dbquery(\"UPDATE \".DB_USERS.\" SET user_groups='\".$userdata['user_groups'].\".\".$_GET['group_id'].\"' WHERE user_id='\".$userdata['user_id'].\"'\");
           ///TESTPN
         function pm_send($pmtoid, $subject, $pmfromid, $message){
         $pmtoid = stripinput($pmtoid);
         $subject = stripinput($subject);
         $pmfromid = stripinput($pmfromid);
         $message = descript($message);
         dbquery(\"INSERT INTO \".DB_MESSAGES.\" (message_id, message_to, message_from, message_subject, message_message, message_smileys, message_read, message_datestamp, message_folder) VALUES ('', '\".$pmtoid.\"', '\".$pmfromid.\"', '\".$subject.\"', '\".$message.\"', '0', '0', '\".time().\"', '0')\");
         }
         $pn_result = dbquery(\"SELECT user_id FROM \".DB_USERS.\" WHERE user_level='103'\");
         while($data = dbarray($pn_result)){
         pm_send($data['user_id'], 'TESTPN', '1', '  DAS IST EIN TEST');
         }
         //TESTPN ENDE

  if (!$result)   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=error\");   }
               else   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=subscribe\");   }
            }
         }
      }
   }
   if (isset($_POST['unjoingroup']))   {
      if ($data['group_unsubscription'] == 0)   {   // If Users are allowed to Unsubscribe
         $user_groups = preg_replace(array(\"(^\.{$_GET['group_id']}$)\",\"(\.{$_GET['group_id']}\.)\",\"(\.{$_GET['group_id']}$)\"), array(\"\",\".\",\"\"), $userdata['user_groups']);
         $result = dbquery(\"UPDATE \".DB_USERS.\" SET user_groups='$user_groups' WHERE user_id='\".$userdata['user_id'].\"'\");
        ///TESTPN
         function pm_send($pmtoid, $subject, $pmfromid, $message){
         $pmtoid = stripinput($pmtoid);
         $subject = stripinput($subject);
         $pmfromid = stripinput($pmfromid);
         $message = descript($message);
         dbquery(\"INSERT INTO \".DB_MESSAGES.\" (message_id, message_to, message_from, message_subject, message_message, message_smileys, message_read, message_datestamp, message_folder) VALUES ('', '\".$pmtoid.\"', '\".$pmfromid.\"', '\".$subject.\"', '\".$message.\"', '0', '0', '\".time().\"', '0')\");
         }
         $pn_result = dbquery(\"SELECT user_id FROM \".DB_USERS.\" WHERE user_level='103'\");
         while($data = dbarray($pn_result)){
         pm_send($data['user_id'], 'TESTPN', '1', '  DAS IST EIN TEST');
         }
         //TESTPN ENDE

if (!$result)   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=error\");   }
         else   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=unsubscribe\");   }
      }
   }

// User Actions
if (isset($_GET['action'])) {
   if ($_GET['action'] == \"subscribe\") {
      $message = $locale['ug108a_action'];
   }
   if ($_GET['action'] == \"unsubscribe\") {
      $message = $locale['ug108b_action'];
   }
   if ($_GET['action'] == \"pending\") {
      $message = $locale['ug108c_action'];
   }
   if ($_GET['action'] == \"error\") {
      $message = $locale['ug108_error'];
   }
   if (isset($message)) {
      echo \"
\".$message.\"
\n\";
   }
}

// Admin Actions
if (iADMIN && checkrights(\"UG\")) {

   // Add Selected Users to Group by Admin
   if (isset($_POST['add_selected']))   {
      if (isset($_POST['user_check_mark'])) {
         $users_ids = is_array($_POST['user_check_mark']) ? implode(\",\", $_POST['user_check_mark']) : $_POST['user_check_mark'][0];
         $users_to_add = dbquery(\"SELECT user_id,user_name,user_groups FROM \".DB_USERS.\" WHERE user_id IN(\".$users_ids.\")\");
         $total_requests = explode(\".\", substr($data['group_requests'],1));
         while ($add_user_data = dbarray($users_to_add)) {
            $user_id = $add_user_data['user_id'];
             if (!preg_match(\"(^\.{$_GET['group_id']}$|\.{$_GET['group_id']}\.|\.{$_GET['group_id']}$)\", $add_user_data['user_groups'])) {
               $user_groups = $add_user_data['user_groups'].\".\".$_GET['group_id'];
               if (in_array($user_id, $total_requests))   {
                  $key_to_delete = array_search($user_id, $total_requests);
                  unset($total_requests[$key_to_delete]);
               }
               $result = dbquery(\"UPDATE \".DB_USERS.\" SET user_groups='$user_groups' WHERE user_id='\".$add_user_data['user_id'].\"'\");
                ///TESTPN
         function pm_send($pmtoid, $subject, $pmfromid, $message){
         $pmtoid = stripinput($pmtoid);
         $subject = stripinput($subject);
         $pmfromid = stripinput($pmfromid);
         $message = descript($message);
         dbquery(\"INSERT INTO \".DB_MESSAGES.\" (message_id, message_to, message_from, message_subject, message_message, message_smileys, message_read, message_datestamp, message_folder) VALUES ('', '\".$pmtoid.\"', '\".$pmfromid.\"', '\".$subject.\"', '\".$message.\"', '0', '0', '\".time().\"', '0')\");
         }
         $pn_result = dbquery(\"SELECT user_id FROM \".DB_USERS.\" WHERE user_level='103'\");
         while($data = dbarray($pn_result)){
         pm_send($data['user_id'], 'TESTPN', '1', '  DAS IST EIN TEST');
         }
         //TESTPN ENDE

 if (!$result)   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=error\");   }
            }
            unset($user_id);
         }
         $group_requests = !empty($total_requests) ? \".\".implode(\".\", $total_requests) : \"\";
         $result2 = dbquery(\"UPDATE \".DB_USER_GROUPS.\" SET group_requests='\".$group_requests.\"' WHERE group_id='\".$_GET['group_id'].\"'\");
          ///TESTPN
         function pm_send($pmtoid, $subject, $pmfromid, $message){
         $pmtoid = stripinput($pmtoid);
         $subject = stripinput($subject);
         $pmfromid = stripinput($pmfromid);
         $message = descript($message);
         dbquery(\"INSERT INTO \".DB_MESSAGES.\" (message_id, message_to, message_from, message_subject, message_message, message_smileys, message_read, message_datestamp, message_folder) VALUES ('', '\".$pmtoid.\"', '\".$pmfromid.\"', '\".$subject.\"', '\".$message.\"', '0', '0', '\".time().\"', '0')\");
         }
         $pn_result = dbquery(\"SELECT user_id FROM \".DB_USERS.\" WHERE user_level='103'\");
         while($data = dbarray($pn_result)){
         pm_send($data['user_id'], 'TESTPN', '1', '  DAS IST EIN TEST');
         }
         //TESTPN ENDE

  if (!$result2)   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=error\");   }
         else   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id']);   }
      }
   }

   // Remove selected Users requests
   if (isset($_POST['remove_selected']))   {
      if (isset($_POST['user_check_mark'])) {
         $total_requests = $data['group_requests'] != \"\" ? explode(\".\", substr($data['group_requests'],1)) : \"\";
         foreach($_POST['user_check_mark'] as $key=>$value)
         {
            if (in_array($value, $total_requests))   {
               $key_to_delete = array_search($value, $total_requests);
               unset($total_requests[$key_to_delete]);
            }
         }
         $group_requests = !empty($total_requests) ? \".\".implode(\".\", $total_requests) : \"\";
         $result = dbquery(\"UPDATE \".DB_USER_GROUPS.\" SET group_requests='\".$group_requests.\"' WHERE group_id='\".$_GET['group_id'].\"'\");
          ///TESTPN
         function pm_send($pmtoid, $subject, $pmfromid, $message){
         $pmtoid = stripinput($pmtoid);
         $subject = stripinput($subject);
         $pmfromid = stripinput($pmfromid);
         $message = descript($message);
         dbquery(\"INSERT INTO \".DB_MESSAGES.\" (message_id, message_to, message_from, message_subject, message_message, message_smileys, message_read, message_datestamp, message_folder) VALUES ('', '\".$pmtoid.\"', '\".$pmfromid.\"', '\".$subject.\"', '\".$message.\"', '0', '0', '\".time().\"', '0')\");
         }
         $pn_result = dbquery(\"SELECT user_id FROM \".DB_USERS.\" WHERE user_level='103'\");
         while($data = dbarray($pn_result)){
         pm_send($data['user_id'], 'TESTPN', '1', '  DAS IST EIN TEST');
         }
         //TESTPN ENDE

 if (!$result)   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id'].\"&action=error\");   }
         else   {   redirect(FUSION_SELF.\"?group_id=\".$_GET['group_id']);   }
      }
   }
}
      $result = dbquery(
         \"SELECT user_id, user_name, user_level, user_status
         FROM \".DB_USERS.\"
         WHERE user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$')
         ORDER BY user_level DESC, user_name\"
      );
      opentable($locale['ug101'].$locale['global_200'].$data['group_name']);
      #$users = dbcount(\"(user_id)\", DB_USERS, \"user_status = 0\");
      #$prozent = 100/$users;
      echo \"\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      echo \"\n\n\";
      if (iMEMBER && in_array($_GET['group_id'], explode(\".\", iUSER_GROUPS)) && ($data['group_unsubscription'] == 0))   {
         echo \"\n\n\";
         echo \"\n\n\";
      }
      elseif(iMEMBER && ($data['group_status'] == 0) && !in_array($_GET['group_id'], explode(\".\", iUSER_GROUPS)) && !in_array($userdata['user_id'], explode(\".\", $data['group_requests'])))   {
         echo \"\n\n\";
         echo \"\n\n\";
      }
      echo \"
\".$locale['ug101'].\" \".$data['group_name'].\"
\".$locale['ug102'].\"\".$data['group_description'].\"
\".$locale['ug103'].\"Von \".$users.\" angemeldeten Mitgliedern befinden sich \".sprintf((dbrows($result) == 1 ? $locale['ug104'] : $locale['ug105']), dbrows($result)).\"
       in der Gruppe \".$data['group_name'].\"
\".(($data['group_status'] == 0) ? $locale['ug105a'] : $locale['ug107']).\"\".(($data['group_status'] == 0) ? $locale['ug106a'] : $locale['ug107a']).\"
\n\";
         echo \"
\n\";
         echo \">\";
         echo \"
\n
\n\";
         echo \"
\n\";
         echo \">\";
         echo \"
\n
\n
\n\";

      if (iADMIN && checkrights(\"UG\")) {
         $users_requests = $data['group_requests'] != \"\" ? explode(\".\", substr($data['group_requests'],1)) : \"\";
         if (!empty($users_requests))   {
            $users_info = dbquery(\"SELECT user_id, user_name, user_status, user_level FROM \".DB_USERS.\" WHERE user_id IN(\".implode(\",\", $users_requests).\")\");
            if (dbrows($users_info))   {
               echo \"
\n\";
               echo \"
\n\".$locale['ug113'].\"\n
\n\";
               echo \"\n\";
               echo \"\n\n\";
               echo \"\n\n\";
               $i=0;
               while ($users_data = dbarray($users_info))   {
               $cell_color = ($i % 2 == 0 ? \"tbl1\" : \"tbl2\"); $i++;                 
               echo \"\n\n\";
               echo \"\n\n\";
               }
               echo \"\n\n\n\";
               echo \"\n\n\n\";
               echo \"\n
\".$locale['ug109'].\"\".$locale['ug110'].\"
\n\".getuserlevel($users_data['user_level']).\"
\n>\".$locale['ug111'].\" |\n\";
               echo \">\".$locale['ug112'].\"\n
\n\n\";
               echo \"\n
\n
\n\";
               echo \"\n\";
            }
         }
      }

      if (dbrows($result)) {
         echo \"\n\";
         echo \"\n\n\";
         #echo \"\n\";
         echo \"\n\n\";
         $i=0;
         while ($data = dbarray($result)) {
            $cell_color = ($i % 2 == 0 ? \"tbl1\" : \"tbl2\"); $i++;
            echo \"\n\n\";
            #echo \"\n\";
            echo \"\n\n\";
         }
         echo \"
\".$locale['ug109'].\"Status\".$locale['ug110'].\"
\n\".profile_link($data['user_id'], $data['user_name'], $data['user_status']).\"
\".$locale['ug106'].\"\".getuserlevel($data['user_level']).\"
\n\";
      }
      closetable();
   
   } else {
      redirect(\"index.php\");
   }
} else {
   add_to_title($locale['global_200'].$locale['ug100']);

   // Pending Requests
   if (iADMIN && checkrights(\"UG\")) {
      $result = dbquery(\"SELECT group_id, group_name, group_image, group_requests FROM \".DB_USER_GROUPS.\" WHERE group_requests<>''\");

      if (dbrows($result))
      {
         opentable($locale['ug117']);

         echo \"\n\";
         echo \"\n\n\";
         echo \"\n\n\";
         $i=0;
         while ($data = dbarray($result))      {
            $cell_color = ($i % 2 == 0 ? \"tbl1\" : \"tbl2\"); $i++;
            $num_of_req = count(explode(\".\", substr($data['group_requests'], 1)));
            echo \"\n\n\";
            echo \"\n\n\";
         }
         echo \"
\".$locale['ug101'].\"\".$locale['ug118'].\"
\".$data['group_name'].\"\".sprintf($locale['ug119'], $num_of_req).\"
\n\";

         closetable();
      }
   }
   opentable($locale['ug100']);

   $result = dbquery(\"SELECT group_id, group_name, group_image, group_description, group_status FROM \".DB_USER_GROUPS.\" ORDER BY group_name\");

   if (dbrows($result))   {
      echo \"\n\";
      #echo \"\n\";
      echo \"\n\";
      echo \"\n\";
      echo \"\n\n\";
      $i=0;
      while ($data = dbarray($result))      {
         $cell_color = ($i % 2 == 0 ? \"tbl1\" : \"tbl2\"); $i++;
         echo \"\n\";
         echo \"\n\";
         echo \"\n\";
         echo \"\n\n\";
      }
      echo \"
Legende\".$locale['ug101'].\"\".$locale['ug116'].\"\".$locale['ug102'].\"
\".$data['group_name'].\"\".($data['group_status'] == 0 ? $locale['ug105a'] : $locale['ug107']).\"\".trimlink($data['group_description'],100).\"
\n\";
   }
   else   {
      echo \"

\n\".$locale['ug120'].\"

\n
\n\";
   }
   closetable();
}

require_once THEMES.\"templates/footer.php\";
?>


Den Code hier den ich jetzt poste den testest du mal durch. Ich habe die stellen markiert, danach nimmst du jedes einzelne markierte mal raus, dan wirst du sehen wo die passende Stelle ist. Mein Groupsportal ist doch ganz anders wieder definiert.
fusion-mods.de/userbar/userbar-1.png
 
https://fusion-mods.de
punkerwelle
leider immer noch keine PM weder an den user noch an den Admin.
 
http://punkerwelle.com/
matze
Ich habe eben den Letzten Code den ich postete , getestet..klappt wunderbar...sogar hier auf der Hauptseite
fusion-mods.de/userbar/userbar-1.png
 
https://fusion-mods.de
punkerwelle
bin mir nicht sicher ob das PN modifiziert ist. welche dateien sind alles für DAS PM system zuständig?

dann häng ich diese mal an.
 
http://punkerwelle.com/
AnfangDu befindest dich auf Seite 12Vorblättern
Springe ins Forum: