function create_music($params) { $limit = 50; if (array_key_exists('limit', $params)) { $limit = $params['limit']; } $res = ''; $query = sprintf('SELECT id,title,track,artist,album,comment,year,genre,filename,date FROM TbMsHearing ORDER BY date DESC LIMIT %s', $limit); $result = my_mysql_query($query); $res .= multi_accordion_start(); while ($row = $result->fetch_assoc()) { $header = $row['title'] . ' / ' . $row['album'] . ' / ' . $row['artist']; $body = ''; $body .= '<ul>'; $body .= '<li>id: ' . $row['id'] . '</li>'; $body .= '<li>title: ' . $row['title'] . '</li>'; $body .= '<li>track: ' . $row['track'] . '</li>'; $body .= '<li>artist: ' . $row['artist'] . '</li>'; $body .= '<li>album: ' . $row['album'] . '</li>'; $body .= '<li>comment: ' . $row['comment'] . '</li>'; $body .= '<li>year: ' . $row['year'] . '</li>'; $body .= '<li>genre: ' . $row['genre'] . '</li>'; $body .= '<li>filename: ' . $row['filename'] . '</li>'; $body .= '<li>date: ' . $row['date'] . '</li>'; $body .= '</ul>'; $res .= multi_accordion_entry($header, $body); } my_mysql_free_result($result); $res .= multi_accordion_end(); return $res; }
function has_child($id) { //$query = "select count(*) from collections where parent_id=$id"; $query = select_query("count(*)", "collections", "parent_id={$id}"); $rs = my_mysql_query($query); $row = my_mysql_fetch_array($rs); return $row[0] > 0 ? true : false; }
function create_certification($params) { $res = ''; // sending query $query = sprintf('SELECT id,name,slug,url,imageId,fromDate FROM TbOrganization where funcCertification order by name asc'); $result = my_mysql_query($query); $res .= get_start_table(); $res .= '<tr>'; $res .= '<td style=\'width:20%\'>type of certification</td>'; $res .= '<td style=\'width:80%\'>date from which I am certified</td>'; $res .= '<td style=\'width:20%\'>image</td>'; $res .= '</tr>'; // printing table rows while ($row = $result->fetch_assoc()) { $id = $row['id']; $name = $row['name']; $slug = $row['slug']; $url = $row['url']; $fromDate = $row['fromDate']; $imageId = $row['imageId']; $link_img = link_to_direct('GetBlob.php?table=TbImage&select_field=id&select_id=' . $imageId . '&data_field=smallData&name_field=slug&mime_field=smallMime'); $res .= '</tr>'; $res .= '<td><a href=\'' . $url . '\'>' . $name . '</a></td>'; $res .= '<td>' . $fromDate . '</td>'; $res .= '<td><img src=\'' . $link_img . '\'/></td>'; $res .= '</tr>'; } $result->free(); $res .= '</table>'; return $res; }
<?php require 'utils.php'; utils_init(); $debug = 0; if ($debug) { print_r($_POST) . "\n"; } # parameters for this script... $p_workId = my_get_post_or_null('workId'); $p_typeId = my_get_post_or_null('typeId'); $p_organizationId = my_get_post_or_null('organizationId'); my_mysql_start_transaction(); $query = sprintf('insert into TbWkWorkContrib (workId,typeId,organizationId) values(%s,%s,%s)', my_mysql_real_escape_string($p_workId), my_mysql_real_escape_string($p_typeId), my_mysql_real_escape_string($p_organizationId)); my_mysql_query($query); $p_id = my_mysql_insert_id(); my_mysql_commit(); echo 'new record successfully inserted with id [' . $p_id . ']';
function make_table($query, $desc) { $result = my_mysql_query($query); $res = ''; $res .= '<a title="' . $query . '">' . $desc . '</a>'; $res .= '<table><tbody>'; $first = true; while ($row = $result->fetch_assoc()) { if ($first) { $res .= '<tr>'; # iterate the result and print the headers... foreach ($row as $k => $v) { $res .= '<td>' . $k . '</td>'; } $first = false; $res .= '</tr>'; } $res .= '<tr>'; # iterate the result and print the content foreach ($row as $k => $v) { $res .= '<td>' . $v . '</td>'; } $res .= '</tr>'; } $res .= '</tbody></table>'; $res .= '<br/>'; my_mysql_free_result($result); return $res; }
} } if ($twit === null) { send($sock, "PRIVMSG {$nick} :Name/Password Error!"); } else { if ($twit->numChans() > 10) { send($sock, "PRIVMSG {$nick} :You can have a maximum of 10 channels"); } else { if ($twit->isChan($words[3])) { send($sock, "PRIVMSG {$nick} :Duplicate channel {$words[3]}"); } else { // Check user is op on chan $nSql = mysql_real_escape_string($nick); $cSql = mysql_real_escape_string(strtolower($words[3])); $sql = "SELECT COUNT(*) AS `cnt` FROM chan c INNER JOIN ison i ON c.chanid=i.chanid INNER JOIN user u ON u.nickid=i.nickid WHERE (u.nick='{$nSql}' AND c.channel='{$cSql}' AND ((i.mode_la = 'Y' OR i.mode_lo = 'Y' OR i.mode_lq = 'Y') OR (u.mode_lo = 'Y')))"; $result = my_mysql_query($sql); $line = mysql_fetch_assoc($result); if ($line['cnt'] > 0) { $twit->addChan($words[3]); $twit->save(SAVE_DIR . "/{$twit->name}.save"); send($sock, "JOIN {$words[3]}"); send($sock, "PRIVMSG {$nick} :Channel {$words[3]} added"); } else { send($sock, "PRIVMSG {$nick} :You are not an op in {$words[3]}"); } } } } } break; case 'delchan':
<?php // url to use this script: // http://veltzer.net/~mark/php/pages/GetBlob.php?table=TbMsLilypond&id=5&field=pdf&type=application/pdf&name_field=filebasename require 'setup.php'; my_include('src/utils.php'); $p_slug = $_GET['slug']; $debug = 0; my_mysql_connect(); $query = sprintf('SELECT id,name,slug,mime,data FROM TbRsBlob where slug="%s"', $p_slug); if ($debug == 1) { echo $query . '<br/>'; } $result = my_mysql_query($query); # make sure we really have a result assert($result); # we should only get one result... assert(mysql_num_rows($result) == 1); $row = $result->fetch_assoc(); $r_id = $row['id']; $r_name = $row['name']; $r_slug = $row['slug']; $r_mime = $row['mime']; $r_data = $row['data']; # You can see more HTTP headers that may improve stuff in # http://en.wikipedia.org/wiki/List_of_HTTP_headers # ideas are: Content-MD5, Content-Length, Last-Modified # if you want to debug HTTP headers just use wget -S on the # command line and compared the headers that you are generating # with the headers that a regular content generates by using # the web server...
function create_lilypond($params) { $res = ''; // sending query $query = sprintf('SELECT id,uuid,title,subtitle,composer,poet,style,piece,copyright,pages,idyoutube,epdfs FROM TbMsLilypond order by title asc'); $result = my_mysql_query($query); $res .= multi_accordion_start(); while ($row = $result->fetch_assoc()) { $id = $row['id']; $s_uuid = $row['uuid']; $s_title = val_or_na($row['title']); $s_subtitle = val_or_na($row['subtitle']); $s_composer = val_or_na($row['composer']); $s_poet = val_or_na($row['poet']); $s_style = val_or_na($row['style']); $s_piece = val_or_na($row['piece']); $s_copyright = val_or_na($row['copyright']); $s_pages = val_or_na($row['pages']); $s_epdfs = val_or_na($row['epdfs']); $link_ly = link_to_direct('GetRsBlob.php?slug=' . $s_uuid . '-ly'); $link_pdf = link_to_direct('GetRsBlob.php?slug=' . $s_uuid . '-pdf'); $link_ps = link_to_direct('GetRsBlob.php?slug=' . $s_uuid . '-ps'); $link_midi = link_to_direct('GetRsBlob.php?slug=' . $s_uuid . '-midi'); $link_wav = link_to_direct('GetRsBlob.php?slug=' . $s_uuid . '-wav'); $link_mp3 = link_to_direct('GetRsBlob.php?slug=' . $s_uuid . '-mp3'); $link_ogg = link_to_direct('GetRsBlob.php?slug=' . $s_uuid . '-ogg'); $s_a_ly = '<a href=' . $link_ly . '>ly</a>'; $s_a_pdf = '<a href=' . $link_pdf . '>pdf</a>'; $s_a_ps = '<a href=' . $link_ps . '>ps</a>'; $s_a_midi = '<a href=' . $link_midi . '>midi</a>'; $s_a_wav = '<a href=' . $link_wav . '>wav</a>'; $s_a_mp3 = '<a href=' . $link_mp3 . '>mp3</a>'; $s_a_ogg = '<a href=' . $link_ogg . '>ogg</a>'; $s_idyoutube = $row['idyoutube']; $header = $s_title; if ($row['composer'] != NULL) { $header .= ' / ' . $s_composer; } if ($row['poet'] != NULL && $s_poet != $s_composer) { $header .= ', ' . $s_poet; } $body = ''; $body .= '<ul>'; if ($row['id'] != NULL) { $body .= '<li>id: ' . $id . '</li>'; } if ($row['title'] != NULL) { $body .= '<li>title: ' . $s_title . '</li>'; } if ($row['subtitle'] != NULL) { $body .= '<li>subtitle: ' . $s_subtitle . '</li>'; } if ($row['composer'] != NULL) { $body .= '<li>composer: ' . $s_composer . '</li>'; } if ($row['poet'] != NULL) { $body .= '<li>poet: ' . $s_poet . '</li>'; } if ($row['style'] != NULL) { $body .= '<li>style: ' . $s_style . '</li>'; } if ($row['piece'] != NULL) { $body .= '<li>piece: ' . $s_piece . '</li>'; } if ($row['copyright'] != NULL) { $body .= '<li>copyright: ' . $s_copyright . '</li>'; } if ($row['pages'] != NULL) { $body .= '<li>pages: ' . $s_pages . '</li>'; } if ($row['epdfs'] != NULL) { $body .= '<li>epdfs: ' . $s_epdfs . '</li>'; } $links = array(); # TODO: only add the links if I have the blobs... array_push($links, $s_a_ly); array_push($links, $s_a_pdf); array_push($links, $s_a_ps); array_push($links, $s_a_midi); array_push($links, $s_a_wav); array_push($links, $s_a_mp3); array_push($links, $s_a_ogg); # lets look and add links to the pngs... for ($i = 0; $i < $s_pages; $i++) { $j = $i + 1; $link = link_to_direct('GetRsBlob.php?slug=' . $s_uuid . '-png' . $j); $link = '<a href=\'' . $link . '\'>png' . $j . '</a>'; array_push($links, $link); } for ($i = 0; $i < $s_epdfs; $i++) { $link = link_to_direct('GetRsBlob.php?slug=' . $s_uuid . '-epdf' . $i); $link = '<a href=\'' . $link . '\'>epdf' . $i . '</a>'; array_push($links, $link); } $body .= '<li>links: ' . join(', ', $links) . '</li>'; $body .= '<li>uuid: ' . $s_uuid . '</li>'; $body .= '</ul>'; # lets put a link to play the audio, currently it looks like the # audio plugin can only play mp3 so that's the only link that we # put... $body .= 'You can play the automatically generated mp3 file here...<br/>'; $body .= get_audio_player($link_mp3, $row['title'], $row['composer'], $row['poet']); if ($row['idyoutube'] != NULL) { $body .= 'Here is a youtube performance of this song that I like...<br/>'; $body .= embed_youtube($s_idyoutube, 0.5); } $res .= multi_accordion_entry($header, $body); } my_mysql_free_result($result); $res .= multi_accordion_end(); return $res; }
function create_mvlog($v_schema_name, $v_table_name) { $v_done = FALSE; $v_column_name = NULL; $v_data_type = NULL; $v_sql = NULL; $cursor_sql = "SELECT COLUMN_NAME, IF(COLUMN_TYPE='TIMESTAMP', 'TIMESTAMP', COLUMN_TYPE) COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='{$v_table_name}' AND TABLE_SCHEMA = '{$v_schema_name}'"; $cur_columns = my_mysql_query($cursor_sql, $this->source); $v_sql = ''; while (1) { if ($v_sql != '') { $v_sql = FlexCDC::concat($v_sql, ', '); } $row = mysql_fetch_array($cur_columns); if ($row === false) { $v_done = true; } if ($row) { $v_column_name = '`' . $row[0] . '`'; $v_data_type = $row[1]; } if ($v_done) { mysql_free_result($cur_columns); break; } $v_sql = FlexCDC::concat($v_sql, $v_column_name, ' ', $v_data_type); } if (trim($v_sql) == "") { trigger_error('Could not access table:' . $v_table_name, E_USER_ERROR); } $v_sql = FlexCDC::concat('CREATE TABLE IF NOT EXISTS`', $this->mvlogDB, '`.`', $v_schema_name, '_', $v_table_name, '` ( dml_type INT DEFAULT 0, uow_id BIGINT, `fv$server_id` INT UNSIGNED,fv$gsn bigint, ', $v_sql, 'KEY(uow_id, dml_type) ) ENGINE=INNODB'); $create_stmt = my_mysql_query($v_sql, $this->dest); if (!$create_stmt) { die1('COULD NOT CREATE MVLOG. ' . $v_sql . "\n"); } $exec_sql = " INSERT IGNORE INTO `" . $this->mvlogDB . "`.`" . $this->mvlogs . "`( table_schema , table_name , mvlog_name ) values('{$v_schema_name}', '{$v_table_name}', '" . $v_schema_name . "_" . $v_table_name . "')"; my_mysql_query($exec_sql) or die1($exec_sql . ':' . mysql_error($this->dest) . "\n"); return true; }
protected function process_rows() { #echo "IN PROCESS ROWS\n"; #print_r($this); foreach ($this->table_map as $table_id => $info) { #FIXME: smartly (and transactionally) invalidate the cache if ($info->db === $this->mvlogDB && $info->table === $this->mvlogs) { $this->refresh_mvlog_cache(); } if (empty($this->mvlogList[$info->db . $info->table])) { continue; } if (!$this->sent_fde) { $sql = "BINLOG '\n" . chunk_split(base64_encode($this->encode_fde()), 76, "\n") . "'/*!*/;\n"; my_mysql_query($sql, $this->dest) or die1("Could not execute statement:\n" . $sql); unset($sql); } $events = $this->encode_remap_table($table_id); $events = chunk_split(base64_encode($events), 76, "\n"); if (!empty($this->rows[$table_id]) && $this->rows[$table_id]['old']['images'] != "") { $events .= chunk_split(base64_encode($this->encode_row_events($table_id, 'old')), 76, "\n"); } if (!empty($this->rows[$table_id]) && $this->rows[$table_id]['new']['images'] != "") { $events .= chunk_split(base64_encode($this->encode_row_events($table_id, 'new')), 76, "\n"); } $sql = "BINLOG '\n{$events}'/*!*/;\n"; unset($events); my_mysql_query($sql, $this->dest) or die1("Could not execute statement:\n" . $sql); unset($sql); } }
function get_moyenne_dla() { $sql = "SELECT sum( -DLAH*60-DLAM ) as dla"; $sql .= " FROM " . _TABLEVTT_; $sql .= " WHERE PVs IS NOT NULL"; $query_result = my_mysql_query($sql); $row = mysql_fetch_array($query_result); return intval($row["dla"] / $this->nb_troll); }
while ($f = readdir($fp)) { if ($f == '.' || $f == '..') { continue; } $f = $tpldir . '/css/' . $f; $c = @file_get_contents($f); if (!$c) { continue; } $c = str_replace('../design/', '../imgs/', $c); @chmod($f, 0777); $r = @file_put_contents($f, $c); @chmod($f, 0755); } closedir($fp); my_mysql_query("REPLACE INTO `settings` SET `word`='THEME', `value`='default' ", $conn); if (!file_exists('../../themes/include_in_footer.php')) { $tmp = "<" . "?php\n\n\t\n\t"; $tmp .= "/" . "**\n\t\t\n\t\t"; $tmp .= "This file in included to the Footer of all themes, right before the </body> tag\n\t\t\n\t\t"; $tmp .= "Here you can place web counters.\n\t\t\n\t"; $tmp .= "*/\n\t\n"; $tmp .= "?" . ">\n"; @file_put_contents('../../themes/include_in_footer.php', $tmp); } } if (!$error) { directory_tree_delete(INCPATH . '../../system/templates/'); directory_tree_delete(INCPATH . '../../i/design/'); directory_tree_delete(INCPATH . '../../i/css/'); directory_tree_delete(INCPATH . '../../i/js/');
function statement($sql) { $sql = trim($sql); if (substr($sql, 0, 6) == '/*!\\C ') { return; } /* if($sql[0] == '/') { $end_comment = strpos($sql, ' '); $sql = trim(substr($sql, $end_comment, strlen($sql) - $end_comment)); } */ preg_match("/([^ ]+)(.*)/", $sql, $matches); //print_r($matches); $command = $matches[1]; $command = str_replace($this->delimiter, '', $command); $args = $matches[2]; switch (strtoupper($command)) { #register change in delimiter so that we properly capture statements case 'DELIMITER': $this->delimiter = trim($args); break; #NEW TRANSACTION #NEW TRANSACTION case 'BEGIN': $this->start_transaction(); break; #END OF BINLOG, or binlog terminated early, or mysqlbinlog had an error #END OF BINLOG, or binlog terminated early, or mysqlbinlog had an error case 'ROLLBACK': $this->rollback_transaction(); break; case 'COMMIT': $this->commit_transaction(); break; case 'USE': #fall through and execute the use $this->activeDB = trim($args); $this->activeDB = str_replace($this->delimiter, '', $this->activeDB); default: my_mysql_query($sql, $this->dest) or die('Could not execute [SBR] statement:' . $sql . ':' . mysql_error($this->dest) . "\n"); break; } }
<?php include_once 'config.php'; include_once 'variables.php'; include_once 'inc_define_vars.php'; ?> <?php $blason = $_REQUEST["blason"]; if ($blason == "init") { # il faut tirer au sort le troll à afficher # tirage au sort d'une ligne de la table $query_result = my_mysql_query("SELECT nom_image_troll FROM trolls WHERE guilde_troll=" . ID_GUILDE . " ORDER BY rand() LIMIT 1"); $row = mysql_fetch_array($query_result); $pseudo = $row["nom_image_troll"]; } else { $pseudo = $blason; } # récupération des infos ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>Blason</TITLE> </HEAD> <BODY bgcolor="#000000" TEXT="yellow" link="cyan" vlink="cyan"> <center>
function parseline($bm_row, $ID) { debug("raw: {$bm_row}"); // debugging love. if (get_magic_quotes_gpc() == 1) { // auto-escape is on... $bm_row = stripslashes($bm_row); } // so remove extra slashes. debug("final: {$bm_row}"); // debugging love. $bm_row = trim($bm_row); // get rid of ooky whitespace. $cmd = substr($bm_row, 0, 1); // first char is what command to perform. $bm_row = substr($bm_row, 3); // strip token of COMMAND,COMMA,SLASH. $l = strpos($bm_row, "\""); // find the end of our bookmark path. $tpath = substr($bm_row, 0, $l); // and save the path itself into $tpath. $path = addslashes($tpath); // encode slashes and apostraphes for SQL. // add bookmark if ($cmd == "A") { $url = substr($bm_row, strlen($tpath) + 3); // get the URL from our row. $url = addslashes(trim($url, "\"\r\n")); // remove ookiness and junk. $surl = addslashes(substr($url, 7, 55) . substr($url, -200)); // MySQL indexes can only be 255. // insert the bookmark. my_mysql_query("insert into syncit_bookmarks (url, surl) values ('{$url}', '{$surl}')"); $res = my_mysql_query("select bookid from syncit_bookmarks where surl='{$surl}'"); // and check the expiration date. deleted URLs should // be regularly purged from the database after a certain // amount of time, but if the current URL is set to be // deleted, but hasn't yet, we resurrect it. if ($data = mysql_fetch_assoc($res)) { $bid = $data['bookid']; // shorter. $res = my_mysql_query("insert into syncit_link (expiration, person_id, access, path, " . "book_id) values (NULL, '{$ID}', now(), '{$path}', '{$bid}')"); // bookmark exists already, but expired. Unexpire! if (!$res) { my_mysql_query("update syncit_link set expiration = NULL, book_id = '{$bid}' " . "where person_id = '{$ID}' and path = '{$path}'"); } } } else { if ($cmd == "D") { my_mysql_query("update syncit_link set expiration = now() where path = '{$path}' and person_id = '{$ID}'"); } else { if ($cmd == "M") { $res = my_mysql_query("insert into syncit_link (expiration, person_id, access, " . "path) values (NULL, '{$ID}', now(), '{$path}')"); if (!$res) { // resurrect a deleted directory. my_mysql_query("update syncit_link set expiration = NULL, book_id = NULL " . "where person_id = '{$ID}' and path = '{$path}'"); } } else { if ($cmd == "R") { my_mysql_query("update syncit_link set expiration = now() where path = '{$path}' and person_id = '{$ID}'"); } else { my_echo("*E"); my_echo("Invalid Bookmark Command: {$cmd} "); debug("Invalid Bookmark Command: [{$cmd}]."); return true; } } } } return false; }
function initBlason($no) { //$no = $_REQUEST["no"]; if ($no == 0) { # il faut tirer au sort le troll à afficher # tirage au sort d'une ligne de la table $query_result = my_mysql_query("SELECT * , nom_troll FROM " . _TABLEVTT_ . ", trolls WHERE No=id_troll ORDER BY rand() LIMIT 1"); } else { # il faut extraire les infos du troll numéro 'no' $query_result = my_mysql_query("SELECT *, nom_troll FROM " . _TABLEVTT_ . ", trolls WHERE No={$no} AND id_troll=No"); } # récupération des infos $row = mysql_fetch_array($query_result); $pseudo = $row["nom_image_troll"]; $cacherdata = $row["CacherData"]; $text .= "<center>"; $text .= "<table class=mh_tdborder width=280>"; $text .= "<tr class=mh_tdpage><td>"; $text .= " <table width=280 cellspacing=0>"; $text .= " <tr class=mh_tdtitre align=center>"; $text .= " <td>"; $text .= "<img src=http://www.pipeshow.net/RM/blasons/{$pseudo}.gif alt={$pseudo} border=0 name=blason>"; $text .= " </td>"; $text .= " </tr>"; $text .= " </table>"; $text .= " </td>"; $text .= " <td>"; $text .= " <table width=280 border=0 cellpadding=3 cellspacing=3>"; $text .= " <tr><td valign=top>"; // $text .= "<tr><td class=mh_tdpage colspan=2 align=center></td></tr>"; // $text .= "<tr>"; // $text .= "</table></td></tr></table>"; $text .= " <h2>{$pseudo} (n°{$no})</h2>"; $text .= "\t\t\t\t<img src=http://www.pipeshow.net/RM/avatars/complets/" . $pseudo . "_avatar.gif"; $text .= "\t\t\t\t\t\talt=[Avatar de {$pseudo}] border=0 width=110 height=110>"; $text .= "<table>"; $text .= "<tr class=mh_tdpage><td colspan=2 align=center>"; $text .= "<b>Les informations ci dessous n engagent que le Joueur. Le webmaster se réserve le droit de restreindre ou de supprimer comme bon lui semble laccès au joueur à ces champs de libre expression.</b>"; $text .= "</td></tr>"; $text .= "<tr class=mh_tdpage><td class=blasong align=right>Compétences</td><td class=blasond align=left>" . ($cacherdata ? "--" : $row["Comps"]) . " </td></tr>"; $text .= "<tr class=mh_tdpage><td class=blasong align=right>Nom (complet)<br>du Troll</td><td class=blasond align=left>"; if (non_vide($row["nom_troll"])) { $text .= htmlspecialchars($row["nom_troll"]); } else { $text .= " "; } $text .= "</td></tr>"; $text .= "<tr class=mh_tdpage><td class=blasong align=right>Joueur</td><td class=blasond align=left>"; if (non_vide($row["Joueur"])) { $text .= htmlspecialchars($row["Joueur"]); } else { $text .= " "; } $text .= "</td></tr>"; $text .= "<tr class=mh_tdpage><td class=blasong align=right>Age du Joueur</td><td class=blasond align=left>"; if (non_vide($row["AgeJoueur"]) and $row["AgeJoueur"] >= 1) { $text .= htmlspecialchars($row["AgeJoueur"]); } else { $text .= " "; } $text .= "</td></tr>"; $text .= "<tr class=mh_tdpage><td class=blasong align=right>Ville du Joueur</td><td class=blasond align=left>"; if (non_vide($row["VilleJoueur"])) { $text .= htmlspecialchars($row["VilleJoueur"]); } else { $text .= " "; } $text .= "</td></tr>"; $text .= "<tr class=mh_tdpage><td class=blasong align=right>MSN</td><td class=blasond align=left>"; if (non_vide($row["MSN"])) { $text .= htmlspecialchars($row["MSN"]); } else { $text .= " "; } $text .= "</td></tr>"; $text .= "<tr class=mh_tdpage><td class=blasong align=right>ICQ</td><td class=blasond align=left>"; if (non_vide($row["ICQ"])) { $text .= htmlspecialchars($row["ICQ"]); } else { $text .= " "; } $text .= "</td></tr>"; $text .= "<tr class=mh_tdpage><td class=blasong align=right>Email</td><td class=blasond align=left>"; if (non_vide($row["EMail"])) { $text .= htmlspecialchars($row["EMail"]); } else { $text .= " "; } $text .= "</td></tr>"; $text .= "<tr class=mh_tdpage><td class=blasong align=right>Divers</td><td class=blasond align=left>"; if (non_vide($row["Divers"])) { $text .= preg_replace("/(\n|\r)/", "<br>", htmlspecialchars($row["Divers"])); } else { $text .= " "; } $text .= "</td></tr>"; $text .= "</table>"; $text .= "</td></tr>"; $text .= "</table>"; $text .= "</td><tr>"; $text .= "</table></td></tr></table>"; $text .= "</center>"; $text = preg_replace("/'/", "_", $text); return htmlentities($text); }
function database_drop_tables_with_prefix($prefix) { if (empty($prefix)) { return FALSE; } global $s; $conn = my_mysql_connect($s['MYSQL_HOST'], $s['MYSQL_USER'], $s['MYSQL_PASS']); $dbs = my_mysql_select_db($s['MYSQL_DBNAME'], $conn); if (!$conn || !$dbs) { return FALSE; } $tmp = my_mysql_query('SHOW TABLES FROM ' . $s['MYSQL_DBNAME'], $conn); while ($tbl = my_mysql_fetch_row($tmp)) { $tbl = $tbl[0]; if (substr($tbl, 0, strlen($prefix)) == $prefix) { my_mysql_query("DROP TABLE IF EXISTS `" . $tbl . "`;", $conn); } } }
public function parse_cate($parser, $content, $base) { $dom = $parser->engine->init($content); $xpath = "/html/body/div[3]/div[3]/div[1]/div[2]/a"; $res = $dom->find($xpath); $base_url = 'http://' . implode('/', $base); $base_url_1 = 'http://' . $base[0]; $xpath_1 = "//*[@id=\"list1\"]/li"; $content = $dom->find($xpath_1); if ($res) { $pattern = '/href=\\"([^\\"]+)\\"/i'; foreach ($res as $value) { preg_match($pattern, $value, $mat); if (isset($mat[1])) { if (strpos($mat[1], '/') === 0) { $url = trim($base_url_1, '/') . '/' . trim($mat[1], '/'); } else { $url = trim($base_url, '/') . '/' . trim($mat[1], '/'); } } if (strpos($url, '.htm')) { $end = strripos($url, '/'); $int = substr($url, $end + 1, -4); if (intval($int) > 5) { break; } } push_to_crawler($url); } } return; if ($content) { foreach ($content as $value) { $value = trim(strip_tags($value)); $time = time(); $value = mb_substr($value, 0, strlen($value), 'utf-8'); $cate_id = 0; $sql = "select id from qq_cates where cate_mark = '{$base[1]}'"; $cate = my_mysql_query($sql); if ($cate) { $cate_id = $cate[0]['id']; } $sub_sql = $cate_id ? ' and cate_id = ' . $cate_id : ''; $sql = "select id from qq_sign where sign_title = '{$value}'" . $sub_sql; $res = my_mysql_query($sql); if ($res) { return; } $sql = "insert into qq_sign (sign_title, cate_id, created_time, updated_time) values('{$value}', {$cate_id}, {$time}, {$time})"; $id = my_mysql_insert($sql); echo $id . "\n"; } } }
<body bgcolor="#30395D" TEXT="white"> <form method="post" action="login.php"> <center> <img src="visiotrollotron.gif"> <br> <?php if ($reason == "login") { echo "<font color=yellow>Login refusé, veuillez essayer de nouveau</font><br>\n"; } ?> Nom d'utilisateur : <SELECT name="no_membre"> <?php # récupération des nos et des pseudos des trolls $query_result = my_mysql_query("SELECT No, Pseudo from trolls ORDER BY Pseudo"); while ($row = mysql_fetch_array($query_result)) { echo "\n\t<OPTION value=\"" . $row["No"] . "\">" . $row["Pseudo"] . "</OPTION>"; } ?> </SELECT> Mot de passe : <input type="password" name="passe_membre"><br> <br><input type="submit" name="SubmitVTT" value="VisioTrollotron"> </form> </center> <H4>Vous ne connaissez pas votre mot de passe ?</H4> <H4>Vous avez oublié votre mot de passe ?</H4> <b><font color=yellow>Envoyez votre demande de mot de passe au Troll Lobo (no 10866), Garbrag (no 30271) ou Grognon (no 2690) qui vous le communiquera.</font></b>
} } if (!$error && strlen($s['ADMIN_PASS']) < 5) { $error = TRUE; $errmsg = 'Password must be at least 5 characters long.'; } if (!$error && $s['ADMIN_PASS'] != $s['ADMIN_PASS2']) { $error = TRUE; $errmsg = 'Passwords don`t match.'; } if (!$error && !is_valid_email($s['ADMIN_EMAIL'])) { $error = TRUE; $errmsg = 'Invalid E-mail address.'; } if (!$error) { $res = my_mysql_query('SELECT id FROM users WHERE email="' . addslashes($s['ADMIN_EMAIL']) . '" LIMIT 1', $conn); if ($res) { if (my_mysql_num_rows($res) > 0) { $error = TRUE; $errmsg = 'This e-mail is already registered.'; } } } if (!$error) { unset($s['ADMIN_PASS2']); $_SESSION['INSTALL_STEP'] = 7; header('Location: ?next&r=' . rand(0, 99999)); } } $html .= ' <div class="ttl">
} } if (!$conn) { $error = TRUE; $errmsg = 'Cannot connect - please check host, username and password.'; } } if (!$error) { $dbs = my_mysql_select_db($s['MYSQL_DBNAME'], $conn); if (!$dbs) { $error = TRUE; $errmsg = 'Database does not exist.'; } } if (!$error && !$is_upgrade) { $tbl = my_mysql_query('SHOW TABLES FROM ' . $s['MYSQL_DBNAME'], $conn); if ($tbl && my_mysql_num_rows($tbl) > 0) { $error = TRUE; $errmsg = 'Database must be empty - this one contains one or more tables.'; } } if (!$error) { $_SESSION['INSTALL_STEP'] = 2; header('Location: ?next&r=' . rand(0, 99999)); } } $html .= ' <div class="ttl"> <div class="ttl2"> <h3>Database Settings</h3> </div>
<?php $title = "赞助我们 | "; include "../config.php"; include "../header.php"; $link = my_mysql_connect(); $donates = my_mysql_query($link, "select name,money,datetime,url,remark from hc_donate where status = 1 and datetime > '2015-01-01 00:00:00' order by datetime"); $donate_total = 0; ?> <section class="s-content"> <div class="container"> <div class="s-slider-nav left"> <ul> <li><a href="/about/index.php">关于我们</a></li> <li class="active"><a href="/about/donate.php">赞助我们</a></li> <li><a href="/about/qun.php">QQ群</a></li> <li><a href="/about/links.php">友情链接</a></li> <li><a href="/about/contact.php">联系我们</a></li> </ul> <a href="http://weibo.com/highcharts" target="_blank"><img src="http://static.hcharts.cn//images/weibo_210x60.png" alt="highcharts中文网官方微博" data-bd-imgshare-binded="1"></a> </div> <div class="s-box s-main left"> <h1>赞助我们 <div class="s-share bdsharebuttonbox bdshare-button-style0-24" data-bd-bind="1428301316404"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a><a href="#" class="bds_youdao" data-cmd="youdao" title="分享到有道云笔记"></a></div></h1> <p>中文网由个人开发和维护着,为了减轻服务器等额外成本,让我可以将更多的精力花在网站开发和网站内容更新上,需要大家的帮助和支持。</p> <p>如果您认为本网站做的不错,对您的工作带来方便,不妨小额赞助我一下,让我有动力继续完善和更新网站内容。</p> <h3>赞助方法</h3> <p>通过支付宝付款或微信转账形式给中文网赞助</p> <p class="donate-method">支付宝付款:</p> <div class="donate-cont">
<?php include_once '../top.php'; include_once 'secure.php'; $query_result = my_mysql_query("SELECT *, nom_troll from vtt, trolls Where No='" . $id . "' and id_troll=No"); $row = mysql_fetch_array($query_result); echo "<center>\n"; echo "<H1>Mise à jour des informations de<br>" . htmlspecialchars($row["nom_troll"]) . "</H1>\n"; echo "<FORM ACTION=\"verifier_maj.php?id=" . $id . "&no=" . $row["No"] . "\" method=post>\n"; echo "<br> <br>\n"; echo "<table cellspacing=0 border=1 cellpadding=1 class=impair>\n"; echo "<tr><td align=right>Race</td>" . "<td align=left><select name=race size=1>" . "<option" . ($row["Race"] == "Kastar" ? " SELECTED" : "") . ">Kastar</option>" . "<option" . ($row["Race"] == "Skrim" ? " SELECTED" : "") . ">Skrim</option>" . "<option" . ($row["Race"] == "Durakuir" ? " SELECTED" : "") . ">Durakuir</option>" . "<option" . ($row["Race"] == "Tomawak" ? " SELECTED" : "") . ">Tomawak</option>" . "</select></td>" . "</tr>\n"; echo "<tr><td align=right>DLA<br>(Duree normale du Tour<br>+ Bonus/Malus sur la durée<br>+ Poids de l'équipement)</td>" . "<td align=left><input name=dlah size=2 maxlength=2 value='" . htmlspecialchars($row["DLAH"], ENT_QUOTES) . "'>h" . "<input name=dlam size=2 maxlength=2 value='" . htmlspecialchars($row["DLAM"], ENT_QUOTES) . "'>min</td>" . "</tr>\n"; echo "<tr><td align=right>VUE</td>" . "<td align=left><input name=vue size=2 maxlength=2 value='" . htmlspecialchars($row["VUE"], ENT_QUOTES) . "'>" . "<input name=vueb size=3 maxlength=3 value='" . plus($row["VUEB"]) . htmlspecialchars($row["VUEB"], ENT_QUOTES) . "'></td>" . "</tr>\n"; echo "<tr><td align=right>Niv</td><td align=left><input name=niveau size=2 maxlength=2 value='" . htmlspecialchars($row["Niveau"], ENT_QUOTES) . "'></td></tr>\n"; echo "<tr><td align=right>PVs</td><td align=left><input name=pvs size=3 maxlength=3 value='" . htmlspecialchars($row["PVs"], ENT_QUOTES) . "'></td></tr>\n"; echo "<tr><td align=right>REG</td>" . "<td align=left><input name=reg size=2 maxlength=2 value='" . htmlspecialchars($row["REG"], ENT_QUOTES) . "'>D3" . "<input name=regb size=3 maxlength=3 value='" . plus($row["REGB"]) . htmlspecialchars($row["REGB"], ENT_QUOTES) . "'></td>" . "</tr>\n"; echo "<tr><td align=right>ATT</td>" . "<td align=left><input name=att size=2 maxlength=2 value='" . htmlspecialchars($row["ATT"], ENT_QUOTES) . "'>D6" . "<input name=attb size=3 maxlength=3 value='" . plus($row["ATTB"]) . htmlspecialchars($row["ATTB"], ENT_QUOTES) . "'></td>" . "</tr>\n"; echo "<tr><td align=right>ESQ</td>" . "<td align=left><input name=esq size=2 maxlength=2 value='" . htmlspecialchars($row["ESQ"], ENT_QUOTES) . "'>D6" . "<input name=esqb size=3 maxlength=3 value='" . plus($row["ESQB"]) . htmlspecialchars($row["ESQB"], ENT_QUOTES) . "'></td>" . "</tr>\n"; echo "<tr><td align=right>DEG</td>" . "<td align=left><input name=deg size=2 maxlength=2 value='" . htmlspecialchars($row["DEG"], ENT_QUOTES) . "'>D3" . "<input name=degb size=3 maxlength=3 value='" . plus($row["DEGB"]) . htmlspecialchars($row["DEGB"], ENT_QUOTES) . "'></td>" . "</tr>\n"; echo "<tr><td align=right>ARM</td>" . "<td align=left><input name=arm size=2 maxlength=2 value='" . htmlspecialchars($row["ARM"], ENT_QUOTES) . "'>" . "<input name=armb size=2 maxlength=2 value='" . plus($row["ARMB"]) . htmlspecialchars($row["ARMB"], ENT_QUOTES) . "'></td>" . "</tr>\n"; echo "<tr><td align=right>KILLs</td><td align=left><input name=kills size=3 maxlength=3 value='" . htmlspecialchars($row["KILLs"], ENT_QUOTES) . "'></td></tr>\n"; echo "<tr><td align=right>Décès</td><td align=left><input name=deads size=2 maxlength=2 value='" . htmlspecialchars($row["DEADs"], ENT_QUOTES) . "'></td></tr>\n"; echo "<tr><td align=right>RM</td>" . "<td align=left><input name=rm size=4 maxlength=4 value='" . htmlspecialchars($row["RM"], ENT_QUOTES) . "'>" . "<input name=rmb size=5 maxlength=5 value='" . plus($row["RMB"]) . htmlspecialchars($row["RMB"], ENT_QUOTES) . "'></td>" . "</tr>\n"; echo "<tr><td align=right>MM</td>" . "<td align=left><input name=mm size=4 maxlength=4 value='" . htmlspecialchars($row["MM"]) . "'>" . "<input name=mmb size=5 maxlength=5 value='" . plus($row["MMB"]) . htmlspecialchars($row["MMB"]) . "'></td>" . "</tr>\n"; # fin de la 1ère table echo "</table>\n"; echo "<br> <br>\n"; # début de la 2nde table echo "<table cellspacing=0 border=1 cellpadding=1 class=impair>\n"; echo "<tr><td align=right>Nom (complet) du Troll</td><td align=left>" . $row[nom_troll] . "></td></tr>\n";
\tTbExternalType WHERE \tTbIdPerson.id=1 AND \tTbIdPerson.id=TbWkWorkViewPerson.viewerId AND \tTbWkWorkViewPerson.viewId=TbWkWorkView.id AND \tTbWkWorkView.locationId=TbLocation.id AND \tTbWkWorkView.deviceId=TbDevice.id AND \tTbWkWorkView.workId=TbWkWork.id AND \tTbWkWork.typeId=TbWkWorkType.id AND \tTbWkWorkType.name='video movie' AND \tTbWkWork.id=TbWkWorkExternal.workId AND \tTbWkWorkExternal.externalId=TbExternalType.id AND \tTbExternalType.name='imdb_title_id' EOT; /* * If you want to only show movies that have dates add the following * predicate to the SQL above: * TbWkWorkView.endViewDate IS NOT NULL AND */ $query_data = sprintf('%s %s %s %s', $sql_select, $sql_frame, $sql_order, $sql_limit); $query_count = sprintf('%s %s', 'SELECT COUNT(*)', $sql_frame); # get the data... $result_obj = my_mysql_query($query_data); $result_rows = my_get_rows($result_obj); $total = my_mysql_query_one($query_count); # form the response $response = array('total' => $total, 'views' => $result_rows); # send the response echo json_encode($response); # finish up utils_finish();
return "Sublifusion Magesque Medius"; } if (eregi('Sublifusion.+Minus', $chaine, $trash)) { return "Sublifusion Magesque Minus"; } if (eregi('Sublifusion.+Maexus', $chaine, $trash)) { return "Sublifusion Magesque Maexus"; } return htmlspecialchars($chaine, ENT_QUOTES); } function exporter($nom_variable) { global ${$nom_variable}; return ${$nom_variable} . "<input type=hidden name=" . $nom_variable . " value=\"" . ${$nom_variable} . "\">"; } $query_result = my_mysql_query("SELECT * from " . _TABLEVTT_ . ", trolls Where No='" . $_SESSION[AuthTroll] . "' AND id_troll = No"); $row = mysql_fetch_array($query_result); echo "<FORM ACTION=\"verifier_maj.php?id=" . $id . "&no=" . $row["No"] . "\" method=post>\n"; echo "<center>"; echo "<H1>Mise à jour des informations de<br>" . htmlspecialchars($row["nom_troll"]) . "</H1>\n"; echo "<H2>2ème Etape : compléter les infos facultatives (à saisie manuelle)</H2>\n"; $lignes = explode("\n", stripslashes($_REQUEST["copiercoller"])); $i = 0; $j = 0; $sorts = 0; $nb_sorts = 0; $nb_comps = 0; while ($lignes[$i]) { #echo "<br>".$lignes[$i]."\n"; if (eregi("[ \t]*Identifian.+:[ \t]*(.+)[ \t]*-[ \t]*(.+)", $lignes[$i], $resultat)) { $troll_id = trim(htmlspecialchars($resultat[1]));
function troll_vtt($id_troll) { $sql = "SELECT id_troll, nom_troll, nb_kills_troll, nb_morts_troll, niveau_troll, race_troll, "; $sql .= "\t No, CacherData, DateTrash, DateMaj,"; $sql .= "\t VUE, VUEB, PVs, "; $sql .= "\t REG, REGB, ATT, ATTB,"; $sql .= "\t ESQ, ESQB, DEG, DEGB,"; $sql .= "\t ARM, ARMB, "; $sql .= "\t RM, RMB, MM, MMB,"; $sql .= "\t DLAH, DLAM, Comps,\tSorts, NbSorts,"; $sql .= " -DLAH*60-DLAM as TDLA, "; $sql .= " VUE+VUEB as TVUE, "; $sql .= " REG*2+REGB as TREG, "; $sql .= " ATT*3.5+ATTB as TATT, "; $sql .= " ESQ*3.5+ESQB as TESQ, "; $sql .= " DEG*2+DEGB as TDEG, "; $sql .= " ARM+ARMB as TARM, "; $sql .= " RM+RMB as TRM, "; $sql .= " MM+MMB as TMM,"; $sql .= " (TO_DAYS(NOW()) - TO_DAYS(DateMaj)) as Peremption"; $sql .= " FROM " . _TABLEVTT_ . ", trolls"; $sql .= " WHERE id_troll = No"; $sql .= " AND id_troll = {$id_troll} "; $query_result = my_mysql_query($sql); $row = mysql_fetch_array($query_result); $this->nom_troll = $row["nom_troll"]; $this->niveau_troll = $row["niveau_troll"]; $this->race_troll = $row["race_troll"]; $this->id_troll = $row["id_troll"]; $this->cacher_data = $row["CacherData"]; $this->date_trash = $row["DateTrash"]; $this->date_maj = $row["DateMaj"]; $this->race_troll = $row["race_troll"]; $this->vue = $row["VUE"]; $this->vue_bonus = $row["VUEB"]; $this->niveau = $row["Niveau"]; $this->pv = $row["PVs"]; $this->reg = $row["REG"]; $this->reg_bonus = $row["REGB"]; $this->att = $row["ATT"]; $this->att_bonus = $row["ATTB"]; $this->esq = $row["ESQ"]; $this->esq_bonus = $row["ESQB"]; $this->deg = $row["DEG"]; $this->deg_bonus = $row["DEGB"]; $this->arm = $row["ARM"]; $this->arm_bonus = $row["ARMB"]; $this->kill = $row["nb_kills_troll"]; $this->death = $row["nb_morts_troll"]; $this->rm = $row["RM"]; $this->rm_bonus = $row["RMB"]; $this->mm = $row["MM"]; $this->mm_bonus = $row["MMB"]; $this->dla_heure = $row["DLAH"]; $this->dla_min = $row["DLAM"]; $this->competences = $row["Comps"]; $this->sorts = $row["Sorts"]; $this->nb_sorts = $row["NbSorts"]; $this->total_dla = $row["TDLA"]; $this->total_vue = $row["TVUE"]; $this->total_reg = $row["TREG"]; $this->total_att = $row["TATT"]; $this->total_esq = $row["TESQ"]; $this->total_deg = $row["TDEG"]; $this->total_arm = $row["TARM"]; $this->total_rm = $row["TRM"]; $this->total_mm = $row["TMM"]; }
function create_person($params) { $firstname = $params['firstname']; $surname = $params['surname']; $res = ''; $external = my_mysql_query_hash('SELECT * FROM TbExternalType', 'id'); $query = sprintf('SELECT * FROM TbIdPerson WHERE firstname=%s AND surname=%s', my_mysql_real_escape_string($firstname), my_mysql_real_escape_string($surname)); $row = my_mysql_query_one_row($query); $id = $row['id']; $res .= '<ul>'; $res .= '<li>id: ' . $id . '</li>'; $res .= '<li>Name: ' . get_full_name($row, $honorifics) . '</li>'; // handle externals $query = sprintf('SELECT * FROM TbIdPersonExternal WHERE personId=%s', my_mysql_real_escape_string($id)); $result = my_mysql_query($query); while ($row = $result->fetch_assoc()) { $externalcode = $row['externalCode']; $externalid = $row['externalId']; $externalname = $external[$externalid]['name']; $externalidname = $external[$externalid]['idname']; $link = get_external_href($externalname, $externalcode); $link = '<a href=\'' . $link . '\'>' . $externalidname . ': ' . $externalcode . '</a>'; $res .= '<li>' . $link . '</li>'; } my_mysql_free_result($result); $res .= '</ul>'; return $res; }
############### # on peut updater $updater = 1; # texte expliquant les erreurs $constat = ""; # vérification que les données qui suivent sont entières et positives if ($updater == 0) { echo "<div class=alerte>" . $constat . "</div>\n"; echo "<br><H1>Les données ne seront pas mises à jour.</H1>\n"; echo "<br>Veuillez revenir à la page précédente et corriger les erreurs.\n"; } else { $update = 'UPDATE ' . _TABLEVTT_ . ' SET'; $update .= ' `CacherData` = \'' . ($_REQUEST["cacherdata"] ? '1' : '0') . '\''; $champs = array('Race' => 'troll_race', 'DLAH' => 'troll_dla_reel_hh', 'DLAM' => 'troll_dla_reel_mm', 'VUE' => 'troll_vue_base', 'VUEB' => 'troll_vue_bm', 'Niveau' => 'troll_niveau', 'PV_ACTUELS' => 'troll_pvact', 'PVs' => 'troll_pv', 'REG' => 'troll_reg_base', 'REGB' => 'troll_reg_bm', 'ATT' => 'troll_att_base', 'ATTB' => 'troll_att_bm', 'ESQ' => 'troll_esq_base', 'ESQB' => 'troll_esq_bm', 'DEG' => 'troll_deg_base', 'DEGB' => 'troll_deg_bm', 'ARM' => 'troll_arm_base', 'ARMB' => 'troll_arm_bm', 'KILLs' => 'troll_kill', 'DEADs' => 'troll_death', 'RM' => 'troll_rm_base', 'RMB' => 'troll_rm_bm', 'MM' => 'troll_mm_base', 'MMB' => 'troll_mm_bm', 'Joueur' => 'joueur', 'AgeJoueur' => 'agejoueur', 'VilleJoueur' => 'villejoueur', 'MSN' => 'msn', 'ICQ' => 'icq', 'EMail' => 'email', 'Divers' => 'divers'); foreach ($champs as $sql => $input) { $update .= ', `' . $sql . '` = \'' . $_REQUEST[$input] . '\''; } $update .= ', `NbSorts` = \'' . $_REQUEST["nbsorts"] . '\''; $update .= ', `Comps` = \'' . $_REQUEST["comps"] . '\''; $update .= ', `Sorts` = \'' . $_REQUEST["sortsappris"] . '\''; $update .= ', `DateMaj` = NOW()'; $update .= ' WHERE `No` = \'' . $_REQUEST["no"] . '\';'; $query_result = my_mysql_query($update); echo "<br><H1>Mise à jour effectuée.</H1>\n"; echo "<br><H2>Retour au <a href=\"vtt.php?id=" . $_SESSION["AuthTroll"] . "&this_one=" . $no . "\">VisioTrollotron</a>.</H2>\n"; echo "<br><H2>Retour à la <a href=\"../engine_view.php?troll=" . $_SESSION["AuthTroll"] . "\">Fiche Engine</a>.</H2>\n"; } include_once '../foot.php'; ?>
function load_old_config() { $file = INCPATH . '../../system/conf_main.php'; if (file_exists($file)) { $C = new stdClass(); $C->INCPATH = realpath(INCPATH . '../../system/') . '/'; include $file; $conn = my_mysql_connect($C->DB_HOST, $C->DB_USER, $C->DB_PASS); if ($conn) { $dbs = my_mysql_select_db($C->DB_NAME, $conn); if ($dbs) { $tmp = my_mysql_query('SELECT * FROM `settings` ', $conn); while ($obj = my_mysql_fetch_object($tmp)) { $C->{$obj->word} = stripslashes($obj->value); } } } return $C; } $file = INCPATH . '../../include/conf_main.php'; if (file_exists($file)) { $C = new stdClass(); $src = file_get_contents($file); $pattern = '/(define(\\s)*\\((\\s)*\'([a-z0-9\\-\\_]+)\'\\,(\\s)*)(\')([^\\\']*)(\')((\\s)*\\))/isu'; preg_match_all($pattern, $src, $matches, PREG_SET_ORDER); foreach ($matches as $dfmatches) { $key = trim($dfmatches[4]); $val = trim($dfmatches[7]); if (empty($key)) { continue; } $C->{$key} = $val; } $C->VERSION = 'unofficial'; return $C; } return new stdClass(); }
$row = mysql_fetch_array($query_result); $best = $row["TRM"]; echo "<li>RM : " . $row["RM"] . ($row["RMB"] >= 0 ? "+" : "") . $row["RMB"] . " ("; $val = $best; $cpt = 0; while ($val == $best) { if ($cpt != 0) { echo ", "; } echo $row["nom_troll"]; $row = mysql_fetch_array($query_result); $val = $row["TRM"]; $cpt++; } echo ")</li>\n"; $query_result = my_mysql_query("SELECT nom_troll, NbSorts from " . _TABLEVTT_ . " ,trolls WHERE id_troll = No ORDER BY NbSorts DESC"); $row = mysql_fetch_array($query_result); $best = $row["NbSorts"]; echo "<li>Nb de Sorts : " . $row["NbSorts"] . " ("; $val = $best; $cpt = 0; while ($val == $best) { if ($cpt != 0) { echo ", "; } echo $row["nom_troll"]; $row = mysql_fetch_array($query_result); $val = $row["NbSorts"]; $cpt++; } echo ")</li>\n";