Exemple #1
0
function sendmessage($touser, $title, $message, $from = '0')
{
    global $hp_url, $admin_email, $admin_name, $hp_title;
    $_language_tmp = new Language();
    $systemmail = false;
    if (!$from) {
        $systemmail = true;
        $from = '1';
    }
    if (!$systemmail) {
        safe_query("INSERT INTO " . PREFIX . "messenger (userID, date, fromuser, touser, title, message, viewed) values('{$from}', '" . time() . "', '{$from}', '{$touser}', '{$title}', '" . $message . "', '0')");
        safe_query("UPDATE " . PREFIX . "user SET pmsent=pmsent+1 WHERE userID='{$from}'");
    }
    if (!isignored($touser, $from) or $systemmail) {
        if ($touser != $from || $systemmail) {
            safe_query("INSERT INTO " . PREFIX . "messenger (userID, date, fromuser, touser, title, message, viewed) VALUES ('{$touser}', '" . time() . "', '{$from}', '{$touser}', '{$title}', '" . $message . "', '0')");
        }
        safe_query("UPDATE " . PREFIX . "user SET pmgot=pmgot+1 WHERE userID='{$touser}'");
        if (wantmail($touser) and isonline($touser) == "offline") {
            $ds = mysql_fetch_array(safe_query("SELECT email, language FROM " . PREFIX . "user WHERE userID='{$touser}'"));
            $_language_tmp->set_language($ds['language']);
            $_language_tmp->read_module('messenger');
            $mail_body = str_replace("%nickname%", getnickname($touser), $_language_tmp->module['mail_body']);
            $mail_body = str_replace("%hp_url%", $hp_url, $mail_body);
            mail($ds['email'], $hp_title . ': ' . $_language_tmp->module['mail_subject'], $mail_body, "Content-Type: text/html; charset=utf-8\nFrom: " . $admin_email . "\n");
        }
    }
}
Exemple #2
0
function get_headline($id, $type)
{
    // GET HEADLINE OF COMMENTTYPE
    if ($type == "ne") {
        $res = mysql_fetch_array(safe_query("SELECT headline FROM `" . PREFIX . "news_contents` WHERE newsID='" . $id . "'"));
        return '<a href="index.php?site=news_comments&amp;newsID=' . $id . '">' . $res['headline'] . '</a>';
    }
    if ($type == "ga") {
        $res = mysql_fetch_array(safe_query("SELECT name FROM " . PREFIX . "gallery_pictures WHERE picID='" . $id . "'"));
        return '<a href="index.php?site=gallery&amp;picID=' . $id . '">' . $res['name'] . '</a>';
    }
    if ($type == "de") {
        $res = mysql_fetch_array(safe_query("SELECT clantag1,clantag2 FROM " . PREFIX . "demos WHERE demoID='" . $id . "'"));
        return '<a href="index.php?site=demos&amp;action=showdemo&amp;demoID=' . $id . '">' . $res['clantag1'] . ' vs. ' . $res['clantag2'] . '</a>';
    }
    if ($type == "ar") {
        $res = mysql_fetch_array(safe_query("SELECT title FROM " . PREFIX . "articles WHERE articlesID='" . $id . "'"));
        return '<a href="index.php?site=articles&amp;action=show&amp;articlesID=' . $id . '">' . $res['title'] . '</a>';
    }
    if ($type == "cw") {
        $res = mysql_fetch_array(safe_query("SELECT squad,opponent FROM " . PREFIX . "clanwars WHERE cwID='" . $id . "'"));
        return '<a href="index.php?site=clanwars_details&amp;cwID=' . $id . '">' . getsquadname($res['squad']) . ' vs. ' . $res['opponent'] . '</a>';
    }
    if ($type == "po") {
        $res = mysql_fetch_array(safe_query("SELECT title FROM " . PREFIX . "polls WHERE pollID='" . $id . "'"));
        return '<a href="index.php?site=polls&amp;pollID=' . $id . '">' . $res['title'] . '</a>';
    }
    return '';
}
function check_if_exists($cc)
{
    $result = safe_query("SELECT id FROM country_data WHERE cc_code_2='{$cc}'");
    $data = sqlite_fetch_array($result, SQLITE_NUM);
    // return the id or NULL if no data is avaliable
    return $data ? $data[0] : NULL;
}
Exemple #4
0
function update_txp_lang()
{
    global $txp_lang_updated, $txpcfg;
    if ($re = mysql_connect('textpattern.otherwords.net', 'textpattern_user', 'textpattern')) {
        if (mysql_select_db('textpattern_master', $re)) {
            if ($q = mysql_query("select unix_timestamp(updated) from \n\t\t\t\t\t\ttextpattern_master.update where\n\t\t\t\t\t\t`table`='txp_lang'", $re)) {
                $updated = mysql_num_rows($q) != 0 ? mysql_result($q, 0) : false;
                if ($updated > $txp_lang_updated) {
                    if ($get = mysql_query("select * from \n\t\t\t\t\t\t\t\ttextpattern_master.txp_lang order by var")) {
                        if (mysql_num_rows($get) > 0) {
                            while ($a = mysql_fetch_assoc($get)) {
                                $incoming[] = $a;
                            }
                            mysql_close($re);
                        }
                        if (!empty($incoming)) {
                            dbconnect($txpcfg['db'], $txpcfg['user'], $txpcfg['pass'], $txpcfg['host']);
                            safe_query("truncate txp_lang");
                            foreach ($incoming as $b) {
                                extract(doSlash($b));
                                safe_query("\n\t\t\t\t\t\t\t\t\t\tinsert into txp_lang set \n\t\t\t\t\t\t\t\t\t\tvar='{$var}',english='{$english}'");
                            }
                            safe_query("update txp_prefs set val= \t\n\t\t\t\t\t\t\t\t\t" . time() . "\n\t\t\t\t\t\t\t\t\twhere `name`='txp_lang_updated'", 1);
                            echo mysql_error();
                        }
                    }
                }
            }
        }
    }
}
Exemple #5
0
function checkCommentsAllow($type, $parentID)
{
    global $userID;
    $moduls = array();
    $moduls['ne'] = array("news", "newsID", "comments");
    $moduls['ar'] = array("articles", "articlesID", "comments");
    $moduls['ga'] = array("gallery_pictures", "picID", "comments");
    $moduls['cw'] = array("clanwars", "cwID", "comments");
    $moduls['de'] = array("demos", "demoID", "comments");
    $moduls['po'] = array("poll", "pollID", "comments");
    $allowed = 0;
    $modul = $moduls[$type];
    $get = safe_query("SELECT " . $modul[2] . " FROM " . PREFIX . $modul[0] . " WHERE " . $modul[1] . "='" . $parentID . "'");
    if (mysql_num_rows($get)) {
        $data = mysql_fetch_assoc($get);
        switch ($data[$modul[2]]) {
            case 0:
                $allowed = 0;
                break;
            case 1:
                if ($userID) {
                    $allowed = 1;
                }
                break;
            case 2:
                $allowed = 1;
                break;
            default:
                $allowed = 0;
        }
    }
    return $allowed;
}
function getSingleValue($query)
{
    $result1 = safe_query($query);
    while ($row = mysql_fetch_array($result1)) {
        $value = $row[0];
    }
    return $value;
}
Exemple #7
0
function generate_rss2()
{
    global $hp_url, $hp_title;
    global $rss_default_language;
    $_language = new Language();
    $_language->set_language($rss_default_language);
    $_language->read_module('feeds');
    $date = safe_query("SELECT `date` FROM " . PREFIX . "news WHERE published = '1' AND intern=0 ORDER BY date DESC LIMIT 0,1");
    if (mysql_num_rows($date)) {
        $date = mysql_fetch_assoc($date);
        $updated = $date['date'];
    } else {
        $updated = time();
    }
    $xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
                <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
                  <channel>
                    <title>' . $hp_title . ' ' . $_language->module['news_feed'] . '</title>
                    <link>http://' . $hp_url . '</link>
                    <atom:link href="http://' . $hp_url . '/tmp/rss.xml" rel="self" type="application/rss+xml" />
                    <description>' . $_language->module['latest_news_from'] . ' http://' . $hp_url . '</description>
                    <language>' . $rss_default_language . '-' . $rss_default_language . '</language>
                    <pubDate>' . date('D, d M Y h:i:s O', $updated) . '</pubDate>
                    ';
    $db_news = safe_query("SELECT * FROM " . PREFIX . "news WHERE published = '1' AND intern=0 ORDER BY date DESC LIMIT 0,10");
    $any_news = mysql_num_rows($db_news);
    if ($any_news) {
        while ($news = mysql_fetch_array($db_news)) {
            $db_newscontent = safe_query("SELECT * FROM " . PREFIX . "news_contents WHERE newsID = '" . $news['newsID'] . "' AND language='" . $rss_default_language . "'");
            $any_newscontent = mysql_num_rows($db_newscontent);
            if ($any_newscontent) {
                $newscontent = mysql_fetch_array($db_newscontent);
                $cat = safe_query('SELECT category FROM ' . PREFIX . 'news_category WHERE categoryID=' . $news['category']);
                $cat = mysql_fetch_array($cat);
                $xmlstring .= '<item>
	                       <title>' . htmlspecialchars($newscontent['headline']) . '</title>
	                       <description><![CDATA[' . (strlen(htmloutput($newscontent['content'])) >= 250 ? substr(htmloutput($newscontent['content']), 0, 245) . '[...]' : htmloutput($newscontent['content'])) . ']]></description>
	                       <author>' . getemail($news['poster']) . ' (' . getfirstname($news['poster']) . ' ' . getlastname($news['poster']) . ')</author>
	                       <guid><![CDATA[http://' . $hp_url . '/' . $cat['category'] . '/' . $news['newsID'] . '/]]></guid>
	                       <link><![CDATA[http://' . $hp_url . '/' . $cat['category'] . '/' . $news['newsID'] . '/]]></link>
	                     </item>
	  			            ';
            } else {
                continue;
            }
        }
    }
    $xmlstring .= '</channel>
                 </rss>';
    $rss_xml = fopen("tmp/rss.xml", "w");
    fwrite($rss_xml, $xmlstring);
    fclose($rss_xml);
}
Exemple #8
0
function jmd_rate_prefs($event, $step)
{
    ob_start('jmd_rate_prefs_head');
    pagetop('jmd_rate_prefs');
    echo '<div id="jmd_rate_prefs">';
    if (!$step) {
        echo fieldset(form(fInput('submit', 'install', 'Install', 'publish') . eInput('jmd_rate_prefs') . sInput('install')) . form(fInput('submit', 'uninstall', 'Uninstall', 'publish') . eInput('jmd_rate_prefs') . sInput('uninstall'), '', "verify('Are you sure you want to delete all ratings?');"), 'Setup', 'setup');
        echo fieldset(form('<label>Quantity ' . fInput('text', 'qty', 4) . '</label><br/>
				<label>Path and filename of star image ' . fInput('text', 'path', '/stars.png') . '</label><br/>
				<label>Star width' . fInput('text', 'width', 19) . '</label><br/>
				<label>Star height' . fInput('text', 'height', 18) . '</label><br/>
				<label>Container class name' . fInput('text', 'class', 'rating') . '</label><br/>' . fInput('submit', 'generate', 'Generate CSS', 'publish') . eInput('jmd_rate_prefs') . sInput('builder')), 'CSS builder');
    } elseif ($step == 'install') {
        $sql = "CREATE TABLE " . safe_pfx('jmd_rate') . "(\n\t\t\tparentid INT,\n\t\t\tvalue INT,\n\t\t\tmax_value INT,\n\t\t\tip INT UNSIGNED,\n\t\t\tPRIMARY KEY(parentid, ip)\n\t\t)";
        $create = safe_query($sql);
        if ($create) {
            echo tag('Table created successfully. ' . eLink('jmd_rate_prefs', '', '', '', 'Back to preferences?'), 'p', ' class="ok"');
        } else {
            echo tag('Database exists. ' . eLink('jmd_rate_prefs', '', '', '', 'Back to preferences?'), 'p', ' class="not-ok"');
        }
    } elseif ($step == 'uninstall') {
        safe_query("DROP TABLE IF EXISTS " . safe_pfx('jmd_rate'));
        echo tag('Table dropped. ' . eLink('jmd_rate_prefs', '', '', '', 'Back to preferences?'), 'p', ' class="ok"');
    } elseif ($step == 'builder') {
        if (is_numeric(gps('qty')) && is_numeric(gps('width')) && is_numeric(gps('height'))) {
            $qty = gps('qty');
            $w = round(gps('width'));
            $h = round(gps('height'));
            $path = htmlentities(gps('path'));
            $class = '.' . gps('class');
            echo tag('CSS', 'h1');
            echo "\n<textarea class=\"code\" cols=\"78\" rows=\"32\" id=\"jmd_rate_css\">\n{$class} {}\n\t{$class}, {$class} * {\n\t\tmargin: 0;\n\t\tborder: 0;\n\t\tpadding: 0;\n\t}\n\t{$class} ul {\n\t\theight: " . $h . "px;\n\t\tposition: relative;\n\t}\n\t\t{$class} ul, {$class} .current_rating, {$class} a:hover {\n\t\t\tbackground: url({$path});\n\t\t}\n\t\t{$class} li {\n\t\t\tlist-style: none;\n\t\t\ttext-indent: -9999px;\n\t\t}\n\t\t\t{$class} .current_rating {\n\t\t\t\tbackground-position: 0 -" . $h . "px;\n\t\t\t\tz-index: 1;\n\t\t\t}\n\t\t\t\t{$class} .current_rating, {$class} a {\n\t\t\t\t\theight: " . $h . "px;\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\ttop: 0;\n\t\t\t\t\tleft: 0;\n\t\t\t\t}\n\t\t\t{$class} a {\n\t\t\t\twidth: " . $w . "px;\n\t\t\t\theight: " . $h . "px;\n\t\t\t\toverflow: hidden;\n\t\t\t\tz-index: 3;\n\t\t\t}\n\t\t\t\t{$class} a:hover{\n\t\t\t\t\tbackground-position: left center;\n\t\t\t\t\tleft: 0;\n\t\t\t\t\tz-index: 2;\n\t\t\t\t}\n\t\t\t\t\t" . $class . "_1 a:hover { width: " . $w . "px }\n\t\t\t";
            for ($i = 2; $i <= $qty; $i++) {
                echo '
					' . $class . '_' . $i . ' a { left: ' . ($i - 1) * $w . 'px }
					' . $class . '_' . $i . ' a:hover { width: ' . $w * $i . 'px }
				';
            }
            echo '</textarea>';
        }
        echo tag(eLink('jmd_rate_prefs', '', '', '', 'Try again?'), 'p');
    } else {
        echo tag('Error.', 'h1');
    }
    echo '</div><!--//jmd_rate_prefs-->';
}
Exemple #9
0
echo '<h1>&curren; ' . $_language->module['about'] . '</h1>';
if (isset($_POST['submit']) != "") {
    $about = $_POST['message'];
    $CAPCLASS = new Captcha();
    if ($CAPCLASS->check_captcha(0, $_POST['captcha_hash'])) {
        if (mysql_num_rows(safe_query("SELECT * FROM " . PREFIX . "about"))) {
            safe_query("UPDATE " . PREFIX . "about SET about='" . $about . "'");
        } else {
            safe_query("INSERT INTO " . PREFIX . "about (about) values( '" . $about . "') ");
        }
        redirect("admincenter.php?site=about", "", 0);
    } else {
        echo $_language->module['transaction_invalid'];
    }
} else {
    $ergebnis = safe_query("SELECT * FROM " . PREFIX . "about");
    $ds = mysql_fetch_array($ergebnis);
    $CAPCLASS = new Captcha();
    $CAPCLASS->create_transaction();
    $hash = $CAPCLASS->get_hash();
    $_language->read_module('bbcode', true);
    echo '<script language="JavaScript" type="text/javascript">
					<!--
						function chkFormular() {
							if(!validbbcode(document.getElementById(\'message\').value, \'admin\')){
								return false;
							}
						}
					-->
				</script>';
    echo '<form method="post" id="post" name="post" action="admincenter.php?site=about" onsubmit="return chkFormular();">
// publisher's email address
if (!safe_field('name', 'txp_prefs', "name = 'publisher_email'")) {
    safe_insert('txp_prefs', "prefs_id = 1, name = 'publisher_email', val = '', type = 1, event = 'admin', position = 115");
}
// goodbye raw ?php support
if (safe_field('name', 'txp_prefs', "name = 'allow_raw_php_scripting'")) {
    safe_delete('txp_prefs', "name = 'allow_raw_php_scripting'");
}
safe_alter('txp_users', "MODIFY RealName VARCHAR(255) NOT NULL default '', MODIFY email VARCHAR(254) NOT NULL default ''");
// Remove any setup strings from lang table
safe_delete('txp_lang', "event='setup'");
$has_idx = 0;
$rs = getRows('show index from `' . PFX . 'textpattern`');
foreach ($rs as $row) {
    if ($row['Key_name'] == 'url_title_idx') {
        $has_idx = 1;
    }
}
if (!$has_idx) {
    safe_query('alter ignore table `' . PFX . 'textpattern` add index url_title_idx(`url_title`)');
}
// Remove is_default from txp_section table and make it a preference
if (!safe_field('name', 'txp_prefs', "name = 'default_section'")) {
    $current_default_section = safe_field('name', 'txp_section', 'is_default=1');
    safe_insert('txp_prefs', "prefs_id = 1, name = 'default_section', val = '" . doSlash($current_default_section) . "', type = '2', event = 'section', html = 'text_input', position = '0'");
}
$cols = getThings('describe `' . PFX . 'txp_section`');
if (in_array('is_default', $cols)) {
    safe_alter('txp_section', "DROP `is_default`");
}
safe_alter('txp_css', 'MODIFY css MEDIUMTEXT NOT NULL');
Exemple #11
0
    } else {
        $main_title = $_language->module['mainsponsors'];
    }
    echo '';
    while ($da = mysql_fetch_array($mainsponsors)) {
        if (!empty($da['banner_small'])) {
            $sponsor = '<img src="images/sponsors/' . $da['banner_small'] . '" alt="" />';
        } else {
            $sponsor = $da['name'];
        }
        $sponsorID = $da['sponsorID'];
        eval("\$sc_sponsors_main = \"" . gettemplate("sc_sponsors_main") . "\";");
        echo $sc_sponsors_main;
    }
}
$sponsors = safe_query("SELECT * FROM " . PREFIX . "sponsors WHERE (displayed = '1' AND mainsponsor = '0' " . $only . ") ORDER BY sort");
if (mysql_num_rows($sponsors)) {
    if (mysql_num_rows($sponsors) == 1) {
        $title = $_language->module['sponsor'];
    } else {
        $title = $_language->module['sponsors'];
    }
    echo '';
    while ($db = mysql_fetch_array($sponsors)) {
        if (!empty($db['banner_small'])) {
            $sponsor = '<img src="images/sponsors/' . $db['banner_small'] . '" alt="" />';
        } else {
            $sponsor = $db['name'];
        }
        $sponsorID = $db['sponsorID'];
        eval("\$sc_sponsors = \"" . gettemplate("sc_sponsors") . "\";");
Exemple #12
0
if (!in_array('flags', $cols)) {
    safe_alter('txp_plugin', "ADD flags SMALLINT UNSIGNED NOT NULL DEFAULT 0");
}
// Default theme.
if (!safe_field('name', 'txp_prefs', "name = 'theme_name'")) {
    safe_insert('txp_prefs', "prefs_id = 1, name = 'theme_name', val = 'classic', type = '1', event = 'admin', html = 'themename', position = '160'");
}
safe_alter('txp_plugin', 'CHANGE code code MEDIUMTEXT NOT NULL, CHANGE code_restore code_restore MEDIUMTEXT NOT NULL');
safe_alter('txp_prefs', 'CHANGE val val TEXT NOT NULL');
// Add author column to files and links,
// Boldy assuming that the publisher in charge of updating this site is the author of any existing content items.
foreach (array('txp_file', 'txp_link') as $table) {
    $cols = getThings('describe `' . PFX . $table . '`');
    if (!in_array('author', $cols)) {
        safe_alter($table, "ADD author varchar(255) NOT NULL default '', ADD INDEX author_idx (author)");
        safe_update($table, "author='" . doSlash($txp_user) . "'", '1=1');
    }
}
// Add indices on author columns.
foreach (array('textpattern' => 'AuthorID', 'txp_image' => 'author') as $table => $col) {
    $has_idx = 0;
    $rs = getRows('show index from `' . PFX . $table . '`');
    foreach ($rs as $row) {
        if ($row['Key_name'] == 'author_idx') {
            $has_idx = 1;
        }
    }
    if (!$has_idx) {
        safe_query('ALTER IGNORE TABLE `' . PFX . $table . '` ADD INDEX author_idx(' . $col . ')');
    }
}
Exemple #13
0
// <txp:message /> is dropped
safe_update('txp_form', "Form = REPLACE(Form, '<txp:message', '<txp:comment_message')", "1 = 1");
// Expiry datetime for articles
safe_upgrade_table('textpattern', array('Expires' => "datetime NOT NULL default '0000-00-00 00:00:00' after `Posted`"));
if (!safe_field('name', 'txp_prefs', "name = 'publish_expired_articles'")) {
    safe_insert('txp_prefs', "prefs_id = 1, name = 'publish_expired_articles', val = '0', type = '1', event='publish', html='yesnoradio', position='130'");
}
/*
 * @todo determine section:article relation key
 */
// populate section_id values
// foreach (safe_rows('id, name', 'txp_section', '1=1') as $row) {
//	safe_update('textpattern', "section_id='".doSlash($row['id'])."'", "Section='".doSlash($row['name'])."'");
//}
// fix up the parent field in txp_category
safe_query("alter ignore table " . safe_pfx('txp_category') . " modify parent INT not null");
$types = safe_column('distinct type', 'txp_category', '1=1');
foreach ($types as $type) {
    $root = safe_field('id', 'txp_category', "type='" . doSlash($type) . "' and name='root' and parent=0");
    if (!$root) {
        $root = safe_insert('txp_category', "name='root', type='" . doSlash($type) . "', parent=0");
    }
    safe_update('txp_category', "parent='" . $root . "'", "type='" . doSlash($type) . "' and parent=0 and id != '" . $root . "'");
    tree_rebuild_full('txp_category', "type='" . doSlash($type) . "'");
}
// index on form type
safe_upgrade_index('txp_form', 'type_idx', '', 'type');
// dropdown ui for certain prefs
safe_upgrade_table('txp_prefs', array('choices' => 'varchar(64)'));
safe_update('txp_prefs', "html='checkbox'", "html='yesnoradio'");
safe_update('txp_prefs', "html='text'", "html='text_input'");
Exemple #14
0
 }
 if (isforumadmin($ds['userID'])) {
     $usertype = $_language->module['administrator'];
     $rang = '<img src="images/icons/ranks/admin.gif" alt="" />';
 } elseif (isanymoderator($ds['userID'])) {
     $usertype = $_language->module['moderator'];
     $rang = '<img src="images/icons/ranks/moderator.gif" alt="" />';
 } else {
     $posts = getuserforumposts($ds['userID']);
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "forum_ranks WHERE " . $posts . " >= postmin AND " . $posts . " <= postmax AND postmax >0");
     $ds = mysql_fetch_array($ergebnis);
     $usertype = $ds['rank'];
     $rang = '<img src="images/icons/ranks/' . $ds['pic'] . '" alt="" />';
 }
 $lastvisits = "";
 $visitors = safe_query("SELECT v.*, u.nickname, u.country FROM " . PREFIX . "user_visitors v JOIN " . PREFIX . "user u ON u.userID = v.visitor WHERE v.userID='" . $id . "' ORDER BY v.date DESC LIMIT 0,8");
 if (mysql_num_rows($visitors)) {
     $n = 1;
     while ($dv = mysql_fetch_array($visitors)) {
         $n % 2 ? $bgcolor = BG_1 : ($bgcolor = BG_2);
         $flag = '[flag]' . $dv['country'] . '[/flag]';
         $country = flags($flag);
         $nicknamevisitor = $dv['nickname'];
         if (isonline($dv['visitor']) == "offline") {
             $statuspic = '<img src="images/icons/offline.gif" alt="' . $_language->module['offline'] . '" />';
         } else {
             $statuspic = '<img src="images/icons/online.gif" alt="' . $_language->module['online'] . '" />';
         }
         $time = time();
         $visittime = $dv['date'];
         $sec = $time - $visittime;
Exemple #15
0
<div id="wrapper">
  <div id="header">
    <h1>' . $_language->module['file_upload'] . ':</h1>
  </div>
    <div id="content">
    <div id="content-inner">
<form method="post" action="upload.php?' . $tableid . '=' . $id . '" enctype="multipart/form-data">
<table width="100%" cellpadding="4" cellspacing="1">
  <tr>
    <td align="center"><input type="file" name="screen" />
    <input type="submit" name="submit" value="' . $_language->module['upload'] . '" />
   
    <h1>' . $_language->module['existing_files'] . ':</h1>
    <table width="100%" border="0" cellspacing="0" cellpadding="2">';
    $ergebnis = safe_query("SELECT screens FROM " . PREFIX . "{$table} WHERE {$tableid}='{$id}'");
    $ds = mysql_fetch_array($ergebnis);
    $screens = array();
    if (!empty($ds['screens'])) {
        $screens = explode("|", $ds['screens']);
    }
    if (is_array($screens)) {
        foreach ($screens as $screen) {
            if ($screen != "") {
                echo '<tr>
            <td><a href="' . $filepath . $screen . '" target="_blank">' . $screen . '</a></td>
            <td><input type="text" name="pic" size="70" value="&lt;img src=&quot;' . $filepath . $screen . '&quot; border=&quot;0&quot; align=&quot;left&quot; style=&quot;padding:4px;&quot; alt=&quot;&quot; /&gt;" /></td>
            <td><input type="button" onclick="AddCodeFromWindow(\'[img]' . $filepath . $screen . '[/img] \')" value="' . $_language->module['add_to_message'] . '" /></td>
            <td><input type="button" onclick="MM_confirm(\'' . $_language->module['delete'] . '\',\'upload.php?action=delete&amp;' . $tableid . '=' . $id . '&amp;file=' . $screen . '\')" value="' . $_language->module['delete'] . '" /></td>
          </tr>';
            }
Exemple #16
0
    </tr>
  </table>
  </form>';
} else {
    echo '<h1>&curren; ' . $_language->module['squads'] . '</h1>';
    echo '<input type="button" onclick="MM_goToURL(\'parent\',\'admincenter.php?site=squads&amp;action=add\');return document.MM_returnValue" value="' . $_language->module['new_squad'] . '" /><br /><br />';
    echo '<form method="post" action="admincenter.php?site=squads">
  <table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#DDDDDD">
    <tr>
      <td width="20%" class="title"><b>' . $_language->module['squad_name'] . '</b></td>
      <td width="17%" class="title"><b>' . $_language->module['squad_type'] . '</b></td>
      <td width="35%" class="title"><b>' . $_language->module['squad_info'] . '</b></td>
      <td width="20%" class="title"><b>' . $_language->module['actions'] . '</b></td>
      <td width="8%" class="title"><b>' . $_language->module['sort'] . '</b></td>
    </tr>';
    $squads = safe_query("SELECT * FROM " . PREFIX . "squads ORDER BY sort");
    $anzsquads = mysql_num_rows($squads);
    $CAPCLASS = new Captcha();
    $CAPCLASS->create_transaction();
    $hash = $CAPCLASS->get_hash();
    if ($anzsquads) {
        $i = 1;
        while ($db = mysql_fetch_array($squads)) {
            if ($i % 2) {
                $td = 'td1';
            } else {
                $td = 'td2';
            }
            $games = explode(";", $db['games']);
            $games = implode(", ", $games);
            if ($games) {
Exemple #17
0
function showlock($reason, $time)
{
    $gettitle = mysql_fetch_array(safe_query("SELECT title FROM " . PREFIX . "styles"));
    $pagetitle = $gettitle['title'];
    eval("\$lock = \"" . gettemplate("lock") . "\";");
    die($lock);
}
function ign_admin($message = '')
{
    global $myprivs, $ign_user, $ign_user_db, $ign_privs;
    pagetop(ign_gTxt('manage_users'), $message);
    $themail = fetch('email', $ign_user_db, 'name', $ign_user);
    $table_exists = safe_query("show table status like 'ign_users'");
    echo ign_useCustomDbForm();
    if ($ign_user_db == 'ign_users' && $table_exists) {
        echo ign_userList();
        echo in_array($myprivs, explode(',', $ign_privs['new_user'])) ? ign_new_user_form() : '';
        echo in_array($myprivs, explode(',', $ign_privs['reset_pass'])) ? ign_resetUserPassForm() : '';
    } else {
        echo '<div align="center" style="margin-top:3em">User management functions only available here when using custom database.<br />Use <a href="?event=admin">site admin</a> tab instead.</div>';
    }
}
function jmd_wiki_events_prefs($event, $step)
{
    ob_start('jmd_wiki_events_prefs_head');
    // event alias
    $eName = 'jmd_wiki_events_prefs';
    pagetop($eName);
    echo '<div id="jmd_wiki_events_prefs">';
    if (!$step) {
        echo fieldset(form(fInput('submit', 'install', 'Install', 'publish') . eInput($eName) . sInput('install')) . form(fInput('submit', 'uninstall', 'Uninstall', 'publish') . eInput($eName) . sInput('uninstall'), '', "verify('Are you sure you want to delete all stored events?');"), 'Setup', 'setup');
    } elseif ($step == 'install') {
        $sql = "CREATE TABLE " . safe_pfx('jmd_wiki_events') . "(\n            title VARCHAR(15) KEY,\n            last_mod DATE,\n            contents LONGTEXT\n        )";
        $create = safe_query($sql);
        if ($create) {
            echo tag('Table created successfully. ' . eLink($eName, '', '', '', 'Back to preferences?'), 'p', ' class="ok"');
        } else {
            echo tag('Database exists. ' . eLink($eName, '', '', '', 'Back to preferences?'), 'p', ' class="not-ok"');
        }
    } elseif ($step == 'uninstall') {
        safe_query("DROP TABLE IF EXISTS " . safe_pfx('jmd_wiki_events'));
        echo tag('Table dropped. ' . eLink($eName, '', '', '', 'Back to preferences?'), 'p', ' class="ok"');
    } else {
        echo tag('Error.', 'h1');
    }
    echo '</div>';
}
Exemple #20
0
#                                                                        #
#   Copyright 2005-2011 by webspell.org                                  #
#                                                                        #
#   visit webSPELL.org, webspell.info to get webSPELL for free           #
#   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
#   - It's NOT allowed to remove this copyright-tag                      #
#   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
#                                                                        #
#   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
#   Far Development by Development Team - webspell.org                   #
#                                                                        #
#   visit webspell.org                                                   #
#                                                                        #
##########################################################################
*/
$result = safe_query("SELECT * FROM " . PREFIX . "servers ORDER BY sort");
$n = 1;
while ($row = mysql_fetch_array($result)) {
    echo '<table width="100%" cellspacing="0" cellpadding="2" border="0">';
    $servername = htmloutput($row['name']);
    $serverip = $row['ip'];
    $servergame = '<img src="images/games/' . $row['game'] . '.gif" alt="" />';
    if ($n % 2) {
        $bg1 = BG_1;
        $bg2 = BG_2;
    } else {
        $bg1 = BG_3;
        $bg2 = BG_4;
    }
    eval("\$sc_servers = \"" . gettemplate("sc_servers") . "\";");
    echo $sc_servers;
function check_if_exists($cc)
{
    $result = safe_query("SELECT id FROM country_data WHERE cc_code_2='{$cc}'");
    return sqlite_fetch_array($result, SQLITE_NUM) ? TRUE : FALSE;
}
Exemple #22
0
function insertlinks($content, $calledfrom = 'root')
{
    global $insertlinks;
    if ($calledfrom == 'admin') {
        $prefix = '../';
    } else {
        $prefix = '';
    }
    if ($insertlinks == 1) {
        $ergebnis = safe_query("SELECT us.userID, us.nickname, us.country FROM " . PREFIX . "squads_members AS sq, " . PREFIX . "user AS us WHERE sq.userID=us.userID GROUP BY us.userID");
        while ($ds = mysql_fetch_array($ergebnis)) {
            $content = str_replace($ds['nickname'] . ' ', '[flag]' . $ds['country'] . '[/flag] <a href="' . $prefix . 'index.php?site=profile&amp;id=' . $ds['userID'] . '">' . $ds['nickname'] . '</a>&nbsp;', $content);
        }
        return $content;
    } else {
        return $content;
    }
}
Exemple #23
0
 $pages = ceil($gesamt / $max);
 if ($pages > 1) {
     $page_link = makepagelink("index.php?site=clanwars&amp;sort={$sort}&amp;type={$type}", $page, $pages);
 } else {
     $page_link = "";
 }
 if ($page == "1") {
     $ergebnis = safe_query("SELECT c.*, s.name AS squadname FROM " . PREFIX . "clanwars c LEFT JOIN " . PREFIX . "squads s ON s.squadID=c.squad ORDER BY c.{$sort} {$type} LIMIT 0,{$max}");
     if ($type == "DESC") {
         $n = $gesamt;
     } else {
         $n = 1;
     }
 } else {
     $start = $page * $max - $max;
     $ergebnis = safe_query("SELECT c.*, s.name AS squadname FROM " . PREFIX . "clanwars c LEFT JOIN " . PREFIX . "squads s ON s.squadID=c.squad ORDER BY {$sort} {$type} LIMIT {$start},{$max}");
     if ($type == "DESC") {
         $n = $gesamt - $page * $max + $max;
     } else {
         $n = $gesamt + 1 - $page * $max + $max;
     }
 }
 if ($type == "ASC") {
     $seiten = '<a href="index.php?site=clanwars&amp;page=' . $page . '&amp;sort=' . $sort . '&amp;type=DESC">' . $_language->module['sort'] . ':</a> <img src="images/icons/asc.gif" width="9" height="7" border="0" alt="" /> ' . $page_link . '<br /><br />';
 } else {
     $seiten = '<a href="index.php?site=clanwars&amp;page=' . $page . '&amp;sort=' . $sort . '&amp;type=ASC">' . $_language->module['sort'] . ':</a> <img src="images/icons/desc.gif" width="9" height="7" border="0" alt="" /> ' . $page_link . '<br /><br />';
 }
 if (isclanwaradmin($userID)) {
     $admin = '<input type="button" onclick="MM_openBrWindow(\'clanwars.php?action=new\',\'Clanwars\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\')" value="' . $_language->module['new_clanwar'] . '" />';
 } else {
     $admin = '';
Exemple #24
0
     if ($search) {
         $ergebnis = safe_query("SELECT u.* FROM " . PREFIX . "user u WHERE userID='{$search}' ORDER BY {$sort} {$type} LIMIT 0,{$max}");
     } else {
         $ergebnis = safe_query("SELECT u.* FROM " . PREFIX . "user u ORDER BY {$sort} {$type} LIMIT 0,{$max}");
     }
     if ($type == "DESC") {
         $n = $gesamt;
     } else {
         $n = 1;
     }
 } else {
     $start = $page * $max - $max;
     if ($search) {
         $ergebnis = safe_query("SELECT u.* FROM " . PREFIX . "user u WHERE userID='{$search}' ORDER BY {$sort} {$type} LIMIT {$start},{$max}");
     } else {
         $ergebnis = safe_query("SELECT u.* FROM " . PREFIX . "user u ORDER BY {$sort} {$type} LIMIT {$start},{$max}");
     }
     if ($type == "DESC") {
         $n = $gesamt - $page * $max + $max;
     } else {
         $n = $gesamt + 1 - $page * $max + $max;
     }
 }
 $page_link = '';
 if ($pages > 1) {
     if ($status == true) {
         $sort = "status";
     }
     $page_link = makepagelink("admincenter.php?site=users&amp;sort={$sort}&amp;type={$type}&amp;search={$search}", $page, $pages);
     $page_link = str_replace('images/', '../images/', $page_link);
 }
Exemple #25
0
#                                                                        #
#   Copyright 2005-2011 by webspell.org                                  #
#                                                                        #
#   visit webSPELL.org, webspell.info to get webSPELL for free           #
#   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
#   - It's NOT allowed to remove this copyright-tag                      #
#   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
#                                                                        #
#   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
#   Far Development by Development Team - webspell.org                   #
#                                                                        #
#   visit webspell.org                                                   #
#                                                                        #
##########################################################################
*/
$ergebnis = safe_query("SELECT date, title, articlesID FROM " . PREFIX . "articles WHERE saved='1' ORDER BY date DESC LIMIT 0, " . $latestarticles);
if (mysql_num_rows($ergebnis)) {
    echo '<table width="100%" cellspacing="0" cellpadding="2">';
    $n = 1;
    while ($ds = mysql_fetch_array($ergebnis)) {
        $date = date("d.m.Y", $ds['date']);
        $time = date("H:i", $ds['date']);
        $title = $ds['title'];
        $articlesID = $ds['articlesID'];
        if ($n % 2) {
            $bg1 = BG_1;
            $bg2 = BG_2;
        } else {
            $bg1 = BG_3;
            $bg2 = BG_4;
        }
Exemple #26
0
function doDiagnostics()
{
    global $files, $txpcfg, $step;
    extract(get_prefs());
    $urlparts = parse_url(hu);
    $mydomain = $urlparts['host'];
    $server_software = @$_SERVER['SERVER_SOFTWARE'] || @$_SERVER['HTTP_HOST'] ? @$_SERVER['SERVER_SOFTWARE'] ? @$_SERVER['SERVER_SOFTWARE'] : $_SERVER['HTTP_HOST'] : '';
    $is_apache = ($server_software and stristr($server_software, 'Apache')) or is_callable('apache_get_version');
    $real_doc_root = isset($_SERVER['DOCUMENT_ROOT']) ? realpath($_SERVER['DOCUMENT_ROOT']) : '';
    // ini_get() returns string values passed via php_value as a string, not boolean
    $is_register_globals = (strcasecmp(ini_get('register_globals'), 'on') === 0 or ini_get('register_globals') === '1');
    $fail = array('path_to_site_missing' => !isset($path_to_site) ? gTxt('path_to_site_missing') : '', 'dns_lookup_fails' => @gethostbyname($mydomain) == $mydomain ? gTxt('dns_lookup_fails') . cs . $mydomain : '', 'path_to_site_inacc' => !@is_dir($path_to_site) ? gTxt('path_to_site_inacc') . cs . $path_to_site : '', 'site_trailing_slash' => rtrim($siteurl, '/') != $siteurl ? gTxt('site_trailing_slash') . cs . $path_to_site : '', 'index_inaccessible' => (!@is_file($path_to_site . "/index.php") or !@is_readable($path_to_site . "/index.php")) ? "{$path_to_site}/index.php " . gTxt('is_inaccessible') : '', 'dir_not_writable' => trim((!@is_writable($path_to_site . '/' . $img_dir) ? str_replace('{dirtype}', gTxt('img_dir'), gTxt('dir_not_writable')) . ": {$path_to_site}/{$img_dir}\r\n" : '') . (!@is_writable($file_base_path) ? str_replace('{dirtype}', gTxt('file_base_path'), gTxt('dir_not_writable')) . ": {$file_base_path}\r\n" : '') . (!@is_writable($tempdir) ? str_replace('{dirtype}', gTxt('tempdir'), gTxt('dir_not_writable')) . ": {$tempdir}\r\n" : '')), 'cleanurl_only_apache' => ($permlink_mode != 'messy' and !$is_apache) ? gTxt('cleanurl_only_apache') : '', 'htaccess_missing' => ($permlink_mode != 'messy' and !@is_readable($path_to_site . '/.htaccess')) ? gTxt('htaccess_missing') : '', 'mod_rewrite_missing' => ($permlink_mode != 'messy' and is_callable('apache_get_modules') and !apache_module('mod_rewrite')) ? gTxt('mod_rewrite_missing') : '', 'file_uploads_disabled' => !ini_get('file_uploads') ? gTxt('file_uploads_disabled') : '', 'setup_still_exists' => @is_dir($txpcfg['txpath'] . DS . 'setup') ? $txpcfg['txpath'] . DS . "setup" . DS . ' ' . gTxt('still_exists') : '', 'no_temp_dir' => empty($tempdir) ? gTxt('no_temp_dir') : '', 'warn_mail_unavailable' => !is_callable('mail') ? gTxt('warn_mail_unavailable') : '', 'warn_register_globals_or_update' => $is_register_globals && (version_compare(phpversion(), '4.4.0', '<=') or version_compare(phpversion(), '5.0.0', '>=') and version_compare(phpversion(), '5.0.5', '<=')) ? gTxt('warn_register_globals_or_update') : '');
    if ($permlink_mode != 'messy') {
        $rs = safe_column("name", "txp_section", "1");
        foreach ($rs as $name) {
            if (@file_exists($path_to_site . '/' . $name)) {
                $fail['old_placeholder_exists'] = gTxt('old_placeholder') . ": {$path_to_site}/{$name}";
            }
        }
    }
    $missing = array();
    foreach ($files as $f) {
        if (!is_readable($txpcfg['txpath'] . $f)) {
            $missing[] = $txpcfg['txpath'] . $f;
        }
    }
    if ($missing) {
        $fail['missing_files'] = gTxt('missing_files') . cs . join(', ', $missing);
    }
    foreach ($fail as $k => $v) {
        if (empty($v)) {
            unset($fail[$k]);
        }
    }
    # Find the highest revision number
    $file_revs = array();
    $rev = 0;
    foreach ($files as $f) {
        $lines = @file($txpcfg['txpath'] . $f);
        if ($lines) {
            foreach ($lines as $line) {
                if (preg_match('/^\\$LastChangedRevision: (\\w+) \\$/', $line, $match)) {
                    $file_revs[$f] = $match[1];
                    if ($match[1] > $rev) {
                        $rev = $match[1];
                    }
                }
            }
        }
    }
    echo pagetop(gTxt('tab_diagnostics'), ''), startTable('list'), tr(td(hed(gTxt('preflight_check'), 1)));
    if ($fail) {
        foreach ($fail as $help => $message) {
            echo tr(tda(nl2br($message) . popHelp($help), ' style="color:red;"'));
        }
    } else {
        echo tr(td(gTxt('all_checks_passed')));
    }
    echo tr(td(hed(gTxt('diagnostic_info'), 1)));
    $fmt_date = '%Y-%m-%d %H:%M:%S';
    $out = array('<textarea style="width:500px;height:300px;" readonly="readonly">', gTxt('txp_version') . cs . txp_version . ' (' . ($rev ? 'r' . $rev : 'unknown revision') . ')' . n, gTxt('last_update') . cs . gmstrftime($fmt_date, $dbupdatetime) . '/' . gmstrftime($fmt_date, @filemtime(txpath . '/update/_update.php')) . n, gTxt('document_root') . cs . @$_SERVER['DOCUMENT_ROOT'] . ($real_doc_root != @$_SERVER['DOCUMENT_ROOT'] ? ' (' . $real_doc_root . ')' : '') . n, '$path_to_site' . cs . $path_to_site . n, gTxt('txp_path') . cs . $txpcfg['txpath'] . n, gTxt('permlink_mode') . cs . $permlink_mode . n, ini_get('open_basedir') ? 'open_basedir: ' . ini_get('open_basedir') . n : '', ini_get('upload_tmp_dir') ? 'upload_tmp_dir: ' . ini_get('upload_tmp_dir') . n : '', gTxt('tempdir') . cs . $tempdir . n, gTxt('web_domain') . cs . $siteurl . n, getenv('TZ') ? 'TZ: ' . getenv('TZ') . n : '', gTxt('php_version') . cs . phpversion() . n, $is_register_globals ? gTxt('register_globals') . cs . $is_register_globals . n : '', gTxt('server_time') . cs . strftime('%Y-%m-%d %H:%M:%S') . n, 'MySQL' . cs . mysql_get_server_info() . n, gTxt('locale') . cs . $locale . n, isset($_SERVER['SERVER_SOFTWARE']) ? gTxt('server') . cs . $_SERVER['SERVER_SOFTWARE'] . n : '', is_callable('apache_get_version') ? gTxt('apache_version') . cs . apache_get_version() . n : '', $fail ? n . gTxt('preflight_check') . cs . n . ln . join("\n", $fail) . n . ln : '', is_readable($path_to_site . '/.htaccess') ? n . gTxt('htaccess_contents') . cs . n . ln . join('', file($path_to_site . '/.htaccess')) . n . ln : '');
    if ($step == 'high') {
        $mysql_client_encoding = is_callable('mysql_client_encoding') ? mysql_client_encoding() : '-';
        $out[] = n . 'Charset (default/config)' . cs . $mysql_client_encoding . '/' . @$txpcfg['dbcharset'] . n;
        $result = safe_query("SHOW variables like 'character_se%'");
        while ($row = mysql_fetch_row($result)) {
            $out[] = $row[0] . cs . $row[1] . n;
            if ($row[0] == 'character_set_connection') {
                $conn_char = $row[1];
            }
        }
        $table_names = array(PFX . 'textpattern');
        $result = safe_query("SHOW TABLES LIKE '" . PFX . "txp\\_%'");
        while ($row = mysql_fetch_row($result)) {
            $table_names[] = $row[0];
        }
        $table_msg = array();
        foreach ($table_names as $table) {
            $ctr = safe_query("SHOW CREATE TABLE " . $table . "");
            if (!$ctr) {
                unset($table_names[$table]);
                continue;
            }
            $ctcharset = preg_replace('#^CREATE TABLE.*SET=([^ ]+)[^)]*$#is', '\\1', mysql_result($ctr, 0, 'Create Table'));
            if (isset($conn_char) && !stristr($ctcharset, 'CREATE') && $conn_char != $ctcharset) {
                $table_msg[] = "{$table} is {$ctcharset}";
            }
            $ctr = safe_query("CHECK TABLE " . $table);
            if (in_array(mysql_result($ctr, 0, 'Msg_type'), array('error', 'warning'))) {
                $table_msg[] = $table . cs . mysql_result($ctr, 0, 'Msg_Text');
            }
        }
        if ($table_msg == array()) {
            $table_msg = count($table_names) < 18 ? array('-') : array('OK');
        }
        $out[] = count($table_names) . ' Tables' . cs . implode(', ', $table_msg) . n;
        $extns = get_loaded_extensions();
        $extv = array();
        foreach ($extns as $e) {
            $extv[] = $e . (phpversion($e) ? '/' . phpversion($e) : '');
        }
        $out[] = n . gTxt('php_extensions') . cs . join(', ', $extv) . n;
        if (is_callable('apache_get_modules')) {
            $out[] = n . gTxt('apache_modules') . cs . join(', ', apache_get_modules()) . n . n;
        }
        foreach ($files as $f) {
            $rev = '';
            $checksum = '';
            if (is_callable('md5_file')) {
                $checksum = md5_file($txpcfg['txpath'] . $f);
            }
            if (isset($file_revs[$f])) {
                $rev = $file_revs[$f];
            }
            $out[] = "{$f}" . cs . ($rev ? "r" . $rev : gTxt('unknown')) . ' (' . ($checksum ? $checksum : gTxt('unknown')) . ')' . n;
        }
    }
    $out[] = '</textarea>' . br;
    $dets = array('low' => gTxt('low'), 'high' => gTxt('high'));
    $out[] = form(eInput('diag') . n . gTxt('detail') . cs . selectInput('step', $dets, $step, 0, 1));
    echo tr(td(join('', $out))), endTable();
}
Exemple #27
0
        }
    }
}
define('txpath', dirname(dirname(__FILE__)) . '/textpattern');
define('txpinterface', 'xmlrpc');
require_once txpath . '/config.php';
require_once txpath . '/lib/txplib_db.php';
require_once txpath . '/lib/txplib_misc.php';
require_once txpath . '/lib/admin_config.php';
require_once txpath . '/lib/IXRClass.php';
require_once txpath . '/vendors/Textpattern/Loader.php';
$loader = new \Textpattern\Loader(txpath . '/vendors');
$loader->register();
$loader = new \Textpattern\Loader(txpath . '/lib');
$loader->register();
if ($connected && numRows(safe_query("show tables like '" . PFX . "textpattern'"))) {
    // TODO: where is dbversion used?
    $dbversion = safe_field('val', 'txp_prefs', "name = 'version'");
    // Hold it globally, instead of do several calls to the function.
    $prefs = get_prefs();
    extract($prefs);
    if (!defined('LANG')) {
        define("LANG", $language);
    }
    if (!defined('hu')) {
        define("hu", 'http://' . $siteurl . '/');
    }
    if (!defined('txrpcpath')) {
        define('txrpcpath', hu . 'rpc/');
    }
    if (!empty($locale)) {
Exemple #28
0
function getmapname($mapID)
{
    $ds = mysql_fetch_array(safe_query("SELECT map FROM " . PREFIX . "maps WHERE mapID='{$mapID}'"));
    return htmlspecialchars($ds['map']);
}
Exemple #29
0
function getThing($query, $debug = '')
{
    if ($r = safe_query($query, $debug)) {
        $thing = mysql_num_rows($r) != 0 ? mysql_result($r, 0) : '';
        mysql_free_result($r);
        return $thing;
    }
    return false;
}
Exemple #30
0
}
header("Content-type: text/html; charset=utf-8");
if (isset($_POST['preview'])) {
    include txpath . '/publish.php';
    textpattern();
    exit;
}
error_reporting(E_ALL);
@ini_set("display_errors", "1");
include txpath . '/lib/txplib_db.php';
include txpath . '/lib/txplib_forms.php';
include txpath . '/lib/txplib_html.php';
include txpath . '/lib/txplib_misc.php';
include txpath . '/lib/admin_config.php';
$microstart = getmicrotime();
if ($connected && safe_query("describe " . PFX . "textpattern")) {
    $dbversion = safe_field('val', 'txp_prefs', "name = 'version'");
    $prefs = get_prefs();
    extract($prefs);
    if (empty($siteurl)) {
        $siteurl = $_SERVER['HTTP_HOST'] . rtrim(dirname(dirname($_SERVER['SCRIPT_NAME'])), '/');
    }
    if (empty($path_to_site)) {
        updateSitePath(dirname(dirname(__FILE__)));
    }
    define("LANG", $language);
    //i18n: define("LANG","en-gb");
    define('txp_version', $thisversion);
    define("hu", 'http://' . $siteurl . '/');
    // v1.0 experimental relative url global
    define("rhu", preg_replace("/http:\\/\\/.+(\\/.*)\\/?\$/U", "\$1", hu));