global $user;
drupal_add_js('misc/functions.js');
drupal_set_breadcrumb(array(l(t('Home'),'
'),l(t('Photographers'), 'fotografusok'), l($node->title,'node/'.$node->nid)));
//drupal_add_css(path_to_theme().'/page-portfolio-kep-popup.css');
//drupal_add_js('misc/image_popup.js');
$_SESSION['photographer'] = $node->title;
if ($_GET['set_frontpage_pictures'] && $user->uid){
if ($_POST){
$trans_node = translation_node_get_translations(array('nid'=>$_POST['photographer_id']), FALSE);
if ($trans_node['en']){
$trans_node = $trans_node['en'];
}else{
$trans_node = $trans_node['hu'];
}
db_query("DELETE FROM {photographers_frontpage_images} WHERE photographer_id=%d", $_POST['photographer_id']);
if ($trans_node->nid){
db_query("DELETE FROM {photographers_frontpage_images} WHERE photographer_id=%d", $trans_node->nid);
}
for ($i=0; $i$tmp[1]), FALSE);
if ($trans_image_nid['en']){
$trans_image_nid = $trans_image_nid['en'];
}else{
$trans_image_nid = $trans_image_nid['hu'];
}
if ($trans_node->nid && $trans_image_nid->nid){
$sql = "SELECT * FROM {files} WHERE fid=%d";
$res = db_query($sql, $tmp[0]);
$row = db_fetch_object($res);
$sql = "SELECT * FROM {files} WHERE filepath='%s' AND nid=%d";
$res = db_query($sql, $row->filepath, $trans_image_nid->nid);
$row = db_fetch_object($res);
db_query("INSERT INTO {photographers_frontpage_images}
(photographer_id,image_id,weight,image_nid)
VALUES
(%d,%d,%d,%d)", $trans_node->nid, $row->fid, $i, $trans_image_nid->nid);
}
}
drupal_set_message('Beállítások sikeresen elmentve.');
}
$portfolios = nodehierarchy_get_descendant_list(arg(1));
for ($i=0; $i < count($portfolios); $i++){
$portfolios[$i] = 'cfpi.nid='.$portfolios[$i];
}
$where = implode(' OR ', $portfolios);
if ($where){
$res = db_query("SELECT *
FROM
{content_field_portfolio_image} AS cfpi,
{files} AS f
WHERE
($where) AND
f.fid=cfpi.field_portfolio_image_fid");
while ($row = db_fetch_object($res)){
$res2 = db_query("SELECT * FROM {photographers_frontpage_images} WHERE image_id=%d", $row->fid);
db_num_rows($res2) ? $checked = ' CHECKED ' : $checked = '';
$pictures_html .= '';
}
}else{
print 'A fotográfusnak nincsenek még portfóliói.';
}
?>
Jelölje be a fotográfus nyitóoldalán megjelenő képeket
}else{
global $menu_array;
$portfolios = get_portfolio_list($node->nid);
//Legfrisebb képek
//$pictures = get_latest_pictures($portfolios['childs']);
//Kiemeltnek beállított képek
/*
$res = db_query("SELECT * FROM
{photographers_frontpage_images} AS pfi,
{content_field_portfolio_image} AS cfpi,
{files} AS f,
{image_dimensions} AS idim
WHERE
pfi.photographer_id = %d AND
cfpi.nid = pfi.image_nid AND
cfpi.field_portfolio_image_fid = pfi.image_id AND
f.fid = cfpi.field_portfolio_image_fid AND
idim.fid = cfpi.field_portfolio_image_fid
ORDER BY
pfi.weight", arg(1));
*/
$res = db_query("SELECT * FROM
{photographers_frontpage_images} AS pfi,
{content_field_portfolio_image} AS cfpi
WHERE
pfi.photographer_id = %d AND
cfpi.nid = pfi.image_nid AND
cfpi.field_portfolio_image_fid = pfi.image_id
ORDER BY
pfi.weight", arg(1));
while ($row0 = db_fetch_object($res)){
$sql = "SELECT * FROM {files} AS f, {image_dimensions} AS idim WHERE f.fid=%d AND idim.fid=f.fid";
$res0 = db_query($sql, $row0->field_portfolio_image_fid);
$row = db_fetch_object($res0);
$row->width > $row->height ? $imagecache_preset = 'w100' : $imagecache_preset = 'h100';
if ($row->width > $row->height){
$row->spec_flag ? $imagecache_preset = 'w_spec100' : $imagecache_preset = 'w100';
}else{
$row->spec_flag ? $imagecache_preset = 'h_spec100' : $imagecache_preset = 'h100';
}
$padding_left = round((100 - ($row->tn_width)) / 2);
$padding_top = round((100 - ($row->tn_height)));
if ($user->uid && $_GET['change_order']){
$pictures_html .= '';
}else{
/*
$pictures_html .= '';
*/
$pictures_html .= '';
}
}
//Első portfólió képei
//$pictures = get_portfolio_pictures($portfolios['top_portfolios'][0]['nid']);
$div_height = (round((db_num_rows($res) / 4)) * 100) + (round((db_num_rows($res) / 4)) * 23 );
//drupal_add_js('misc/thickbox.js');
//drupal_add_css('misc/thickbox.css');
if ($user->uid && $_GET['change_order']) admin_sort_portfolio_images_photographer();
?>
önéletrajz:
Erdei Krisztina
www.krisztinaerdei.com
portfólió
}?>