本文整理汇总了PHP中module_installed函数的典型用法代码示例。如果您正苦于以下问题:PHP module_installed函数的具体用法?PHP module_installed怎么用?PHP module_installed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了module_installed函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_block_module_installed
/**
* Module Installed
*
* Only display the content between the tags if the named module is installed
*
* @param string $name
*
* @return tagdata or FALSE
*/
function smarty_block_module_installed($params, $tagdata, &$smarty, &$repeat)
{
if (module_installed($params['name'])) {
return $tagdata;
} else {
return '';
}
}
示例2: search
/**
* Search
*
* Performs the search and stores results
*
* @param string $query
*/
function search($query = '', $page = 0)
{
$this->CI->load->helper('shorten');
// content search
$content_types = unserialize(setting('search_content_types'));
if (!empty($content_types)) {
$this->CI->load->model('publish/content_model');
$this->CI->load->model('publish/content_type_model');
$this->CI->load->model('custom_fields_model');
foreach ($content_types as $type => $summary_field) {
$content = $this->CI->content_model->get_contents(array('keyword' => $query, 'type' => $type, 'sort' => 'relevance', 'sort_dir' => 'DESC', 'limit' => '50'));
if (!empty($content)) {
foreach ($content as $item) {
// prep summary field
if (!empty($summary_field)) {
$item['summary'] = shorten(strip_tags($item[$summary_field]), setting('search_trim'), TRUE);
}
$item['result_type'] = 'content';
$this->content_results[$item['id']] = $item;
$this->relevance_keys['content|' . $item['id']] = $item['relevance'];
}
}
}
}
// product search
if (setting('search_products') == '1' and module_installed('store')) {
$this->CI->load->model('store/products_model');
$products = $this->CI->products_model->get_products(array('keyword' => $query, 'sort' => 'relevance', 'sort_dir' => 'DESC', 'limit' => '50'));
if (!empty($products)) {
foreach ($products as $product) {
// prep summary field
$product['summary'] = shorten(strip_tags($product['description']), setting('search_trim'), TRUE);
$product['result_type'] = 'product';
$this->product_results[$product['id']] = $product;
$this->relevance_keys['product|' . $product['id']] = $product['relevance'];
}
}
}
// sort results
arsort($this->relevance_keys);
// put together final results array
foreach ($this->relevance_keys as $item => $relevance) {
list($type, $id) = explode('|', $item);
if ($type == 'content') {
$this->results[] = $this->content_results[$id];
} elseif ($type == 'product') {
$this->results[] = $this->product_results[$id];
}
}
// how many total results?
$this->total_results = count($this->results);
if ($this->total_results == 0) {
return array();
}
// grab the segment of the array corresponding to our page
return array_slice($this->results, $page * $this->results_per_page, $this->results_per_page);
}
示例3: run
/**
* Standard modular run function for search results.
*
* @param string Search string
* @param boolean Whether to only do a META (tags) search
* @param ID_TEXT Order direction
* @param integer Start position in total results
* @param integer Maximum results to return in total
* @param boolean Whether only to search titles (as opposed to both titles and content)
* @param string Where clause that selects the content according to the main search string (SQL query fragment) (blank: full-text search)
* @param SHORT_TEXT Username/Author to match for
* @param ?MEMBER Member-ID to match for (NULL: unknown)
* @param TIME Cutoff date
* @param string The sort type (gets remapped to a field in this function)
* @set title add_date
* @param integer Limit to this number of results
* @param string What kind of boolean search to do
* @set or and
* @param string Where constraints known by the main search code (SQL query fragment)
* @param string Comma-separated list of categories to search under
* @param boolean Whether it is a boolean search
* @return array List of maps (template, orderer)
*/
function run($content, $only_search_meta, $direction, $max, $start, $only_titles, $content_where, $author, $author_id, $cutoff, $sort, $limit_to, $boolean_operator, $where_clause, $search_under, $boolean_search)
{
unset($author_id);
unset($limit_to);
if (!module_installed('catalogues')) {
return array();
}
$remapped_orderer = '';
switch ($sort) {
case 'title':
$remapped_orderer = 'cc_title';
break;
case 'add_date':
$remapped_orderer = 'cc_add_date';
break;
}
require_code('catalogues');
require_lang('catalogues');
// Calculate our where clause (search)
if ($author != '') {
return array();
}
if (!is_null($cutoff)) {
$where_clause .= ' AND ';
$where_clause .= 'cc_add_date>' . strval($cutoff);
}
if (!$GLOBALS['FORUM_DRIVER']->is_super_admin(get_member())) {
$where_clause .= ' AND ';
$where_clause .= 'z.category_name IS NOT NULL';
$where_clause .= ' AND ';
$where_clause .= 'p.category_name IS NOT NULL';
}
$g_or = _get_where_clause_groups(get_member());
// Calculate and perform query
if ($g_or == '') {
$rows = get_search_rows('catalogue_category', 'id', $content, $boolean_search, $boolean_operator, $only_search_meta, $direction, $max, $start, $only_titles, 'catalogue_categories r', array('r.cc_title', 'r.cc_description'), $where_clause, $content_where, $remapped_orderer, 'r.*');
} else {
$rows = get_search_rows('catalogue_category', 'id', $content, $boolean_search, $boolean_operator, $only_search_meta, $direction, $max, $start, $only_titles, 'catalogue_categories r LEFT JOIN ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'group_category_access z ON (' . db_string_equal_to('z.module_the_name', 'catalogues_category') . ' AND z.category_name=r.id AND ' . str_replace('group_id', 'z.group_id', $g_or) . ') LEFT JOIN ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'group_category_access p ON (' . db_string_equal_to('p.module_the_name', 'catalogues_catalogue') . ' AND p.category_name=r.c_name AND ' . str_replace('group_id', 'p.group_id', $g_or) . ')', array('r.cc_title', 'r.cc_description'), $where_clause, $content_where, $remapped_orderer, 'r.*');
}
$out = array();
foreach ($rows as $i => $row) {
$out[$i]['data'] = $row;
unset($rows[$i]);
if ($remapped_orderer != '' && array_key_exists($remapped_orderer, $row)) {
$out[$i]['orderer'] = $row[$remapped_orderer];
} elseif (substr($remapped_orderer, 0, 7) == '_rating') {
$out[$i]['orderer'] = $row['compound_rating'];
}
}
return $out;
}
示例4: admin_preload
function admin_preload()
{
if (module_installed('billing', 'store', 'coupons')) {
$this->CI->admin_navigation->child_link('reports', 10, 'Invoices', site_url('admincp/reports/invoices'));
$this->CI->admin_navigation->child_link('reports', 20, 'Product Orders', site_url('admincp/reports/products'));
$this->CI->admin_navigation->child_link('reports', 30, 'Subscriptions', site_url('admincp/reports/subscriptions'));
$this->CI->admin_navigation->child_link('reports', 40, 'Cancellations', site_url('admincp/reports/cancellations'));
$this->CI->admin_navigation->child_link('reports', 50, 'Expirations', site_url('admincp/reports/expirations'));
$this->CI->admin_navigation->child_link('reports', 55, 'Coupons', site_url('admincp/reports/coupons'));
$this->CI->admin_navigation->child_link('reports', 60, 'Taxes Received', site_url('admincp/reports/taxes'));
}
$this->CI->admin_navigation->child_link('reports', 70, 'Registrations', site_url('admincp/reports/registrations'));
$this->CI->admin_navigation->child_link('reports', 80, 'Popular Content', site_url('admincp/reports/popular'));
$this->CI->admin_navigation->child_link('configuration', 100, 'Cronjob', site_url('admincp/reports/cronjob'));
}
示例5: info
/**
* Standard modular info function.
*
* @return ?array Map of module info (NULL: module is disabled).
*/
function info()
{
if (!module_installed('calendar')) {
return NULL;
}
if (!has_actual_page_access(get_member(), 'calendar')) {
return NULL;
}
if ($GLOBALS['SITE_DB']->query_value('calendar_events', 'COUNT(*)') == 0) {
return NULL;
}
require_lang('calendar');
$info = array();
$info['lang'] = do_lang_tempcode('CALENDAR');
$info['default'] = false;
return $info;
}
示例6: info
/**
* Standard modular info function.
*
* @return ?array Map of module info (NULL: module is disabled).
*/
function info()
{
if (!module_installed('iotds')) {
return NULL;
}
if (!has_actual_page_access(get_member(), 'iotds')) {
return NULL;
}
if ($GLOBALS['SITE_DB']->query_value('iotd', 'COUNT(*)') == 0) {
return NULL;
}
require_lang('iotds');
$info = array();
$info['lang'] = do_lang_tempcode('IOTD_ARCHIVE');
$info['default'] = true;
return $info;
}
示例7: info
/**
* Standard modular info function.
*
* @return ?array Map of module info (NULL: module is disabled).
*/
function info()
{
if (!module_installed('galleries')) {
return NULL;
}
if (!has_actual_page_access(get_member(), 'galleries')) {
return NULL;
}
if ($GLOBALS['SITE_DB']->query_value('galleries', 'COUNT(*)') <= 1) {
return NULL;
}
require_lang('galleries');
$info = array();
$info['lang'] = do_lang_tempcode('GALLERIES');
$info['default'] = true;
return $info;
}
示例8: info
/**
* Standard modular info function.
*
* @return ?array Map of module info (NULL: module is disabled).
*/
function info()
{
if (!module_installed('banners')) {
return NULL;
}
require_lang('banners');
$info = array();
$info['db_table'] = 'banners';
$info['db_identifier'] = 'name';
$info['db_validated'] = 'validated';
$info['db_add_date'] = 'add_date';
$info['db_edit_date'] = 'edit_date';
$info['edit_module'] = 'cms_banners';
$info['edit_type'] = '_ed';
$info['edit_identifier'] = 'id';
$info['title'] = do_lang_tempcode('BANNERS');
return $info;
}
示例9: info
/**
* Standard modular info function.
*
* @return ?array Map of module info (NULL: module is disabled).
*/
function info()
{
if (!module_installed('filedump')) {
return NULL;
}
if (!has_actual_page_access(get_member(), 'filedump')) {
return NULL;
}
require_code('files2');
if (count(get_directory_contents(get_custom_file_base() . '/uploads/filedump')) == 0) {
return NULL;
}
require_lang('filedump');
$info = array();
$info['lang'] = do_lang_tempcode('FILE_DUMP');
$info['default'] = false;
$info['extra_sort_fields'] = array('file_size' => do_lang_tempcode('_FILE_SIZE'));
return $info;
}
示例10: info
/**
* Standard modular info function.
*
* @return ?array Map of module info (NULL: module is disabled).
*/
function info()
{
if (!module_installed('galleries')) {
return NULL;
}
if (!has_actual_page_access(get_member(), 'galleries')) {
return NULL;
}
if ($GLOBALS['SITE_DB']->query_value('images', 'COUNT(*)') == 0) {
return NULL;
}
require_lang('galleries');
$info = array();
$info['lang'] = do_lang_tempcode('IMAGES');
$info['default'] = true;
$info['category'] = 'cat';
$info['integer_category'] = false;
return $info;
}
示例11: info
/**
* Standard modular info function.
*
* @return ?array Map of module info (NULL: module is disabled).
*/
function info()
{
if (!module_installed('downloads')) {
return NULL;
}
if (!has_actual_page_access(get_member(), 'downloads')) {
return NULL;
}
if ($GLOBALS['SITE_DB']->query_value('download_downloads', 'COUNT(*)') == 0) {
return NULL;
}
require_lang('downloads');
$info = array();
$info['lang'] = do_lang_tempcode('SECTION_DOWNLOADS');
$info['default'] = true;
$info['category'] = 'category_id';
$info['integer_category'] = true;
$info['extra_sort_fields'] = array('file_size' => do_lang_tempcode('_FILE_SIZE'));
return $info;
}
示例12: info
/**
* Standard modular info function.
*
* @return ?array Map of module info (NULL: module is disabled).
*/
function info()
{
if (!module_installed('news')) {
return NULL;
}
require_lang('news');
$info = array();
$info['db_table'] = 'news';
$info['db_identifier'] = 'id';
$info['db_validated'] = 'validated';
$info['db_title'] = 'title';
$info['db_title_dereference'] = true;
$info['db_add_date'] = 'date_and_time';
$info['db_edit_date'] = 'edit_date';
$info['edit_module'] = 'cms_news';
$info['edit_type'] = '_ed';
$info['edit_identifier'] = 'id';
$info['title'] = do_lang_tempcode('NEWS');
return $info;
}
示例13: info
/**
* Standard modular info function.
*
* @return ?array Map of module info (NULL: module is disabled).
*/
function info()
{
if (!module_installed('galleries')) {
return NULL;
}
if (!has_actual_page_access(get_member(), 'galleries')) {
return NULL;
}
if ($GLOBALS['SITE_DB']->query_value('videos', 'COUNT(*)') == 0) {
return NULL;
}
require_lang('galleries');
$info = array();
$info['lang'] = do_lang_tempcode('VIDEOS');
$info['default'] = true;
$info['category'] = 'cat';
$info['integer_category'] = false;
$info['extra_sort_fields'] = array('video_length' => do_lang_tempcode('VIDEO_LENGTH'));
return $info;
}
示例14: info
/**
* Standard modular info function.
*
* @return ?array Map of module info (NULL: module is disabled).
*/
function info()
{
if (!module_installed('cedi')) {
return NULL;
}
require_lang('cedi');
$info = array();
$info['db_table'] = 'seedy_posts';
$info['db_identifier'] = 'id';
$info['db_validated'] = 'validated';
$info['db_title'] = 'the_message';
$info['db_title_dereference'] = true;
$info['db_add_date'] = 'date_and_time';
$info['db_edit_date'] = 'edit_date';
$info['edit_module'] = 'cedi';
$info['edit_type'] = 'post';
$info['edit_identifier'] = 'post_id';
$info['title'] = do_lang_tempcode('CEDI');
$info['is_minor'] = true;
return $info;
}
示例15: get_possible_links
function get_possible_links($menu_id)
{
// Each "possible link" must have the following 3 attributes:
// - Text (display text)
// - Type (content type, not used technically but just to show what type of content it is)
// - Code (a base64_encoded, serialized array of data including:
// - link_type (either "link" or "special),
// - link_id (if in universal `links` table and link_type == "link"),
// - special_type (if link_type == "special")
$possible_links = array();
// get current links so we can prevent duplicates
$this->load->model('menu_model');
$current_links = $this->menu_model->get_links(array('menu' => $this->session->userdata('manage_menu_id'), 'parent' => $this->session->userdata('manage_menu_parent_link_id')));
// add special links
$special_links = array('home' => 'Home', 'control_panel' => 'Control Panel', 'my_account' => 'My Account', 'search' => 'Search');
if (module_installed('store')) {
$special_links['store'] = 'Store';
$special_links['cart'] = 'Shopping Cart';
}
if (module_installed('billing')) {
$special_links['subscriptions'] = 'Subscription Plans';
}
foreach ($special_links as $special_link_code => $special_link_name) {
if (!$this->special_link_in_array($current_links, $special_link_code)) {
$possible_links[] = array('text' => $special_link_name, 'type' => 'Special', 'code' => base64_encode(serialize(array('special_type' => $special_link_code, 'link_type' => 'special', 'link_text' => $special_link_name))));
}
}
// get all content links from the universal link database
$this->load->model('link_model');
$links = $this->link_model->get_links();
foreach ((array) $links as $link) {
if (!$this->universal_link_in_array($current_links, $link['id'])) {
$possible_links[] = array('text' => $link['title'], 'type' => $link['type'], 'code' => base64_encode(serialize(array('link_id' => $link['id'], 'link_type' => 'link', 'link_text' => $link['title']))));
}
}
return $possible_links;
}