• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP yasDB_update函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中yasDB_update函数的典型用法代码示例。如果您正苦于以下问题:PHP yasDB_update函数的具体用法?PHP yasDB_update怎么用?PHP yasDB_update使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了yasDB_update函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: exchangeCheck

function exchangeCheck()
{
    if (isset($_SERVER['HTTP_REFERER'])) {
        $referral = $_SERVER['HTTP_REFERER'];
        $array = parse_url($referral);
        $referral1 = $array['host'];
        $referral2 = str_replace("www.", "", $referral1);
        $referral3 = "http://" . trim($referral2);
        $referral4 = "http://www." . $referral2;
        $select_link_in = yasDB_select("SELECT * FROM links WHERE url='{$referral1}' OR url='{$referral2}' OR url='{$referral3}' OR url='{$referral4}'");
        if ($select_link_in->num_rows > 0) {
            $link_in = $select_link_in->fetch_array(MYSQLI_ASSOC);
            $select_link_in->close();
            yasDB_update("UPDATE links SET `in`=`in`+1 WHERE id='{$link_in['id']}'");
            return true;
        }
    }
    return false;
}
开发者ID:royalswe,项目名称:yas26,代码行数:19,代码来源:inc.php


示例2: intval

                    $new_jobs[$jobNames[$i]][1] = $plus_month;
                } else {
                    $new_jobs[$jobNames[$i]][1] = $midnight_today;
                }
            }
        } else {
            $new_jobs[$jobNames[$i]][1] = $job[1];
        }
        if ($jobNames[$i] == 'gameque') {
            $new_jobs[$jobNames[$i]][3] = intval($_POST['gameCount']);
        }
        $i++;
    }
    $new_jobs['jobstate'] = $status;
    $finished_jobs = serialize($new_jobs);
    yasDB_update("UPDATE `settings` SET `jobs` = '{$finished_jobs}' WHERE `id` = 1");
    include "../includes/settings_function.inc.php";
    createConfigFile();
    ?>
