本文整理汇总了PHP中db_count_query函数的典型用法代码示例。如果您正苦于以下问题:PHP db_count_query函数的具体用法?PHP db_count_query怎么用?PHP db_count_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了db_count_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count_files
function count_files($cid)
{
$zges = 0;
$e = db_query("SELECT `id` FROM `prefix_linkcats` WHERE `cat` = " . $cid);
if (db_num_rows($e) > 0) {
while ($r = db_fetch_assoc($e)) {
$zges = $zges + count_files($r['id']);
}
}
$zges = $zges + db_count_query("SELECT COUNT(*) FROM `prefix_links` WHERE `cat` = " . $cid);
return $zges;
}
示例2: content_stats
function content_stats($m)
{
$numrows = db_count_query("SELECT COUNT(id) FROM `prefix_stats_content` WHERE content = '" . $m . "'");
if ($numrows == 0) {
if (db_query("INSERT INTO `prefix_stats_content` (content, counter) VALUES ('" . $m . "', '1')")) {
debug('"' . $m . '" zu ContentStats hinzugefuegt');
} else {
debug('"' . $m . '" konnte nicht geloggt werden');
}
} else {
if ($numrows >= 1) {
db_query("UPDATE `prefix_stats_content` SET counter = counter +1 WHERE content = '" . $m . "'");
debug('ContentStats aktualisiert...');
}
}
}
示例3: dbliste
}
$ar['mods1'] = dbliste($ar['mod1'], $tpl, 'mods1', "SELECT id,name FROM prefix_user WHERE recht <= -4 ORDER BY name");
$ar['mods2'] = dbliste($ar['mod2'], $tpl, 'mods2', "SELECT id,name FROM prefix_user WHERE recht <= -4 ORDER BY name");
$ar['mods3'] = dbliste($ar['mod3'], $tpl, 'mods3', "SELECT id,name FROM prefix_user WHERE recht <= -4 ORDER BY name");
$ar['mods4'] = dbliste($ar['mod4'], $tpl, 'mods4', "SELECT id,name FROM prefix_user WHERE recht <= -4 ORDER BY name");
$ar['mods2'] = '<option value="0">keiner</option>' . $ar['mods2'];
$ar['mods3'] = '<option value="0">keiner</option>' . $ar['mods3'];
$ar['mods4'] = '<option value="0">keiner</option>' . $ar['mods4'];
$ar['pic'] = arlistee($ar['img'], get_teampic_ar());
$ar['pic'] = '<option value="0">kein Bild<option>' . $ar['pic'];
$ar['msg'] = empty($msg) ? '' : '<table width="50%" cellpadding="2" cellspacing="1" border="0" class="border"><tr><td class="Cnorm"><b>Nachricht:</b> ' . $msg . '</td></tr></table>';
$ar['joinu'] = '';
if (0 < db_result(db_query("SELECT COUNT(*) FROM prefix_usercheck WHERE ak = 4"), 0)) {
$ar['joinu'] = '<a href="admin.php?groups-joinus"><b>Joinus Anfragen bearbeiten</b></a><br /><br />';
}
$tpl->set_ar_out($ar, 0);
$class = 'Cnorm';
$erg = db_query("SELECT name,id FROM prefix_groups ORDER BY pos ASC");
while ($row = db_fetch_assoc($erg)) {
$row['useranz'] = db_count_query("SELECT COUNT(uid) FROM prefix_groupusers WHERE gid = " . $row['id']);
$class = $class == 'Cnorm' ? 'Cmite' : 'Cnorm';
$row['class'] = $class;
$tpl->set_ar_out($row, 1);
}
$tpl->out(2);
if ($allgAr['groups_forall'] and $_SESSION['authright'] > -8) {
$tpl->out(3);
}
$tpl->out(4);
}
$design->footer();
示例4: db_query
$e = db_query("SELECT id FROM prefix_forums WHERE cid = " . $cid);
while ($r = db_fetch_row($e)) {
db_query("DELETE FROM prefix_posts WHERE fid = " . $r[0]);
db_query("DELETE FROM prefix_topics WHERE fid = " . $r[0]);
}
db_query("DELETE FROM prefix_forums WHERE cid = " . $cid);
list($pos, $uid) = db_fetch_row(db_query("SELECT pos, cid FROM prefix_forumcats WHERE id = " . $cid));
db_query("UPDATE prefix_forumcats SET pos = pos -1 WHERE pos > " . $pos . " AND cid = " . $uid);
db_query("DELETE FROM prefix_forumcats WHERE id = " . $cid);
break;
case 'moveCategorie':
$move = $menu->get(2);
$cid = $menu->get(3);
$topcid = db_result(db_query("SELECT cid FROM `prefix_forumcats` WHERE id = {$cid}"), 0);
$pos = $menu->get(4);
$a = db_count_query("SELECT COUNT(*) as anz FROM prefix_forumcats WHERE cid = {$topcid}");
$np = $move == 0 ? $pos - 1 : $pos + 1;
$np = $np >= $a - 1 ? $a - 1 : $np;
$np = $np < 0 ? 0 : $np;
db_query("UPDATE prefix_forumcats SET pos = " . $pos . " WHERE cid = " . $topcid . " AND pos = " . $np);
db_query("UPDATE prefix_forumcats SET pos = " . $np . " WHERE id = " . $cid);
break;
case 'repair':
$tpl = new tpl('forum/repair', 1);
if (isset($_POST['sub'])) {
//Kategorien
if ($_POST['cb_repc'] == 'on') {
$cats_sql = db_query("SELECT cid FROM `prefix_forumcats`");
while ($cats_row = db_fetch_object($cats_sql)) {
$ucats_sql = db_query("SELECT id FROM `prefix_forumcats` WHERE cid = {$cats_row->cid} ORDER BY pos, id");
$pos = 0;
示例5: defined
<?php
/**
* @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL)
* @copyright (C) 2000-2010 ilch.de
* @version $Id$
*/
defined('main') or die('no direct access');
// -----------------------------------------------------------|
$title = $allgAr['title'] . ' :: Joinus';
$hmenu = 'Joinus';
$header = array('jquery/jquery.validate.js', 'forms/joinus.js');
$design = new design($title, $hmenu);
$design->header($header);
if (0 == db_count_query("SELECT COUNT(*) FROM `prefix_groups` WHERE `show_joinus` = 1")) {
echo $lang['noteamthere'];
$design->footer();
exit;
}
$skill_ar = array(1 => $lang['verybad'], 2 => $lang['bad'], 3 => $lang['middle'], 4 => $lang['good'], 5 => $lang['verygood']);
$far = array('name', 'skill', 'icqnumber', 'favmap', 'mail', 'age', 'hometown', 'squad', 'ground', 'rules');
$x = 0;
foreach ($far as $v) {
if (!empty($_POST[$v])) {
${$v} = escape($_POST[$v], 'string');
$x++;
} else {
${$v} = '';
}
}
$xname = escape_nickname($name);
示例6: db_query
if (empty($_POST['vid'])) {
db_query('INSERT INTO `prefix_poll` (`frage`,`recht`,`stat`,`text`) VALUES ( "' . $_POST['frage'] . '" , "' . $_POST['poll_recht'] . '" , "1" ,"") ');
$poll_id = db_last_id();
$i = 1;
foreach ($_POST['antw'] as $v) {
if (!empty($v)) {
$v = escape($v, 'string');
db_query('INSERT INTO `prefix_poll_res` (`sort`,`poll_id`,`antw`,`res`) VALUES ( "' . $i . '" , "' . $poll_id . '" , "' . $v . '" , "" ) ');
$i++;
}
}
} else {
db_query('UPDATE `prefix_poll` SET frage = "' . $_POST['frage'] . '", recht = "' . $_POST['poll_recht'] . '" WHERE poll_id = "' . $_POST['vid'] . '"');
$i = 1;
foreach ($_POST['antw'] as $k => $v) {
$a = db_count_query("SELECT COUNT(*) FROM `prefix_poll_res` WHERE `poll_id` = " . $_POST['vid'] . " AND `sort` = " . $k);
$v = escape($v, 'string');
if ($a == 0 and $v != '') {
db_query("INSERT INTO `prefix_poll_res` (`sort`,`poll_id`,`antw`,`res`) VALUES ( '" . $i . "' , '" . $_POST['vid'] . "' , '" . $v . "' , '' )");
$i++;
} elseif ($a == 1 and $v == '') {
db_query("DELETE FROM `prefix_poll_res` WHERE `poll_id` = " . $_POST['vid'] . " AND `sort` = " . $k);
} elseif ($a == 1 and $v != '') {
db_query("UPDATE `prefix_poll_res` SET `antw` = '" . $v . "', `sort` = " . $i . " WHERE `poll_id` = " . $_POST['vid'] . " AND `sort` = " . $k);
$i++;
}
}
}
}
if (empty($_POST['add'])) {
if (isset($_GET['vid'])) {
示例7: str_replace
$gAnz = @db_result(db_query(str_replace('{WHERE}', $where, str_replace('{SELECT}', ' COUNT(DISTINCT a.id)', $q))), 0);
$q = str_replace('{WHERE}', $where, str_replace('{SELECT}', $s, $q));
}
$MPL = db_make_sites($page, "", $limit, 'index.php?forum-' . $such . ($such == 'aeit' ? '-' . $uid : ''), "", $gAnz);
$tpl = new tpl('forum/search');
$q = db_query($q . " LIMIT {$anfang},{$limit}");
$class = '';
$tpl->set_out('gAnz', $gAnz, 0);
while ($r = db_fetch_assoc($q)) {
$class = $class == 'Cmite' ? 'Cnorm' : 'Cmite';
$r['class'] = $class;
$r['ctime'] = db_result(db_query("SELECT MAX(time) FROM prefix_posts WHERE tid = " . $r['id']), 0, 0);
$r['ord'] = forum_get_ordner($r['ctime'], $r['id'], $r['fid']);
$r['link'] = 'forum-showposts-' . $r['id'];
if ($menu->get(1) == 'aeit') {
$r['author'] = '';
} elseif ($such == 'aubt') {
$r['author'] = ' ' . $lang['from'] . ' ' . $r['author'];
} else {
$r['author'] = ' ' . $lang['newpost'] . ' ' . $lang['from'] . ' ' . $r['author'];
$r['postsbefore'] = db_count_query('SELECT COUNT(id) FROM prefix_posts WHERE tid = ' . $r['id'] . ' AND id < ' . $r['firstnew']);
$r['page'] = ceil(($r['postsbefore'] + 1) / $allgAr['Fpanz']);
$r['link'] .= '-p' . $r['page'] . '#' . $r['firstnew'];
}
$tpl->set_ar_out($r, 1);
}
$tpl->set_out('MPL', $MPL, 2);
if ($such == 'aeit') {
$tpl->set_out('name', $name, 3);
}
$design->footer();
示例8: db_query
db_query("UPDATE `prefix_profilefields` SET `show` = '" . $_POST['show'] . "', `func` = " . $_POST['func'] . " WHERE `id` = " . $_POST['sid']);
}
}
if ($menu->get(1) == 'delete') {
$id = $menu->get(2);
// TODO func in diesem query anpassen
$anz = db_count_query("SELECT COUNT(`id`) FROM `prefix_profilefields` WHERE `id` = " . $id . " AND `func` != 3 AND `func` != 2");
if ($anz == 1) {
$pos = db_result(db_query("SELECT `pos` FROM `prefix_profilefields` WHERE `id` = " . $id), 0);
db_query("DELETE FROM `prefix_profilefields` WHERE `id` = " . $id);
db_query("UPDATE `prefix_profilefields` SET `pos` = `pos` - 1 WHERE `pos` > " . $pos);
db_query("DELETE FROM `prefix_userfields` WHERE `fid` = " . $id);
}
}
if ($menu->get(1) == 'u' or $menu->get(1) == 'o') {
$a = db_count_query("SELECT COUNT(*) as `anz` FROM `prefix_profilefields`");
$np = $menu->get(1) == 'o' ? $menu->get(3) - 1 : $menu->get(3) + 1;
$np = $np >= $a - 1 ? $a - 1 : $np;
$np = $np < 0 ? 0 : $np;
db_query("UPDATE `prefix_profilefields` SET `pos` = " . $menu->get(3) . " WHERE `pos` = " . $np);
db_query("UPDATE `prefix_profilefields` SET `pos` = " . $np . " WHERE `id` = " . $menu->get(2));
}
if ($menu->get(1) == 'c') {
$n = $menu->get(3) == 3 ? 4 : 3;
db_query("UPDATE `prefix_profilefields` SET `func` = " . $n . " WHERE `id` = " . $menu->get(2));
}
if ($show) {
$tpl = new tpl('profilefields', 1);
if ($menu->get(1) != 'edit') {
$row = array('sub' => 'Eintragen', 'pos' => '', 'show' => '', 'func' => arliste('', profilefields_functions2(), $tpl, 'func'), 'sid' => '', 'ANTISPAM' => get_antispam('adminuser_action', 0, true));
} else {
示例9: escape
$msn = escape($_POST['msn'], 'string');
$yahoo = escape($_POST['yahoo'], 'string');
$aim = escape($_POST['aim'], 'string');
$staat = escape($_POST['staat'], 'string');
$spezrank = escape($_POST['spezrank'], 'integer');
$geschlecht = escape($_POST['geschlecht'], 'integer');
$status = escape($_POST['status'], 'integer');
$sperre = escape($_POST['usersperre'], 'integer');
$opt_mail = escape($_POST['opt_mail'], 'integer');
$opt_pm = escape($_POST['opt_pm'], 'integer');
$opt_pm_popup = escape($_POST['opt_pm_popup'], 'integer');
$gebdatum = escape($_POST['gebdatum'], 'string');
$sig = escape($_POST['sig'], 'string');
// Name im Forum aendern
if ($_POST['forumname'] == 'on') {
$oldname = db_count_query("SELECT `name` FROM `prefix_user` WHERE `id` =" . $uid);
if ($oldname != $usaName1) {
db_query("UPDATE `prefix_posts` SET `erst` = '" . $usaName1 . "' WHERE `erstid` = " . $uid);
db_query("UPDATE `prefix_topics` SET `erst` = '" . $usaName1 . "' WHERE `erst` = '" . $oldname . "'");
}
}
db_query('UPDATE `prefix_user`
SET
`name` = "' . $usaName1 . '",
`recht` = "' . $neues_recht . '",
`email` = "' . $email . '",
`homepage` = "' . $homepage . '",
`wohnort` = "' . $wohnort . '",
`icq` = "' . $icq . '",
`msn` = "' . $msn . '",
`yahoo` = "' . $yahoo . '",
示例10: db_query
db_query("INSERT INTO `prefix_warmaps` (`wid`,`mnr`,`map`,`opp`,`owp`) VALUES (" . $wid . "," . $i . ",'" . escape($_POST['map'][$i], 'string') . "'," . escape($_POST['opp'][$i], 'string') . "," . escape($_POST['owp'][$i], 'string') . ")");
}
}
// in den kalender eintragen wenn gewuenscht
if (isset($_POST['kalender']) and $_POST['kalender'] == 'yes') {
$timestamp = strtotime(get_datime());
$page = str_replace('admin.php', 'index.php', $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"]);
db_query("INSERT INTO `prefix_kalender` (`time`, `title`, `text`, `recht`) VALUES (" . $timestamp . ",'Lastwar gegen " . $_POST['gegner'] . "', '" . $_POST['mtyp'] . " " . $_POST['mod'] . " in " . $_POST['game'] . " gegen [url=" . $_POST['page'] . "]" . $_POST['gegner'] . "[/url]\n\n[url=http://" . $page . "?wars-more-" . $wid . "]details des Wars[/url]', 0)");
}
$msg = '<tr class="Cmite"><td colspan="2">Erfolgreich eingetragen</td></tr>';
} else {
//
db_query("UPDATE `prefix_wars` SET `datime` = '" . get_datime() . "', `status` = 3,`wlp` = '" . $_POST['wlp'] . "',`owp` = '" . $_POST['sumowp'] . "',`opp` = '" . $_POST['sumopp'] . "',`gegner` = '" . $_POST['gegner'] . "',`tag` = '" . $_POST['tag'] . "',`page` = '" . $_POST['page'] . "',`mail` = '" . $_POST['email'] . "',`icq` = '" . $_POST['icq'] . "',`wo` = '" . $_POST['wo'] . "',`tid` = '" . $_POST['tid'] . "',`mod` = '" . $_POST['mod'] . "',`game` = '" . $_POST['game'] . "',`mtyp` = '" . $_POST['mtyp'] . "',`land` = '" . $_POST['land'] . "',`txt` = '" . $_POST['txt'] . "' WHERE `id` = '" . $_POST['pkey'] . "'");
$wid = $_POST['pkey'];
for ($i = 1; $i <= 5; $i++) {
$a = db_count_query("SELECT COUNT(*) FROM `prefix_warmaps` WHERE `mnr` = " . $i . " AND `wid` = " . $wid);
if ($a == 0 and $_POST['map'][$i] != '' and $_POST['opp'][$i] != '' and $_POST['owp'][$i] != '') {
db_query("INSERT INTO `prefix_warmaps` (`wid`,`mnr`,`map`,`opp`,`owp`) VALUES (" . $wid . "," . $i . ",'" . $_POST['map'][$i] . "'," . $_POST['opp'][$i] . "," . $_POST['owp'][$i] . ")");
} elseif ($a == 1 and ($_POST['map'][$i] == '' or $_POST['opp'][$i] == '' and $_POST['owp'][$i] == '')) {
db_query("DELETE FROM `prefix_warmaps` WHERE `wid` = " . $wid . " AND `mnr` = " . $i);
if (file_exists('include/images/wars/' . $wid . '_' . $i . '.gif')) {
unlink('include/images/wars/' . $wid . '_' . $i . '.gif');
}
if (file_exists('include/images/wars/' . $wid . '_' . $i . '.png')) {
unlink('include/images/wars/' . $wid . '_' . $i . '.png');
}
if (file_exists('include/images/wars/' . $wid . '_' . $i . '.jpg')) {
unlink('include/images/wars/' . $wid . '_' . $i . '.jpg');
}
if (file_exists('include/images/wars/' . $wid . '_' . $i . '.jpeg')) {
unlink('include/images/wars/' . $wid . '_' . $i . '.jpeg');
示例11: array
' . $friendsCheckDiv . '
</div>
</div>';
if ($friendAnzahl > 0) {
$optionsClass = 'nOptions2';
} else {
$optionsClass = 'nOptions';
}
$options = '<div id="mOptions" class="button ' . $optionsClass . '">
<div class="pfeilDownIcon"></div>
</div>';
}
}
if (db_count_query('SELECT count(uid) FROM prefix_usergallery WHERE uid = ' . $uid) > '0' or $_SESSION['authid'] == $uid) {
$fotos = '<div class="button foto" onclick="location.href = \'?user-fotos-' . $uid . '\';">
<div class="buttonText">Fotos</div>
</div>';
}
if ($UGAnzahl > 0 or $_SESSION['authid'] == $uid) {
$friendClass = 'friend2';
} else {
$friendClass = 'friend';
}
if (db_count_query('SELECT count(uid) FROM prefix_friends WHERE uid = ' . $uid)) {
$friends = '<div class="button ' . $friendClass . '" onclick="location.href = \'?user-friends-' . $uid . '\';">
<div class="buttonText">Freunde</div>
</div>';
}
$arHeader = array("UID" => $row['id'], 'NAME' => $row['name'], 'TITELBILD' => $titelbild, 'sFriendschek' => $friendsCheck, 'sOpstions' => $options, 'AVATA' => $avatar, 'FRIENDADDBUTTON' => $friendAddButton, 'PNBUTTON' => $PNButton, 'MOREBUTTON' => $MoreButton, 'AVATA' => $avatar, 'sFotos' => $fotos, 'sFriends' => $friends);
$tpl = new tpl('uprofil/header.htm');
$tpl->set_ar_out($arHeader, 0);
示例12: Header
// weiterleiten $_SERVER['host_name']
Header("Location: " . $dir . $banner . "");
exit;
} else {
}
} else {
$design->header();
echo '<center><strong>FEHLER</strong> : Banner-ID nicht vorhanden</center>';
$design->footer();
}
break;
// ################################################################
// ################################################################
case 'click':
// prüfen ob ID + Datei vorhanden
$checkid = db_count_query("SELECT COUNT(id) FROM `prefix_linkus` WHERE id = " . $menu_2 . "");
if ($checkid != 0) {
// Auslesen der Ziel-URL
$link = db_result(db_query("SELECT link FROM `prefix_linkus` WHERE id = " . $menu_2 . ""));
if ($menu_3 == 'true') {
// click-wert +1
db_query("UPDATE `prefix_linkus` SET klicks = klicks + 1 WHERE id = " . $menu_2 . "");
}
// weiterleiten
Header("Location: " . $link . "");
exit;
} else {
$design->header();
echo '<center><strong>FEHLER</strong> : Banner-ID nicht vorhanden</center>';
$design->footer();
}
示例13: db_query
if ($_POST['map'][$i] != '' and $_POST['opp'][$i] != '' and $_POST['owp'][$i] != '') {
db_query("INSERT INTO prefix_warmaps (wid,mnr,map,opp,owp) VALUES (" . $wid . "," . $i . ",'" . escape($_POST['map'][$i], 'string') . "'," . escape($_POST['opp'][$i], 'string') . "," . escape($_POST['owp'][$i], 'string') . ")");
}
}
# in den kalender eintragen wenn gewuenscht
if (isset($_POST['kalender']) and $_POST['kalender'] == 'yes') {
$timestamp = strtotime(get_datime());
$page = str_replace('admin.php', 'index.php', $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"]);
db_query("INSERT INTO prefix_kalender (time, title, text, recht) VALUES (" . $timestamp . ",'Lastwar gegen " . $_POST['gegner'] . "', '" . $_POST['mtyp'] . " " . $_POST['mod'] . " in " . $_POST['game'] . " gegen [url=" . $_POST['page'] . "]" . $_POST['gegner'] . "[/url]\n\n[url=http://" . $page . "?wars-more-" . $wid . "]details des Wars[/url]', 0)");
}
$msg = '<tr class="Cmite"><td colspan="2">Erfolgreich eingetragen</td></tr>';
} else {
db_query("UPDATE prefix_wars SET datime = '" . get_datime() . "', status = 3,wlp = '" . $_POST['wlp'] . "',owp = '" . $_POST['sumowp'] . "',opp = '" . $_POST['sumopp'] . "',gegner = '" . $_POST['gegner'] . "',tag = '" . $_POST['tag'] . "',page = '" . $_POST['page'] . "',mail = '" . $_POST['email'] . "',icq = '" . $_POST['icq'] . "',wo = '" . $_POST['wo'] . "',tid = '" . $_POST['tid'] . "',`mod` = '" . $_POST['mod'] . "',game = '" . $_POST['game'] . "',mtyp = '" . $_POST['mtyp'] . "',land = '" . $_POST['land'] . "',txt = '" . $_POST['txt'] . "' WHERE id = '" . $_POST['pkey'] . "'");
$wid = $_POST['pkey'];
for ($i = 1; $i <= 5; $i++) {
$a = db_count_query("SELECT COUNT(*) FROM prefix_warmaps WHERE mnr = " . $i . " AND wid = " . $wid);
if ($a == 0 and $_POST['map'][$i] != '' and $_POST['opp'][$i] != '' and $_POST['owp'][$i] != '') {
db_query("INSERT INTO prefix_warmaps (wid,mnr,map,opp,owp) VALUES (" . $wid . "," . $i . ",'" . $_POST['map'][$i] . "'," . $_POST['opp'][$i] . "," . $_POST['owp'][$i] . ")");
} elseif ($a == 1 and ($_POST['map'][$i] == '' or $_POST['opp'][$i] == '' and $_POST['owp'][$i] == '')) {
db_query("DELETE FROM prefix_warmaps WHERE wid = " . $wid . " AND mnr = " . $i);
if (file_exists('include/images/wars/' . $wid . '_' . $i . '.gif')) {
unlink('include/images/wars/' . $wid . '_' . $i . '.gif');
}
if (file_exists('include/images/wars/' . $wid . '_' . $i . '.png')) {
unlink('include/images/wars/' . $wid . '_' . $i . '.png');
}
if (file_exists('include/images/wars/' . $wid . '_' . $i . '.jpg')) {
unlink('include/images/wars/' . $wid . '_' . $i . '.jpg');
}
if (file_exists('include/images/wars/' . $wid . '_' . $i . '.jpeg')) {
unlink('include/images/wars/' . $wid . '_' . $i . '.jpeg');
示例14: db_fetch_assoc
$row = db_fetch_assoc($erg);
if ($row['gebdatum'] != "0000-00-00") {
$gebdatum = '<img src="include/images/userprofil/icons/icon_birthday.png"> ' . date('d. M Y', strtotime($row['gebdatum'])) . '<br />';
} else {
$gebdatum = '';
}
if (empty($row['wohnort'])) {
$wohnort = '';
} else {
$wohnort = '<img src="include/images/userprofil/icons/icon_home.png"> aus ' . $row['wohnort'] . '<br />';
}
$geschlecht = array('0' => 'Unbekannt', '1' => 'Männlich', '2' => 'Weiblich');
$geschlecht = '<img src="include/images/userprofil/icons/icon_user.png"> ' . $geschlecht[$row['geschlecht']];
$UGAnzahl = db_count_query('SELECT count(uid) FROM prefix_usergallery WHERE uid = ' . $uid);
$FAnzahl = db_count_query('SELECT count(uid) FROM prefix_friends WHERE uid = ' . $uid);
$GBAnzahl = db_count_query('SELECT count(uid) FROM prefix_usergbook WHERE uid = ' . $uid);
$tpl = new tpl('uprofil/leftbox.htm');
$ar = array('UID' => $row['id'], 'GEBURTSTAG' => $gebdatum, 'WOHNORT' => $wohnort, 'GESCHLECHT' => $geschlecht, 'UGBILDER' => $UGAnzahl, 'JOINED' => '<img src="include/images/userprofil/icons/icon_calendar.png"> ' . date('d. M Y', $row['regist']) . '<br />', 'SITELINK' => $MPL);
$tpl->set_ar_out($ar, 0);
if ($UGAnzahl > 0) {
$tpl->set_out('UGBILDER', ' (' . $UGAnzahl . ')', 1);
while ($rowUG = db_fetch_assoc($ergUG)) {
if (empty($rowUG['txt'])) {
$rowUG['txt'] = $rowUG['name'];
} else {
$rowUG['txt'] = $rowUG['txt'];
}
$rowUG['BILDER'] = '<div class="boxUserFotos"><a href="include/images/usergallery/img_' . $rowUG['id'] . '.' . $rowUG['endung'] . '" target="_blank"><img src="include/images/usergallery/img_thumb_' . $rowUG['id'] . '.' . $rowUG['endung'] . '" title="' . $rowUG['txt'] . '" width="80px" height="80px"></a></div>';
$tpl->set_ar_out($rowUG, 2);
}
$tpl->out(3);
示例15: db_query
} else {
db_query("UPDATE `prefix_profilefields` SET `show` = '" . $_POST['show'] . "', func = " . $_POST['func'] . " WHERE id = " . $_POST['sid']);
}
}
if ($menu->get(1) == 'delete') {
$id = $menu->get(2);
$anz = db_count_query("SELECT COUNT(id) FROM prefix_profilefields WHERE id = " . $id . " AND func < 3");
if ($anz == 1) {
$pos = db_result(db_query("SELECT pos FROM prefix_profilefields WHERE id = " . $id), 0);
db_query("DELETE FROM `prefix_profilefields` WHERE id = " . $id);
db_query("UPDATE prefix_profilefields SET pos = pos - 1 WHERE pos > " . $pos);
db_query("DELETE FROM prefix_userfields WHERE fid = " . $id);
}
}
if ($menu->get(1) == 'u' or $menu->get(1) == 'o') {
$a = db_count_query("SELECT COUNT(*) as anz FROM prefix_profilefields");
$np = $menu->get(1) == 'o' ? $menu->get(3) - 1 : $menu->get(3) + 1;
$np = $np >= $a - 1 ? $a - 1 : $np;
$np = $np < 0 ? 0 : $np;
db_query("UPDATE prefix_profilefields SET pos = " . $menu->get(3) . " WHERE pos = " . $np);
db_query("UPDATE prefix_profilefields SET pos = " . $np . " WHERE id = " . $menu->get(2));
}
if ($menu->get(1) == 'c') {
$n = $menu->get(3) == 3 ? 4 : 3;
db_query("UPDATE prefix_profilefields SET func = " . $n . " WHERE id = " . $menu->get(2));
}
if ($show) {
$tpl = new tpl('profilefields', 1);
if ($menu->get(1) != 'edit') {
$row = array('sub' => 'Eintragen', 'pos' => '', 'show' => '', 'func' => arliste('', profilefields_functions2(), $tpl, 'func'), 'sid' => '');
} else {