Example #1
0
        $parts[0] = strtolower($parts[0]);
        if ($parts[0] == 'doc' || $parts[0] == 'lang') {
            $title = $db->escape_string($title);
        } else {
            $title = $gpc->save_str($title);
        }
        return $title;
    } else {
        return '';
    }
}
define('EDITOR_IMAGEDIR', './uploads/images/');
$supportedextentions = array('gif', 'png', 'jpeg', 'jpg');
($code = $plugins->load('admin_cms_jobs')) ? eval($code) : null;
if ($job == 'nav') {
    send_nocache_header();
    echo head();
    ?>
 <table class="border" border="0" cellspacing="0" cellpadding="4" align="center">
  <tr>
   <td class="obox"><?php 
    echo $lang->phrase('admin_cms_head_manage_navigation');
    ?>
</td>
  </tr>
  <tr>
   <td class="mbox center">
   	<a class="button" href="admin.php?action=cms&amp;job=nav_add"><?php 
    echo $lang->phrase('admin_cms_manage_navigation_add_link');
    ?>
</a>
 function makeImage($session_expired_lang = 'Session Error<br>Refresh the Page')
 {
     global $config, $gpc;
     $challenge = $gpc->get('challenge');
     $this->settings['colortext'] = (bool) $config['botgfxtest_colortext'];
     $this->settings['filter'] = (bool) $config['botgfxtest_filter'];
     $jpeg_quality = (int) $config['botgfxtest_quality'];
     $format = $config['botgfxtest_format'] == 'png' ? 'PNG' : 'JPEG';
     if ((ImageTypes() & constant("IMG_{$format}")) == false) {
         $format = $format == 'PNG' ? 'JPEG' : 'PNG';
     }
     $lines = file($this->datasource);
     $lines = array_map('trim', $lines);
     foreach ($lines as $row) {
         if (empty($row)) {
             continue;
         }
         $data = explode("\t", $row);
         if ($data[0] == $challenge) {
             $this->session = array('word' => $data[2], 'id' => $data[1]);
             break;
         }
     }
     if (empty($this->session['word'])) {
         $this->_errorImage($session_expired_lang);
     }
     // Generate the image
     $im = $this->_drawImage();
     send_nocache_header();
     switch ($format) {
         case 'PNG':
             header("Content-type: image/png");
             imagepng($im);
             break;
         default:
             header("Content-type: image/jpeg");
             imagejpeg($im, '', $jpeg_quality);
     }
     imagedestroy($im);
 }