http://cigaretteburnpictures.com/sites/default/files/videos/') . ' ' . l(t('More information.'), 'video/help', array('fragment' => 'videofile')); } } /* Advance Forums Style Hook */ /* Adds CBP specific Styles Directory */ function cbp_advforum_styles() { $items = array(); $items['cbp'] = array('directory' => 'cbp_forum',); return $items; } /* Preprocess Author Pane Hook */ /* Add second avatar support and display */ function cbp_preprocess_author_pane(&$variables) { // Get user id & path $account_id = $variables['account']->uid; $variables['profilelink'] = base_path() . "user/" . $account_id; // If uid is valid, set avatar link if ($account_id != 0 && $node = content_profile_load('profile', $account_id)) { $variables['avatarlink'] = base_path() . $node->field_avatar[0]['filepath']; } // If no avatar link is set, set as default image if (!$variables['avatarlink']) { $variables['avatarlink'] = base_path() . "sites/default/files/imagefield_default_images/default_av.jpg"; } } /* Return number of unread posts in all forums for a given user */ function cbp_unread_comments_in_forum($uid) { static $result_cache_2 = NULL; if (is_NULL($result_cache_2)) { $result_cache_2 = 0; $vid = variable_get('forum_nav_vocabulary', ''); $sql = "SELECT COUNT(c.cid) AS count, tn.tid FROM {comments} c INNER JOIN {term_node} tn ON c.nid = tn.nid INNER JOIN {term_data} td ON td.tid = tn.tid AND td.vid = %d LEFT JOIN {history} h ON c.nid = h.nid AND h.uid = %d WHERE c.status = 0 AND c.timestamp > %d AND (c.timestamp > h.timestamp OR h.timestamp IS NULL) GROUP BY tn.tid"; $sql = db_rewrite_sql($sql, 'c', 'cid'); $result = db_query($sql, $vid, $uid, NODE_NEW_LIMIT); while ($row = db_fetch_array($result)) { $result_cache_2 += $row['count']; } } return (isset($result_cache_2)) ? $result_cache_2 : 0; } ?>