Verzeichnisstruktur phpBB-3.0.0


Veröffentlicht
12.12.2007

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

adjust_smilies.php

Zuletzt modifiziert: 09.10.2024, 12:50 - Dateigröße: 2.70 KiB


 001  <?php
 002  /**
 003  * Updates smilies that were changed to the new ones
 004  */
 005  die("Please read the first lines of this script for instructions on how to enable it");
 006   
 007  set_time_limit(0);
 008   
 009  define('IN_PHPBB', true);
 010  $phpbb_root_path = './../';
 011  $phpEx = substr(strrchr(__FILE__, '.'), 1);
 012  include($phpbb_root_path . 'common.'.$phpEx);
 013   
 014  // Start session management
 015  $user->session_begin();
 016  $auth->acl($user->data);
 017  $user->setup();
 018   
 019  $echos = 0;
 020   
 021  $replace = array(
 022      '<img src="{SMILIES_PATH}/icon_biggrin.gif',
 023      '<img src="{SMILIES_PATH}/icon_confused.gif',
 024      '<img src="{SMILIES_PATH}/icon_sad.gif',
 025      '<img src="{SMILIES_PATH}/icon_smile.gif',
 026      '<img src="{SMILIES_PATH}/icon_surprised.gif',
 027      '<img src="{SMILIES_PATH}/icon_wink.gif',
 028  );
 029   
 030  $with = array(
 031      '<img src="{SMILIES_PATH}/icon_e_biggrin.gif',
 032      '<img src="{SMILIES_PATH}/icon_e_confused.gif',
 033      '<img src="{SMILIES_PATH}/icon_e_sad.gif',
 034      '<img src="{SMILIES_PATH}/icon_e_smile.gif',
 035      '<img src="{SMILIES_PATH}/icon_e_surprised.gif',
 036      '<img src="{SMILIES_PATH}/icon_e_wink.gif',
 037  );
 038   
 039  // Adjust user signatures
 040  $sql = 'SELECT user_id, user_sig
 041      FROM ' . USERS_TABLE;
 042  $result = $db->sql_query($sql);
 043   
 044  while ($row = $db->sql_fetchrow($result))
 045  {
 046      $new_content = str_replace($replace, $with, $row['user_sig']);
 047   
 048      if ($new_content != $row['user_sig'])
 049      {
 050          $sql = 'UPDATE ' . USERS_TABLE . " SET user_sig = '" . $db->sql_escape($new_content) . "'
 051              WHERE user_id = " . $row['user_id'];
 052          $db->sql_query($sql);
 053   
 054          if ($echos > 200)
 055          {
 056              echo '<br />' . "\n";
 057              $echos = 0;
 058          }
 059   
 060          echo '.';
 061          $echos++;
 062   
 063          flush();
 064      }
 065  }
 066  $db->sql_freeresult($result);
 067   
 068   
 069  // Now adjust posts
 070  $sql = 'SELECT post_id, post_text
 071      FROM ' . POSTS_TABLE;
 072  $result = $db->sql_query($sql);
 073   
 074  while ($row = $db->sql_fetchrow($result))
 075  {
 076      $new_content = str_replace($replace, $with, $row['post_text']);
 077   
 078      if ($row['post_text'] != $new_content)
 079      {
 080          $sql = 'UPDATE ' . POSTS_TABLE . " SET post_text = '" . $db->sql_escape($new_content) . "'
 081              WHERE post_id = " . $row['post_id'];
 082          $db->sql_query($sql);
 083   
 084          if ($echos > 200)
 085          {
 086              echo '<br />' . "\n";
 087              $echos = 0;
 088          }
 089   
 090          echo '.';
 091          $echos++;
 092   
 093          flush();
 094      }
 095  }
 096  $db->sql_freeresult($result);
 097   
 098  // Now to the private messages
 099  $sql = 'SELECT msg_id, message_text
 100      FROM ' . PRIVMSGS_TABLE;
 101  $result = $db->sql_query($sql);
 102   
 103  while ($row = $db->sql_fetchrow($result))
 104  {
 105      $new_content = str_replace($replace, $with, $row['message_text']);
 106   
 107      if ($row['message_text'] != $new_content)
 108      {
 109          $sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET bbcode_bitfield = '" . $db->sql_escape($new_content) . "'
 110              WHERE msg_id = " . $row['msg_id'];
 111          $db->sql_query($sql);
 112   
 113          if ($echos > 200)
 114          {
 115              echo '<br />' . "\n";
 116              $echos = 0;
 117          }
 118   
 119          echo '.';
 120          $echos++;
 121   
 122          flush();
 123      }
 124  }
 125  $db->sql_freeresult($result);
 126   
 127  // Done
 128  $db->sql_close();
 129   
 130  ?>