function NickInUse() { bnick(rand_name()); }
<?php if (isset($_GET['id'])) { $id = $_GET["id"]; } $tbl = new table('combi'); if (isset($_POST["done"])) { // get field /*$filea = $_FILES["image"]["name"]; if($filea=='') $image = '../'.$_POST['tmpimage']; else $image = uploadFile('image',0,'../uploads/');*/ $field = array('name', 'details', 'ordering', 'alias'); $values = array(format($_POST["name"], 0), format($_POST["details"], 0), format($_POST["ordering"], 0), format(rand_name($_POST["name"], $id), 0)); // insertObject($field,$value) $res = $tbl->updateObject($field, $values, 'id=' . $id); if ($res) { header('location: ' . loadPage('combi')); } } $res = $tbl->loadOne('id=' . $id); if ($res) { $row = mysql_fetch_array($res); ?> <div id="center-column"> <div class="top-bar"> <h1>Mua hàng trên web Nhật</h1> <div class="breadcrumbs"><a href="#">Sửa</a></div> </div><br />
<?php $tbl = new table('combi'); if (isset($_POST["done"])) { // get field $field = 'id,name,details,ordering,alias'; // upload file // uploadFile($file,$auto=1,$dir='uploads/images/') //$image = uploadFile('image',0,'../uploads/'); $id = $tbl->getLastId() + 1; $values = format($id, 1); $values .= format($_POST["name"], 1); $values .= format($_POST["details"], 1); $values .= format($_POST["ordering"], 1); $values .= format(rand_name($_POST["name"], $id), 0); // insertObject($field,$value) $res = $tbl->insertObject($field, $values); if ($res) { echo "OK"; } } ?> <div id="center-column"> <div class="top-bar"> <h1>Mua hàng trên web Nhật</h1> <div class="breadcrumbs"><a href="#">Thêm</a></div> </div><br /> <div class="table">
return array("msg" => "El nombre es demasiado corto", "linea" => $linea); } } else { return array("msg" => "El nombre debe estar separado por una coma", "linea" => $linea); } return strtolower(substr($apellido1, 0, 2) . substr($apellido2, 0, 2) . substr($nombre, 0, 2)); } $error = false; $errorMsg = ""; if (isset($_POST["submit"])) { if (file_exists($_FILES["fichero"]["tmp_name"])) { $nombres = array(); $nombresCompletos = array(); $archivo = fopen($_FILES["fichero"]["tmp_name"], "r"); do { $name = "uploads/users/" . rand_name() . ".txt"; } while (file_exists($name)); move_uploaded_file($_FILES["fichero"]["tmp_name"], $name); $linea = 1; while (!feof($archivo)) { $str_linea = fgets($archivo); $user = getNombreUsuario(trim($str_linea), $linea++); if (is_array($user)) { $error = true; $errorMsg = $user["msg"] . ", línea: " . $user["linea"]; break; } while (in_array($user, $nombres)) { $letras = ["x", "z", "y", "q", "w", "k", "v"]; $user[strlen($user) - 1] = $letras[rand(0, count($letras) - 1)]; }
function make_clean_slug($string, $prefix, $table, $slug_field, $id_field = '', $id = null) { $slug = make_slug($string); $used_string = array(); $Register =& Register::getInstance(); $DBHandler =& $Register->get(VAR_DBHANDLER); /* @var DBHandler DataBase*/ $query = "SELECT DISTINCT`{$slug_field}` as slug FROM {$table} WHERE `{$slug_field}` LIKE ?" . ($id ? " AND NOT(`{$id_field}` LIKE ?)" : ''); $DBHandler->ph_query($query, $prefix . $slug . '%', $id); while ($row = $DBHandler->fetch_assoc()) { $used_slug[] = $row['slug']; } $DBHandler->freeResult(); $max_i = 100; $_slug = $slug; while ($max_i-- > 0 && in_array($prefix . $_slug, $used_slug)) { $_slug = $slug . '_' . rand_name(3); } return $_slug; }
$links = array_merge($links, $dors_links[0]['index_urls']); } if ($use_map_urls) { $links = array_merge($links, $dors_links[0]['map_urls']); } if ($use_full_map_urls) { $links = array_merge($links, $dors_links[0]['full_map_urls']); } if ($use_page_urls) { $links = array_merge($links, $dors_links[0]['page_urls']); } if ($use_xml_sitemap_urls) { $links = array_merge($links, $dors_links[0]['sitemap_xmls']); } $links = array_values(array_unique($links)); $links_fname = rand_name() . '.txt'; $content = implode("\n", $links); $fh = fopen("tmp/{$tmp}/{$links_fname}", 'w+'); fputs($fh, $content); fclose($fh); $ftp_con = connect_to_ftp(); $upload = upload_file_to_aposter($links_fname, $ftp_con, $ftp_dir); clear_ap_dir('tmp/' . $tmp); if ($upload) { for ($i = 0; $i < $quant; $i++) { $send = send_xml_to_aposter(); } change_dor_status($ids); echo "Добавлено {$quant} заданий."; } else { echo 'Не удалось залить файл на хост. Задание не добавлено';
(at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ if (!@(include "config.php")) { die("The configuration file was not found!\n"); } $version = "Slappy , a php irc bot"; $buser = "******"; $buser .= " " . rand_name(); $buser .= " " . rand_name(); $buser .= " :{$brealname}"; set_time_limit(0); // setting max exec time to zero connect($ircserver); function connect($ircserver) { global $socket, $ircserver, $bnick, $buser, $bchans, $autojoin; $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); // create the socket $connection = socket_connect($socket, $ircserver, 6667); // connect //var_dump($connection); // THIS IS FOR DEBUG socket_write($socket, "USER {$buser}\r\n"); // send the Username socket_write($socket, "NICK {$bnick}\r\n");
$dem=0; for($i=0;$i<$max;$i++){ $sizename = $_POST['size'.$i]; if($sizename!=''){ $cuoi = ''; $dem++; if($dem!=1) $cuoi='-'; $size .= $cuoi.$sizename; } } } } */ // values $values = array(format($_POST["catid1"], 0), format($_POST["catid2"], 0), format($_POST["catid3"], 0), format($_POST["chuyenmucid"], 0), format($_POST["name"], 0), format($_POST["mavach"], 0), format($_POST["ghichu"], 0), format($_POST["nsx"], 0), format($_POST["status"], 0), format($str_img, 0), format($color, 0), format($_POST["details"], 0), format(isCheck($_POST["new"]), 0), format(isCheck($_POST["promo"]), 0), format(isCheck($_POST["typi"]), 0), format(isCheck($_POST["feat"]), 0), format(isCheck($_POST["like"]), 0), format(isCheck($_POST["chobe"]), 0), format(isCheck($_POST["chome"]), 0), format(isCheck($_POST["chogiadinh"]), 0), format($_POST["huongdan"], 0), format(rand_name($_POST["name"], $id), 0), format($_POST["url"], 0)); // updateObject($field=array(),$value=array(),$where) $res = $tbl->updateObject($field, $values, 'id=' . $id); if ($res) { header('location: ' . loadPage('products')); } } else { echo "Lỗi trùng mã vạch. Vui lòng nhập mã vạch khác."; } } // load page // loadOne($where) $res = $tbl->loadOne('id=' . $id); if ($res) { $row = mysql_fetch_array($res); $img = explode('(*_^)', $row['image']);
<?php if (isset($_GET['id'])) { $id = $_GET["id"]; } $tbl = new table('news'); if (isset($_POST["done"])) { $field = array('catid', 'name', 'details', 'image', 'hot', 'date_add', 'alias', 'url'); $img = edit_img('../', 'Images/News/', 'news', 'image', $_POST['tmpimage'], $id, 250, 163); $values = array(format($_POST["catid"], 0), format($_POST["name"], 0), format($_POST["details"], 0), format($img, 0), format(isCheck(isset($_POST["hot"])), 0), format(strtotime(date('H:i:s ') . $_POST["date_add"]), 0), format(rand_name($_POST["name"], $id), 0), format($_POST["url"], 0)); // insertObject($field,$value) $res = $tbl->updateObject($field, $values, 'id=' . $id); if ($res) { header('location: ' . loadPage('news')); } } $res = $tbl->loadOne('id=' . $id); if ($res) { $row = mysql_fetch_array($res); $thumb_img = get_thumb('Images/News/', $row['image']); ?> <div id="center-column"> <div class="top-bar"> <h1>Tin tức</h1> <div class="breadcrumbs"><a href="<?php echo loadPage('news'); ?> ">Tin tức</a> / <a href="#">Sửa</a></div> </div><br />