Welcome, Guest. Please Login or Register.
November 26, 2024, 06:25:19 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  German User Help  |  Hilfe bzw. Diskussionen zu Mods  |  Hat wer Zeit? Kategorien löschen... Bug? « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Hat wer Zeit? Kategorien löschen... Bug?  (Read 1118 times)
chris
Guest
Hat wer Zeit? Kategorien löschen... Bug?
« on: October 14, 2002, 02:16:07 PM »
Reply with quote

Hollahe!

Ich hab momentan leider nicht soviel Zeit, habe aber das Gefühl das in "ManageCats.php" ein Fehler in "ModifyCat" ist...

Meiner Meinung nach werden ein paar Sachen nicht gemacht die gemacht werden müssten, bzw. sinnvoll wären:

  • Polls werden glaub ich nicht gelöscht
  • die Tabelle "calendar" wird nicht aktualisiert
  • aus den Tabellen "log_boards", "log_mark_read", "log_topics" sollten ggf. die überflüssigen Einträge gelöscht werden

Wie gesagt... mit Zeit siehts bei mir schlecht aus... wenn also jemand Zeit/Lust hat : ein MOD wäre willkommen *g* (wenn meine Vermutungen überhaupt stimmen)

Gleiches gilt übrigens anscheinend auch für "ManageBoards.php" und die Funktion "ModifyBoard" :-(
« Last Edit: October 14, 2002, 02:39:27 PM by Christian Land » Logged
chris
Guest
Re:Hat wer Zeit? Kategorien löschen... Bug?
« Reply #1 on: October 16, 2002, 10:00:42 AM »
Reply with quote

Hat sich erledigt...

Hab die Änderungen selber gemacht, Jeff schaut wahrscheinlich heute nochmal drüber... es wird demnächst eventuell doch noch eine 1.4.2 geben in der noch ein paar andere Kleinigkeiten geändert werden...

Für die Furchtlosen unter Euch (ACHTUNG! Die Funktionen sind noch nicht sehr umfangreich getestet!):

ACHTUNG!!! Ich hab MEINE Board-Version als Grundlage genommen und KEINE saubere Installation!!! Es kann also noch zusätzlicher Schmutz in den Funktionen sein!!!

Folgende Strings müssen ins Language File:

$txt['advdel1'] = "Removing polls";
$txt['advdel2'] = "Cleaning up Log-Tables";
$txt['advdel3'] = "Removing calendar-events";


und in "ManageBoards.php" muss die Funktion "ModifyBoard" angepasst werden.

function ModifyBoard ()
{

   global $descr,$boardname,$moderator,$ID_BOARD,$yySetLocation,$moda,$txt,$cgi,$db_prefix,$changecat,$isAnnouncement,$notifyAnnouncements,$count;

   if($moda != '-1')
   {

      // move category

           if ($changecat!="nochange")
           {
         $result   = mysql_query("UPDATE {$db_prefix}boards SET ID_CAT='$changecat' WHERE ID_BOARD=$ID_BOARD");
           }

      if (get_magic_quotes_gpc()==0)
      {
         $boardname   = mysql_escape_string($boardname);
         $descr      = mysql_escape_string($descr);
      }
      $isAnnouncement      = ($isAnnouncement == 'on') ? '1' : '0';
      $notifyAnnouncements   = ($notifyAnnouncements == 'on' && $isAnnouncement == '1') ? '1' : '0';
      $count         = ($count == 'on') ? '1' : '0';
      $moderator      = implode(',', array_map("trim", explode(',', $moderator)));
      $request      = mysql_query("UPDATE {$db_prefix}boards SET name='$boardname',description='$descr',moderators='$moderator',isAnnouncement='$isAnnouncement',notifyAnnouncements='$notifyAnnouncements',count='$count' WHERE ID_BOARD=$ID_BOARD");
      $yySetLocation      = "$cgi;action=manageboards";
      redirectexit();

   }
   else
   {
      template_header();

      print "$txt[48] $ID_BOARD<br>";

      // Delete Attachments - Jeff

           $request   = mysql_query("SELECT m.attachmentFilename FROM {$db_prefix}messages as m, {$db_prefix}topics as t WHERE m.ID_TOPIC=t.ID_TOPIC AND t.ID_BOARD=$ID_BOARD AND attachmentFilename IS NOT NULL");

      if (mysql_numrows($request)>0)
      {
         while($row = mysql_fetch_array($request))
         {
            unlink($modSettings['attachmentUploadDir'] . "/" . $row['attachmentFilename']);
         }
      }

      // Delete Board

      $request2 = mysql_query("DELETE FROM {$db_prefix}boards WHERE ID_BOARD=$ID_BOARD");

      // Delete all Topics, Polls, ... changed by Christian

      $request2 = mysql_query("SELECT ID_TOPIC, ID_POLL FROM {$db_prefix}topics WHERE ID_BOARD=$ID_BOARD");
      while ($row2 = mysql_fetch_row($request2))
      {
         print "&nbsp;&nbsp;$txt[50] $row2[0]<br>";
         $request3 = mysql_query("DELETE FROM {$db_prefix}topics WHERE ID_TOPIC=$row2[0]");
         print "&nbsp;&nbsp;&nbsp;&nbsp;$txt[49]<br>";
         $request3 = mysql_query("DELETE FROM {$db_prefix}messages WHERE ID_TOPIC=$row2[0]");
         print "&nbsp;&nbsp;&nbsp;&nbsp;$txt[advdel1]<br>";
         $request3 = mysql_query("DELETE FROM {$db_prefix}polls WHERE ID_POLL=$row2[1]");
         print "&nbsp;&nbsp;&nbsp;&nbsp;$txt[advdel2]<br>";
         $request3 = mysql_query("DELETE FROM {$db_prefix}log_topics WHERE ID_TOPIC=$row2[0]");
         print "&nbsp;&nbsp;$txt[51]<br>";
      }
      print "&nbsp;&nbsp;$txt[advdel2]<br>";
      $request3 = mysql_query("DELETE FROM {$db_prefix}log_mark_read WHERE ID_BOARD=$ID_BOARD");
      $request3 = mysql_query("DELETE FROM {$db_prefix}log_boards WHERE ID_BOARD=$ID_BOARD");
      print "&nbsp;&nbsp;$txt[advdel3]<br>";
      $request3 = mysql_query("DELETE FROM {$db_prefix}calendar WHERE id_board=$ID_BOARD");
      print "$txt[51]<br> <br>";
      print "<font size=2><a href=\"$cgi;action=manageboards\">$txt[4]</a><br><a href=\"$cgi;action=admin\">$txt[208]</a></font><br>";
      footer();

   }

   obExit();

}

und in "ManageCats.php" muss die Funktion "ModifyCat" angepasst werden.

function ModifyCat ()
{

   global $moda,$txt,$catname,$catgroups,$catorder,$ID_CAT,$yySetLocation,$cgi,$db_prefix;
   global $iconon,$iconoff;

   if($moda != '-1')
   {
           if (get_magic_quotes_gpc()==0)
           {
              $catname = mysql_escape_string($catname);
           }
      $request = mysql_query("UPDATE {$db_prefix}categories SET name='$catname',iconon='$iconon',iconoff='$iconoff',memberGroups='$catgroups',catOrder='$catorder' WHERE ID_CAT=$ID_CAT");
      $yySetLocation = "$cgi;action=managecats";
      redirectexit();
   }
   else
   {

      template_header();

      print "$txt[60] $ID_CAT<br>";

      // Delete Attachments - Jeff

      $request = mysql_query("SELECT m.attachmentFilename FROM {$db_prefix}messages as m, {$db_prefix}topics as t, {$db_prefix}boards as b WHERE (m.ID_TOPIC=t.ID_TOPIC AND t.ID_BOARD=b.ID_BOARD AND b.ID_CAT=$ID_CAT AND m.attachmentFilename IS NOT NULL)");

      if (mysql_numrows($request)>0)
      {
         while($row = mysql_fetch_array($request)){
            unlink($modSettings['attachmentUploadDir'] . "/" . $row['attachmentFilename']);
         }
      }

      $request = mysql_query("DELETE FROM {$db_prefix}categories WHERE ID_CAT=$ID_CAT");
      $request = mysql_query("SELECT ID_BOARD FROM {$db_prefix}boards WHERE ID_CAT=$ID_CAT");

      while($row = mysql_fetch_row($request))
      {
         print "&nbsp;&nbsp;$txt[48] $row[0]<br>";
         $request2 = mysql_query("DELETE FROM {$db_prefix}boards WHERE ID_BOARD=$row[0]");
         $request2 = mysql_query("SELECT ID_TOPIC, ID_POLL FROM {$db_prefix}topics WHERE ID_BOARD=$row[0]");
         while ($row2 = mysql_fetch_row($request2))
         {
            print "&nbsp;&nbsp;&nbsp;&nbsp;$txt[50] $row2[0]<br>";
            $request3 = mysql_query("DELETE FROM {$db_prefix}topics WHERE ID_TOPIC=$row2[0]");
            print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$txt[49]<br>";
            $request3 = mysql_query("DELETE FROM {$db_prefix}messages WHERE ID_TOPIC=$row2[0]");
            print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$txt[advdel1]<br>";
            $request3 = mysql_query("DELETE FROM {$db_prefix}polls WHERE ID_POLL=$row2[1]");
            print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$txt[advdel2]<br>";
            $request3 = mysql_query("DELETE FROM {$db_prefix}log_topics WHERE ID_TOPIC=$row2[0]");
            print "&nbsp;&nbsp;&nbsp;&nbsp;$txt[51]<br>";
         }
         print "&nbsp;&nbsp;&nbsp;&nbsp;$txt[advdel2]<br>";
         $request3 = mysql_query("DELETE FROM {$db_prefix}log_mark_read WHERE ID_BOARD=$row[0]");
         $request3 = mysql_query("DELETE FROM {$db_prefix}log_boards WHERE ID_BOARD=$row[0]");
         print "&nbsp;&nbsp;&nbsp;&nbsp;$txt[advdel3]<br>";
         $request3 = mysql_query("DELETE FROM {$db_prefix}calendar WHERE id_board=$row[0]");
         print "&nbsp;&nbsp;$txt[51]<br>";
      }
      print "$txt[51]<br> <br>";
      print "<font size=2><a href=\"$cgi;action=managecats\">$txt[3]</a><br><a href=\"$cgi;action=admin\">$txt[208]</a></font><br>";
      footer();
   obExit();
   }

(Also bei mir ist ModifyCat DEFINITIV anders als im Original!!! - also sollten NUR LEUTE mit AHNUNG daran rumfummeln weil der Source SO NICHT auf Original-YaBBs läuft!)
« Last Edit: October 16, 2002, 10:03:31 AM by Christian Land » Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  German User Help  |  Hilfe bzw. Diskussionen zu Mods  |  Hat wer Zeit? Kategorien löschen... Bug? « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.083 seconds with 19 queries.