'.$num_rows.'
'."\n"; $all_pers = $num_rows; $k = '0'; for ($i=0; $i < $num_rows; $i++) { $f = mysql_fetch_array($q); if ($i == '0') { $list[$k] = $f['list']; } else { if ($f['list'] != $list[$k]) { $k++; $list[$k] = $f['list']; } } } for ($i=0; $i < count($list); $i++) { $qw = " SELECT `last_name`, `first_name`, `fathers_name`, `id`, `city`, `organization` FROM `youth_forum_2013_members` WHERE `list` LIKE '".$list[$i]."' ORDER BY `youth_forum_2013_members`.`last_name` ASC " ; mysql_query('SET names "utf8"'); $q = mysql_query($qw, $con_id); if ($q != '0') $num_rows = mysql_num_rows($q); if ((isset($num_rows)) AND ($num_rows != '0')) { // print ''.$num_rows.'
'; $pers_in_list[$i] = $num_rows; for ($j=0; $j < $num_rows; $j++) { $f = mysql_fetch_array($q); $id[$i][$j] = $f['id']; $last_name[$i][$j] = $f['last_name']; $first_name[$i][$j] = $f['first_name']; $fathers_name[$i][$j] = $f['fathers_name']; $city[$i][$j] = $f['city']; $organization[$i][$j] = $f['organization']; } } } $success = chdir ("images/youth_forum_2013_members"); //путь где создавать папку /* Включить только в первый раз // print ''.$home_dir."images/youth_forum_2013_members".'
'; //путь где создавать папку // print getcwd()."\n"; for ($i=0; $i < count($list); $i++) { for ($j=0; $j < $pers_in_list[$i]; $j++) { if (!is_dir($id[$i][$j])) $success = mkdir ($id[$i][$j], 0770); //имя папки и атрибуты на папку } } */ // print'Всего участников : '.$all_pers.'
'."\n"; /* print''."\n"; print''."\n"; */ for ($i=0; $i < count($list); $i++) { // print'';
if ($current_user->ID AND $current_user->ID =='1')
{
print'
'."\n";
/*
for ($j=0; $j < $pers_in_list[$i]; $j++)
{
print' '.$list[$i].' : '.$pers_in_list[$i].'
'."\n"; } else { print''.substr($list[$i], 3).'
'."\n"; } // print''."\n";
print'
'."\n";
// print'- '."\n";
for ($j=0; $j < $pers_in_list[$i]; $j++)
{
$files[$i][$j] = scandir($id[$i][$j]);
if (isset($files[$i][$j]) AND count($files[$i][$j]) > 2)
{
$amount[$i][$j] = (count($files[$i][$j]) - 2);
$amount_no_portrait[$i][$j] = 0;
}
print'
- '; if (isset($amount[$i][$j])) { for ($z=2; $z < count($files[$i][$j]); $z++) { // print'picture = '.$files[$i][$j][$z]."\n"; // print 'str = '.strstr($files[$i][$j][$z], 'portrait_')."\n"; if (strstr($files[$i][$j][$z], 'portrait_') == '') $amount_no_portrait[$i][$j]++; if ($files[$i][$j][$z] == ('portrait_'.$id[$i][$j].'_s.jpg') OR $files[$i][$j][$z] == ('portrait_'.$id[$i][$j].'_s.JPG') ) { $imgsrc[$i][$j] = 'images/youth_forum_2013_members/'.$id[$i][$j].'/'.$files[$i][$j][$z]; // print $imgsrc[$i][$j]; } } } if (isset($imgsrc[$i][$j])) { // print substr($imgsrc[$i][$j], 0, (strlen($imgsrc[$i][$j])-4)).'_x'.substr($imgsrc[$i][$j], -4); print''; print''; print''; print' '; } else { print''; print''; print''; print' '; } print''; if ($current_user->ID AND $current_user->ID =='1') { if (!isset($imgsrc[$i][$j])) { print $id[$i][$j].'. '; } } print''.$last_name[$i][$j].' '.$first_name[$i][$j].' '.$fathers_name[$i][$j]; if ($current_user->ID AND $current_user->ID =='1') { print', '.$organization[$i][$j].', ('.$city[$i][$j].')'; } // print' images/youth_forum_2013_members/'.$id[$i][$j].'/'; if ($current_user->ID AND $current_user->ID =='1') { if (isset($amount_no_portrait[$i][$j])) { if ($amount_no_portrait[$i][$j] != 0) { print', '.($amount_no_portrait[$i][$j]/2).' фото'; } else { print', '.$amount_no_portrait[$i][$j].' фото'; } } else { print', нет фото'; } } print''; print' '."\n"; } print'
'.$id[$i][$j].'. '.$last_name[$i][$j].' '.$first_name[$i][$j].' '.$fathers_name[$i][$j].', '.$organization[$i][$j].', ('.$city[$i][$j].'), '.$list[$i].'
'."\n"; } */ } } print''."\n"; /* работающая версия с плюсиками [raw] '."\n"; global $current_user; get_currentuserinfo(); include_once('incl/functions.inc.php'); include('incl/config.php'); $con_id = base_connect($host, $v_user, $v_password, $data_base); $qw = " SELECT `list` FROM `youth_forum_2013_members` ORDER BY `youth_forum_2013_members`.`list` ASC " ; mysql_query('SET names "utf8"'); $q = mysql_query($qw, $con_id); if ($q != '0') $num_rows = mysql_num_rows($q); if ((isset($num_rows)) AND ($num_rows != '0')) { $all_pers = $num_rows; $k = '0'; for ($i=0; $i < $num_rows; $i++) { $f = mysql_fetch_array($q); if ($i == '0') { $list[$k] = $f['list']; } else { if ($f['list'] != $list[$k]) { $k++; $list[$k] = $f['list']; } } } for ($i=0; $i < count($list); $i++) { $qw = " SELECT `last_name`, `first_name`, `fathers_name`, `id`, `city`, `organization` FROM `youth_forum_2013_members` WHERE `list` LIKE '".$list[$i]."' ORDER BY `youth_forum_2013_members`.`last_name` ASC " ; mysql_query('SET names "utf8"'); $q = mysql_query($qw, $con_id); if ($q != '0') $num_rows = mysql_num_rows($q); if ((isset($num_rows)) AND ($num_rows != '0')) { $pers_in_list[$i] = $num_rows; for ($j=0; $j < $num_rows; $j++) { $f = mysql_fetch_array($q); $id[$i][$j] = $f['id']; $last_name[$i][$j] = $f['last_name']; $first_name[$i][$j] = $f['first_name']; $fathers_name[$i][$j] = $f['fathers_name']; $city[$i][$j] = $f['city']; $organization[$i][$j] = $f['organization']; } } } $success = chdir ("images/youth_forum_2013_members"); //путь где создавать папку // Включить только в первый раз // print ''.$home_dir."images/youth_forum_2013_members".'
'; //путь где создавать папку // print getcwd()."\n"; // for ($i=0; $i < count($list); $i++) // { // for ($j=0; $j < $pers_in_list[$i]; $j++) // { // if (!is_dir($id[$i][$j])) // $success = mkdir ($id[$i][$j], 0770); //имя папки и атрибуты на папку // } // } print''."\n"; print''."\n"; for ($i=0; $i < count($list); $i++) { print'';
if ($current_user->ID AND $current_user->ID =='1')
{
print $list[$i].' : '.$pers_in_list[$i]."\n";
}
else
{
print substr($list[$i], 3);
}
print'
'."\n";
}
}
print''."\n";
?>
'."\n";
print'
'."\n";
print'- '."\n";
for ($j=0; $j < $pers_in_list[$i]; $j++)
{
$files[$i][$j] = scandir($id[$i][$j]);
if (isset($files[$i][$j]) AND count($files[$i][$j]) > 2)
{
$amount[$i][$j] = (count($files[$i][$j]) - 2);
$amount_no_portrait[$i][$j] = 0;
}
print'
- '; if (isset($amount[$i][$j])) { for ($z=2; $z < count($files[$i][$j]); $z++) { if (strstr($files[$i][$j][$z], 'portrait_') == '') $amount_no_portrait[$i][$j]++; if ($files[$i][$j][$z] == ('portrait_'.$id[$i][$j].'_s.jpg') OR $files[$i][$j][$z] == ('portrait_'.$id[$i][$j].'_s.JPG') ) { $imgsrc[$i][$j] = 'images/youth_forum_2013_members/'.$id[$i][$j].'/'.$files[$i][$j][$z]; } } } if (isset($imgsrc[$i][$j])) { print''; print''; print''; print' '; } print''; if ($current_user->ID AND $current_user->ID =='1') { if (!isset($imgsrc[$i][$j])) { print $id[$i][$j].'. '; } } print''.$last_name[$i][$j].' '.$first_name[$i][$j].' '.$fathers_name[$i][$j]; if ($current_user->ID AND $current_user->ID =='1') { print', '.$organization[$i][$j].', ('.$city[$i][$j].')'; } if ($current_user->ID AND $current_user->ID =='1') { if (isset($amount_no_portrait[$i][$j])) { print', '.$amount_no_portrait[$i][$j].' фото'; } else { print', нет фото'; } } print''; print' '."\n"; } print'
*/
?>
[/raw]