Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Problem z panelem
Forum PHP.pl > Forum > Przedszkole
beyond13
Potrzebuję pomocy, gdy chce wejść na panel administratora mojej strony to wyświetla mi się pusta strona. Najprawdopodobniej problem znajduje się w tym kodzie w linijce 55, co zrobić?

Oto kod:
  1. <?php
  2. require_once DIR_PLUGINS.'ckeditor/ckeditor.php';
  3. /**
  4. * Function returns editor
  5. * @return string
  6. * @param string $sName
  7. * @param int $iH
  8. * @param int $iW
  9. * @param string $sContent
  10. */
  11. function htmlEditor( $sName = 'sDescriptionFull', $iH = '300', $iW = '100%', $sContent = '', $aOption = null ){
  12. $sEdit = '';
  13. if( !strstr( $iH, '%' ) )
  14. $iH .= 'px';
  15. if( !strstr( $iW, '%' ) )
  16. $iW .= 'px';
  17.  
  18. if( WYSIWYG === true ){
  19. if( defined( 'TinyMceFullActive' ) && TinyMceFullActive === true ){
  20. if( defined( 'CKEditorActive' ) && CKEditorActive === true ){
  21. $oCKEditor = new CKEditor() ;
  22. $oCKEditor->returnOutput = true;
  23. $oCKEditor->basePath = DIR_PLUGINS.'ckeditor/';
  24. $oCKEditor->config['width'] = $iW;
  25. $oCKEditor->config['height'] = $iH;
  26. $oCKEditor->config['language'] = $GLOBALS['config']['admin_lang'];
  27. return $oCKEditor->editor($sName, $sContent);
  28. }
  29. else{
  30. if( !defined( 'WYSIWYG_START' ) ){
  31. $sEdit .= '<script language="javascript" type="text/javascript" src="'.DIR_PLUGINS.'tinymce-full/jscripts/tiny_mce/tiny_mce.js"></script>
  32.  
  33. <script language="javascript" type="text/javascript">
  34. <!--
  35. tinyMCE.init({
  36. theme : "advanced",
  37. plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emot
    ions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contex
    tmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxt
    ras,template,wordcount,advlist,autosave,visualblocks",
  38. mode : "exact",
  39. entity_encoding : "raw",
  40. elements : "sDescriptionShort,sDescriptionFull,sContent",
  41. theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justif
    ycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizesele
    ct",
  42. theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,out
    dent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|
    ,insertdate,inserttime,preview,|,forecolor,backcolor",
  43. theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iesp
    ell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
  44. theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acro
    nym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,vis
    ualblocks",
  45. theme_advanced_toolbar_location : "top",
  46. theme_advanced_toolbar_align : "left",
  47. theme_advanced_resizing : true,
  48. theme_advanced_resize_horizontal : false,
  49. debug : false
  50. });
  51. //-->
  52. </script>';
  53. }
  54. }
  55. else{
  56. if( defined( 'CKEditorActive' ) && CKEditorActive === true ){
  57. $oCKEditor = new CKEditor() ;
  58. $oCKEditor->returnOutput = true;
  59. $oCKEditor->basePath = DIR_PLUGINS.'ckeditor/';
  60. $oCKEditor->config['width'] = $iW;
  61. $oCKEditor->config['height'] = $iH;
  62. $oCKEditor->config['language'] = $GLOBALS['config']['admin_lang'];
  63. return $oCKEditor->editor($sName, $sContent);
  64. }
  65. else{
  66. if( !defined( 'WYSIWYG_START' ) ){
  67. define( 'WYSIWYG_START', true );
  68. $sEdit .= '<script language="javascript" type="text/javascript" src="'.$GLOBALS['config']['dir_plugins'].'tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
  69. <script language="javascript" type="text/javascript">
  70. <!--
  71. var theme_advanced_buttons1 = "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyrigh
    t,justifyfull,|,bullist,numlist,|,undo,redo";
  72. var theme_advanced_buttons2 = "";
  73. var additional_buttons = ",link,unlink,cleanup,removeformat,|,help,code";
  74. if( parseInt( window.screen.availWidth ) < 1130 )
  75. theme_advanced_buttons2 = additional_buttons;
  76. else
  77. theme_advanced_buttons1 += ",|"+additional_buttons;
  78. tinyMCE.init({
  79. theme : "advanced",
  80. mode : "exact",
  81. entity_encoding : "raw",
  82. elements : "sDescriptionShort,sDescriptionFull,sContent",
  83. theme_advanced_buttons1 : theme_advanced_buttons1,
  84. theme_advanced_buttons2 : theme_advanced_buttons2,
  85. theme_advanced_toolbar_location : "top",
  86. theme_advanced_toolbar_align : "left",
  87. theme_advanced_resizing : true,
  88. theme_advanced_resize_horizontal : false,
  89. debug : false
  90. });
  91. //-->
  92. </script>';
  93. }
  94. }
  95. }
  96. }
  97. $sEdit .= '<textarea name="'.$sName.'" id="'.$sName.'" rows="20" cols="60" style="width:'.$iW.';height:'.$iH.';" tabindex="1">'.$sContent.'</textarea>';
  98.  
  99. return $sEdit;
  100. } // end function htmlEditor
  101. ?>
nospor
Problem z OOP nie ma zadnego zwiazku. Patrz prosze gdzie piszesz. Przenosze
fate
to wywal od 55 linijki w dół
beyond13
a w tym kodzie:
  1. <?php
  2. /*
  3. * Quick.Cms by OpenSolution.org
  4. * www.OpenSolution.org
  5. */
  6. extract( $_GET );
  7. define( 'ADMIN_PAGE', true );
  8. $_SERVER['REQUEST_URI'] = htmlspecialchars( strip_tags( $_SERVER['REQUEST_URI'] ) );
  9. $_SERVER['PHP_SELF'] = htmlspecialchars( strip_tags( $_SERVER['PHP_SELF'] ) );
  10.  
  11. require 'database/config/general.php';
  12. require DB_CONFIG_LANG;
  13.  
  14.  
  15. header( 'Content-Type: text/html; charset='.$config['charset'] );
  16. require_once DIR_LIBRARIES.'file-jobs.php';
  17. require_once DIR_LIBRARIES.'flat-files.php';
  18. require_once DIR_LIBRARIES.'image-jobs.php';
  19. require_once DIR_LIBRARIES.'trash.php';
  20. require_once DIR_PLUGINS.'plugins-admin.php';
  21.  
  22. require_once DIR_DATABASE.'_fields.php';
  23. require_once DIR_CORE.'common-admin.php';
  24. require_once DIR_CORE.'pages.php';
  25. require_once DIR_CORE.'pages-admin.php';
  26. require_once DIR_CORE.'lang-admin.php';
  27. require_once DIR_CORE.'files.php';
  28. require_once DIR_CORE.'files-admin.php';
  29.  
  30. $p = !empty( $p ) ? strip_tags( $p ) : 'news';
  31.  
  32. if( !isset( $iTypeSearch ) )
  33. $iTypeSearch = 1;
  34.  
  35. if( $p == 'search' ){
  36. $aSearchActions = Array( 1 => 'pages-list' );
  37. $p = ( isset( $aSearchActions[$iTypeSearch] ) ) ? $aSearchActions[$iTypeSearch] : null;
  38. }
  39.  
  40. $sPhrase = isset( $sPhrase ) && !empty( $sPhrase ) ? trim( changeSpecialChars( htmlspecialchars( stripslashes( $sPhrase ) ) ) ) : null;
  41. if( !isset( $sSort ) )
  42. $sSort = null;
  43. $aActions = getAction( $p );
  44.  
  45. $sDateLog = displayDate( $config['before_last_login'] );
  46. loginActions( $p, SESSION_KEY_NAME );
  47.  
  48. $oFFS = FlatFilesSerialize::getInstance( );
  49. $oImage = ImageJobs::getInstance( );
  50. $oPage = PagesAdmin::getInstance( );
  51. $oFile = FilesAdmin::getInstance( );
  52.  
  53. if( isset( $config['login'] ) && isset( $config['pass'] ) && $config['login'] == $config['pass'] )
  54. $sMsg .= '<div id="msg" class="error">'.$lang['Change_login_and_pass'].'</div>';
  55.  
  56. if( ( strstr( $p, '-delete' ) || count( $_POST ) > 0 ) && !empty( $_SERVER['HTTP_REFERER'] ) && !strstr( $_SERVER['HTTP_REFERER'], $_SERVER['SCRIPT_NAME'] ) ){
  57. header( 'Location: '.$_SERVER['PHP_SELF'].'?p=error' );
  58. }
  59.  
  60. // back-end dashboard
  61. if( $p == 'news' || $p == 'login' ){
  62. require_once DIR_TEMPLATES.'admin/home.php';
  63. }
  64.  
  65. // pages actions
  66. elseif( $p == 'pages-list' ){
  67. $iTypeSearch = 1;
  68. require_once DIR_TEMPLATES.'admin/pages.php';
  69. }
  70. elseif( $p == 'pages-form' ){
  71. $iTypeSearch = 1;
  72. require_once DIR_TEMPLATES.'admin/pages-form.php';
  73. }
  74. elseif( $p == 'pages-delete' && isset( $iPage ) && is_numeric( $iPage ) ){
  75. if( !isset( $bWithoutFiles ) )
  76. $bWithoutFiles = null;
  77. $oPage->deletePage( $iPage, $bWithoutFiles );
  78. header( 'Location: '.$_SERVER['PHP_SELF'].'?p=pages-list&sOption=del' );
  79. }
  80.  
  81. // translations actions
  82. elseif( $p == 'lang-list' || $p == 'lang-translations' ){
  83. require_once DIR_TEMPLATES.'admin/languages.php';
  84. }
  85. elseif( $p == 'lang-form' ){
  86. require_once DIR_TEMPLATES.'admin/languages-form.php';
  87. }
  88. elseif( $p == 'lang-delete' && isset( $sLanguage ) && !empty( $sLanguage ) ){
  89. deleteLanguage( $sLanguage );
  90. header( 'Location: '.$_SERVER['PHP_SELF'].'?p=lang-list&sOption=del' );
  91. }
  92.  
  93. // plugins
  94. elseif( $p == 'plugins' && isset( $config['plugins']['plugins'] ) && $config['plugins']['plugins'] === true ){
  95. require_once DIR_TEMPLATES.'admin/plugins.php';
  96. }
  97.  
  98.  
  99. // backup actions
  100. elseif( $p == 'backup-create' ){
  101. if( function_exists( 'gzcompress' ) ){
  102. require_once DIR_PLUGINS.'class-pclzip.php';
  103. $sFile = DIR_BACKUP.'backup_'.date('Y-m-d_H-i').'_'.rand( 10000, 99999 ).'.zip';
  104. $oBackup = new PclZip( $sFile );
  105. $oBackup->create( DIR_DATABASE );
  106. header( 'Location: '.$sFile );
  107. }
  108. }
  109. elseif( $p == 'backup-list' ){
  110. require_once DIR_TEMPLATES.'admin/backup.php';
  111. }
  112. elseif( $p == 'backup-delete' && isset( $sFile ) && is_file( DIR_BACKUP.$sFile ) ){
  113. unlink( DIR_BACKUP.$sFile );
  114. header( 'Location: '.$_SERVER['PHP_SELF'].'?p=backup-list&sOption=del' );
  115. }
  116.  
  117. elseif( $p == 'fixes' ){
  118. require_once DIR_TEMPLATES.'admin/fixes.php';
  119. }
  120.  
  121. // boxes actions
  122. elseif( $p == 'boxes-list' ){
  123. require_once DIR_TEMPLATES.'admin/boxes.php';
  124. }
  125. elseif( $p == 'boxes-form' ){
  126. require_once DIR_TEMPLATES.'admin/boxes-form.php';
  127. }
  128. elseif( $p == 'boxes-delete' && isset( $iBox ) && is_numeric( $iBox ) ){
  129. require_once DIR_CORE.'boxes-admin.php';
  130. deleteBox( $iBox );
  131. header( 'Location: '.$_SERVER['PHP_SELF'].'?p=boxes-list&sOption=del' );
  132. }
  133.  
  134. // settings
  135. elseif( $p == 'tools-config' ){
  136. require_once DIR_TEMPLATES.'admin/settings.php';
  137. }
  138.  
  139. // files actions
  140. elseif( $p == 'files-in-dir' ){
  141. header( 'Cache-Control: no-cache' );
  142. header( 'Content-type: text/html' );
  143. echo $oFile->listFilesInDir( 'time' );
  144. }
  145. elseif( $p == 'files-upload' && !empty( $sFileName ) ){
  146. echo $oFile->uploadFile( $sFileName );
  147. }
  148. // plugins actions
  149.  
  150. // error page
  151. else{
  152. require_once DIR_TEMPLATES.'admin/_header.php'; // include headers
  153. require_once DIR_TEMPLATES.'admin/_menu.php'; // include menu
  154. echo '<div id="msg" class="error">'.$lang['Operation_unknown'].'</div>';
  155. require_once DIR_TEMPLATES.'admin/_footer.php'; // include menu
  156. }
  157. ?>
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.