function user_update_0() { //this should be replaced with a user save but that requires a full bootstrap :( $sql = "REPLACE INTO `user` (`uid`, `email`, `username`, `password`, `created`, `updated`, `deleted`, `status`, `firstname`, `lastname`, `profile`, `location`, `age`, `picture`, `gender`)\nVALUES\n (2, '*****@*****.**', 'nodefortytwo', '5133b5ed586f3107c016ab3440d1f251', 1346599169, 1346599169, 0, 1, 'Rick', 'Burgess', '', '4c03d3af187ec9287322b67b', 25, '', 'Male');\n "; db()->query($sql); file_init(); $file = array('name' => 'default-profile.gif', 'tmp_name' => cwd() . '/' . PATH_TO_MODULES . '/user/img/default-profile.gif', 'type' => 'image/gif'); $f = new File(); $f->upload($file); var_set('DEFAULT_PROFILE_PIC', $f->id); }
private function compile_js() { $this->js_complied = ''; $js = ''; foreach ($this->js as $file) { if (beginsWith($file, 'http://') || beginsWith($file, 'https://')) { $js .= file_get_contents($file); } else { $file = cwd() . $file; if (file_exists($file)) { $js .= file_get_contents($file); } } } $id = md5($js) . '_' . var_get('CACHE_KEY', md5(time())); $path = UPLOAD_PATH . '/js/' . $id . '.js'; if (!file_exists($path)) { file_put_contents($path, $js); } $this->js_complied = "\t" . '<script src="' . get_url('/' . $path) . '"></script>' . "\n"; }
function file_init() { global $upload_path; $upload_path = cwd() . '/' . UPLOAD_PATH; require 'file.class.php'; }