public function getImageLink($url, $width) { $imagename = Filehelper::cleanseUrl($url); if (!file_exists("{$this->savepath}/{$width}")) { Filehelper::mkdir("{$this->savepath}/{$width}"); } if (!file_exists("{$this->savepath}/{$width}/{$imagename}.jpg")) { $this->load($url); $this->resizeToWidth($width); $this->save("{$this->savepath}/{$width}/{$imagename}.jpg"); } return $this->root . "/{$this->savepath}/{$width}/{$imagename}.jpg"; }
<?php /********* * Black Rabbit Component Creator * by Caleb Nance */ // include what is needed to logout include 'master.php'; Filehelper::endsession();
$post = $_POST; $task = $post['task']; // Posted data $posted_date = date('Y-m-d H:i:s'); /* * Include Config and Database */ require_once 'master.php'; // Connect to database $database = new Database(HOST, DBNAME, DBUSER, DBPASS); /** * Lets set the language session! * */ if ($task == 'setlanguage') { Filehelper::languagesession($post['submit'], $post['return']); exit; } // Set Black Rabbit Version $br_version = $post['brversion']; if (DEBUG) { /* $database->truncate('br_components'); $database->truncate('br_components_views'); $database->truncate('br_components_images'); $database->truncate('br_components_version_history'); */ //echo '<div class="debug">Databases could have been truncated!!! Add this feature somewhere, Caleb?</div>'; } /* * Download helloworld task
public function action_index() { $data['recentlyStudied'] = Filehelper::get_dir_file_info('xmlcache'); return View::make('picker', $data); }