/** * Получение списка из кеша * @param $type * @return array */ function getList($type) { $list = cache_get('acl_' . $type, true); if ($list) { return $list; } $list = $this->createList($type); cache_save('acl_' . $type, $list, true); return $list; }
public static function handleOnShutdown() { $request = self::_getRequest(); if (!$request->three_o_four_buffering_started) { return; } $response = ob_get_clean(); if (http_response_code() != 200) { ob_end_flush(); return; } $contentLength = strlen($response); $etag = null; if (isset($request->three_o_four_cache_response) && $request->three_o_four_cache_response == true) { $key = self::_generateCacheKey($request); $microtime = microtime(); //$etag = md5($key . $microtime); $etag = self::_hash($response); $cacheData = array('changed' => $microtime, 'etag' => $etag, 'contentLength' => $contentLength, 'content' => $response, 'headers' => apache_response_headers(), 'params' => array()); if (isset($request->three_o_four_cache_opts['store_params'])) { foreach ($request->three_o_four_cache_opts['store_params'] as $k) { if (isset($request->url_params[$k])) { $cacheData['params'][$k] = $request->url_params[$k]; } } } // Optimization for pages cache_set($key, $cacheData); cache_save(); } else { if (isset($request->three_o_four_emit_etag) && $request->three_o_four_emit_etag == true) { $etag = self::_hash($response); } } self::_sendResponse($response, $contentLength, $etag); }
/** * open(host, port); * @return: true if connection was successful, false otherwise */ function open($host, $port) { $conn_status = 1; if (function_exists("cache_assign_key")) { // checkig if we had a successful connection with the same server and the same port // whithin the last GEKKO_REMOTE_TIMEOUT seconds $key = cache_assign_key($host, $port); if (($life = cache_check_life($key)) !== false && time() - $life < GEKKO_REMOTE_CONN_CACHE_LIFE) { // if we had a successful connection we put a 1 in a cached file, this is for // avoiding wasting time trying to connect to a specific server when it is not // responding, we can check it later cache_read($key, $conn_status); } } // trying to connect if the last try was successful of if this is the first if ($conn_status) { $this->socket = @fsockopen($host, $port, $this->errno, $this->errstr, GEKKO_REMOTE_CONN_TIMEOUT); } // saving connection status if (function_exists("cache_save") && $conn_status != $this->status()) { cache_save($key, intval($this->status())); } return $conn_status ? $this->status() : false; }
<? $cachetime = (60*12) * 60; include "cache.php"; cache_check('fikirdegistirenmod'); ?> Çabuk fikir deðiþtirenler ve beðenmeyenler (Modlar diðer entryleri düzenleyebilmektedir): <table border="0"> <?php $sorgu = mysql_query("select updater,count(id) as sayi from mesajciklar group by updater order by sayi desc limit 10"); while ($oku = mysql_fetch_array($sorgu)) { echo "\n <tr>\n <td>{$oku['updater']} - {$oku['sayi']}</td>\n </tr>\n "; } ?> </table> <? cache_save('fikirdegistirenmod'); ?>
<td></td> <p> <?php echo "<table border='0'>"; $cachetime = 60 * 12 * 60; include "cache.php"; cache_check('encokokunan'); $sorgu = mysql_query("select baslik, (hit) as sayi from konucuklar group by baslik order by sayi desc limit 10"); while ($oku = mysql_fetch_array($sorgu)) { echo "\n <tr>\n <td><a href='{$oku['baslik']}.html' target=main>{$oku['baslik']}</a> - {$oku['sayi']} Okuma</td>\n </tr>\n "; } ?> <? cache_save('encokokunan'); ?> </table>
function Menu_show($b) { global $PAGEDATA; if (!$PAGEDATA->id) { return ''; } $md5 = md5('ww_menudisplay|' . print_r($b, true)); $cache = cache_load('menus', $md5); if ($cache) { return $cache; } if (is_array($b)) { $align = isset($b['direction']) && $b['direction'] == 'vertical' ? 'Left' : 'Top'; $vals = $b; } else { $arr = explode('|', $b); $b = $arr[0]; $vals = array(); if (count($arr) > 1) { $d = split(',', $arr[1]); } else { $d = array(); } foreach ($d as $e) { $f = split('=', $e); if (count($f) > 1) { $vals[$f[0]] = $f[1]; } else { $vals[$f[0]] = 1; } } $c = ''; $align = $b == 'vertical' ? 'Left' : 'Top'; } $parent = 0; $classes = ''; if (isset($vals['mode'])) { if ($vals['mode'] == 'accordian' || $vals['mode'] == 'accordion') { $classes .= ' click_required accordion'; } else { if ($vals['mode'] == 'two-tier') { $classes .= ' two-tier'; } } } else { $vals['mode'] = 'default'; } if (isset($vals['preopen_menu'])) { $classes .= ' preopen_menu'; } if (isset($vals['close']) && $vals['close'] == 'no') { $classes .= ' noclose'; } if (isset($vals['parent'])) { $r = Page::getInstanceByName($vals['parent']); if ($r) { $parent = $r->id; } } if (isset($vals['spans'])) { $vals['spans'] = (int) $vals['spans']; } else { $vals['spans'] = 1; } $search_options = 0; $ajaxmenu = $vals['nodropdowns'] ? '' : ' ajaxmenu '; $c = '<div id="ajaxmenu' . $parent . '" class="menuBar' . $align . $ajaxmenu . $classes . ' parent' . $parent . '">'; $rs = Menu_getChildren($parent, $PAGEDATA->id, 0, $parent, $search_options); $links = 0; if ($vals['spans']) { $spanl = '<span class="l"></span>'; $spanr = '<span class="r"></span>'; } else { $spanl = ''; $spanr = ''; } if (count($rs)) { foreach ($rs as $r) { $page = Page::getInstance($r['id']); if (!$links) { $r['classes'] .= ' first'; } $c .= '<a id="ajaxmenu_link' . $r['id'] . '" class="' . $r['classes'] . '" href="' . $page->getRelativeURL() . '">' . $spanl . htmlspecialchars($page->name) . $spanr . '</a>'; $links++; } } if (!@$GLOBALS['DBVARS']['disable-hidden-sitemap']) { $c .= '<a class="menuItemTop nojs" href="' . $PAGEDATA->getRelativeURL() . '?webmespecial=sitemap">' . __('Site Map') . '</a>'; } $c .= '</div>'; if ($vals['mode'] == 'two-tier') { $pid = $PAGEDATA->getTopParentId(); if ($pid != 2 && $pid != 3 && $pid != 17 && $pid != 32 && $pid != 33 && $pid != 34) { $pid = 2; } $rs = Menu_getChildren($pid, $PAGEDATA->id, 0, $parent, $search_options); $c .= '<div id="ajaxmenu' . $pid . '" class="menu tier-two">'; if (count($rs)) { foreach ($rs as $r) { $page = Page::getInstance($r['id']); $c .= '<a id="ajaxmenu_link' . $r['id'] . '" class="' . $r['classes'] . '" href="' . $page->getRelativeURL() . '">' . $spanl . htmlspecialchars($page->name) . $spanr . '</a>'; } } else { $c .= '<a><span class="l"></span> <span class="r"></span></a>'; } $c .= '</div>'; } cache_save('menus', $md5, $c); return $c; }
<td>En Fazla + (hos) Oy'a Sahip Yazarlar:</td> <p> <?php echo "<table border='0'>"; $cachetime = 60 * 12 * 60; include "cache.php"; cache_check('enfazlahos'); $sorgu = mysql_query("select entry_sahibi,count(id) as sayi from oylar where oy='1' group by entry_sahibi order by sayi desc limit 10"); while ($oku = mysql_fetch_array($sorgu)) { echo "\n <tr>\n <td><a href='sozluk.php?process=word&q={$oku['entry_sahibi']}' target=main>{$oku['entry_sahibi']}</a> : {$oku['sayi']} oy</td>\n </tr>\n "; } echo "</table>"; ?> <? cache_save('enfazlhos'); ?>
<? $cachetime = (5*60) * 1; include "cache.php"; cache_check('duyuru'); ?> Duyduk duymadýk demeyenler: <br> <table border="0"> <?php $sorgu = mysql_query("select yazar,count(id) as sayi from haberler group by yazar order by sayi desc limit 10"); while ($oku = mysql_fetch_array($sorgu)) { echo "\n <tr>\n <td>{$oku['yazar']} - {$oku['sayi']}</td>\n </tr>\n "; } ?> </table> <? cache_save('duyuru'); ?>
<? $cachetime = (30*60) * 1; include "cache.php"; cache_check('bugungelenler'); ?> <td>Bugün bu bataga düþenler</td> <p> <table border="0" width="100%"> <?php $today = date("Y/m/d"); $sorgu = mysql_query("select nick from user where regtarih='{$today}%' group by nick desc limit 10"); while ($oku = mysql_fetch_array($sorgu)) { echo "<tr>\n <td><a href='sozluk.php?process=word&q={$oku['nick']}' tarhet=main>{$oku['nick']}</a></td>\n <td>"; } ?> <? cache_save('bugungelenler'); ?>
include "cache.php"; cache_check('yazarayx'); ?> <table border="0" width="60%"> <? $sorgu=mysql_query("select entry_sahibi,count(id) as sayi from oylar where oy='1' group by entry_sahibi order by sayý desc limit 0,10"); $toplam=mysql_num_rows(mysql_query("select entry_sahibi from oylar ")); ?> <tr> <td nowrap>toplam</td><td nowrap width="100%"><div class=highlight style='text-align:right; width:100%'><?php echo $toplam; ?> </td> </tr> <? $say=0; while ($oku=mysql_fetch_array($sorgu)) { $say++; $oran=$toplam/$oku['sayi']; $yoran=100/$oran; $kes=substr($yoran,0,1); echo "<tr> <td nowrap>$say. <a href='sozluk.php?process=word&q=$oku[entry_sahibi]' target=main>$oku[entry_sahibi]</a></td><td nowrap width='100%'><div class=highlight style='text-align:right; width:$kes%'>$oku[sayi]</td> <td>"; } ?> </table> <? cache_save('yazarayx'); ?>
function forum_latest_posts_cache($options = array()) { $posts = discussion_forum_post_fetch(array('threads_only' => 'true', 'limit' => 10, 'url_lookup' => true, 'order-by' => 'p.last_post', 'order-direction' => 'DESC', 'min_quality_level' => 2, 'max_userlevel_read' => 1)); cache_save('latest_forum_posts', $posts); }
<? $cachetime = (10*60) * 1; include "cache.php"; cache_check('saatista'); ?> <td width="100%">hangi saatlerde entry girilmiþ:</td><p> <table border="0" width="100%"> <? $sorgu=mysql_query("select saat,count(id) as sayi from mesajlar group by saat order by sayi desc limit 0,10"); $toplam=mysql_num_rows(mysql_query("select id from user")); ?> <? $say=0; while ($oku=mysql_fetch_array($sorgu)) { $say++; $oran=$toplam/$oku['sayi']; $yoran=100/$oran; echo "<tr> <td>$say. <a href='sozluk.php?process=word&q=$oku[saat]' target=main>$oku[saat]</a>($oku[sayi])</td> <td>"; } ?> </table> <? cache_save('saatista'); ?>
<?php $query = 'SELECT id, type, label, timestamp, url FROM recent_updates WHERE timestamp > ' . (time() - 900) . ' ORDER BY id DESC LIMIT 1'; $result = mysql_query($query); if (mysql_num_rows($result) == 1) { $data = mysql_fetch_assoc($result); cache_save('recent_update', $data); }
imagesavealpha($imgThumb, true); // save alphablending setting (important) } // Copy ImageSrc to ImageThumb if ($thLowquality) { $image_isCopied = imagecopyresized ( $imgThumb, $imgSrc, 0, 0, $offset_left, $offset_top, $imgnWidth, $imgnHeight, $imgoWidth, $imgoHeight ); } if (!$thLowquality) { $image_isCopied = imagecopyresampled ( $imgThumb, $imgSrc, 0, 0, $offset_left, $offset_top, $imgnWidth, $imgnHeight, $imgoWidth, $imgoHeight ); } $str = "imagecopyresized ( imgThumb, imgSrc, 0, 0, $offset_left, $offset_top, $imgnWidth, $imgnHeight, $imgoWidth, $imgoHeight );"; //error($str); if (!$image_isCopied) { error("ImageCopy() Failed!\n$php_errormsg"); } // Save Cache if ($cfg["cacheEnabled"]) { $imgCache = cache_save($realImgFile, $imgThumb, $thWidth, $thHeight); } // Header header("Content-Disposition: filename=\"{$imgName}\""); // Output Thumb switch(strtolower($imgSrcExtension)) { case "jpg": case "jpeg": header("Content-type: image/jpeg"); imagejpeg($imgThumb, NULL, $thQuality); if ($imgCache) { imagejpeg($imgThumb, $imgCache, $thQuality); } break;
foreach ($files as $f) { $mt = is_array($f) ? filemtime($f[0]) : filemtime($f); if ($mt > $latest) { $latest = $mt; } } $name = md5($name); if (file_exists(USERBASE . '/ww.cache/c/css-' . $name) && filemtime(USERBASE . '/ww.cache/c/css-' . $name) < $latest) { unlink(USERBASE . '/ww.cache/c/css-' . $name); } $css_code = false; //cache_load('c','css-'.$name); if ($css_code == false) { $css_code = ''; require 'Minify/CSS.php'; foreach ($files as $f) { if (is_array($f)) { $css_code .= Minify_CSS::minify(file_get_contents($f[0]), array('prependRelativePath' => preg_replace('/[^\\/]*$/', '', $f[1]))); } else { $css_code .= Minify_CSS::minify(file_get_contents($f)); } } cache_save('c', 'css-' . $name, $css_code); } header('Content-type: text/css; charset=utf-8'); header('Cache-Control: max-age = 2592000'); header('Expires-Active: On'); header('Expires: Fri, 1 Jan 2500 01:01:01 GMT'); header('Pragma:'); header('Content-Length: ' . strlen($css_code)); echo $css_code;
/** * Проверка свежести курса и возвращение его значения * * @param array $params * @return double */ function getKurs(&$params) { $kurs = sql_getValue('SELECT value FROM currencies WHERE name="USD"'); $cache_name = 'currencies'; // Проверка - если менялся курс, надо обновить все цены if (!cache_table_test($cache_name, array('currencies'), true) && $kurs > 0) { $sql = 'UPDATE objects SET price_dollar = price_rub / ' . $kurs . ', price_dollar_print = price_rub_print / ' . $kurs; sql_query($sql); $sql = 'UPDATE obj_elem_free SET price_metr = price / ' . $kurs; sql_query($sql); cache_save($cache_name, '', true); } return $kurs; }
<? $cachetime = (60*12) * 60; include "cache.php"; cache_check('encokmesajlasanlar'); ?> Sosyallesme top 10:<br> <small>(yemeyip, içmeyip mesajlasanlar)</small> <p> <table border="0"> <?php $sorgu = mysql_query("select gonderen,count(id) as sayi from privmsg group by gonderen order by sayi desc limit 10"); while ($oku = mysql_fetch_array($sorgu)) { echo "<tr>\n <td>{$say}. <a href='sozluk.php?process=word&q={$oku['gonderen']}' tarhet=main>{$oku['gonderen']}</a> - {$oku['sayi']}</td>\n <td>"; } ?> </table> <? cache_save('encokmesajlasanlar'); ?>
<? $cachetime = (60*12) * 60; include "cache.php"; cache_check('enpopbolum'); ?> En fazla okunan bölümler:<p> <table border="0"> <? $sorgu=mysql_query("select bolum,count(id) as sayi from user group by bolum order by sayi desc limit 0,10"); while ($oku=mysql_fetch_array($sorgu)) { echo " <tr> <td>$oku[bolum] - $oku[sayi] kiþi</td> </tr> "; } echo "</table>"; ?> <? cache_save('enpopbolum'); ?>
<td>En Faz + (hos) Oyu Veren Yazarlar (Cömertler): </td> <p> <?php echo "<table border='0'>"; $cachetime = 60 * 12 * 60; include "cache.php"; cache_check('enfazlahosveren'); $sorgu = mysql_query("select nick,count(id) as sayi from oylar where oy='1' group by nick order by sayi desc limit 10"); while ($oku = mysql_fetch_array($sorgu)) { echo "\n <tr>\n<td><a href='sozluk.php?process=word&q={$oku['nick']}' target=main>{$oku['nick']}</a> : {$oku['sayi']} oy</td>\n </tr>\n "; } echo "</table>"; ?> <? cache_save('enfazlahosveren'); ?>
<? $cachetime = (60*12) * 60; include "cache.php"; cache_check('endaginik'); ?> En daðýnýk, en üþengeç, en pasaklý yazarlar: <table border="0"> <?php $sorgu = mysql_query("select kime,count(id) as sayi from privmsg group by kime order by sayi desc limit 10"); while ($oku = mysql_fetch_array($sorgu)) { echo "\n <tr>\n <td>{$oku['kime']} - {$oku['sayi']}</td>\n </tr>\n "; } ?> </table> <? cache_save('endaginik'); ?>
function getDistricsAndCities() { // используем кеширование для более быстрой генерации списка $my_cache_name = "districs_and_cities_list"; if (!cache_table_test($my_cache_name, array('obj_locat_districts'), true)) { //Получим все МО $districs_mo = sql_getRows("SELECT id, name FROM `obj_locat_districts` WHERE pid='" . MO_DISTRICS . "' AND coordinat<>'' ORDER BY name", true); //Получим все города МО $ids_mo = ""; foreach ($districs_mo as $key => $value) { $ids_mo .= $key . ","; } $ids_mo = substr($ids_mo, 0, -1); if ($ids_mo) { $ret['cities_mo'] = sql_getRows("SELECT id, name, pid FROM `obj_locat_districts` WHERE pid in (" . $ids_mo . ") ORDER BY pid, name", true); } $new_cities = array(); foreach ($ret['cities_mo'] as $key => $value) { foreach ($ret['cities_mo'] as $k => $v) { if ($value['pid'] == $v['pid'] && !in_array($k, $new_cities[$value['pid']])) { $new_cities[$value['pid']][$k] = $v; } } } $all_districs = array(); foreach ($districs_mo as $key => $value) { $all_districs[$key] = $value; if (isset($new_cities[$key])) { foreach ($new_cities[$key] as $val) { $all_districs[$val['id']] = "--" . $val['name']; } } } cache_save($my_cache_name, serialize($all_districs), true); } else { $all_districs = unserialize(cache_get($my_cache_name, true)); } return $all_districs; }
<a href="sozluk.php?process=cp&tema=defaultgri">default gri</a> | <a href="sozluk.php?process=cp&tema=defaultlila">default lila</a> | <a href="sozluk.php?process=cp&tema=bayrak">bayrak</a> | <a href="sozluk.php?process=cp&tema=simsiyah">simsiyah</a> | <a href="sozluk.php?process=cp&tema=cokpis">çok pis</a> | <a href="sozluk.php?process=cp&tema=absolute">absolute</a> | <a href="sozluk.php?process=cp&tema=simpsons2">simpsons2</a> | <a href="sozluk.php?process=cp&tema=simpsons">simpsons</a> | <a href="sozluk.php?process=cp&tema=toa">toa</a> | <a href="sozluk.php?process=cp&tema=wall">Wall</a> | <a href="sozluk.php?process=cp&tema=metallica">metallica</a> | <a href="sozluk.php?process=cp&tema=comodore64">comodore64</a> | <a href="sozluk.php?process=cp&tema=gecegorusu">gecegorusu</a> | <a href="sozluk.php?process=cp&tema=ledzeppelin">ledzeppelin</a> | <a href="sozluk.php?process=cp&tema=yigitozgur">yigitozgur</a> | <a href="sozluk.php?process=cp&tema=evanescence">evanescence</a> | <a href="sozluk.php?process=cp&tema=dragon">dragon</a> | <a href="sozluk.php?process=cp&tema=cogitonair">cogitonair</a> | <a href="sozluk.php?process=cp&tema=lost">LOST</a> | <a href="sozluk.php?process=cp&tema=barisakarsu">Barýþ Akarsu</a> | <a href="sozluk.php?process=cp&tema=kata">kata</a></td> </tr> </table> </FIELDSET> </TD> </TR></TBODY></TABLE> </BODY></HTML> <? cache_save('onlinespanel'); ?>
function schedule_releases_do($options) { /* option array support comment item_id yes type yes release_after no */ //trace('schedule', 'Init'); $options['release_before'] = time(); $options['released'] = 0; $events = schedule_event_fetch($options); foreach ($events as $event) { //trace('schedule', 'Releasing ' . $event['type']); $data = unserialize($event['data']); switch ($event['type']) { case 'todays_discussion': trace('todays_discussion_break', 'Tried to release todays_discussion in ' . __FILE__ . ' on line ' . __LINE__); break; case 'contest': contests_create($data); $url = '/taevlingar/'; $label = $data['title']; break; case 'poll': $poll_handle = poll_create($data); $poll = poll_fetch(array('handle' => $poll_handle)); $post['content'] = '[poll:' . $poll[0]['id'] . ']'; $post['forum_id'] = 78; $post['title'] = 'Undersökning: ' . $poll[0]['question']; $post['mode'] = 'new_thread'; $post['author'] = 2348; // Webmaster $thread_id = discussion_forum_post_create($post); $comment_url = forum_get_url_by_post($thread_id); $query = 'UPDATE poll SET comment_url = "' . $comment_url . '" WHERE id = "' . $poll[0]['id'] . '"'; mysql_query($query); $url = '/index.php#poll'; $label = $data['question']; break; /* Old sex and sense case 'sex_sense': $entry_id = sex_sense_create($data); $entry = sex_sense_fetch(array('id' => $entry_id)); $url = '/sex_och_sinne/' . $entry[0]['category'] . '/' . $entry[0]['handle'] . '.html'; $label = $entry[0]['title']; break;*/ /* Old sex and sense case 'sex_sense': $entry_id = sex_sense_create($data); $entry = sex_sense_fetch(array('id' => $entry_id)); $url = '/sex_och_sinne/' . $entry[0]['category'] . '/' . $entry[0]['handle'] . '.html'; $label = $entry[0]['title']; break;*/ case 'sex_sense': try { $entries = sex_sense_fetch_posts($data['fetch_item_options']); if (count($entries) != 1) { throw new Exception('Fel 1 i schedule_releae! Base64(serialize): ' . base64_encode(serialize($data))); } $entry = array_pop($entries); $query = 'UPDATE sex_questions SET is_released = 1 WHERE id = ' . $entry['id']; $label = $entry['title']; $url = '/sex_och_sinne/'; $categories = sex_sense_fetch_categories(array('category_id' => $entry['category_id'])); foreach ($categories as $category_tree) { $category = array_pop($category_tree); $url .= $category['category_handle'] . '/'; } $url .= $entry['handle'] . '.html'; // Forum thread creation (main thread) unset($thread); $thread['author'] = '876354'; $thread['title'] = $entry['title']; $thread['mode'] = 'new_thread'; $thread['forum_id'] = '102'; $thread['content'] = $entry['question']; $thread_id = discussion_forum_post_create($thread); $query = 'UPDATE sex_questions SET forum_post_id = ' . $thread_id . ', is_released = 1 WHERE id = ' . $entry['id']; mysql_query($query) or report_sql_error($query, __FILE__, __LINE__); // Create forum posts and guestbook notifications for all answers. sex_sense_answer_distribute(array('post_id' => $entry['id'])); } catch (Exception $error) { trace('sex_sense_schedule', $error->getMessage()); } break; case 'music_guess': $query = 'INSERT INTO music_guess_songs (secret_id, artist, song, alternate_spellings, timestamp, artist_score, song_score)' . "\n"; $query .= ' VALUES("' . $data['secret_id'] . '", "' . $data['artist'] . '", "' . $data['song'] . '", "' . addslashes(serialize($data['alternate_spellings'])) . '", "' . time() . '", "' . $data['artist_score'] . '", "' . $data['song_score'] . '")'; mysql_query($query) or trace('sql_error', $query . ' ' . mysql_error()); $url = '/mattan/gissa_laaten.php'; $label = 'Ny låt!'; break; case 'survey': survey_create($data); $survey = survey_fetch(array('type' => 'front_page')); cache_save('fp_survey', $survey); $url = '/index.php#survey'; $label = $data['question']; break; case 'new_image': case 'new_clip': case 'new_flash': case 'new_background': case 'new_software': case 'new_prank': case 'new_music': case 'new_game': $url = $data['url']; $label = $data['title']; break; } $query = 'INSERT INTO recent_updates (type, label, timestamp, url)' . ' VALUES("' . $event['type'] . '", "' . $label . '", "' . $event['release'] . '", "' . $url . '")'; $query . '<br />'; if (!mysql_query($query)) { report_sql_error($query, __FILE__, __LINE__); } else { $query = 'UPDATE scheduled_events SET released = 1 WHERE id="' . $event['id'] . '"'; if (!mysql_query($query)) { report_sql_error($query, __FILE__, __LINE__); } else { log_to_file('scheduled_events', LOGLEVEL_INFO, __FILE__, __LINE__, 'released ' . $event['type'] . ' id: ' . $event['id'] . ' ' . date('Y-m-d H:i', $release)); } } } }
<p><strong>En kötü 10 entry:</strong></p> <? $cachetime = (60*12) * 60; include "cache.php"; cache_check('enkotuentryler'); $sorgu=mysql_query("select entry_id,count(entry_id) as sayi from oylar where oy='0' group by entry_id order by sayi desc limit 0,10"); $kac=0; while($oku=mysql_fetch_array($sorgu)) { $kac++; $id=$oku['entry_id']; $say=$oku['sayi']; echo "<p><td>$kac. <a href='sozluk.php?process=eid&eid=$oku[entry_id]' target='main'>#$oku[entry_id]</a> ($say oy)</td></tr>"; } ?> <? cache_save('enkotuentryler'); ?>
<td>"; } } ?></font></p> </div> <div align="center"> <p><strong>Gammazlar</strong></p> <p><font color="#00FF00"> <? $sorgu = "SELECT nick,durum,email,id,isim FROM user WHERE `yetki` = 'gammaz'"; $sorgulama = @mysql_query($sorgu); if (@mysql_num_rows($sorgulama)>0){ while ($kayit=@mysql_fetch_assoc($sorgulama)){ echo "<tr> <td nowrap><div><strong><em><a href='$kayit[nick].html' target=main>$kayit[nick]</a></em></strong></div></td> <td>"; } } ?></font></p> </div> </table> <? cache_save('idarikadro'); ?>
ui_bottom(); exit; } ui_top($ui_options); if (isset($_GET['filename'])) { $module_save_path = realpath(PATHS_DYNAMIC_CONTENT . 'fp_modules/') . '/'; if (!file_exists($module_save_path . $_GET['filename']) || strncmp(realpath($module_save_path . $_GET['filename']), $module_save_path, strlen($module_save_path)) != 0) { echo 'Tjockis!'; ui_bottom(); exit; } if (isset($_POST['code'])) { $module['display'] = $_POST['display'] == 1 ? 1 : 0; $module['phpenabled'] = $_POST['phpenabled'] == 1 ? 1 : 0; $module['stylesheets'] = explode(' ', $_POST['stylesheets']); cache_save('fp_module_' . $_GET['filename'], $module); $code = stripslashes(html_entity_decode($_POST['code'])); file_put_contents(PATHS_DYNAMIC_CONTENT . 'fp_modules/' . $_GET['filename'], $code); $output .= '<h1>Sparat! - <a href="/site_admin/fp_module_rearrange.php">sortera moduler</a></h1>'; } $module = cache_load('fp_module_' . $_GET['filename']); $module['display'] = $module['display'] == 1 ? ' checked="true"' : ''; $module['phpenabled'] = $module['phpenabled'] == 1 ? ' checked="true"' : ''; $module['code'] = file_get_contents(PATHS_DYNAMIC_CONTENT . 'fp_modules/' . $_GET['filename']); $output .= '<form method="post">' . "\n"; $output .= '<input name="display" type="checkbox"' . $module['display'] . ' id="view_control" value="1" /><label for="view_control">Visa på förstasidan</label><br />'; $output .= '<input name="phpenabled" type="checkbox"' . $module['phpenabled'] . ' id="php_control" value="1" /><label for="php_control">Kör som PHP-fil (script = kryssa, enkel HTML = kryssa inte)</label><br />'; $output .= '<br /><label>CSS-filer (ange bara filnamn, inklusive filändelse, separera med mellanslag)<br /><strong>Stilmallarna ska ligga i stylesheets/fp_modules/</strong> Lef kommer att ge dig spö annars. Srsly. Den mappen är gitignorad. Sedan hämtas stilmallen med fp_modules/stilmallsnamn.css</label><br />' . "\n"; $output .= '<input type="text" name="stylesheets" style="width: 600px;" value="' . implode(' ', $module['stylesheets']) . '" /><br />'; $output .= '<textarea name="code" style="width: 630px; height: 500px; font-size: 11px;">' . htmlspecialchars($module['code']) . '</textarea>' . "\n"; $output .= '<input type="submit" value="Spara" />' . "\n";
<?php include_partial('relationship/header', array('relationship' => $relationship, 'show_actions' => true)); ?> <?php include_partial('relationship/rightcol', array('relationship' => $relationship)); ?> <?php if (!cache('main', 86400)) { ?> <div class="relationship-main"> <?php include_partial('relationship/' . strtolower(RelationshipCategoryTable::getNameById($relationship['category_id'])) . 'view', array('relationship' => $relationship, 'current' => $current)); ?> </div> <?php cache_save(); }
<? $cachetime = (60*12) * 60; include "cache.php"; cache_check('bugunyazan'); ?> <td>Günün çalýþkan yazarlarý:</td> <p> <table border="0" width="100%"> <? $bugun=date("d"); $ay=date("m"); $yil=date("Y"); $sorgu=mysql_query("select yazar,count(id) as sayi from mesajciklar gun='$bugun' and ay='$ay' and yil='$yil' group by yazar order by sayi desc limit 10"); while ($oku=mysql_fetch_array($sorgu)) { echo " <tr> <td>$oku[yazar] - $oku[sayi]</td> </tr> "; } ?> <? cache_save('bugunyazan'); ?>
<? $cachetime = (10*60) * 1; include "cache.php"; cache_check('eforgun'); ?> <? $toplam=mysql_query("select id from mesajciklar order by id desc limit 1"); $id=mysql_result($toplam,0,'id'); $sorgu=mysql_query("select gun,ay,yil,count(id) as sayi from mesajciklar group by gun,ay,yil order by sayi desc limit 0,100"); ?> <table border="0"> <tr> <td colspan=2>en çok erfor sarfedilen günler</td> </tr> <? $say=0; while ($oku=mysql_fetch_array($sorgu)) { $say++; $oran=$id/$oku[sayi]; $oran=100/$oran; $oran=$oran*25; $oran=ceil($oran); $format=number_format($oku[sayi]); echo "<tr><td nowrap>$say. <a href='sozluk.php?process=word&q=$oku[gun]' target='main'>$oku[gun]</a>.<a href='sozluk.php?process=word&q=$oku[ay]' target='main'>$oku[ay]</a>.<a href='sozluk.php?process=word&q=$oku[yil]' target='main'>$oku[yil]</a></td><td nowrap width='100%'><div class=highlight style='text-align:right; width:$oran%'>$format</td></tr>"; } ?> </table> <? cache_save('eforgun'); ?>
<?php require '../include/core/common.php'; require_once PATHS_LIBRARIES . 'schedule.lib.php'; $ui_options['menu_path'] = array('admin', 'registrering'); if (!is_privilegied('register_suspend_admin')) { header('location: /'); die; } ui_top($ui_options); if (isset($_POST)) { cache_save('register_suspend', $_POST['reg_status']); } $reg_status = cache_load('register_suspend'); if ($reg_status == 'disabled') { echo '<h1>Användarregistreringen är avstängd</h1>' . "\n"; } else { echo '<h1>Användarregistreringen är aktiv</h1>' . "\n"; } echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n"; echo '<input type="submit" value="disabled" name="reg_status" />' . "\n"; echo '<input type="submit" value="enabled" name="reg_status" />' . "\n"; echo '</form>' . "\n"; ui_bottom();