switch ($cp) { case 'new': include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_images.php'; formImages(); break; case 'edit': include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_images.php'; formImages(1); break; case 'save': include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_images.php'; saveImages(); break; case 'saveedit': include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_images.php'; saveImages(1); break; case 'delete': include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_images.php'; deleteImages(); break; case 'saveAll': include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_images.php'; saveAll(); break; case 'toset': include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_images.php'; formSets(); break; case 'savesets': include XOOPS_ROOT_PATH . '/modules/galleries/include/cp_images.php';
<link href="css/main.css" rel="stylesheet" type="text/css" /> <!-- Link scripts --> <script src="https://www.google.com/jsapi"></script> <script> google.load("jquery", "1.7.1"); </script> <script src="js/script.js"></script> </head> <body> <header> </header> <div class="container"> <input name="uploads[]" type="file" multiple="multiple" /> <input type='submit' value="Upload File" onclick="<?php saveImages(); ?> " /> </div> <!-- Container with last photos --> <div class="container"> <h1> </h1> <div class="photo"><img src="../images/thumb_photo1.jpg" id="1" /><p>Item #1 item</p><i>Description of Item #1</i></div> <div class="photo"><img src="../images/thumb_photo2.jpg" id="2" /><p>Item #2 item</p><i>Description of Item #2</i></div> <div class="photo"><img src="../images/thumb_photo3.jpg" id="3" /><p>Item #3 item</p><i>Description of Item #3</i></div> <div class="photo"><img src="../images/thumb_photo4.jpg" id="4" /><p>Item #4 item</p><i>Description of Item #4</i></div> <div class="photo"><img src="../images/thumb_photo5.jpg" id="5" /><p>Item #5 item</p><i>Description of Item #5</i></div> <div class="photo"><img src="../images/thumb_photo6.jpg" id="6" /><p>Item #6 item</p><i>Description of Item #6</i></div>
break; case 'changelanguage': changeLanguage(); break; case 'import_swMenuFree': import_swmenufree(); break; case "upgrade": upgrade($option); break; case "exportMenu": $msg = exportMenu($cid[0], $option); $mainframe->redirect("index2.php?task=showmodules&option={$option}&limit={$limit}&limitstart={$limitstart}", $msg); break; case "imagesave": saveImages($cid[0], $option); break; case "manualsave": saveCSS($cid[0], $option); break; case "editDhtmlMenu": editDhtmlMenu($cid[0], $option); break; case "editCSS": editCSS($cid[0], $option); break; case "remove": if (is_array($cid) && count($cid) > 1) { foreach ($cid as $delid) { removeMyMenu($delid, $option); }
/** * 获取一篇文章信息绝想 * @param int $id 日记id */ function pickOne($id) { $url = $GLOBALS['prefix'] . "/{$id}.html"; echo $url; $dom = new simple_html_dom(); $dom->load_file($url); $postHeader_title = $dom->find('.left h1[0]'); $pubtime = $dom->find('.pubtime'); $heart = $dom->find('.week a'); $info = $dom->find('.author a'); $content = $dom->find('.content'); $views = $dom->find('.views b'); $writer = $info[0]->innertext; $title = $postHeader_title[0]->innertext; $senddate = $pubdate = strtotime($pubtime[0]->innertext); $body = $content[0]->innertext; $views = $views[0]->innertext; /* 释放资源 */ $dom->clear(); unset($dom); $mp3 = preg_match_all('/\\?mp3=(.+\\.mp3).*autostart/Us', $body, $res); if ($mp3 and isset($res) and count($res) > 0) { $music = $res[1][0]; } /* 去除超链接和开头的空白段落 */ $body = preg_replace('/<a.*>(.*)<\\/a>/isU', '$1', preg_replace('/<div.*>(.*)<\\/div>/isU', '', preg_replace('/^<p>\\s*<\\/p>/', '', preg_replace('/\\s*<style.+<\\/style>/s', '', $body)))); /* 本地化图片 */ saveImages($body, $res_img); $obj = array('title' => $title, 'writer' => $writer, 'body' => $body, 'pubdate' => $pubdate, 'senddate' => $senddate, 'views' => $views); $obj['sortrank'] = AddDay($senddate, 0); /* 处理背景音乐 */ $obj['music'] = isset($music) ? $music : ''; return $obj; }
for ($i = 0; $i < count($filenames); $i++) { $ext = explode('.', basename($filenames[$i])); $filename = DIRECTORY_SEPARATOR . md5(uniqid()) . "." . array_pop($ext); $target = "../images" . $filename; if (move_uploaded_file($images['tmp_name'][$i], $target)) { $success = true; $paths[] = $filename; } else { $success = false; break; } } //wenn alles erfolgreich, Dateinamen in DB schreiben if ($success === true) { //Funktionsaufruf in DB schreiben saveImages($paths, $artistIdGet); $output = ['uploaded' => $target]; } elseif ($success === false) { $output = ['error' => 'Error while uploading images. Contact the system administrator']; // delete any uploaded files foreach ($paths as $file) { unlink($file); } } else { $output = ['error' => 'No files were processed.']; } //Return Fehler oder Erfolg echo json_encode($output); break; //+++++++++++++++++++++++++++++++++++Bilder upload+++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++Einzelnes Bild löschen+++++++++++++++++++++++++++++++++++++++