function _photos_res_count in Album Photos 6.2
Same name and namespace in other branches
- 7.3 photos.module \_photos_res_count()
2 calls to _photos_res_count()
- photos_admin_update in inc/
photos.admin.inc - photos_cron in ./
photos.module
File
- ./
photos.module, line 1170
Code
function _photos_res_count($cron = 0) {
photos_set_count('site_album');
photos_set_count('site_image');
$time = $cron ? 7200 : 0;
if (time() - variable_get('cron_last', 0) > $time) {
$result = db_query('SELECT uid FROM {users} WHERE uid != 0');
while ($t = db_fetch_object($result)) {
photos_set_count('user_image', $t->uid);
photos_set_count('user_album', $t->uid);
}
$result = db_query('SELECT pid FROM {x_album}');
while ($t = db_fetch_object($result)) {
photos_set_count('node_album', $t->pid);
}
$result = db_query('SELECT DISTINCT(nid) FROM {x_node}');
while ($t = db_fetch_object($result)) {
photos_set_count('node_node', $t->nid);
}
}
}