public static function info($s) { if (is_object($s)) { ob_start(); preint_r($s); $s = ob_get_clean(); } $s = date("Y-m-d H:i:s\t") . $s . "\n"; file_put_contents(BS_CORE_PATH . "../logs/bitrix24-" . date("Y-m-d") . ".log", $s, FILE_APPEND); }
function photo_get_action_b($uri) { echo $uri; //$uri = $_SERVER['REQUEST_URI']; $result = preg_match('/\\/fotoalbum\\/(\\w+)\\/(\\w+)\\/(\\w+)\\/([\\w\\d]+)?/', $uri, $matches); // preint_r($matches); $action['owner_type'] = $matches[1]; // owner type is [user|group|system] $action['owner'] = $matches[2]; // owner is user name, group name or a special system name $action['action'] = $matches[3]; // action is a view or a post $action['item'] = $matches[4]; // an id identifying a photo or an album preint_r($action); return $action; }
function report_sql_error($query, $file = null, $line = null) { echo '<div class="server_message_error"><h2>Såhär skall det ju inte bli, usch!</h2><p>Ett fel på hamsterpaj har inträffat! Utvecklingsansvariga har meddelats om detta, du behöver inte rapportera felet. Vi åtgärdar det snart (om vi kan :P)</p>'; echo '<h3 class="server_message_collapse_header" id="server_message_collapse_header_sqlerror">Visa felsökningsinformation</h3>' . "\n"; echo '<div class="server_message_collapsed_information" id="server_message_collapse_information_sqlerror">' . "\n"; echo '<br />Felsökningsinformation:<br />' . htmlspecialchars(mysql_error()); echo '<br />Frågan löd:<br /><p>' . htmlspecialchars($query) . '</p>'; echo $file . ' #' . $line; echo '<h1>Backtrace</h1>' . "\n"; preint_r(debug_backtrace()); echo '</div></div>' . "\n"; if (isset($file)) { echo '<strong>Logging</strong>'; //log_to_file('sql_error', LOGLEVEL_ERROR, $file, $line, $query); trace('sql_errors', $query . ' in ' . $file . ' on line ' . $line); } }
<?php header('Content-type: image/jpeg'); include '../include/core/common.php'; $sql = 'SELECT id FROM login WHERE MD5(id) = "' . $_GET['user_hash'] . '" LIMIT 1;'; $result = mysql_query($sql) or die('Dummer, det här fungerar ju inte.<br />' . mysql_error()); $data = mysql_fetch_assoc($result); $out = readfile(IMAGE_PATH . 'images/users/full/' . $data['id'] . '.jpg') or die('FISKROJK! BOM-SPÖKENA JAGAR MIG') && preint_r($data); echo $out;
<?php require '../include/core/common.php'; $ui_options['current_menu'] = 'admin'; $ui_options['stylesheets'][] = 'admin_log.css'; $ui_options['menu_path'] = array('admin', 'log_view'); include $hp_includepath . 'admin-functions.php'; require $hp_includepath . 'avataradmin-functions.php'; if (!is_privilegied('use_ghosting_tools')) { header('location: /'); die; } ui_top($ui_options); if (isset($_POST['username'])) { preint_r($_POST); } $numeric = array_key_exists('numeric', $_POST) == 1; echo rounded_corners_top(); echo '<h1 style="margin-top: 0px; padding-top: 2px;">Logg över administrativa händelser</h1>'; echo '<h3>Filtrera på valfria fält</h3><br />'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<table class="admin_log" >'; echo ' <tr>'; echo ' <td class="event" >Händelse</td>'; echo ' <td class="comment">Info</td>'; echo ' <td class="time">Tidpunkt</td>'; echo ' <td class="admin">Admin</td>'; echo ' <td class="user">Användare</td>'; echo ' <td class="item">Item id</td>'; echo ' </tr>'; echo ' <tr>';
function films_film_distribute_new($film) { preint_r($_SESSION); $command = 'mv ' . FILMS_TEMP_PATH . $_SESSION['new_film_temp']['hash'] . '.' . $_SESSION['new_film_temp']['extension'] . ' /storage/www/www.hamsterpaj.net/data/distribute/film/' . $film['handle'] . '.' . $film['extension']; log_to_file('films', LOGLEVEL_DEBUG, __FILE__, __LINE__, 'executing command: ' . $command); exec($command, $output, $return_value); log_to_file('films', LOGLEVEL_DEBUG, __FILE__, __LINE__, 'command: ' . $command . ' returned ' . $return_value, serialize($output)); distribute_item(array('type' => 'film', 'handle' => $film['handle'], 'extension' => $film['extension'])); }
$post = array_pop($posts); discussion_forum_remove_post(array('post_id' => $_GET['post_id'], 'removal_comment' => $_GET['removal_comment'])); $message = 'Hej, ditt inlägg i forumet med titeln "%TITLE%" har tagits bort.' . "\n"; $message .= 'Ordningsvakten som tog bort ditt inlägg heter %REMOVERS_USERNAME% och gjorde följande notering:' . "\n\n"; $message .= '-----' . "\n"; $message .= '%REMOVAL_COMMENT%' . "\n"; $message .= '-----' . "\n\n"; $message .= 'Här är ditt inlägg:' . "\n"; $message .= '-----' . "\n"; $message .= '%CONTENT%' . "\n"; $message .= '-----' . "\n\n"; $message .= 'Har du några frågor så ta det med någon ordningsvakt, du hittar sådana i modulen "Inloggade Ordningsvakter" till höger.' . "\n"; $message .= 'Detta är inte hela världen, men det är kanske bäst att du chillar lite extra i framtiden.' . "\n\n"; $message .= '/Webmaster'; $guestbook_message = array('sender' => 2348, 'recipient' => intval($post['author']), 'message' => mysql_real_escape_string(str_replace(array('%TITLE%', '%CONTENT%', '%REMOVAL_COMMENT%', '%REMOVERS_USERNAME%'), array($post['title'], $post['content'], $_GET['removal_comment'], $_SESSION['login']['username']), $message))); preint_r($guestbook_message); guestbook_insert($guestbook_message); log_admin_event('post removed', $post['removal_comment'], $_SESSION['login']['id'], $post['author'], $_GET['post_id']); admin_action_count($_SESSION['login']['id'], 'post_removed'); } if ($_GET['action'] == 'unremove_post' && forum_security(array('action' => 'unremove_post', 'post_id' => $_GET['post_id']))) { discussion_forum_remove_post(array('post_id' => $_GET['post_id'], 'mode' => 'unremove')); } if ($_GET['action'] == 'vote' && login_checklogin() && is_numeric($_GET['thread_id'])) { $query = 'UPDATE forum_read_posts SET has_voted = 1 WHERE thread_id = "' . $_GET['thread_id'] . '" AND user_id = "' . $_SESSION['login']['id'] . '" AND has_voted = 0'; mysql_query($query); if (mysql_affected_rows() == 1) { $operand = $_GET['vote'] == 'positive' ? '+' : '-'; $query = 'UPDATE forum_posts SET score = score ' . $operand . ' 1 WHERE id = "' . $_GET['thread_id'] . '"'; mysql_query($query) or report_sql_error($query, __FILE__, __LINE__); }
} } // form $out .= '<fieldset>' . "\n"; $out .= '<legend>Användarmeddelande!</legend>' . "\n"; $out .= '<p>Den här funktionen ger användaren en javascriptruta med ditt meddelande. Detta kräver dock att användaren är inloggad.</p>' . "\n"; $out .= '<form action="?action=submit" method="post">'; $out .= '<table class="form">' . "\n"; $out .= '<tr>' . "\n"; $out .= '<th><label for="username">Användarnamn <strong>*</strong></label></th>' . "\n"; $out .= '<td><input type="text" name="username" /></td>' . "\n"; $out .= '</tr>' . "\n"; $out .= '<tr>' . "\n"; $out .= '<th><label for="message">Meddelande <strong>*</strong></label></th>' . "\n"; $out .= '<td><input type="text" name="message" /></td>' . "\n"; $out .= '</tr>' . "\n"; $out .= '</table>' . "\n"; $out .= '<input type="submit" id="submit" value="Skicka" />' . "\n"; $out .= '</form>'; $out .= '</fieldset>' . "\n"; } catch (Exception $error) { $options['type'] = 'error'; $options['title'] = 'Nu blev det fel här'; $options['message'] = $error->getMessage(); $options['collapse_link'] = 'Visa felsökningsinformation'; $options['collapse_information'] = preint_r($error, true); $out .= ui_server_message($options); } ui_top($ui_options); echo $out; ui_bottom();
} } foreach ($confirmed_recipients as $recipient) { $entry['sender'] = $send_from; $entry['recipient'] = $recipient; $entry['message'] = $_POST['message']; $entry['is_private'] = $_POST['is_private']; $entry['is_mass_gb'] = true; if (!guestbook_insert($entry)) { $out .= 'Failade att skicka meddelande till ' . $recipient . '.<br />' . "\n"; } else { $out .= 'Meddelande skickat till ' . $recipient . '<br />'; } } preint_r($confirmed_recipients); preint_r($entry); } $out .= '<fieldset> <legend>MassGB-SPAM!</legend> <style> .recipient_filters li { list-style-type:none; } .mass_gb_left_div { border-right: thin solid #BBB; padding-right: 15px; margin-right: 15px; width: 200px; float:left; } .mass_gb_right_div {
<?php require '../include/core/common.php'; require PATHS_LIBRARIES . 'movie_compability.lib.php'; $ui_options['menu_path'] = array('dev', 'visa_sessionsdata'); ui_top($ui_options); if (is_privilegied('use_debug_tools')) { echo '<h1>Visar sessionsdata</h1>' . "\n"; preint_r($_SESSION); } else { preint_r(array('fisk' => 'kakor')); } ui_bottom(); ?>
$out .= 'Det där var tydligen ingen IP-adress.'; } } elseif ($action == 'ip2long' && $value_isset) { if (ereg('^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2}){0,1}$', $value)) { $out .= ip2long($value); } else { $out .= 'Det där var tydligen ingen IP-adress.'; } } elseif ($action == 'long2ip' && $value_isset) { if (is_numeric($value)) { $out .= long2ip($value); } else { $out .= 'En \'long\' måste bestå av nummer.'; } } elseif ($action == 'serialize2preint_r' && $value_isset) { $out .= preint_r(unserialize(stripslashes($value))); } elseif ($action == 'md5' && $value_isset) { $out .= md5($value); } elseif ($action == 'sha1' && $value_isset) { $out .= sha1($value); } elseif ($action == 'hamsterpaj_password_hash' && $value_isset) { $out .= sha1(utf8_decode($value) . PASSWORD_SALT); } elseif ($action == 'timestamp2readable' && $value_isset && is_numeric($value)) { $out .= date('Y-m-d H:i:s', $value); } elseif ($action == 'base64encode' && $value_isset) { $out .= base64_encode($value); } elseif ($action == 'base64decode' && $value_isset) { $out .= base64_decode($value); } echo utf8_encode($out); //echo $out;
function knowledge_database_readable_categories_tree($categories_tree, $categories_by_parent = false) { echo 'Fellund...'; if (!is_array($categories_by_parent)) { // It's the first time we iterate... $categories_by_parent = $categories_tree; } preint_r($categories_tree, rand(0, 99999)); $output .= "\n" . '<ul>' . "\n"; foreach ($categories_tree as $category) { $output .= "\t" . '<li>' . (array_key_exists('is_data', $category) ? 'lolz<a href="#">' . $category['label'] . '</a>' . knowledge_database_readable_categories_tree($category, $categories_by_parent) : 'p3') . '</li>' . "\n"; } $output .= '</ul>' . "\n"; return $output; }
<?php require '../include/core/common.php'; require_once PATHS_INCLUDE . 'libraries/posts.php'; require_once PATHS_INCLUDE . 'libraries/markup.php'; //require_once($hp_includepath . '/libraries/markup.php'); //require_once($hp_includepath . '/libraries/games.lib.php'); //require_once($hp_includepath . '/libraries/schedule.lib.php'); //require_once(PATHS_INCLUDE . 'libraries/tips.lib.php'); preint_r($_GET); preint_r($_SESSION);
function entertain_item_draw($item, $options) { global $entertain_types; entertain_item_viewed($item['id'], $item['entertain_type'], $item['view_count']); $output .= '<span class="' . $item['entertain_type'] . '">' . "\n"; $output .= '<div class="entertain_item">' . "\n"; // Item title $output .= '<h1 class="entertain_header">' . $item['title'] . '</h1>' . "\n"; /* The entertainment items are displayed in different ways for different types. Games have full width while movie clips, flash films and images are displayed in 3/4 width, whith a few thumbnails on the side. */ switch ($item['entertain_type']) { case 'software': case 'clip': case 'flash': case 'image': $fetch_result = entertain_fetch(array('released' => true, 'entertain_type' => $item['entertain_type'], 'exclude' => array($item['id']), 'limit' => 3, 'order' => 'random')); $related_items = $fetch_result['items']; $output .= entertain_list($related_items, array('list_style' => 'thumbnails', 'headline' => 'Fler ' . $entertain_types[$item['entertain_type']]['label_plural'])); break; case 'game': break; } // Item rank, counter and release date $output .= '<div class="entertain_statistics">' . "\n"; $output .= '<div class="entertain_rank">' . "\n"; $output .= rank_draw($item['rank_average'], array('size' => 'medium')); $output .= '</div>' . "\n"; // end entertain_rank $output .= '<div class="entertain_view_count">' . "\n"; $output .= cute_number($item['view_count'] + 1) . ' visningar sedan ' . "\n"; $output .= date('Y-m-d', $item['release']); //fix_time($item['release']); $output .= '</div>' . "\n"; // end entertain_date $output .= '</div>' . "\n"; // end entertain_statistics $output .= '<div class="entertain_player" id="entertain_player">' . "\n"; /* Now we shall display the entertainment item itself. This is done in different ways for different types and also different depending on special properties like use_special_code or trailer_id. */ if ($_SESSION['login']['id'] == 87926) { preint_r($item); } //First, we consider a bunch of special cases, that is film trailers, items with their own special html, images and software links if ($item['trailer_id'] > 0) { $output .= '<!-- Play Networks - Embeddable Flash Player -->' . "\n"; $output .= '<div id="playnw" class="playnw">' . "\n"; $output .= '<script src="http://se.player.playnetworks.net/player.php?mid=' . $item['trailer_id'] . '&channel_user_id=4601100020-1&width=474&height=355"></script><br>' . "\n"; $output .= '</div>' . "\n"; $output .= '<!-- Play Networks - Embeddable Flash Player -->' . "\n"; } elseif ($item['use_special_code'] == 1) { $output .= stripslashes($item['html']); } elseif (strlen($item['link']) > 2 && $item['entertain_type'] == 'image') { $server = distribute_server_get(array('item_handle' => $item['handle'], 'type' => $item['entertain_type'])); $address = 'http://' . $server['address'] . '/distribute/' . $item['entertain_type'] . '/' . $item['handle'] . '.' . $item['extension']; $output .= '<a href="' . $item['link'] . '"><img src="' . $address . '" class="entertain_' . $item['entertain_type'] . '" /></a>' . "\n"; } elseif ($item['entertain_type'] == 'software') { $output .= '<button onclick="window.location=\'' . $item['link'] . '\';" class="button_150">Ladda ner</button><br />' . "\n"; $output .= '<p>Alla filer är givetvis gratis att ladda ner och innehåller inga virus!</p>' . "\n"; } else { $server = distribute_server_get(array('item_handle' => $item['handle'], 'type' => $item['entertain_type'])); $address = 'http://' . $server['address'] . '/distribute/' . $item['entertain_type'] . '/' . $item['handle'] . '.' . $item['extension']; switch ($item['extension']) { case 'swf': $wrapper = ''; $output .= '<object type="application/x-shockwave-flash" data="' . $wrapper . $address . '" > <param name="movie" value="' . $wrapper . $address . '" /></object>'; $item['entertain_type'] == 'clip' || $item['entertain_type'] == 'flash' ? event_log_log('jc_ad_after') : ''; break; case 'flv': $player_url = '/entertain/flvplayer.swf'; // On end of J-store campaign, set width to 456 and height to 355 on both places $output .= '<div id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Installera Flash Player</a> för att kunna se den här grejen.</div> <script type="text/javascript"> var s1 = new SWFObject("' . $player_url . '","single","466","336","7"); s1.addParam("allowfullscreen","true"); s1.addVariable("file","' . $address . '"); s1.addVariable("image","' . IMAGE_URL . '/entertain/' . $item['handle'] . '.png"); s1.addVariable("width","466"); s1.addVariable("height","336"); s1.write("player1"); </script>'; break; case 'jpg': case 'png': case 'gif': $server = distribute_server_get(array('item_handle' => $item['handle'], 'type' => $item['entertain_type'])); $address = 'http://' . $server['address'] . '/distribute/' . $item['entertain_type'] . '/' . $item['handle'] . '.' . $item['extension']; $output .= '<img src="' . $address . '" class="entertain_' . $item['entertain_type'] . '" />' . "\n"; } } $output .= '<div class="entertain_item_buttons">' . "\n"; if ($item['entertain_type'] == 'image') { $query = 'SELECT id, handle FROM entertain_items WHERE id < "' . $item['id'] . '"'; $query .= ' AND `release` < ' . time(); $query .= ' AND entertain_type = "' . $item['entertain_type'] . '"'; $query .= ' ORDER BY id DESC'; $query .= ' LIMIT 1'; $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__)); if ($data = mysql_fetch_assoc($result)) { $output .= '<a href="/' . $entertain_types[$item['entertain_type']]['url_handle'] . '/' . $data['handle'] . '.html">'; $output .= '<button id="entertain_previous" class="button_90">'; $output .= 'Föregående'; $output .= '</button></a>' . "\n"; } $query = 'SELECT id, handle FROM entertain_items WHERE id > "' . $item['id'] . '"'; $query .= ' AND `release` < ' . time(); $query .= ' AND entertain_type = "' . $item['entertain_type'] . '"'; $query .= ' ORDER BY id ASC'; $query .= ' LIMIT 1'; $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__)); if ($data = mysql_fetch_assoc($result)) { $output .= '<a href="/' . $entertain_types[$item['entertain_type']]['url_handle'] . '/' . $data['handle'] . '.html">'; $output .= '<button id="entertain_next" class="button_90">'; $output .= 'Nästa'; $output .= '</button></a>' . "\n"; } } if ($item['extension'] == 'swf') { $output .= '<button id="entertain_fullscreen" onclick="javascript: open_fullscreen_window(\'' . $address . '\');">'; $output .= 'Spela i fullskärm'; $output .= '</button>' . "\n"; } $output .= '</div>' . "\n"; // end entertain_item_buttons $output .= '</div>' . "\n"; // end entertain_player // Description and game controls $output .= '<div class="entertain_description">' . "\n"; if (strlen($item['description']) > 0) { $output .= $item['description'] . "\n"; } if ($item['trailer_id'] > 0) { $output .= '<p>Filmtrailers visas i samarbete med Play Networks</p>' . "\n"; } $output .= '</div>' . "\n"; // end entertain_description if (!is_array($item['controls'])) { $item['controls'] = unserialize(utf8_decode($item['controls'])); $utf8_mupp = true; } if (is_array($item['controls']) && count($item['controls']) > 0) { $output .= '<h2>Kontroller</h2>' . "\n"; $output .= '<table class="entertain_controls">' . "\n"; $num_of_rows = ceil(count($item['controls']) / 2); for ($i = 0; $i < $num_of_rows; $i++) { $output .= '<tr>' . "\n"; if (!$utf8_mupp) { $output .= '<td class="combination">' . $item['controls'][$i]['combination'] . '</td>' . "\n"; $output .= '<td class="description">' . $item['controls'][$i]['description'] . '</td>' . "\n"; } else { $output .= '<td class="combination">' . utf8_encode($item['controls'][$i]['combination']) . '</td>' . "\n"; $output .= '<td class="description">' . utf8_encode($item['controls'][$i]['description']) . '</td>' . "\n"; } $output .= '</tr>' . "\n"; } $output .= '</table>' . "\n"; } if (is_privilegied('entertain_update')) { $output .= '<a class="entertain_edit" href="/' . $entertain_types[$item['entertain_type']]['url_handle'] . '/admin/' . $item['handle'] . '.html">[Redigera]</a>' . "\n"; } if (is_privilegied('entertain_add')) { $output .= 'Personen som laddat upp det här objektet är: <a href="/traffa/profile.php?id=' . $item['uploader'] . '">' . $item['uploader'] . '</a>'; } //todo! connect with javascript // Comments - Users can rank and leave a comment. These are handled by separate libraries but are connected // by javascript so that users submit rank and comment together. $output .= '<div class="entertain_comments">' . "\n"; $output .= '<input type="hidden" id="entertain_item_id" value="' . $item['id'] . '" />' . "\n"; $output .= '<h2 class="rank_input_header">Din poäng</h2>' . "\n"; $output .= '<h2 class="comment_input_header">Din kommentar</h2>' . "\n"; $output .= '<br style="clear: both;" />' . "\n"; if (login_checklogin()) { $query = 'SELECT rank FROM user_ranks WHERE user_id = "' . $_SESSION['login']['id'] . '" AND item_id = "' . $item['id'] . '" AND item_type = "entertain"'; $result = mysql_query($query); if (mysql_num_rows($result) == 1) { $data = mysql_fetch_assoc($result); } } unset($rank_options); $rank_options['previous'] = $data['rank']; $output .= rank_input_draw($item['id'], 'entertain', $rank_options); $output .= comments_input_draw($item['id'], 'entertain'); $output .= '<br style="clear: both;" />' . "\n"; $output .= '</div>' . "\n"; // end entertain_comments $options['comments'] = isset($options['comments']) ? $options['comments'] : 'yes'; if ($options['comments'] == 'yes') { $output .= comments_list($item['id'], 'entertain'); } $output .= '</div>' . "\n"; // end entertainment_item $output .= '</span>' . "\n"; // end $entertain_type return $output; }
<li><a href="/flash/">Flashfilmer</a></li> </ul> </p> <h2>Finns det våld, sex eller droger på er underhållningsavdelning?</h2> <p> På Hamsterpaj lägger vi inte upp någonting som vi bedömmer att kan skada ungdomar över 13 år. Vi tar avstånd från och lägger aldrig upp brutalt våld i underhållningssyfte. Filmer där folk får allvarligare skador än skrubbsår eller blåmärken publicerar vi inte. </p> <p> </p> <?php $parameters['fetch']['handle'] = array('miss_teen_usa', 'tv4__mensvaerk'); preint_r($parameters); films_fetch_and_list($parameters); ?> <h2>Så här kan du tipsa om nya roliga grejor!</h2> <p> </p> <h2>Vi har sällan licenser eller rättigheter till vårt innehåll</h2> <p> </p> <h2>Frågor eller synpunkter?</h2>
<?php echo '<div style="border: 1px solid ' . $profile_colors['border'] . '; background: ' . $profile_colors['background'] . '; padding: 3px;">' . "\n"; $query = 'SELECT ur.rank, uc.comment, f.id, f.handle, f.title, f.category_id'; $query .= ' FROM user_ranks AS ur, user_comments AS uc, film AS f'; $query .= ' WHERE ur.user_id = "' . $userid . '" AND uc.user_id = ur.user_id AND uc.item_id = ur.item_id AND f.id = ur.item_id'; $query .= ' ORDER BY ur.rank DESC, uc.timestamp DESC LIMIT 4'; $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__)); if (mysql_num_rows($result) > 0) { while ($data = mysql_fetch_assoc($result)) { echo ''; preint_r($data); } } ?> </div>
$result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__); while ($report = mysql_fetch_assoc($result)) { $out .= '<tr' . ($report['id'] & 1 ? ' class="gb_autoreport_post_odd"' : '') . ' id="gb_autoreport_post_message_' . $report['id'] . '">' . "\n"; $out .= '<th>Inlägg:</th>' . "\n"; $out .= '<td colspan="6" class="gb_autoreport_message">' . nl2br($report['message']) . '</td>' . "\n"; $out .= '</tr>' . "\n"; $out .= '<tr id="gb_autoreport_post_info_' . $report['id'] . '" class="gb_autoreport_post_info' . ($report['id'] & 1 ? ' gb_autoreport_post_odd' : '') . '">' . "\n"; $out .= '<td>' . (is_privilegied('use_ghosting_tools') ? '<a href="/admin/guestbook_hack.php?id_1=' . $report['sender'] . '&id_2=' . $report['recipient'] . '">Läs diskussion</a>' : 'Kräver gb-hack') . '</td>' . "\n"; $out .= '<td>' . (is_privilegied('use_ghosting_tools') ? '<a href="/admin/guestbook_hack.php?id_1=' . $report['sender'] . '">Läs alla inlägg</a>' : 'Kräver gb-hack') . '</td>' . "\n"; $out .= '<td class="username"><a href="/traffa/profile.php?user_id=' . $report['user_id'] . '">' . $report['username'] . '</a></td>' . "\n"; $out .= '<td class="username"><a href="/traffa/profile.php?user_id=' . $report['recipient_id'] . '">' . $report['recipient_username'] . '</a></td>' . "\n"; $out .= '<td><a id="' . $report['id'] . '" class="gb_autoreport_validate" href="/ajax_gateways/gb_autoreport.php?action=post_validate&id=' . $report['id'] . '&return=true" style="color: green;">Validera</a></td>' . "\n"; $out .= '</tr>' . "\n"; } $out .= '</table>' . "\n"; break; } ui_top($ui_options); echo rounded_corners_tabs_top($rounded_corners_tabs_options, true); echo $out; echo rounded_corners_tabs_bottom($rounded_corners_tabs_options, true); ui_bottom(); } catch (Exception $error) { $options['type'] = 'error'; $options['title'] = 'Nu blev det fel här'; $options['message'] = $error->getMessage(); $options['collapse_link'] = 'Visa felsökningsinformation'; $options['collapse_information'] = preint_r($error, true); $out .= ui_server_message($options); preint_r($error); }
<?php require '../include/core/common.php'; include PATHS_INCLUDE . 'libraries/poll.lib.php'; if ($_GET['action'] == 'vote' && is_numeric($_GET['poll_id']) && in_array($_GET['answer_id'], array(1, 2, 3, 4, 5, 6, 7))) { echo 'Ok'; $poll = poll_fetch(array('id' => $_GET['poll_id'])); preint_r($poll); if ($poll[0]['can_answer'] == true) { $query = 'UPDATE poll SET alt_' . $_GET['answer_id'] . '_votes = alt_' . $_GET['answer_id'] . '_votes + 1'; $query .= ' WHERE id = "' . $_GET['poll_id'] . '"'; mysql_query($query) or report_sql_error($query, __FILE__, __LINE__); if (login_checklogin()) { $query = 'INSERT INTO poll_answers (poll_id, user_id, answer_id) VALUES("' . $_GET['poll_id'] . '", "' . $_SESSION['login']['id'] . '", "' . $_GET['answer_id'] . '")'; mysql_query($query) or report_sql_error($query, __FILE__, __LINE__); } else { } } }
<?php require '../include/core/common.php'; require_once PATHS_INCLUDE . 'libraries/posts.php'; require_once PATHS_INCLUDE . 'libraries/markup.php'; //require_once($hp_includepath . '/libraries/markup.php'); //require_once($hp_includepath . '/libraries/games.lib.php'); //require_once($hp_includepath . '/libraries/schedule.lib.php'); //require_once(PATHS_INCLUDE . 'libraries/tips.lib.php'); preint_r($_GET); // HELL NO! // Med den här raden så kan man cracka 50% av hamsterpajs lösenord på några timmar. // I och med att den skriver ut sessionen så får man reda på sin hash, och skriver // man då ett program som byter lösenord <generalsettings.php> och hämtar hashen <$_SERVER['SCRIPT_NAME']> (FFS!) // Så kan man komma ganska långt. [reformaterat] // Hälsar LordDanne. // preint_r($_SESSION);
google_ad_type = "text"; //2007-10-03: Tävlingsfliken google_ad_channel = "6075720464"; google_color_border = "EEEEEE"; google_color_bg = "FFFFFF"; google_color_link = "000000"; google_color_text = "000000"; google_color_url = "333333"; google_ui_features = "rc:6"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
case 'item_save_new': if (!is_privilegied('entertain_add', $request['entertain_type'])) { die('Ej priviligierad för ' . $request['entertain_type']); } $item = entertain_item_save(array('entertain_type' => $request['entertain_type'], 'new' => true, 'update_file' => false)); if (!isset($_POST['use_special_code'])) { entertain_item_distribute_new($item); } header('Location: ' . $item['url']); unset($_SESSION['new_entertain_temp']); exit; break; case 'item_save_and_update_file': $update_file = true; case 'item_save': preint_r($request); if (!is_privilegied('entertain_update') && is_privilegied('entertain_delete')) { die('Ej priviligierad för ändring av det här objektet. Rad ' . __LINE__); } if ($_POST['delete'] == 'delete' && is_privilegied('entertain_delete')) { entertain_item_delete($_POST['item_id']); global $entertain_types; header('Location: http://www.hamsterpaj.net/' . $entertain_types[$_POST['entertain_type']]['url_handle'] . '/'); } else { if (!is_privilegied('entertain_update')) { die('Inga privilegier, på rad ' . __LINE__); } $item = entertain_item_save(array('entertain_type' => $request['entertain_type'], 'update' => true, 'update_file' => $update_file)); } if ($update_file) { entertain_item_distribute_new($item);
} else { echo 'IP: ' . '<form>' . '<input type="hidden" name="page" value="encoders_decoders" />' . '<input type="hidden" name="type" value="ip2host" />' . '<input type="text" name="ip" />' . '<input type="submit" value="Convert" />' . '</form>'; } if ($type == 'ip2long' && isset($_GET['ip']) && ereg('^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2}){0,1}$', $_GET['ip'])) { echo ip2long($_GET['ip']) . $go_back; } else { echo 'ip2long(): ' . '<form>' . '<input type="hidden" name="page" value="encoders_decoders" />' . '<input type="hidden" name="type" value="ip2long" />' . '<input type="text" name="ip" />' . '<input type="submit" value="Convert" />' . '</form>'; } if ($type == 'long2ip' && isset($_GET['long']) && is_numeric($_GET['long'])) { echo long2ip($_GET['long']) . $go_back; } else { echo 'long2ip(): ' . '<form>' . '<input type="hidden" name="page" value="encoders_decoders" />' . '<input type="hidden" name="type" value="long2ip" />' . '<input type="text" name="long" />' . '<input type="submit" value="Convert" />' . '</form>'; } echo '<h3>Serialize > preint_r():</h3>' . "\n"; if ($type == 'serialize2preint_r' && isset($_GET['data'])) { preint_r(unserialize(stripslashes($_GET['data']))) . $go_back; } else { echo 'Serialized data string: (Note: DO NOT convert untrusted data)' . '<form>' . '<input type="hidden" name="page" value="encoders_decoders" />' . '<input type="hidden" name="type" value="serialize2preint_r" />' . '<textarea name="data"></textarea>' . '<input type="submit" value="Convert" />' . '</form>'; } echo '<h3>Hash calculators</h3>' . "\n"; if ($type == 'md5' && isset($_POST['data'])) { echo md5($_POST['data']) . $go_back; } else { echo 'MD5:' . '<form method="post" action="?page=encoders_decoders&type=md5">' . '<input type="text" name="data" />' . '<input type="submit" value="Convert" />' . '</form>'; } if ($type == 'sha1' && isset($_POST['data'])) { echo sha1($_POST['data']) . $go_back; } else { echo 'SHA1:' . '<form method="post" action="?page=encoders_decoders&type=sha1">' . '<input type="text" name="data" />' . '<input type="submit" value="Convert" />' . '</form>'; } if ($type == 'hamsterpaj_password_hash' && isset($_POST['data'], $_POST['data_do_not_show'])) {
function schedule_minute_job() { $last_monday = strtotime(date('D') == 'Mon' ? 'Today' : 'last Monday'); $minutes_passed_this_week = floor((time() - $last_monday) / 60); $query = 'SELECT sp.id, sp.type, sp.data, sp.released' . ' FROM schedule_schema AS ss, schedule_pool AS sp' . ' WHERE ss.type = sp.type' . ' AND ss.start <= ' . $minutes_passed_this_week . ' AND ss.end >= ' . $minutes_passed_this_week . ' AND sp.released = 0' . ' ORDER BY rand()'; $result = mysql_query($query) or report_sql_error($query); echo $minutes_passed_this_week; while ($data = mysql_fetch_assoc($result)) { preint_r($data); } }
function tag_set_wrap($options) { /* Obs! Removes all old tags options array support possible values item_id no object_type no 'discussion', 'post', 'wallpaper', 'article', 'survey', 'game', 'clip', 'a1' tag_handle yes handle_type_values tag_label yes Free text values tag_id yes 1, 2, 3.. add no set to true if tags should be added to old tags */ if (644314 == $_SESSION['login']['id']) { preint_r($options); } $keys = array('tag_handle', 'tag_label', 'tag_id'); foreach ($keys as $key) { if (isset($options[$key])) { $options[$key] = is_array($options[$key]) ? $options[$key] : array($options[$key]); $keytype = $key; } } if ($keytype == 'tag_label') { foreach ($options['tag_label'] as $label) { if (!($tag = tag_get_by_handle(url_secure_string($label)))) { $tag_id = tag_create($label); } else { $tag_id = $tag['id']; } $tag_ids[] = $tag_id; } } elseif ($keytype == 'tag_handle') { $tags = tag_get_by_handle($options['tag_handle']); unset($tag_ids); foreach ($tags as $tag) { $tag_ids[] = $tag['id']; } } if (!isset($options['add'])) { $query = 'DELETE FROM object_tags WHERE object_type = "' . $options['object_type'] . '" AND reference_id = "' . $options['item_id'] . '"'; mysql_query($query); } foreach ($tag_ids as $tag_id) { $query = 'INSERT INTO object_tags (tag_id, object_type, reference_id)'; $query .= ' VALUES ("' . $tag_id . '", "' . $options['object_type'] . '", "' . $options['item_id'] . '")'; mysql_query($query); //todo! annan felhantering här då det kan hända att man försöker sätta redan satta taggar, or die(report_sql_error($query, __FILE__, __LINE__)); } }