<center>Scheduled Jobs updated!<br/><a href="index.php?act=managejobs" />Continue</a></center><?php 
} else {
    if (isset($_GET['run'])) {
        $_SESSION['runjobs'] = 'good-to-go';
        $runjob = $_GET['run'];
        class usersOnline
        {
            public function ipCheck()
            {
                if (getenv('HTTP_CLIENT_IP')) {
                    $ip = getenv('HTTP_CLIENT_IP');
                } elseif (getenv('HTTP_X_FORWARDED_FOR')) {
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:manage_jobs.php


示例3: yasDB_clean

    $name = yasDB_clean($_POST['name']);
    $email = yasDB_clean($_POST['email']);
    $location = yasDB_clean($_POST['location']);
    $aboutme = yasDB_clean($_POST['aboutme']);
    $hobbies = yasDB_clean($_POST['hobbies']);
    $shhobs = yasDB_clean($_POST['shhobs']);
    $shloc = yasDB_clean($_POST['shloc']);
    $sheml = yasDB_clean($_POST['sheml']);
    $shname = yasDB_clean($_POST['shname']);
    $shabout = yasDB_clean($_POST['shabout']);
    $deact = yasDB_clean($_POST['deact']);
    $cmtsdisabled = yasDB_clean($_POST['cmtsdisabled']);
    yasDB_update("UPDATE `user` SET website = '{$website}', name = '{$name}', email = '{$email}', location = '{$location}', aboutme = '{$aboutme}', hobbies = '{$hobbies}', shhobs = '{$shhobs}', shloc = '{$shloc}', sheml = '{$sheml}', shname = '{$shname}', shabout = '{$shabout}', deact = '{$deact}', cmtsdisabled = '{$cmtsdisabled}' WHERE username = '{$user}'");
    if (!empty($_POST['password'])) {
        $password = md5(yasDB_clean($_POST['password']));
        yasDB_update("UPDATE user SET password = '{$password}' WHERE username = '{$user}'");
    }
    echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=index.php?act=profile">';
} else {
    $query = yasDB_select("SELECT * FROM `user` WHERE username = '{$user}'");
    $row = $query->fetch_array(MYSQLI_ASSOC);
    echo ' <div class="containbox2"><div id="preview"></div><div id="profileBox">
	<form name="usersettings" id="profile" method="post" action="index.php?act=profile">
	<table class="tg">
	<tr>
	<th class="tg-s6z2" colspan="4">' . $user . 's Profile:</th>
	</tr>
	<tr>
	<td class="tg-vn4c">Name:</td>
	<td class="tg-vn4c"><input type="text" name="name" id="s-a-g" value="' . $row['name'] . '" size="30" /></td>
	<td class="tg-vn4c">Email:</td>
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:profile.php


示例4: yasDB_select

<input type="submit" name="submit" value="Submit" /><br/><br/>
</form>
<?php 
if (isset($_POST["username"]) || isset($_POST["useremail"])) {
    $username = $_POST["username"];
    $useremail = $_POST["useremail"];
    $res = yasDB_select("SELECT * FROM user WHERE username='{$username}' AND email='{$useremail}'", false);
    $row = $res->fetch_array(MYSQLI_ASSOC);
    $res->close();
    if (!empty($row)) {
        $email = $row["email"];
        srand((double) microtime() * 1000000);
        $random = rand(1234, 2343);
        $password = $row["name"] . $random;
        $upassword = md5($password);
        yasDB_update("UPDATE user SET password='{$upassword}' WHERE username='{$username}'", false);
        $headers = "From: {$setting['email']} \n";
        //from address
        $headers .= "MIME-Version: 1.0\n";
        $headers .= "Content-type: text/html; charset=iso-8859-1 \n";
        $subject = $setting['sitename'] . " Password Reset - Do Not Reply";
        $body = "<div align=center><br><br>----------------------------- Password Reset--------------------------------<br><br><br><br>\n\t\tYour New Password is: {$password}<br/>\n\t\tPlease log in and create a new password if you wish.</div>";
        if (mail($email, $subject, $body, $headers)) {
            echo "<font class=tblackb>Your password has been sent to your Email address</font>";
        } else {
            echo "";
        }
    } else {
        echo '<span style="color: #ff0000;">Invalid user name or email. If you feel this is error, please contact us for assistance.</span><br/>';
    }
}
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:forgotpassword.php


示例5: elseif

        echo $row['id'];
        ?>
" /><input type="submit" class="button" name="check" value="Edit!" />
		<input type="reset" class="button" value="Reset" /></td>
			</tr>
		</table>
			</div>
			</form>
	<?php 
    }
} elseif (isset($_GET['check'])) {
    if (empty($_GET['name'])) {
        echo '<center>One or more fields was left empty.<br />';
        echo '<a href="index.php?act=manageforumcats&edit=' . $_GET['id'] . '">Click here to go back</a></center>';
    } else {
        yasDB_update("UPDATE forumcats SET name = '{$_GET['name']}', active = '{$_GET['active']}', `order` = '{$_GET['order']}', `desc` = '{$_GET['desc']}' where id = '{$_GET['id']}'", false);
        echo '<center>Category Successfully edited!<br/><br/>';
        echo '<a href="index.php?act=manageforumcats">Click here to proceed</a></center>';
    }
} elseif (!empty($_GET['delete'])) {
    $query = yasDB_select("SELECT id FROM forumcats WHERE id = '{$_GET['delete']}'", false);
    if ($query->num_rows == 0) {
        echo '<center>You cannot delete a category that does not exist!<br />';
        echo '<a href="index.php?act=manageforumcats">Click here to go back</a></center>';
        $query->close();
    } else {
        $query->close();
        yasDB_delete("DELETE FROM forumcats WHERE id = '{$_GET['delete']}'");
        echo '<center>Category successfully deleted.<br />';
        echo '<a href="index.php?act=manageforumcats">Click here to proceed</a></center>';
    }
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:manage_forumcats.php


示例6: yasDB_delete

        echo "Error converting games to the new category. Please check your dberror_log.txt for more details.<br/>Deleting of category cancelled.";
    } else {
        $catreturn = yasDB_delete("DELETE FROM categories WHERE id={$oldid}");
        if ($catreturn === false) {
            echo "Error deleteing category. Please check your dberror_log.txt for more details.<br/>Deleting of category aborted.";
        } else {
            echo '<center>Category Successfully deleted!<br/><br/>';
            echo '<a href="index.php?act=categories">Click here to proceed</a></center>';
        }
    }
} elseif (isset($_GET['check'])) {
    if (empty($_GET['name'])) {
        echo '<center>One or more fields was left empty.<br />';
        echo '<a href="index.php?act=categories&edit=' . $_GET['id'] . '">Click here to go back</a></center>';
    } else {
        yasDB_update("UPDATE categories SET name = '{$_GET['name']}', active = '{$_GET['active']}', `order` = '{$_GET['order']}', `parent` = '{$_GET['parent']}', `home` = '{$_GET['home']}', `desc` = '{$_GET['desc']}', `pid` = '{$_GET['pid']}' where id = '{$_GET['id']}'", false);
        echo '<center>Category Successfully edited!<br/><br/>';
        echo '<a href="index.php?act=categories">Click here to proceed</a></center>';
    }
} elseif (!empty($_GET['delete'])) {
    $query = yasDB_select("SELECT id FROM categories WHERE id = " . intval($_GET['delete']), false);
    $query2 = yasDB_select("SELECT COUNT(id) AS count FROM games WHERE category=" . intval($_GET['delete']));
    $tcount = $query2->fetch_array(MYSQLI_ASSOC);
    if ($query->num_rows == 0) {
        echo '<center>You cannot delete a category that does not exist!<br />';
        echo '<a href="index.php?act=categories">Click here to go back</a></center>';
        $query->close();
    } elseif ($tcount['count'] > 0) {
        ?>
<center>Games are attached to this category. Please choose a category for these games.<br />
			<?php 
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:manage_category.php


示例7: User

        $user = null;
    }
    if (!empty($user_profile)) {
        $username = $user_profile['name'];
        $uid = $user_profile['id'];
        $email = $user_profile['email'];
        $user = new User();
        $userdata = $user->checkUser($uid, 'facebook', $username, $email);
        if (!empty($userdata)) {
            $_SESSION['userid'] = $userdata['id'];
            $_SESSION['oauth_id'] = $uid;
            $_SESSION['user'] = $userdata['username'];
            $_SESSION['email'] = $email;
            $_SESSION['oauth_provider'] = $userdata['oauth_provider'];
            $now = time();
            $query = yasDB_select("SELECT `id` FROM `membersonline` WHERE `memberid` = '{$userdata['id']}'");
            if ($query->num_rows == 0) {
                yasDB_insert("INSERT INTO `membersonline` (id, memberid, timeactive) VALUES ('', '{$userdata['id']}', '{$now}')", false);
            } else {
                yasDB_update("UPDATE `membersonline` SET timeactive='{$now}' WHERE `memberid`='{$userdata['id']}'");
            }
            header("Location: " . $setting['siteurl']);
            exit;
        }
    } else {
        die("There was an error.");
    }
} else {
    $login_url = $facebook->getLoginUrl(array('scope' => 'email'));
    header("Location: " . $login_url);
}
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:login-facebook.php


示例8: date

            $name = '';
        }
    }
    $date = date("F j, Y, g:i a");
    //create date time
    $sql = "INSERT INTO `forumtopics` (id, subject, cat, date, name, text,lastupdate) VALUES ('', '{$subject}', {$cat}, '{$date}', '{$name}', '{$text}'," . time() . ")";
    $result = yasDB_insert($sql);
    if (isset($_SESSION['user'])) {
        $user = yasDB_clean($_SESSION['user']);
        yasDB_update("UPDATE `user` set topics = topics +1 WHERE username = '{$user}'");
        // add a post to the user
        yasDB_update("UPDATE `user` set totalposts = totalposts +1 WHERE username = '{$user}'");
        // add a post to user total
        yasDB_update("UPDATE `stats` set numbers = numbers +1 WHERE id = '3'");
        // adds a post to Forum Total Posts
        yasDB_update("UPDATE `stats` set numbers = numbers +1 WHERE id = '4'");
        // adds a post to Post Today
    }
    if ($result) {
        ?>
<center>Successful<br/></center>
            <?php 
        $query = yasDB_select("SELECT max(id) AS lastid FROM forumtopics");
        $answer = $query->fetch_array(MYSQLI_ASSOC);
        if ($setting['seo'] == 'yes') {
            $answerlink = $setting['siteurl'] . 'forumtopics/' . $answer['lastid'] . '/1.html';
        } else {
            $answerlink = $setting['siteurl'] . 'index.php?act=forumtopics&id=' . $answer['lastid'];
        }
        ?>
            <center><a href="<?php 
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:createtopic.php


示例9: yasDB_clean

    echo "\n\n<form action='forgotpassword.php' method='POST'>\n\tEnter your username <input type='text' name='username'><p><br>\n\tEnter your email &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' name='email'><p></br>\n\t<input type='submit' value='Submit' name='submit'></br><br>\n</form>\n\n";
    if (isset($_POST['submit'])) {
        $username = yasDB_clean($_POST['username']);
        $email = yasDB_clean($_POST['email']);
        $query = yasDB_select("SELECT * FROM user WHERE username='{$username}'");
        $numrow = $query->num_rows;
        if ($numrow != 0) {
            while ($row = mysqli_fetch_assoc($query)) {
                $db_email = $row['email'];
            }
            if ($email == $db_email) {
                $code = rand(10000, 1000000);
                $to = $db_email;
                $subject = $setting['sitename'] . " Password Reset";
                $body = "\n\t\t\tYou are receiving this e-mail because a request was made to reset your password\t\t\t\n\t\t\tIf you did not make this request, you can ignore this e-mail. Click this link to reset your password.\n\t\t\t" . $setting['siteurl'] . "forgotpassword.php?code={$code}&username={$username}";
                yasDB_update("UPDATE user SET passreset='{$code}' WHERE username='{$username}'");
                mail($to, $subject, $body);
                echo "Check your email for password reset";
            } else {
                echo "Email is incorrect";
            }
        } else {
            echo "That username doesnt exist";
        }
    }
}
?>
</div>
<div class="clear"></div>
</div>
</body>
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:forgotpassword.php


