function solve($position, $val, $status) { $answer = array(); $val_len = count($val); // 時計回りに進んだ場合 $new_position_plus = ($position + $val[$position]) % $val_len; $answer_plus = next_step($new_position_plus, $val, $status); // 反時計回りに進んだ場合 $new_position_minus = ($position - $val[$position] + $val_len * 10) % $val_len; $answer_minus = next_step($new_position_minus, $val, $status); $answer = array_merge($answer_plus, $answer_minus); // 現在のpositionを先から返ってきた答えに加えてリターン foreach ($answer as $key => $value) { $answer[$key][] = $position; } return $answer; }
$Time = $ctime; } } } } mysql_query('UPDATE labirint SET location="' . $my_cord . '", vector="' . $my_vector . '", visit_time="' . $Time . '" WHERE user_id="' . $login . '"'); } $step1 = next_step($my_cord, $my_vector); if ($step1['fwd']) { $step2 = next_step($step1['fwd'], $my_vector); } if ($step2['fwd']) { $step3 = next_step($step2['fwd'], $my_vector); } if ($step3['fwd']) { $step4 = next_step($step3['fwd'], $my_vector); } else { $step4['fwd'] = false; } #echo $my_cord."-".$my_vector."-".$step1['fwd']."-"; #################################Нападение###################################### if ($_GET["attack"]) { $char_id = (int) $_GET["attack"]; if ($char_id == $db["id"]) { $msg = "Нападение на самого себя - это уже мазохизм..."; } else { if (!$db["battle"]) { $res = mysql_fetch_array(mysql_query("SELECT users.battle, users.last_ip, war_team.*, labirint.location FROM `users` LEFT JOIN war_team ON war_team.player=users.login LEFT JOIN labirint ON labirint.user_id=users.login WHERE id = '" . $char_id . "'")); if (!$res) { $msg = "Персонаж не найден."; } else {
$search_words = array(); foreach ($search_match_fields as $image_column => $match_column) { if (isset($row[$image_column])) { $search_words[$image_column] = $row[$image_column]; } } add_searchwords($row['image_id'], $search_words); echo "."; flush(); } while ($row = $site_db->fetch_array($result)); } $site_db->free_result($result); $counter += $batchsize; print " <b>OK</b><br />\n"; } next_step("finish", "Update complete"); } ?> <br /> </td> </tr> </table> <p align="center">Powered by <b>4images</b> <?php echo SCRIPT_VERSION; ?> <br /> Copyright © 2002 <a href="http://www.4homepages.de" target="_blank">4homepages.de</a> </p> </body> </html>
<?php // this file needs updating to new pms // Check if PunPMS is installed if ($start == 0 && !$db->table_exists('messages')) { next_step(); } $result = $fdb->query('SELECT m.*,t.*,u.username FROM ' . $fdb->prefix . $_SESSION['phpnuke'] . 'privmsgs AS m, ' . $fdb->prefix . $_SESSION['phpnuke'] . 'privmsgs_text AS t, ' . $fdb->prefix . 'users AS u WHERE t.privmsgs_text_id=privmsgs_id AND m.privmsgs_from_userid=u.user_id AND m.privmsgs_id>' . $start . ' ORDER BY m.privmsgs_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get message list", __FILE__, __LINE__, $fdb->error()); $last_id = -1; while ($ob = $fdb->fetch_assoc($result)) { $last_id = $ob['privmsgs_id']; echo htmlspecialchars($ob['username']) . ' (' . $ob['privmsgs_id'] . ")<br>\n"; flush(); // Check for anonymous poster id problem if ($ob['privmsgs_from_userid'] == -1) { $ob['privmsgs_from_userid'] = 1; $ob['username'] = '******'; } /* Skickar meddelande: 1: Skickat, användaren inte läst det [ Outbox ] 2: Meddelandet kopieras från orginalmeddelandet [ Sentbox ] 4: Save message [ Savebox ] Mottagit meddelande: 5: Sett att det finns, inte läst det [ Inbox ] 0: Läst meddelandet [ Inbox ] 3: Save message [ Savebox ] */ switch ($ob['privmsgs_type']) { // Send message:
if ($ok || $ok_t !== null && $ok_t) { $log .= $row['image_id'] . "," . $ok . "," . $ok_t . "," . $where . "," . $where_t . ";"; } $ok_show = ok($ok); $ok_t_show = ok($ok_t); $where = where($where); $where_t = where($where_t); echo "<tr align=\"center\" class=\"" . get_row_bg() . "\"><td>{$i}</td><td align=\"left\"><b>" . $row['image_name'] . "</b></td><td>" . $row['image_id'] . "</td>"; echo "<td><font color={$where}>{$ok_show}</font></td><td>" . substr(strrchr($row['image_media_file'], "."), 1) . "</td>" . ($thumbs ? "<td><font color={$where_t}>{$ok_t_show}</font></td><td>" . substr(strrchr($row['image_thumb_file'], "."), 1) . "</td>" : "") . "</tr>\n"; $i++; } echo "</table></td></tr></table>"; $log = $site_sess->get_session_var("imchklog") . $log; $site_sess->set_session_var("imchklog", $log); if ($imchkend < $max) { next_step($imchkend + 1, $imchksize, $autoredirect, $cat, $local, $subcat, $thumbs); } else { if ($log) { final_step($imchksize, $autoredirect, $thumbs); } else { echo "<p><b>Files Check Complete!<br /><br /> No errors found.</b><p>\n"; show_text_link("Back", "files_check.php"); } } } if ($action == "final") { $log = $site_sess->get_session_var("imchklog"); $log = trim($log, ";"); $log_array = explode(";", $log); $log = array(); $i = 0;
if ($cat_id) { $batchend = $row['image_id']; } printf($lang_rebuild_image, $row['image_name'], $row['image_id']); flush(); @set_time_limit(90); $search_words = array(); foreach ($search_match_fields as $image_column => $match_column) { if (isset($row[$image_column])) { $search_words[$image_column] = $row[$image_column]; } } remove_searchwords($row['image_id']); add_searchwords($row['image_id'], $search_words); echo " <b>OK</b><br />\n"; flush(); } if ($num_rows) { $sql = "SELECT cat_id\n FROM " . IMAGES_TABLE . "\n WHERE {$cat_filter} AND image_id >= " . ($batchend + 1) . $order; $num_rows = $site_db->query_firstrow($sql); } if ($num_rows) { next_step($batchend + 1, $batchsize, $autoredirect); show_text_link($lang_rebuild_back, "rebuild_searchindex.php"); } else { echo "<p><b>" . $lang_rebuild_success . "</b><p>\n"; show_text_link($lang_rebuild_back, "rebuild_searchindex.php"); $site_sess->set_session_var("rsibatchstart", 0); } } show_admin_footer();
function build_move_image($location, $vector) { global $smert_bot; $step1 = next_step($location, $vector); if ($step1['fwd']) { $step2 = next_step($step1['fwd'], $vector); } if ($step2['fwd']) { $step3 = next_step($step2['fwd'], $vector); } else { $step3['fwd'] = false; } $s = ""; if ($step1['left']) { $s .= "document.getElementById('l2l').style.display = 'block';"; } else { $s .= "document.getElementById('l1l').style.display = 'block';"; } if ($step1['fwd']) { if ($step1['fwd'] == "19x11" && $smert_bot) { $s .= "document.getElementById('bot_id').style.display = 'block';"; } if ($step2['left']) { $s .= "document.getElementById('l3l').style.display = 'block';"; } else { $s .= "document.getElementById('l2l').style.display = 'block';"; } if ($step2['fwd']) { if ($step3['left']) { $s .= "document.getElementById('l4l').style.display = 'block';"; } else { $s .= "document.getElementById('l3l').style.display = 'block';"; } if (!$step3['fwd']) { $s .= "document.getElementById('l3f').style.display = 'block';"; } if ($step3['right']) { $s .= "document.getElementById('l4r').style.display = 'block';"; } else { $s .= "document.getElementById('l3r').style.display = 'block';"; } if ($step2['fwd'] == "19x11" && $smert_bot) { $s .= "document.getElementById('bot_id_small').style.display = 'block';"; } } else { $s .= "document.getElementById('l2f').style.display = 'block';"; } if ($step2['right']) { $s .= "document.getElementById('l3r').style.display = 'block';"; } else { $s .= "document.getElementById('l2r').style.display = 'block';"; } } else { $s .= "document.getElementById('l1f').style.display = 'block';"; } if ($step1['right']) { $s .= "document.getElementById('l2r').style.display = 'block';"; } else { $s .= "document.getElementById('l1r').style.display = 'block';"; } return $s; }