PageRenderTime 54ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/Includes/blocks/block_html.php

https://code.google.com/p/nuked-klan/
PHP | 78 lines | 62 code | 8 blank | 8 comment | 14 complexity | 145a65306a3331478df75d495ea9180b MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause, GPL-2.0, LGPL-3.0, LGPL-2.1
  1. <?php
  2. // -------------------------------------------------------------------------//
  3. // Nuked-KlaN - PHP Portal //
  4. // http://www.nuked-klan.org //
  5. // -------------------------------------------------------------------------//
  6. // This program is free software. you can redistribute it and/or modify //
  7. // it under the terms of the GNU General Public License as published by //
  8. // the Free Software Foundation; either version 2 of the License. //
  9. // -------------------------------------------------------------------------//
  10. if (!defined("INDEX_CHECK")){
  11. exit('You can\'t run this file alone.');
  12. }
  13. function affich_block_html($blok){
  14. if(!function_exists('htmlspecialchars_decode'))
  15. $blok['content'] = strtr($blok['content'], array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
  16. else
  17. $blok['content'] = htmlspecialchars_decode(html_entity_decode($blok['content']));
  18. return $blok;
  19. }
  20. function edit_block_html($bid){
  21. global $nuked, $language;
  22. $sql = mysql_query('SELECT active, position, titre, module, content, type, nivo, page FROM ' . BLOCK_TABLE . ' WHERE bid = \'' . $bid . '\' ');
  23. list($active, $position, $titre, $modul, $content, $type, $nivo, $pages) = mysql_fetch_array($sql);
  24. $titre = printSecuTags($titre);
  25. $content = html_entity_decode($content);
  26. if ($active == 1) $checked1 = 'selected="selected"';
  27. else if ($active == 2) $checked2 = 'selected="selected"';
  28. else if ($active == 3) $checked3 = 'selected="selected"';
  29. else if ($active == 4) $checked4 = 'selected="selected"';
  30. else $checked0 = 'selected="selected"';
  31. echo '<div class="content-box">',"\n" //<!-- Start Content Box -->
  32. , '<div class="content-box-header"><h3>' , _BLOCKADMIN , '</h3>',"\n"
  33. , '<a href="help/' , $language , '/block.html" rel="modal">',"\n"
  34. , '<img style="border: 0;" src="help/help.gif" alt="" title="' , _HELP , '" /></a>',"\n"
  35. , '</div>',"\n"
  36. , '<div class="tab-content" id="tab2"><form method="post" action="index.php?file=Admin&amp;page=block&amp;op=modif_block">',"\n"
  37. , '<table style="margin-left: auto;margin-right: auto;text-align: left;" cellspacing="0" cellpadding="2" border="0">',"\n"
  38. , '<tr><td><b>' , _TITLE , '</b></td><td><b>' , _BLOCK , '</b></td><td><b>' , _POSITION , '</b></td><td><b>' , _LEVEL , '</b></td></tr>',"\n"
  39. , '<tr><td style="text-align:center;" ><input type="text" name="titre" size="40" value="' , $titre , '" /></td>',"\n"
  40. , '<td style="text-align:center;"><select name="active">',"\n"
  41. , '<option value="1" ' , $checked1 , '>' , _LEFT , '</option>',"\n"
  42. , '<option value="2" ' , $checked2 , '>' , _RIGHT , '</option>',"\n"
  43. , '<option value="3" ' , $checked3 , '>' , _CENTERBLOCK , '</option>',"\n"
  44. , '<option value="4" ' , $checked4 , '>' , _FOOTERBLOCK , '</option>',"\n"
  45. , '<option value="0" ' , $checked0 , '>' , _OFF , '</option></select></td>',"\n"
  46. , '<td style="text-align:center;"><input type="text" name="position" size="2" value="' , $position , '" /></td>',"\n"
  47. , '<td style="text-align:center;"><select name="nivo"><option>' , $nivo , '</option>',"\n"
  48. , '<option>0</option>',"\n"
  49. , '<option>1</option>',"\n"
  50. , '<option>2</option>',"\n"
  51. , '<option>3</option>',"\n"
  52. , '<option>4</option>',"\n"
  53. , '<option>5</option>',"\n"
  54. , '<option>6</option>',"\n"
  55. , '<option>7</option>',"\n"
  56. , '<option>8</option>',"\n"
  57. , '<option>9</option></select></td></tr>',"\n"
  58. , '<tr><td colspan="4"><b>' , _TYPE , ' :</b> ' , _HTMLBLOCK , '</td></tr>',"\n"
  59. , '<tr><td colspan="4"><textarea name="content" rows="10" cols="70" class="noediteur">' , $content , '</textarea></td></tr>',"\n"
  60. , '<tr><td colspan="4">&nbsp;</td></tr><tr><td colspan="4" align="center"><b>' , _PAGESELECT , ' :</b></td></tr><tr><td colspan="4">&nbsp;</td></tr>',"\n"
  61. , '<tr><td colspan="4" style="text-align:center;"><select name="pages[]" size="8" multiple="multiple">',"\n";
  62. select_mod2($pages);
  63. echo '</select></td></tr><tr><td colspan="4" align="center"><br />',"\n"
  64. , '<input type="hidden" name="type" value="' . $type , '" />',"\n"
  65. , '<input type="hidden" name="bid" value="' . $bid , '" />',"\n"
  66. , '<input type="submit" name="send" value="' . _MODIFBLOCK , '" />',"\n"
  67. , '</td></tr></table>'
  68. , '<div style="text-align: center;"><br />[ <a href="index.php?file=Admin&amp;page=block"><b>' . _BACK , '</b></a> ]</div></form><br /></div></div>',"\n";
  69. }
  70. ?>