示例10: elseif

        echo $row['newsid'];
        ?>
" /><input type="submit" class="button" name="edit" value="Edit!" /><input type="reset" class="button" value="Reset"/></td>
		</tr>
		</table>
		</div>
		</form>		
	<?php 
    }
    $query->close();
} elseif (isset($_POST['edit'])) {
    if (!isset($_POST['username']) || !isset($_POST['comment'])) {
        echo '<center>One or more fields was left empty.<br />';
        echo '<a href="index.php?act=newsblogcomments&edit=' . intval($_POST['id']) . '">Click here to go back</a><center>';
    } else {
        yasDB_update("update newsblog set username = '" . yasDB_clean($_POST['username']) . "', comment = '" . yasDB_clean($_POST['comment']) . "' WHERE id = " . intval($_POST['id']), false);
        echo '<center>Comment Successfully edited!<br />';
        echo '<a href="index.php?act=newsblogcomments">Click here to proceed</a></center>';
    }
} elseif (!empty($_GET['delete'])) {
    $query = yasDB_select("select id from newsblog where id = " . intval($_GET['delete']), false);
    if ($query->num_rows == 0) {
        echo '<center>You cannot delete a members comment that does not exist!<br />';
        echo '<a href="index.php?act=newsblogcomments">Click here to go back</a></center>';
        $query->close();
    } else {
        $query->close();
        yasDB_delete("delete from newsblog where id = " . intval($_GET['delete']), false);
        echo '<center>Members comment successfully deleted.<br />';
        echo '<a href="index.php?act=newsblogcomments">Click here to proceed</a></center>';
    }
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:newsblogcomments.php


示例11: array

</div>
<?php 
$replace = array('https://', 'http://', 'www.');
$serverUrl = $setting['siteurl'];
$serverUrl = str_replace($replace, "", $serverUrl);
$serverUrl = 'www.' . $serverUrl;
if (isset($_POST['edit_ga'])) {
    $galogin = yasDB_clean($_POST['gaLogin']);
    $gapassword = yasDB_clean($_POST['gaPassword']);
    $gaurl = yasDB_clean($_POST['gaUrl']);
    if ($gapassword == "") {
        $pswd = "";
    } else {
        $pswd = ", `gapassword` = '" . $gapassword . "'";
    }
    yasDB_update("UPDATE `settings` SET `galogin` = '{$galogin}'" . $pswd . ", `gaurl` = '{$gaurl}' WHERE id = 1", false);
    echo '<center>Updated!';
    echo '<br/><a href="index.php?act=gainfo">Click to continue.</a></center>';
} else {
    echo '<br/>';
    $query = yasDB_select("SELECT `galogin`, `gapassword`, `gaurl` FROM `settings` WHERE `id` = 1");
    $social = $query->fetch_array(MYSQLI_ASSOC);
    ?>
	<div class="table">
	<img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<form name="app_ids" method="post" action="index.php?act=gainfo">
	<table class="listing form" cellpadding="0" cellspacing="0">
	<tr>
		<th class="full" colspan="2">Google Analytics Login Info</th>
	</tr>
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:gainfo.php


示例12: yasDB_select

}
// kill the script because normal users will never see this.
//connecting to the database to get some information
$query = yasDB_select("SELECT total_votes, total_value, used_ips FROM ratingsbar WHERE id='{$id_sent}' ") or die(" Error");
$numbers = $query->fetch_array(MYSQLI_ASSOC);
$checkIP = unserialize($numbers['used_ips']);
$count = $numbers['total_votes'];
//how many votes total
$current_rating = $numbers['total_value'];
//total number of rating added together and stored
$sum = $vote_sent + $current_rating;
// add together the current vote value and the total vote value
$tense = $count == 1 ? "vote" : "votes";
$sum == 0 ? $added = 0 : ($added = $count + 1);
is_array($checkIP) ? array_push($checkIP, $ip_num) : ($checkIP = array($ip_num));
$insertip = serialize($checkIP);
//IP check when voting
$result = yasDB_select("SELECT used_ips FROM ratingsbar WHERE used_ips LIKE '%" . $ip . "%' AND id='" . $id_sent . "' ");
$voted = $result->num_rows;
if (!$voted) {
    //if the user hasn't yet voted, then vote normally...
    if ($vote_sent >= 1 && $vote_sent <= $units && $ip == $ip_num) {
        // keep votes within range
        $update = "UPDATE ratingsbar SET total_votes='" . $added . "', total_value='" . $sum . "', used_ips='" . $insertip . "' WHERE id='{$id_sent}'";
        $result = yasDB_update($update);
    }
    header("Location: {$referer}");
    // go back to the page we came from
    exit;
}
//end for the "if(!$voted)"
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:db.php


示例13: intval

</head>
<body>
<div id="body_wrapper">
    <div id="wrapper"><div id="menu">Your Account:</div>
	<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">
<?php 
include_once "includes/config.inc.php";
include_once "includes/db_functions.inc.php";
$id = intval($_GET['id']);
$code = yasDB_clean($_GET['code']);
if ($id && $code) {
    $check = yasDB_select("SELECT id FROM user WHERE id={$id} AND randomkey='{$code}'", false);
    $checknum = $check->num_rows;
    if ($checknum == 1) {
        $activated = yasDB_update("UPDATE user SET activated='1' WHERE id='{$id}'", false);
        echo '<h4>Your account is now active you can now login!.<br />
 Click here to login.<br />
 <a href="' . $setting['siteurl'] . 'index.php">Login</a>
 </h4>';
    } else {
        echo '<h4>Invalid ID or Activation code.Please contact admin using our contact form<br />
   <a href="' . $setting['siteurl'] . 'contactus.html">Contact Us</a>
   </h4>';
    }
} else {
    echo '<h4>Date missing!<br /><br /> This means something has went wrong when you tryed to register with us. <br /> Please contact admin from the contactus page <br /> 
 <a href="' . $setting['siteurl'] . 'contactus.html">Contact Us</a></h4>';
}
?>
</div>
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:activated.php


示例14: md5

<div id="center"> 
<div class="container_box1"><div id="headergames2">Members</div> 
<div class="containbox">   
<?php 
//include "includes/db_functions.inc.php";
$newpass = $_POST['newpass'];
$newpass1 = $_POST['newpass1'];
$post_username = $_POST['username'];
$code = $_GET['code'];
if (strlen($_POST['newpass']) < 4 || strlen($_POST['newpass']) > 20) {
    echo "<h3>Password must be between 4 and 20 characters!</h3><br />Go back to your mail and click on the link again";
} else {
    if ($newpass == $newpass1) {
        $enc_pass = md5($newpass);
        yasDB_update("UPDATE user SET password='{$enc_pass}' WHERE username='{$post_username}'");
        yasDB_update("UPDATE user SET repeatpassword='{$enc_pass}' WHERE username='{$post_username}'");
        yasDB_update("UPDATE user SET passreset='0' WHERE username='{$post_username}'");
        echo "Your password has been updated!";
    } else {
        echo "Passwords must match. Go back to your mail and click on the link again";
    }
}
?>
</div>
<div class="clear"></div></div>
开发者ID:royalswe,项目名称:yas26,代码行数:25,代码来源:pass_reset_complete.php


示例15: yasDB_select

                    $new = $query2->fetch_array();
                    $old = $query1->fetch_array();
                    yasDB_select("UPDATE `gameque` SET `order` = `order` +1 WHERE `source` = '{$new[0]}' AND `sourceid` = {$new[1]}");
                    yasDB_select("UPDATE `gameque` SET `order` = `order` - 1 WHERE `source` = '{$old[0]}' AND `sourceid` = {$old[1]}");
                }
                break;
        }
    }
    exit;
}
if (isset($_GET['delete'])) {
    $ident = explode(',', $_GET['delete']);
    $query1 = yasDB_select("SELECT `order` FROM `gameque` WHERE `source` = '" . yasDB_clean($ident[0]) . "' AND `sourceid` = " . intval($ident[1]));
    $order = $query1->fetch_array();
    $deleteResult = yasDB_delete("DELETE FROM `gameque` WHERE `source` = '" . yasDB_clean($ident[0]) . "' AND `sourceid` = " . intval($ident[1]));
    yasDB_update("UPDATE `gameque` SET `order` = `order` - 1 WHERE `order` > {$order[0]}");
}
?>
<script language="JavaScript">
function Check(chk) {
	if(document.deleteform.Check_All.value=="Check All"){
		for (i = 0; i < chk.length; i++) {
			chk[i].checked = true;
		}
		document.deleteform.Check_All.value="UnCheck All";
	} else {
		for (i = 0; i < chk.length; i++) {
			chk[i].checked = false;
		}
		document.deleteform.Check_All.value="Check All";
	}
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:managegamequeue.php


示例16: install_konggame

function install_konggame($gameid)
{
    global $mysqli;
    $query = yasDB_select("SELECT * FROM `kongregate` WHERE `id` = '{$gameid}'", false);
    $result = $query->fetch_array(MYSQLI_ASSOC);
    $categories = array('Action' => 2, 'Adventure & RPG' => 3, 'Strategy & Defense' => 10, 'Multiplayer' => 2, 'Puzzle' => 1, 'Rhythm' => 7, 'Shooter' => 5, 'Sports & Racing' => 4, 'Music & More' => 7);
    //Other
    // Download and save game file
    if ($result['file']) {
        $g_url = str_replace("..", "", $result['file']);
        $game_file = basename($g_url);
        $game_file = "kong_" . preg_replace('#\\W#', '', $result['title']) . "." . GetFileExtension($result['file']);
        $game_url = '../swf/' . $game_file;
        download_file($g_url, $game_url);
    } else {
        return false;
    }
    // Download and save thumbnail pic
    if ($result['thumbnail']) {
        $t_url = str_replace("..", "", $result['thumbnail']);
        $smallthumb = "kong_" . preg_replace('#\\W#', '', $result['title']) . "." . GetFileExtension($result['thumbnail']);
        $thumb = '../img/' . $smallthumb;
        download_file($t_url, $thumb);
    }
    $desc = yasDB_clean($result['description']);
    // Prep for DB insert
    $gamename = yasDB_clean($result['title']);
    $gamefile = yasDB_clean(str_replace("../", "", $game_url));
    $gamethumb = yasDB_clean(str_replace("../", "", $thumb));
    $height = $result['height'];
    $width = $result['width'];
    $c = $result['category'];
    $category = $categories[$c];
    $query->close();
    $query = yasDB_insert("INSERT INTO `games` (`id`, `title`, `description`, `instructions`, `keywords`, `file`, `height`, `width`, `category`, `plays`, `code`, `type`, `source`, `sourceid`, `thumbnail`, `thumbnail_200`, `screen1`, `screen2`, `screen3`, `screen4`) VALUES (NULL, '{$gamename}', '{$desc}', '', '', '{$gamefile}', {$height}, {$width}, {$category}, 0, '', 'SWF', 'KONGREGATE', {$gameid}, '{$gamethumb}', '', '', '','','')", false);
    if (!$query) {
        echo 'Error updating Games database';
        return false;
    }
    $query = yasDB_update("UPDATE kongregate SET installed = 1 WHERE id = {$result['id']}", false);
    if (!query) {
        echo 'Error updating kongergate database';
        return false;
    }
    return true;
}
开发者ID:royalswe,项目名称:yas26,代码行数:46,代码来源:kongregate_function.php


示例17: elseif

        echo $row['id'];
        ?>
" /><input type="submit" class="button" name="edit" value="Edit!" /><input type="reset" class="button" value="Reset"/></td>
		</tr>
		</table>
		</div>
		</form>	
	<?php 
    }
    $query->close();
} elseif (isset($_POST['edit'])) {
    if (empty($_POST['name']) || empty($_POST['comment'])) {
        echo '<center>One or more fields was left empty.<br />';
        echo '<a href="index.php?act=memberscomment?edit=' . $_POST['id'] . '">Click here to go back</a></center>';
    } else {
        yasDB_update("update memberscomments set name = '{$_POST['name']}', comment = '{$_POST['comment']}' where id = '{$_POST['id']}'", false);
        echo '<center>Comment Successfully edited!<br />';
        echo '<a href="index.php?act=memberscomment">Click here to proceed</a></center>';
    }
} elseif (!empty($_GET['delete'])) {
    $query = yasDB_select("select id from memberscomments where id = '{$_GET['delete']}'", false);
    if ($query->num_rows == 0) {
        echo '<center>You cannot delete a members comment that does not exist!<br />';
        echo '<a href="index.php?act=memberscomment">Click here to go back</a></center>';
        $query->close();
    } else {
        $query->close();
        yasDB_delete("delete from memberscomments where id = '{$_GET['delete']}'", false);
        echo '<center>Members comment successfully deleted.<br />';
        echo '<a href="index.php?act=memberscomment">Click here to proceed</a></center>';
    }
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:manage_memberscomment.php


示例18: time

                $endban = $endban * 24 * 60 * 60;
                $endban = time() + $endban;
            }
        } else {
            $endban = 0;
        }
        yasDB_update("UPDATE user SET username = '{$_POST['username']}', email = '{$_POST['email']}', website = '{$_POST['website']}', endban = {$endban} \n\t\t\tWHERE id = '{$_POST['id']}'");
        echo '<center>user Successfully edited!<br />';
        echo '<a href="index.php?act=manage_users">Click here to proceed</a></center>';
    }
} elseif (!empty($_GET['reset'])) {
    $query = yasDB_select("SELECT avatar FROM user WHERE id='{$_GET['reset']}'");
    $exists = $query->fetch_array(MYSQLI_ASSOC);
    if ($exists['avatar'] != "") {
        unlink("../avatars/" . $exists['avatar']);
        yasDB_update("UPDATE user SET avatar='' WHERE id='{$_GET['reset']}'");
        echo "<center>Users avatar has been deleted and reset.<br />";
        echo "<a href=\"index.php?act=manage_users\">Click here to proceed</a></center>";
    }
} elseif (!empty($_GET['delete'])) {
    $query = yasDB_select("select username FROM user WHERE id = '{$_GET['delete']}'");
    if ($query->num_rows == 0) {
        echo '<center>You cannot delete a user that does not exist!<br />';
        echo '<a href="index.php?act=manage_users">Click here to go back</a></center>';
    } else {
        yasDB_delete("DELETE FROM user WHERE id = '{$_GET['delete']}'");
        echo '<center>user successfully deleted.<br />';
        echo '<a href="index.php?act=manage_users">Click here to proceed</a></center>';
    }
} elseif (isset($_POST['deletechecked'])) {
    $count = count($_POST['checkbox']);
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:manage_users.php


示例19: install_vascogame

function install_vascogame($gameid)
{
    global $mysqli;
    $query = yasDB_select("SELECT * FROM `vascogames` WHERE `id` = '{$gameid}'", false);
    $result = $query->fetch_array(MYSQLI_ASSOC);
    $categories = array('action games' => 2, 'adventure games' => 3, 'strategy games' => 10, 'skill games' => 10, 'puzzle games' => 1, 'arcade games' => 9, 'shooting games' => 5, 'sports games' => 4, 'misc games' => 7, 'car games' => 4);
    //Strategy
    // Download and save game file
    if ($result['file']) {
        $g_url = str_replace("..", "", $result['file']);
        $game_file = basename($g_url);
        $game_file = "vasco_" . preg_replace('#\\W#', '', $result['title']) . "." . GetFileExtension($result['file']);
        $game_url = '../swf/' . $game_file;
        download_file($g_url, $game_url);
    } else {
        return false;
    }
    // Download and save thumbnail pic
    if ($result['thumbnail']) {
        $t_url = str_replace("..", "", $result['thumbnail']);
        $smallthumb = "vasco_" . preg_replace('#\\W#', '', $result['title']) . "." . GetFileExtension($result['thumbnail']);
        $thumb = '../img/' . $smallthumb;
        download_file($t_url, $thumb);
    }
    $desc = yasDB_clean($result['description']);
    // Prep for DB insert
    $gamename = yasDB_clean($result['title']);
    $gamefile = yasDB_clean(str_replace("../", "", $game_url));
    $gamethumb = yasDB_clean(str_replace("../", "", $thumb));
    $height = $result['height'];
    $width = $result['width'];
    $c = $result['category'];
    $category = $categories[$c];
    $query->close();
    if ($category == null || $category == '' || $category == 0) {
        $category == 7;
    }
    $query = yasDB_insert("INSERT INTO `games` (`id`, `title`, `description`, `instructions`, `keywords`, `file`, `height`, `width`, `category`, `plays`, `code`, `type`, `source`, `sourceid`, `thumbnail`, `thumbnail_200`, `screen1`, `screen2`, `screen3`, `screen4`) VALUES (NULL, '{$gamename}', '{$desc}', '', '', '{$gamefile}', {$height}, {$width}, {$category}, 0, '', 'SWF', 'VASCOGAMES', {$gameid}, '{$gamethumb}', '', '', '','','')", false);
    if (!$query) {
        echo 'Error updating Games database';
        return false;
    }
    $query = yasDB_update("UPDATE `vascogames` SET `installed` = 1 WHERE `id` = {$result['id']}", false);
    if (!query) {
        echo 'Error updating vascogames database';
        return false;
    }
    return true;
}
开发者ID:royalswe,项目名称:yas26,代码行数:49,代码来源:vascofeed_functions.php


示例20: yasDB_update

            echo '<center>Files per page must be a number.</center>';
        } else {
            if ($_POST['use'] == 1) {
                $captcha = 'yes';
            } else {
                $captcha = 'no';
            }
            if (!empty($_POST['password']) && $_POST['password'] == $_POST['passwordcheck']) {
                $id = '1';
                yasDB_update("UPDATE settings SET gperpage = " . intval($_POST['gperpage']) . ", numbgames = " . intval($_POST['numbgames']) . ", gamesort = '{$_POST['gamesort']}', approvelinks = '{$_POST['approvelinks']}', numblinks = " . intval($_POST['numblinks']) . ", seo = '{$_POST['seo']}' , lightbox = '{$_POST['lightbox']}', theme = '{$_POST['theme']}', skin = '{$_POST['skin']}', disabled = '{$_POST['disabled']}', regclosed = '{$_POST['regclosed']}', email = '{$_POST['email']}', sitename = '" . yasDB_clean($_POST['sitename']) . "', slogan = '" . yasDB_clean($_POST['slogan']) . "', metades = '" . yasDB_clean($_POST['metades']) . "', metakeywords = '" . yasDB_clean($_POST['metakeywords']) . "',`userecaptcha` = '{$captcha}', `cachelife` = " . intval($_POST['pagecache']) . ", `password` = '" . md5($_POST['password']) . "' where id = '1'");
                include "../includes/settings_function.inc.php";
                createConfigFile();
                echo '<center>Site settings updated!<br />';
                echo '<a href="index.php?act=settings">Click here to proceed.</a></center>';
            } elseif (empty($_POST['password'])) {
                yasDB_update("UPDATE settings SET gperpage = " . intval($_POST['gperpage']) . ", numbgames = " . intval($_POST['numbgames']) . ", gamesort = '{$_POST['gamesort']}', approvelinks = '{$_POST['approvelinks']}', numblinks = " . intval($_POST['numblinks']) . ", seo = '{$_POST['seo']}' , lightbox = '{$_POST['lightbox']}', theme = '{$_POST['theme']}', skin = '{$_POST['skin']}', disabled = '{$_POST['disabled']}', regclosed = '{$_POST['regclosed']}', email = '{$_POST['email']}', sitename = '" . yasDB_clean($_POST['sitename']) . "', slogan = '" . yasDB_clean($_POST['slogan']) . "', metades = '" . yasDB_clean($_POST['metades']) . "', metakeywords = '" . yasDB_clean($_POST['metakeywords']) . "',`userecaptcha` = '{$captcha}', `cachelife` = " . intval($_POST['pagecache']) . "  where id = '1'");
                include "../includes/settings_function.inc.php";
                createConfigFile();
                echo '<center>Site settings updated!<br />';
                echo '<a href="index.php?act=settings"><span style="color:green;">Click here to proceed.</span></a></center>';
            } else {
                echo '<center>Passwords did not match!<br />';
                echo '<a href="index.php?act=settings">Click here to proceed.</a></center>';
            }
        }
    }
} else {
    $query = yasDB_select("SELECT * FROM settings");
    $row = $query->fetch_array(MYSQLI_ASSOC);
    $dir = $setting['sitepath'] . '/templates/';
    $files = scandir($dir);
开发者ID:royalswe,项目名称:yas26,代码行数:31,代码来源:settings.php



注:本文中的yasDB_update函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP yaz_connect函数代码示例发布时间:2022-05-23
下一篇:
PHP yasDB_select函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap