| 1 |
<?php |
<?php |
| 2 |
// $Id: photos.module,v 1.2.2.35 2009/03/10 02:18:59 eastcn Exp $ |
// $Id: photos.module,v 1.2.2.36 2009/03/11 02:38:31 eastcn Exp $ |
| 3 |
|
|
| 4 |
//hook_menu |
//hook_menu |
| 5 |
function photos_menu() { |
function photos_menu() { |
| 449 |
} |
} |
| 450 |
if(variable_get('photos_node_'.$node->type, 0)){ |
if(variable_get('photos_node_'.$node->type, 0)){ |
| 451 |
db_query('DELETE FROM {x_node} WHERE nid = %d', $node->nid);//移除节点下所有图片,图片仍存在于相册中 |
db_query('DELETE FROM {x_node} WHERE nid = %d', $node->nid);//移除节点下所有图片,图片仍存在于相册中 |
| 452 |
db_query('DELETE FROM {x_count} WHERE nid = %d', $node->nid);//移除统计记录 |
db_query("DELETE FROM {x_count} WHERE cid = %d AND type = '%s'", $node->nid, 'node_node');//移除统计记录 |
| 453 |
} |
} |
|
break; |
|
| 454 |
} |
} |
| 455 |
} |
} |
| 456 |
//node_nodepai_view |
//node_nodeapi_view |
| 457 |
function _photos_node_view($node, $display, $type){ |
function _photos_node_view($node, $display, $type){ |
| 458 |
switch($display){ |
switch($display){ |
| 459 |
case 1: |
case 1: |
| 472 |
if($i >= $limit) $album .= theme('more_link', url('photos/album/'.$node->nid), t('Album view')); |
if($i >= $limit) $album .= theme('more_link', url('photos/album/'.$node->nid), t('Album view')); |
| 473 |
return $album; |
return $album; |
| 474 |
case 3: |
case 3: |
| 475 |
if($type == 'teaser' && $node->album['teaser_slide']){ |
if($node->album['count'] || $node->subalbum['count']){ |
| 476 |
list($width, $height) = explode('x', $node->album['teaser_slide']); |
if($type == 'teaser' && $node->album['teaser_slide']){ |
| 477 |
}else if($type == 'page' && $node->album['page_slide']){ |
list($width, $height) = explode('x', $node->album['teaser_slide']); |
| 478 |
list($width, $height) = explode('x', $node->album['page_slide']); |
}else if($type == 'page' && $node->album['page_slide']){ |
| 479 |
}else{ |
list($width, $height) = explode('x', $node->album['page_slide']); |
| 480 |
list($width, $height) = explode('x', variable_get('photos_display_slide', '640x480')); |
}else{ |
| 481 |
|
list($width, $height) = explode('x', variable_get('photos_display_slide', '640x480')); |
| 482 |
|
} |
| 483 |
|
return dfgallery_html(array('url' => url("photos/data/album/$node->nid/json.json", array('absolute' => true)), 'width' => $width, 'height' => $height)); |
| 484 |
} |
} |
|
return dfgallery_html(array('url' => url("photos/data/album/$node->nid", array('absolute' => true, 'query' => array('type' => 'json.json'))), 'width' => $width, 'height' => $height));; |
|
| 485 |
} |
} |
| 486 |
} |
} |
|
|
|
| 487 |
//hook_user |
//hook_user |
| 488 |
function photos_user($op, &$edit, &$ac) { |
function photos_user($op, &$edit, &$ac) { |
| 489 |
global $user; |
global $user; |
| 1192 |
function photos_init() { |
function photos_init() { |
| 1193 |
drupal_add_js(drupal_get_path('module', 'photos').'/js/photos.js'); |
drupal_add_js(drupal_get_path('module', 'photos').'/js/photos.js'); |
| 1194 |
drupal_add_js(drupal_get_path('module', 'photos').'/js/jquery.jeditable.pack.js'); |
drupal_add_js(drupal_get_path('module', 'photos').'/js/jquery.jeditable.pack.js'); |
| 1195 |
drupal_add_js(drupal_get_path('module', 'photos').'/thickbox/thickbox-compressed.js'); |
if(!module_exists('thickbox')){ |
| 1196 |
drupal_add_css(drupal_get_path('module', 'photos').'/thickbox/thickbox.css'); |
drupal_add_js(drupal_get_path('module', 'photos').'/thickbox/thickbox-compressed.js'); |
| 1197 |
|
drupal_add_css(drupal_get_path('module', 'photos').'/thickbox/thickbox.css'); |
| 1198 |
|
} |
| 1199 |
drupal_add_css(drupal_get_path('module', 'photos').'/css/photos.css'); |
drupal_add_css(drupal_get_path('module', 'photos').'/css/photos.css'); |
| 1200 |
} |
} |
| 1201 |
//hook_theme |
//hook_theme |