statistik mod problem

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
greezie
Mitglied
Beiträge: 174
Registriert: 13.02.2005 21:17

statistik mod problem

Beitrag von greezie »

hallo

die smileys statistik scheint zu spinnen. überall soll nur 1 smileys verwendet worden sein....dabei stimmt das nicht.....weiss da jemand genaueres?

gruss
Benutzeravatar
Dungeonwatcher
Mitglied
Beiträge: 635
Registriert: 11.07.2004 10:04
Wohnort: Berlin

Re: statistik mod problem

Beitrag von Dungeonwatcher »

Hi!

Selbiges Problem hatte ich auch. Hier --> http://www.opentools.de/board/viewtopic.php?t=1904 wurde mir geholfen.

Code: Alles auswählen

#
#-----[ ÖFFNE ]---------------------------------------------
#

/top_smilies/module.php

#
#-----[ FINDE ]---------------------------------------------
#
    for ($i = 0; $i < count($smile_group); $i++)
   {
      $found = FALSE;
      $match_regexp = '';
      for ($j = 0; $j < count($smile_group[$i]['code']) && $found == FALSE; $j++)
      {
         if ($smile_pref == 0)
         {
            if (strstr($message, $smile_group[$i]['code'][$j]))
            {
               $all_smilies[$i]['count'] = $all_smilies[$i]['count'] + 1;
               $found = TRUE;
            }
         }
         else
         {
            $match_regexp .= ($match_regexp == '') ? '/(?<=.\W|\W.|^\W)' . preg_quote($smile_group[$i]['code'][$j], "/") . '(?=.\W|\W.|\W$)' : '|(?<=.\W|\W.|^\W)' . preg_quote($smile_group[$i]['code'][$j], "/") . '(?=.\W|\W.|\W$)';
         }
      }

      if (!$found)
      {
         if ($match_regexp != '')
         {
            $match_regexp .= '/';
   //         echo "<br /><br />" . $match_regexp . "<br />";
   //         echo "#".$all_smilies[$i]['smile_url']."#";
            preg_match_all($match_regexp, ' ' . $message . ' ', $matches);
   //         echo "<br />-" . count($matches[0]) . "-<br />";
            $all_smilies[$i]['count'] = $all_smilies[$i]['count'] + count($matches[0]);
         }
      }
   }

#
#-----[ ERSETZE DURCH ]---------------------------------------
#

// BEGIN: Modified to cycle through each message separately to correct count = 1 problem
   for ($k = 0; $k < count($rows); $k++)
   {
      //$message .= $rows[$i]['post_text'];
      $message = $rows[$k]['post_text'];
   //}
   
      //echo ";".$message.";";   
      for ($i = 0; $i < count($smile_group); $i++)
      {
         $found = FALSE;
         $match_regexp = '';
         for ($j = 0; $j < count($smile_group[$i]['code']) && $found == FALSE; $j++)
         {
            if ($smile_pref == 0)
            {
               if (strstr($message, $smile_group[$i]['code'][$j]))
               {
                  $all_smilies[$i]['count'] = $all_smilies[$i]['count'] + 1;
                  $found = TRUE;
               }
            }
            else
            {
               $match_regexp .= ($match_regexp == '') ? '/(?<=.\W|\W.|^\W)' . preg_quote($smile_group[$i]['code'][$j], "/") . '(?=.\W|\W.|\W$)' : '|(?<=.\W|\W.|^\W)' . preg_quote($smile_group[$i]['code'][$j], "/") . '(?=.\W|\W.|\W$)';
            }
         }
   
         if (!$found)
         {
            if ($match_regexp != '')
            {
               $match_regexp .= '/';
         //      echo "<br /><br />" . $match_regexp . "<br />";
         //      echo "#".$all_smilies[$i]['smile_url']."#";
               preg_match_all($match_regexp, ' ' . $message . ' ', $matches);
         //      echo "<br />-" . count($matches[0]) . "-<br />";
               $all_smilies[$i]['count'] = $all_smilies[$i]['count'] + count($matches[0]);
            }
         }
      }
   }
// END: Modified to cycle through each message separately to correct count = 1 problem

#
#-----[ SPEICHER DIESE DATEI ]------------------------------------------
#
# EoM
Jetzt tut dieses Modul exakt was es soll. :)

Bye/2
Antworten

Zurück zu „phpBB 2.0: Mod Support“