public function modify_static() { $dimImg = array(200, 300); $VStatic = new VStatic(); $images = $VStatic->getNewImages(); $texts = $VStatic->getNewTexts(); $numPage = $VStatic->getNumPage(); $iter = 1; $numContents = 3; $UFile = new UFile(); foreach ($images as $img) { if ($img) { $dir = "images/"; $file = $dir . "img{$iter}" . "_static{$numPage}.jpg"; $image = new USimpleImage(); $image->load($img); $image->resize($dimImg[0], $dimImg[1]); $image->save($file); } $iter++; } for ($iter = 1; $iter < $numContents + 1; $iter++) { if ($texts[$iter - 1]) { $dir = "templates/templates/static_contents/"; $file = $dir . "cnt{$iter}" . "_static{$numPage}"; $UFile->writeFileContent($file, $texts[$iter - 1]); } } $CStatic = new CStatic(); return $CStatic->mux(1); }
public function show($logged) { $VStatic = new VStatic(); $page = "0"; if ($VStatic->getNumPage()) { $page = $VStatic->getNumPage(); } if ($logged >= 1) { $VStatic->setData('admin', true); } else { $VStatic->setData('admin', false); } $num_content = 3; $arr_cnt = array(); $UFile = new UFile(); for ($iter = 1; $iter < $num_content + 1; $iter++) { $arr_cnt[] = $UFile->readFile("templates/templates/static_contents/cnt{$iter}" . "_static" . $page); } $VStatic->setData("static_cnt", $arr_cnt); return $VStatic->fetch("static_" . $page . ".tpl"); }