本文整理汇总了PHP中safe_query函数的典型用法代码示例。如果您正苦于以下问题:PHP safe_query函数的具体用法?PHP safe_query怎么用?PHP safe_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了safe_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendmessage
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");
}
}
}
示例2: get_headline
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&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&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&action=showdemo&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&action=show&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&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&pollID=' . $id . '">' . $res['title'] . '</a>';
}
return '';
}
示例3: check_if_exists
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;
}
示例4: update_txp_lang
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();
}
}
}
}
}
}
}
示例5: checkCommentsAllow
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;
}
示例6: getSingleValue
function getSingleValue($query)
{
$result1 = safe_query($query);
while ($row = mysql_fetch_array($result1)) {
$value = $row[0];
}
return $value;
}
示例7: generate_rss2
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);
}
示例8: jmd_rate_prefs
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-->';
}
示例9: Captcha
echo '<h1>¤ ' . $_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();">
示例10: safe_insert
// 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');
示例11: while
} 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") . "\";");
示例12: safe_alter
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 . ')');
}
}
示例13: safe_update
// <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'");
示例14: elseif
}
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;
示例15: safe_query
<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="<img src="' . $filepath . $screen . '" border="0" align="left" style="padding:4px;" alt="" />" /></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&' . $tableid . '=' . $id . '&file=' . $screen . '\')" value="' . $_language->module['delete'] . '" /></td>
</tr>';
}