Sun Boy
04-29-2003, 08:35 AM
hello every one
as all of you know this command and what it's do in sql
update user SET cookieuser='1'
but there is a problem with this command..
it's not do it for all users we have
so i make up a hack from my own but i need a help from you to finish it ( file name is cookies.php in admin folder )
<?php
error_reporting(7);
if (function_exists("set_time_limit")==1 and get_cfg_var("safe_mode")==0) {
@set_time_limit(1200);
}
//suppress gzipping
$nozip=1;
require("./global.php");
require("./config.php");
adminlog();
cpheader();
//
################################################## ####
if ($action=="updatecookie") {
if (isset($perpage)==0 or $perpage=="") {
$perpage=50;
}
if (isset($startat)==0 or $startat=="") {
$startat=0;
}
echo "<p>User
ids:</p>";
$updatecookieuserquery=$DB_site->query("SELECT *
;
FROM user
;
WHERE user.userid>=$startat
;
AND user.userid<$finishat
;
AND user.open<>10
;
GROUP BY user.userid
;
ORDER BY userid DESC"
);
while ($updatecookieuser=$DB_site->fetch_array($updatecookieuserquery)) {
$userid=$updatecookieuser[userid];
echo "Processing user <b>$us
erid</b><br>\n";
flush();
$getpost=$DB_site->query_first("SELECT * FROM user
;WHERE userid='$updatecookieuser[userid]' ORDER BY userid A
SC LIMIT 1");
$DB_site->query("UPDATE user SET cookieu
ser='1' WHERE userid='$updatecookieuser[userid]'");
}
if ($checkmore=$DB_site->query_first("SELECT userid FROM user
WHERE userid>=$finishat")) {
cpredirect("cookies.php?s=$session[sessionhash]&action=updatecookie&startat=$f
inishat&perpage=$perpage");
echo "<p><a href=\"cookies.php?s=$session[sessionhash]&action=updatecookie&startat=$f
inishat&perpage=$perpage\">Click here to contin
ue updating users cookies</a></
p>";
} else {
echo "<p>cookies updated in user
table!</p>";
cpredirect("cookies.php",1);
}
}
cpfooter();
?>
what do you think ?
as all of you know this command and what it's do in sql
update user SET cookieuser='1'
but there is a problem with this command..
it's not do it for all users we have
so i make up a hack from my own but i need a help from you to finish it ( file name is cookies.php in admin folder )
<?php
error_reporting(7);
if (function_exists("set_time_limit")==1 and get_cfg_var("safe_mode")==0) {
@set_time_limit(1200);
}
//suppress gzipping
$nozip=1;
require("./global.php");
require("./config.php");
adminlog();
cpheader();
//
################################################## ####
if ($action=="updatecookie") {
if (isset($perpage)==0 or $perpage=="") {
$perpage=50;
}
if (isset($startat)==0 or $startat=="") {
$startat=0;
}
echo "<p>User
ids:</p>";
$updatecookieuserquery=$DB_site->query("SELECT *
;
FROM user
;
WHERE user.userid>=$startat
;
AND user.userid<$finishat
;
AND user.open<>10
;
GROUP BY user.userid
;
ORDER BY userid DESC"
);
while ($updatecookieuser=$DB_site->fetch_array($updatecookieuserquery)) {
$userid=$updatecookieuser[userid];
echo "Processing user <b>$us
erid</b><br>\n";
flush();
$getpost=$DB_site->query_first("SELECT * FROM user
;WHERE userid='$updatecookieuser[userid]' ORDER BY userid A
SC LIMIT 1");
$DB_site->query("UPDATE user SET cookieu
ser='1' WHERE userid='$updatecookieuser[userid]'");
}
if ($checkmore=$DB_site->query_first("SELECT userid FROM user
WHERE userid>=$finishat")) {
cpredirect("cookies.php?s=$session[sessionhash]&action=updatecookie&startat=$f
inishat&perpage=$perpage");
echo "<p><a href=\"cookies.php?s=$session[sessionhash]&action=updatecookie&startat=$f
inishat&perpage=$perpage\">Click here to contin
ue updating users cookies</a></
p>";
} else {
echo "<p>cookies updated in user
table!</p>";
cpredirect("cookies.php",1);
}
}
cpfooter();
?>
what do you think ?