function settingDefineConstants()
{
$q = db_query("select settings_constant_name, settings_value from ".SETTINGS_TABLE);
while( $row = db_fetch_row($q) ){
$EvalStr = 'define(\''.$row["settings_constant_name"].'\', \''.
str_replace(array('\\',"'"),array('\\\\',"\'"), $row["settings_value"] ).'\');';
eval( $EvalStr );
}
}
if (($this->dv == "w"
&& $op >= 145
&& ($user_id == 113448 || $user_id == 200003 || $user_id == 200002 || $user_id == 4902 || $user_id == 492 || $user_id == 204435 || $user_id == 247444 || $user_id == 696980))
||
($this->dv == "i"
&& $op >= 149
&& ($user_id == 201661 || $user_id == 211076 || $user_id == 201658 || $user_id == 202049 || $user_id == 201650 || $user_id == 228336)))
// ...
$mas = array(
array ('1','2','3'),
array ('A','B','C'),
array ('Q','W','E','R','T','Y'),
array ('7','8'),
);
function recursive_function($count,$i=0) {
$str='foreach ($mas['.$i.'] as $key'.($i+1).' => $bukva'.($i+1).'){
';
if ($count) {
$str.=str_repeat(' ',($i+1)*3).recursive_function($count-1,$i+1);
} else {
$str.='$word = \'\';
$word=$word';
for ($j = 0;$j<$i+1;$j++) {
$str.='.$bukva'.($j+1);
}
$str.=';
$words[] = $word;';
}
$str.='
'.(str_repeat(' ',$i*3)).'}';
return $str;
}
$function = '
$words = array();
'.recursive_function(count($mas)-1).'
return $words;
';
.........
тогда уж DIRECTORY_SEPARATOR$NETCAT_FOLDER = dirname(__FILE__) . '/';
$g=0;
$result = mysql_query("SELECT *
FROM `members_photos` WHERE inact='0'
ORDER BY rating DESC , scores DESC LIMIT 0, 500");
$rows = mysql_num_rows($result);
for ($i=0; $i<$rows; $i++) {
$member_id = mysql_result($result, $i, member_id);
$min_photo = mysql_result($result, $i, min_photo);
$result2 = mysql_query("SELECT member_pol FROM members WHERE member_id='$member_id'");
$rows2 = mysql_num_rows($result2);
if ($result2==0) {
} else {
if ($g<1) {
$member_pol = mysql_result($result2, 0, member_pol);
if ($member_pol=='1') {
$g++;
$photo = $min_photo;
}
}
}
}
// Выборка 10 товаров, удовлетворяющих условиям поиска
$sql1 = "
SELECT * FROM products
WHERE $sql_where
LIMIT $page, 10
";
$res = mysql_query($sql1);
... // Загоняются в массив
// А теперь надо узнать общее кол-во товаров, удовлетворяющих условиям поиска
$sql2 = "
SELECT * FROM products
WHERE $sql_where
";
$products_count = mysql_numrows(mysql_query($sql2))