[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/admin/ -> admin_smilies.php (source)

   1  <?php
   2  /***************************************************************************
   3  *                               admin_smilies.php
   4  *                              -------------------
   5  *     begin                : Thu May 31, 2001
   6  *     copyright            : (C) 2001 The phpBB Group
   7  *     email                : support@phpbb.com
   8  *
   9  *     $Id: admin_smilies.php 8377 2008-02-10 12:52:05Z acydburn $
  10  *
  11  ****************************************************************************/
  12  
  13  /***************************************************************************
  14   *
  15   *   This program is free software; you can redistribute it and/or modify
  16   *   it under the terms of the GNU General Public License as published by
  17   *   the Free Software Foundation; either version 2 of the License, or
  18   *   (at your option) any later version.
  19   *
  20   ***************************************************************************/
  21  
  22  /**************************************************************************
  23  *    This file will be used for modifying the smiley settings for a board.
  24  **************************************************************************/
  25  
  26  define('IN_PHPBB', 1);
  27  
  28  //
  29  // First we do the setmodules stuff for the admin cp.
  30  //
  31  if( !empty($setmodules) )
  32  {
  33      $filename = basename(__FILE__);
  34      $module['General']['Smilies'] = $filename;
  35  
  36      return;
  37  }
  38  
  39  $phpbb_root_path = "./../";
  40  require ($phpbb_root_path . 'extension.inc');
  41  
  42  $cancel = ( isset($HTTP_POST_VARS['cancel']) || isset($_POST['cancel']) ) ? true : false;
  43  $no_page_header = $cancel;
  44  
  45  //
  46  // Load default header
  47  //
  48  if ((!empty($HTTP_GET_VARS['export_pack']) && $HTTP_GET_VARS['export_pack'] == 'send') || (!empty($_GET['export_pack']) && $_GET['export_pack'] == 'send'))
  49  {
  50      $no_page_header = true;
  51  }
  52  
  53  require('./pagestart.' . $phpEx);
  54  
  55  if ($cancel)
  56  {
  57      redirect('admin/' . append_sid("admin_smilies.$phpEx", true));
  58  }
  59  
  60  //
  61  // Check to see what mode we should operate in.
  62  //
  63  if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
  64  {
  65      $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
  66      $mode = htmlspecialchars($mode);
  67  }
  68  else
  69  {
  70      $mode = "";
  71  }
  72  
  73  $delimeter  = '=+:';
  74  
  75  //
  76  // Read a listing of uploaded smilies for use in the add or edit smliey code...
  77  //
  78  $dir = @opendir($phpbb_root_path . $board_config['smilies_path']);
  79  
  80  while($file = @readdir($dir))
  81  {
  82      if( !@is_dir(phpbb_realpath($phpbb_root_path . $board_config['smilies_path'] . '/' . $file)) )
  83      {
  84          $img_size = @getimagesize($phpbb_root_path . $board_config['smilies_path'] . '/' . $file);
  85  
  86          if( $img_size[0] && $img_size[1] )
  87          {
  88              $smiley_images[] = $file;
  89          }
  90          else if( eregi('.pak$', $file) )
  91          {    
  92              $smiley_paks[] = $file;
  93          }
  94      }
  95  }
  96  
  97  @closedir($dir);
  98  
  99  //
 100  // Select main mode
 101  //
 102  if( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack']) )
 103  {
 104      //
 105      // Import a list a "Smiley Pack"
 106      //
 107      $smile_pak = ( isset($HTTP_POST_VARS['smile_pak']) ) ? $HTTP_POST_VARS['smile_pak'] : $HTTP_GET_VARS['smile_pak'];
 108      $clear_current = ( isset($HTTP_POST_VARS['clear_current']) ) ? $HTTP_POST_VARS['clear_current'] : $HTTP_GET_VARS['clear_current'];
 109      $replace_existing = ( isset($HTTP_POST_VARS['replace']) ) ? $HTTP_POST_VARS['replace'] : $HTTP_GET_VARS['replace'];
 110  
 111      if ( !empty($smile_pak) )
 112      {
 113          //
 114          // The user has already selected a smile_pak file.. Import it.
 115          //
 116          if( !empty($clear_current)  )
 117          {
 118              $sql = "DELETE 
 119                  FROM " . SMILIES_TABLE;
 120              if( !$result = $db->sql_query($sql) )
 121              {
 122                  message_die(GENERAL_ERROR, "Couldn't delete current smilies", "", __LINE__, __FILE__, $sql);
 123              }
 124          }
 125          else
 126          {
 127              $sql = "SELECT code 
 128                  FROM ". SMILIES_TABLE;
 129              if( !$result = $db->sql_query($sql) )
 130              {
 131                  message_die(GENERAL_ERROR, "Couldn't get current smilies", "", __LINE__, __FILE__, $sql);
 132              }
 133  
 134              $cur_smilies = $db->sql_fetchrowset($result);
 135  
 136              for( $i = 0; $i < count($cur_smilies); $i++ )
 137              {
 138                  $k = $cur_smilies[$i]['code'];
 139                  $smiles[$k] = 1;
 140              }
 141          }
 142  
 143          $fcontents = @file($phpbb_root_path . $board_config['smilies_path'] . '/'. $smile_pak);
 144  
 145          if( empty($fcontents) )
 146          {
 147              message_die(GENERAL_ERROR, "Couldn't read smiley pak file", "", __LINE__, __FILE__, $sql);
 148          }
 149  
 150          for( $i = 0; $i < count($fcontents); $i++ )
 151          {
 152              $smile_data = explode($delimeter, trim(addslashes($fcontents[$i])));
 153  
 154              for( $j = 2; $j < count($smile_data); $j++)
 155              {
 156                  //
 157                  // Replace > and < with the proper html_entities for matching.
 158                  //
 159                  $smile_data[$j] = str_replace("<", "&lt;", $smile_data[$j]);
 160                  $smile_data[$j] = str_replace(">", "&gt;", $smile_data[$j]);
 161                  $k = $smile_data[$j];
 162  
 163                  if( $smiles[$k] == 1 )
 164                  {
 165                      if( !empty($replace_existing) )
 166                      {
 167                          $sql = "UPDATE " . SMILIES_TABLE . " 
 168                              SET smile_url = '" . str_replace("\'", "''", $smile_data[0]) . "', emoticon = '" . str_replace("\'", "''", $smile_data[1]) . "' 
 169                              WHERE code = '" . str_replace("\'", "''", $smile_data[$j]) . "'";
 170                      }
 171                      else
 172                      {
 173                          $sql = '';
 174                      }
 175                  }
 176                  else
 177                  {
 178                      $sql = "INSERT INTO " . SMILIES_TABLE . " (code, smile_url, emoticon)
 179                          VALUES('" . str_replace("\'", "''", $smile_data[$j]) . "', '" . str_replace("\'", "''", $smile_data[0]) . "', '" . str_replace("\'", "''", $smile_data[1]) . "')";
 180                  }
 181  
 182                  if( $sql != '' )
 183                  {
 184                      $result = $db->sql_query($sql);
 185                      if( !$result )
 186                      {
 187                          message_die(GENERAL_ERROR, "Couldn't update smilies!", "", __LINE__, __FILE__, $sql);
 188                      }
 189                  }
 190              }
 191          }
 192  
 193          $message = $lang['smiley_import_success'] . "<br /><br />" . sprintf($lang['Click_return_smileadmin'], "<a href=\"" . append_sid("admin_smilies.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
 194  
 195          message_die(GENERAL_MESSAGE, $message);
 196          
 197      }
 198      else
 199      {
 200          //
 201          // Display the script to get the smile_pak cfg file...
 202          //
 203          $smile_paks_select = "<select name='smile_pak'><option value=''>" . $lang['Select_pak'] . "</option>";
 204          while( list($key, $value) = @each($smiley_paks) )
 205          {
 206              if ( !empty($value) ) 
 207              {
 208                  $smile_paks_select .= "<option>" . $value . "</option>";
 209              }
 210          }
 211          $smile_paks_select .= "</select>";
 212  
 213          $hidden_vars = "<input type='hidden' name='mode' value='import'>";    
 214  
 215          $template->set_filenames(array(
 216              "body" => "admin/smile_import_body.tpl")
 217          );
 218  
 219          $template->assign_vars(array(
 220              "L_SMILEY_TITLE" => $lang['smiley_title'],
 221              "L_SMILEY_EXPLAIN" => $lang['smiley_import_inst'],
 222              "L_SMILEY_IMPORT" => $lang['smiley_import'],
 223              "L_SELECT_LBL" => $lang['choose_smile_pak'],
 224              "L_IMPORT" => $lang['import'],
 225              "L_CONFLICTS" => $lang['smile_conflicts'],
 226              "L_DEL_EXISTING" => $lang['del_existing_smileys'], 
 227              "L_REPLACE_EXISTING" => $lang['replace_existing'], 
 228              "L_KEEP_EXISTING" => $lang['keep_existing'], 
 229  
 230              "S_SMILEY_ACTION" => append_sid("admin_smilies.$phpEx"),
 231              "S_SMILE_SELECT" => $smile_paks_select,
 232              "S_HIDDEN_FIELDS" => $hidden_vars)
 233          );
 234  
 235          $template->pparse("body");
 236      }
 237  }
 238  else if( isset($HTTP_POST_VARS['export_pack']) || isset($HTTP_GET_VARS['export_pack']) )
 239  {
 240      //
 241      // Export our smiley config as a smiley pak...
 242      //
 243      if ( $HTTP_GET_VARS['export_pack'] == "send" )
 244      {    
 245          $sql = "SELECT * 
 246              FROM " . SMILIES_TABLE;
 247          if( !$result = $db->sql_query($sql) )
 248          {
 249              message_die(GENERAL_ERROR, "Could not get smiley list", "", __LINE__, __FILE__, $sql);
 250          }
 251  
 252          $resultset = $db->sql_fetchrowset($result);
 253  
 254          $smile_pak = "";
 255          for($i = 0; $i < count($resultset); $i++ )
 256          {
 257              $smile_pak .= $resultset[$i]['smile_url'] . $delimeter;
 258              $smile_pak .= $resultset[$i]['emoticon'] . $delimeter;
 259              $smile_pak .= $resultset[$i]['code'] . "\n";
 260          }
 261  
 262          header("Content-Type: text/x-delimtext; name=\"smiles.pak\"");
 263          header("Content-disposition: attachment; filename=smiles.pak");
 264  
 265          echo $smile_pak;
 266  
 267          exit;
 268      }
 269  
 270      $message = sprintf($lang['export_smiles'], "<a href=\"" . append_sid("admin_smilies.$phpEx?export_pack=send", true) . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_smileadmin'], "<a href=\"" . append_sid("admin_smilies.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
 271  
 272      message_die(GENERAL_MESSAGE, $message);
 273  
 274  }
 275  else if( isset($HTTP_POST_VARS['add']) || isset($HTTP_GET_VARS['add']) )
 276  {
 277      //
 278      // Admin has selected to add a smiley.
 279      //
 280  
 281      $template->set_filenames(array(
 282          "body" => "admin/smile_edit_body.tpl")
 283      );
 284  
 285      $filename_list = "";
 286      for( $i = 0; $i < count($smiley_images); $i++ )
 287      {
 288          $filename_list .= '<option value="' . $smiley_images[$i] . '">' . $smiley_images[$i] . '</option>';
 289      }
 290  
 291      $s_hidden_fields = '<input type="hidden" name="mode" value="savenew" />';
 292  
 293      $template->assign_vars(array(
 294          "L_SMILEY_TITLE" => $lang['smiley_title'],
 295          "L_SMILEY_CONFIG" => $lang['smiley_config'],
 296          "L_SMILEY_EXPLAIN" => $lang['smile_desc'],
 297          "L_SMILEY_CODE" => $lang['smiley_code'],
 298          "L_SMILEY_URL" => $lang['smiley_url'],
 299          "L_SMILEY_EMOTION" => $lang['smiley_emot'],
 300          "L_SUBMIT" => $lang['Submit'],
 301          "L_RESET" => $lang['Reset'],
 302  
 303          "SMILEY_IMG" => $phpbb_root_path . $board_config['smilies_path'] . '/' . $smiley_images[0], 
 304  
 305          "S_SMILEY_ACTION" => append_sid("admin_smilies.$phpEx"), 
 306          "S_HIDDEN_FIELDS" => $s_hidden_fields, 
 307          "S_FILENAME_OPTIONS" => $filename_list, 
 308          "S_SMILEY_BASEDIR" => $phpbb_root_path . $board_config['smilies_path'])
 309      );
 310  
 311      $template->pparse("body");
 312  }
 313  else if ( $mode != "" )
 314  {
 315      switch( $mode )
 316      {
 317          case 'delete':
 318              //
 319              // Admin has selected to delete a smiley.
 320              //
 321  
 322              $smiley_id = ( !empty($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : $HTTP_GET_VARS['id'];
 323              $smiley_id = intval($smiley_id);
 324  
 325              $confirm = isset($HTTP_POST_VARS['confirm']);
 326  
 327              if( $confirm )
 328              {
 329                  $sql = "DELETE FROM " . SMILIES_TABLE . "
 330                      WHERE smilies_id = " . $smiley_id;
 331                  $result = $db->sql_query($sql);
 332                  if( !$result )
 333                  {
 334                      message_die(GENERAL_ERROR, "Couldn't delete smiley", "", __LINE__, __FILE__, $sql);
 335                  }
 336  
 337                  $message = $lang['smiley_del_success'] . "<br /><br />" . sprintf($lang['Click_return_smileadmin'], "<a href=\"" . append_sid("admin_smilies.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
 338  
 339                  message_die(GENERAL_MESSAGE, $message);
 340              }
 341              else
 342              {
 343                  // Present the confirmation screen to the user
 344                  $template->set_filenames(array(
 345                      'body' => 'admin/confirm_body.tpl')
 346                  );
 347  
 348                  $hidden_fields = '<input type="hidden" name="mode" value="delete" /><input type="hidden" name="id" value="' . $smiley_id . '" />';
 349  
 350                  $template->assign_vars(array(
 351                      'MESSAGE_TITLE' => $lang['Confirm'],
 352                      'MESSAGE_TEXT' => $lang['Confirm_delete_smiley'],
 353  
 354                      'L_YES' => $lang['Yes'],
 355                      'L_NO' => $lang['No'],
 356  
 357                      'S_CONFIRM_ACTION' => append_sid("admin_smilies.$phpEx"),
 358                      'S_HIDDEN_FIELDS' => $hidden_fields)
 359                  );
 360                  $template->pparse('body');
 361              }
 362              break;
 363  
 364          case 'edit':
 365              //
 366              // Admin has selected to edit a smiley.
 367              //
 368  
 369              $smiley_id = ( !empty($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : $HTTP_GET_VARS['id'];
 370              $smiley_id = intval($smiley_id);
 371  
 372              $sql = "SELECT *
 373                  FROM " . SMILIES_TABLE . "
 374                  WHERE smilies_id = " . $smiley_id;
 375              $result = $db->sql_query($sql);
 376              if( !$result )
 377              {
 378                  message_die(GENERAL_ERROR, 'Could not obtain emoticon information', "", __LINE__, __FILE__, $sql);
 379              }
 380              $smile_data = $db->sql_fetchrow($result);
 381  
 382              $filename_list = "";
 383              for( $i = 0; $i < count($smiley_images); $i++ )
 384              {
 385                  if( $smiley_images[$i] == $smile_data['smile_url'] )
 386                  {
 387                      $smiley_selected = "selected=\"selected\"";
 388                      $smiley_edit_img = $smiley_images[$i];
 389                  }
 390                  else
 391                  {
 392                      $smiley_selected = "";
 393                  }
 394  
 395                  $filename_list .= '<option value="' . $smiley_images[$i] . '"' . $smiley_selected . '>' . $smiley_images[$i] . '</option>';
 396              }
 397  
 398              $template->set_filenames(array(
 399                  "body" => "admin/smile_edit_body.tpl")
 400              );
 401  
 402              $s_hidden_fields = '<input type="hidden" name="mode" value="save" /><input type="hidden" name="smile_id" value="' . $smile_data['smilies_id'] . '" />';
 403  
 404              $template->assign_vars(array(
 405                  "SMILEY_CODE" => $smile_data['code'],
 406                  "SMILEY_EMOTICON" => $smile_data['emoticon'],
 407  
 408                  "L_SMILEY_TITLE" => $lang['smiley_title'],
 409                  "L_SMILEY_CONFIG" => $lang['smiley_config'],
 410                  "L_SMILEY_EXPLAIN" => $lang['smile_desc'],
 411                  "L_SMILEY_CODE" => $lang['smiley_code'],
 412                  "L_SMILEY_URL" => $lang['smiley_url'],
 413                  "L_SMILEY_EMOTION" => $lang['smiley_emot'],
 414                  "L_SUBMIT" => $lang['Submit'],
 415                  "L_RESET" => $lang['Reset'],
 416  
 417                  "SMILEY_IMG" => $phpbb_root_path . $board_config['smilies_path'] . '/' . $smiley_edit_img, 
 418  
 419                  "S_SMILEY_ACTION" => append_sid("admin_smilies.$phpEx"),
 420                  "S_HIDDEN_FIELDS" => $s_hidden_fields, 
 421                  "S_FILENAME_OPTIONS" => $filename_list, 
 422                  "S_SMILEY_BASEDIR" => $phpbb_root_path . $board_config['smilies_path'])
 423              );
 424  
 425              $template->pparse("body");
 426              break;
 427  
 428          case "save":
 429              //
 430              // Admin has submitted changes while editing a smiley.
 431              //
 432  
 433              //
 434              // Get the submitted data, being careful to ensure that we only
 435              // accept the data we are looking for.
 436              //
 437              $smile_code = ( isset($HTTP_POST_VARS['smile_code']) ) ? trim($HTTP_POST_VARS['smile_code']) : '';
 438              $smile_url = ( isset($HTTP_POST_VARS['smile_url']) ) ? trim($HTTP_POST_VARS['smile_url']) : '';
 439              $smile_url = phpbb_ltrim(basename($smile_url), "'");
 440              $smile_emotion = ( isset($HTTP_POST_VARS['smile_emotion']) ) ? htmlspecialchars(trim($HTTP_POST_VARS['smile_emotion'])) : '';
 441              $smile_id = ( isset($HTTP_POST_VARS['smile_id']) ) ? intval($HTTP_POST_VARS['smile_id']) : 0;
 442              $smile_code = trim($smile_code);
 443              $smile_url = trim($smile_url);
 444  
 445              // If no code was entered complain ...
 446              if ($smile_code == '' || $smile_url == '')
 447              {
 448                  message_die(GENERAL_MESSAGE, $lang['Fields_empty']);
 449              }
 450  
 451              //
 452              // Convert < and > to proper htmlentities for parsing.
 453              //
 454              $smile_code = str_replace('<', '&lt;', $smile_code);
 455              $smile_code = str_replace('>', '&gt;', $smile_code);
 456  
 457              //
 458              // Proceed with updating the smiley table.
 459              //
 460              $sql = "UPDATE " . SMILIES_TABLE . "
 461                  SET code = '" . str_replace("\'", "''", $smile_code) . "', smile_url = '" . str_replace("\'", "''", $smile_url) . "', emoticon = '" . str_replace("\'", "''", $smile_emotion) . "'
 462                  WHERE smilies_id = $smile_id";
 463              if( !($result = $db->sql_query($sql)) )
 464              {
 465                  message_die(GENERAL_ERROR, "Couldn't update smilies info", "", __LINE__, __FILE__, $sql);
 466              }
 467  
 468              $message = $lang['smiley_edit_success'] . "<br /><br />" . sprintf($lang['Click_return_smileadmin'], "<a href=\"" . append_sid("admin_smilies.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
 469  
 470              message_die(GENERAL_MESSAGE, $message);
 471              break;
 472  
 473          case "savenew":
 474              //
 475              // Admin has submitted changes while adding a new smiley.
 476              //
 477  
 478              //
 479              // Get the submitted data being careful to ensure the the data
 480              // we recieve and process is only the data we are looking for.
 481              //
 482              $smile_code = ( isset($HTTP_POST_VARS['smile_code']) ) ? $HTTP_POST_VARS['smile_code'] : '';
 483              $smile_url = ( isset($HTTP_POST_VARS['smile_url']) ) ? $HTTP_POST_VARS['smile_url'] : '';
 484              $smile_url = phpbb_ltrim(basename($smile_url), "'");
 485              $smile_emotion = ( isset($HTTP_POST_VARS['smile_emotion']) ) ? htmlspecialchars(trim($HTTP_POST_VARS['smile_emotion'])) : '';
 486              $smile_code = trim($smile_code);
 487              $smile_url = trim($smile_url);
 488  
 489              // If no code was entered complain ...
 490              if ($smile_code == '' || $smile_url == '')
 491              {
 492                  message_die(GENERAL_MESSAGE, $lang['Fields_empty']);
 493              }
 494  
 495              //
 496              // Convert < and > to proper htmlentities for parsing.
 497              //
 498              $smile_code = str_replace('<', '&lt;', $smile_code);
 499              $smile_code = str_replace('>', '&gt;', $smile_code);
 500  
 501              //
 502              // Save the data to the smiley table.
 503              //
 504              $sql = "INSERT INTO " . SMILIES_TABLE . " (code, smile_url, emoticon)
 505                  VALUES ('" . str_replace("\'", "''", $smile_code) . "', '" . str_replace("\'", "''", $smile_url) . "', '" . str_replace("\'", "''", $smile_emotion) . "')";
 506              $result = $db->sql_query($sql);
 507              if( !$result )
 508              {
 509                  message_die(GENERAL_ERROR, "Couldn't insert new smiley", "", __LINE__, __FILE__, $sql);
 510              }
 511  
 512              $message = $lang['smiley_add_success'] . "<br /><br />" . sprintf($lang['Click_return_smileadmin'], "<a href=\"" . append_sid("admin_smilies.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
 513  
 514              message_die(GENERAL_MESSAGE, $message);
 515              break;
 516      }
 517  }
 518  else
 519  {
 520  
 521      //
 522      // This is the main display of the page before the admin has selected
 523      // any options.
 524      //
 525      $sql = "SELECT *
 526          FROM " . SMILIES_TABLE;
 527      $result = $db->sql_query($sql);
 528      if( !$result )
 529      {
 530          message_die(GENERAL_ERROR, "Couldn't obtain smileys from database", "", __LINE__, __FILE__, $sql);
 531      }
 532  
 533      $smilies = $db->sql_fetchrowset($result);
 534  
 535      $template->set_filenames(array(
 536          "body" => "admin/smile_list_body.tpl")
 537      );
 538  
 539      $template->assign_vars(array(
 540          "L_ACTION" => $lang['Action'],
 541          "L_SMILEY_TITLE" => $lang['smiley_title'],
 542          "L_SMILEY_TEXT" => $lang['smile_desc'],
 543          "L_DELETE" => $lang['Delete'],
 544          "L_EDIT" => $lang['Edit'],
 545          "L_SMILEY_ADD" => $lang['smile_add'],
 546          "L_CODE" => $lang['Code'],
 547          "L_EMOT" => $lang['Emotion'],
 548          "L_SMILE" => $lang['Smile'],
 549          "L_IMPORT_PACK" => $lang['import_smile_pack'],
 550          "L_EXPORT_PACK" => $lang['export_smile_pack'],
 551          
 552          "S_HIDDEN_FIELDS" => $s_hidden_fields, 
 553          "S_SMILEY_ACTION" => append_sid("admin_smilies.$phpEx"))
 554      );
 555  
 556      //
 557      // Loop throuh the rows of smilies setting block vars for the template.
 558      //
 559      for($i = 0; $i < count($smilies); $i++)
 560      {
 561          //
 562          // Replace htmlentites for < and > with actual character.
 563          //
 564          $smilies[$i]['code'] = str_replace('&lt;', '<', $smilies[$i]['code']);
 565          $smilies[$i]['code'] = str_replace('&gt;', '>', $smilies[$i]['code']);
 566          
 567          $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
 568          $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
 569  
 570          $template->assign_block_vars("smiles", array(
 571              "ROW_COLOR" => "#" . $row_color,
 572              "ROW_CLASS" => $row_class,
 573              
 574              "SMILEY_IMG" =>  $phpbb_root_path . $board_config['smilies_path'] . '/' . $smilies[$i]['smile_url'], 
 575              "CODE" => $smilies[$i]['code'],
 576              "EMOT" => $smilies[$i]['emoticon'],
 577              
 578              "U_SMILEY_EDIT" => append_sid("admin_smilies.$phpEx?mode=edit&amp;id=" . $smilies[$i]['smilies_id']), 
 579              "U_SMILEY_DELETE" => append_sid("admin_smilies.$phpEx?mode=delete&amp;id=" . $smilies[$i]['smilies_id']))
 580          );
 581      }
 582  
 583      //
 584      // Spit out the page.
 585      //
 586      $template->pparse("body");
 587  }
 588  
 589  //
 590  // Page Footer
 591  //
 592  include('./page_footer_admin.'.$phpEx);
 593  
 594  ?>


Generated: Mon Jan 14 19:21:40 2013 Cross-referenced by PHPXref 0.7.1