Turning off error logging in 2.64

12 posts by 2 authors in: Forums > CMS Builder
Last Post: March 31, 2015   (RSS)

By gkornbluth - March 31, 2015 - edited: June 11, 2015

 Hi all,

 I tried adding a check box field called ("Err Log") in a single record section (called "Organization Information"), that will show or remove the error log from the Admin menu.

Building on the code above, my final now looks like this:

(I hope Dave approves...)

Jerry Kornbluth

//
  $errorCount = mysql_count('_error_log');
  $adminMenus[] = array(
    'menuType'    => 'custom',
    'menuName'    => t('Error Log') . " ($errorCount)", //
    'menuOrder'   => ++$menuOrder,
    'link'        => '?menu=_error_log',
    'isSelected'  => ($menu == '_error_log'),

    'tableName'   => '_error_log',
    'recordCount' => $errorCount,
  );
 ?>
<?php 
   $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
 $dirsToCheck = array('/home2/nawaflco/public_html/nawafl/','','../','../../','../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
  
 list($organization_informationRecords, $organization_informationMetaData) = getRecords(array(
    'tableName'   => 'organization_information',
    'where'       => '', // load first record
    'limit'       => '1',
  ));
  $organization_informationRecord = @$organization_informationRecords[0]; // get first record
 ?>

<?php $no_error_log = 1 ?>
 <?php $no_error_log = $organization_informationRecord['no_error_log'] ?>
 <?php if ($no_error_log == 1 ):?>
 
  <?php  array_pop($adminMenus); // remove "Error Log" from menu   
  ?>
  <?php endif?>
  <?php

  return $adminMenus;
}

?>

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php