Esempio n. 1
0
 public function thumbImg($id)
 {
     if (!($d = $this->_model->imageData($id))) {
         PPHP::PExit();
     }
     $tmpDir = new PDataDir('gallery/user' . $d->user_id_foreign);
     if (isset($_GET['t'])) {
         $thumbFile = 'thumb' . (int) $_GET['t'] . $d->file;
     } else {
         $thumbFile = 'thumb' . $d->file;
     }
     if (!$tmpDir->fileExists($thumbFile)) {
         $thumbFile = $d->file;
     }
     if (!$tmpDir->fileExists($thumbFile) || $tmpDir->file_Size($thumbFile) == 0) {
         $tmpDir = new PDataDir('gallery');
         $thumbFile = 'nopic.gif';
         $d->mimetype = 'image/gif';
     }
     header('Content-type: ' . $d->mimetype);
     $tmpDir->readFile($thumbFile);
     PPHP::PExit();
 }
Esempio n. 2
0
 private function _getPageByKeyword($keyword, $keyword_2)
 {
     switch ($keyword) {
         case 'thepeople':
             return new AboutThepeoplePage();
         case 'getactive':
             return new AboutGetactivePage();
         case 'newsletters':
         case 'missions':
         case 'bod':
         case 'help':
         case 'terms':
         case 'commentguidelines':
         case 'impressum':
         case 'affiliations':
         case 'privacy':
             $page = new AboutGenericPage($keyword);
             $page->setModel(new AboutModel());
             return $page;
         case 'stats':
         case 'statistics':
             if (!empty($keyword_2)) {
                 // return the given image
                 header('Content-type: image/png');
                 $statsDir = new PDataDir('statimages');
                 $statsDir->readFile($keyword_2);
                 PPHP::PExit();
             }
             $statsModel = new StatsModel();
             // Generate new statsImages if needed
             $statsModel->generateStatsImages();
             $page = new AboutStatisticsPage();
             $page->setModel($statsModel);
             return $page;
         case 'feedback':
         case 'contact':
         case 'contactus':
         case 'support':
             if (isset($keyword_2) && $keyword_2 == "submit") {
                 return new FeedbackSentPage();
             }
             $page = new FeedbackPage();
             $page->model = new FeedbackModel();
             return $page;
         case 'faq':
         case 'faqs':
             $model = new AboutModel();
             $faq_categories = $model->getFaqsCategorized();
             if ($faq_section = $model->getFaqSection($keyword_2)) {
                 $page = new AboutFaqsectionPage();
                 $page->faq_section = $faq_section;
                 $page->key = $keyword_2;
             } else {
                 $page = new AboutFaqPage();
             }
             $page->faq_categories = $faq_categories;
             return $page;
         case 'idea':
         case 'theidea':
         default:
             return new AboutTheideaPage();
     }
 }
Esempio n. 3
0
 /**
  * sends headers, reads out an image and then exits
  *
  * @param int $id - id of group to get thumbnail for
  * @access public
  */
 public function realImg($id)
 {
     if (!($group = $this->createEntity('Group')->findById($id)) || !$group->Picture) {
         PPHP::PExit();
     }
     $dir = new PDataDir('groups');
     if (!$dir->fileExists($group->Picture) || $dir->file_Size($group->Picture) == 0) {
         PPHP::PExit();
     }
     $img = new MOD_images_Image($dir->dirName() . '/' . $group->Picture);
     header('Content-type: ' . $img->getMimetype());
     $dir->readFile($group->Picture);
     PPHP::PExit();
 }