예제 #1
0
 function LevelBGImage_SV($id)
 {
     // нужно скачать картинку и поставить в фон
     //if(strtolower(substr($url,0,7))!=='http://') return false;
     $url = 'http://ob5.ru/download.php?id=' . intval($id) . '&w=' . $this->GameOptions['BGImgSize'];
     $t = new TThread('TRGUI::BGImagetDownload');
     $t->____url = $url;
     $t->____file = $this->GameOptions['BGImgSave'] ? DOC_ROOT . '/Pictures/Img_' . $this->GameOptions['BGImgSize'] . '_' . intval($id) . '.jpg' : false;
     $t->____func = 'TRGUI::BGImagetDownloaded';
     $t->resume();
     return true;
 }
예제 #2
0
 function BGImagetDownload($id)
 {
     if (!$GLOBALS['THREAD_SELF']) {
         return;
     }
     // проверка на поточность
     $t = TThread::get($id);
     $url = $t->____url;
     $func = $t->____func;
     $file = $t->____file;
     $content = file_get_contents($url);
     sync($func, array($content, $file));
     return true;
 }