• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mosArrayToInts函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中mosArrayToInts函数的典型用法代码示例。如果您正苦于以下问题:PHP mosArrayToInts函数的具体用法?PHP mosArrayToInts怎么用?PHP mosArrayToInts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了mosArrayToInts函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: edit

 /**
  * @param database A database connector object
  * @param integer The unique id of the category to edit (0 if new)
  */
 function edit(&$uid, $menutype, $option)
 {
     global $database, $my, $mainframe;
     $menu = new mosMenu($database);
     $menu->load((int) $uid);
     // fail if checked out not by 'me'
     if ($menu->checked_out && $menu->checked_out != $my->id) {
         mosErrorAlert("The module " . $menu->title . " is currently being edited by another administrator");
     }
     if ($uid) {
         $menu->checkout($my->id);
         // get previously selected Categories
         $params = new mosParameters($menu->params);
         $catids = $params->def('categoryid', '');
         if ($catids) {
             $catidsArray = explode(',', $catids);
             mosArrayToInts($catidsArray);
             $catids = 'c.id=' . implode(' OR c.id=', $catidsArray);
             $query = "SELECT c.id AS `value`, c.section AS `id`, CONCAT_WS( ' / ', s.title, c.title) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . "\n WHERE s.scope = 'content'" . "\n AND ( {$catids} )" . "\n ORDER BY s.name,c.name";
             $database->setQuery($query);
             $lookup = $database->loadObjectList();
         } else {
             $lookup = '';
         }
     } else {
         $menu->type = 'content_blog_category';
         $menu->menutype = $menutype;
         $menu->ordering = 9999;
         $menu->parent = intval(mosGetParam($_POST, 'parent', 0));
         $menu->published = 1;
         $lookup = '';
     }
     // build the html select list for category
     $rows[] = mosHTML::makeOption('', 'All Categories');
     $query = "SELECT c.id AS `value`, c.section AS `id`, CONCAT_WS( ' / ', s.title, c.title) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . "\n WHERE s.scope = 'content'" . "\n ORDER BY s.name,c.name";
     $database->setQuery($query);
     $rows = array_merge($rows, $database->loadObjectList());
     $category = mosHTML::selectList($rows, 'catid[]', 'class="inputbox" size="10" multiple="multiple"', 'value', 'text', $lookup);
     $lists['categoryid'] = $category;
     // build the html select list for ordering
     $lists['ordering'] = mosAdminMenus::Ordering($menu, $uid);
     // build the html select list for the group access
     $lists['access'] = mosAdminMenus::Access($menu);
     // build the html select list for paraent item
     $lists['parent'] = mosAdminMenus::Parent($menu);
     // build published button option
     $lists['published'] = mosAdminMenus::Published($menu);
     // build the url link output
     $lists['link'] = mosAdminMenus::Link($menu, $uid);
     // get params definitions
     $params = new mosParameters($menu->params, $mainframe->getPath('menu_xml', $menu->type), 'menu');
     /* chipjack: passing $sectCatList (categories) instead of $slist (sections) */
     content_blog_category_html::edit($menu, $lists, $params, $option);
 }
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:58,代码来源:content_blog_category.class.php


示例2: edit

 /**
  * @param database A database connector object
  * @param integer The unique id of the section to edit (0 if new)
  */
 function edit($uid, $menutype, $option)
 {
     global $database, $my, $mainframe;
     $menu = new mosMenu($database);
     $menu->load((int) $uid);
     // fail if checked out not by 'me'
     if ($menu->checked_out && $menu->checked_out != $my->id) {
         mosErrorAlert("O módulo " . $menu->title . " está sendo editado atualmente por outro administrador");
     }
     if ($uid) {
         $menu->checkout($my->id);
         // get previously selected Categories
         $params = new mosParameters($menu->params);
         $secids = $params->def('sectionid', '');
         if ($secids) {
             $secidsArray = explode(',', $secids);
             mosArrayToInts($secidsArray);
             $secids = 's.id=' . implode(' OR s.id=', $secidsArray);
             $query = "SELECT s.id AS `value`, s.id AS `id`, s.title AS `text`" . "\n FROM #__sections AS s" . "\n WHERE s.scope = 'content'" . "\n AND ( {$secids} )" . "\n ORDER BY s.name";
             $database->setQuery($query);
             $lookup = $database->loadObjectList();
         } else {
             $lookup = '';
         }
     } else {
         $menu->type = 'content_blog_section';
         $menu->menutype = $menutype;
         $menu->ordering = 9999;
         $menu->parent = intval(mosGetParam($_POST, 'parent', 0));
         $menu->published = 1;
         $lookup = '';
     }
     // build the html select list for section
     $rows[] = mosHTML::makeOption('', 'Todas as Seções');
     $query = "SELECT s.id AS `value`, s.id AS `id`, s.title AS `text`" . "\n FROM #__sections AS s" . "\n WHERE s.scope = 'content'" . "\n ORDER BY s.name";
     $database->setQuery($query);
     $rows = array_merge($rows, $database->loadObjectList());
     $section = mosHTML::selectList($rows, 'secid[]', 'class="inputbox" size="10" multiple="multiple"', 'value', 'text', $lookup);
     $lists['sectionid'] = $section;
     // build the html select list for ordering
     $lists['ordering'] = mosAdminMenus::Ordering($menu, $uid);
     // build the html select list for the group access
     $lists['access'] = mosAdminMenus::Access($menu);
     // build the html select list for paraent item
     $lists['parent'] = mosAdminMenus::Parent($menu);
     // build published button option
     $lists['published'] = mosAdminMenus::Published($menu);
     // build the url link output
     $lists['link'] = mosAdminMenus::Link($menu, $uid);
     // get params definitions
     $params = new mosParameters($menu->params, $mainframe->getPath('menu_xml', $menu->type), 'menu');
     content_blog_section_html::edit($menu, $lists, $params, $option);
 }
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:57,代码来源:content_blog_section.class.php


示例3: sendMail

function sendMail()
{
    global $database, $my, $acl;
    global $mosConfig_sitename;
    global $mosConfig_mailfrom, $mosConfig_fromname;
    josSpoofCheck();
    $mode = intval(mosGetParam($_POST, 'mm_mode', 0));
    $subject = strval(mosGetParam($_POST, 'mm_subject', ''));
    $gou = mosGetParam($_POST, 'mm_group', NULL);
    $recurse = strval(mosGetParam($_POST, 'mm_recurse', 'NO_RECURSE'));
    // pulls message inoformation either in text or html format
    if ($mode) {
        $message_body = $_POST['mm_message'];
    } else {
        // automatically removes html formatting
        $message_body = strval(mosGetParam($_POST, 'mm_message', ''));
    }
    $message_body = stripslashes($message_body);
    if (!$message_body || !$subject || $gou === null) {
        mosRedirect('index2.php?option=com_massmail&mosmsg=Please fill in the form correctly');
    }
    // get users in the group out of the acl
    $to = $acl->get_group_objects($gou, 'ARO', $recurse);
    $rows = array();
    if (count($to['users']) || $gou === '0') {
        // Get sending email address
        $query = "SELECT email" . "\n FROM #__users" . "\n WHERE id = " . (int) $my->id;
        $database->setQuery($query);
        $my->email = $database->loadResult();
        mosArrayToInts($to['users']);
        $user_ids = 'id=' . implode(' OR id=', $to['users']);
        // Get all users email and group except for senders
        $query = "SELECT email" . "\n FROM #__users" . "\n WHERE id != " . (int) $my->id . ($gou !== '0' ? " AND ( {$user_ids} )" : '');
        $database->setQuery($query);
        $rows = $database->loadObjectList();
        // Build e-mail message format
        $message_header = sprintf(_MASSMAIL_MESSAGE, html_entity_decode($mosConfig_sitename, ENT_QUOTES));
        $message = $message_header . $message_body;
        $subject = html_entity_decode($mosConfig_sitename, ENT_QUOTES) . ' / ' . stripslashes($subject);
        //Send email
        foreach ($rows as $row) {
            mosMail($mosConfig_mailfrom, $mosConfig_fromname, $row->email, $subject, $message, $mode);
        }
    }
    $msg = 'E-mail sent to ' . count($rows) . ' users';
    mosRedirect('index2.php?option=com_massmail', $msg);
}
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:47,代码来源:admin.massmail.php


示例4: publishModule

function publishModule($cid = null, $publish = 1, $option, $client = 'admin')
{
    global $database, $my;
    if (count($cid) < 1) {
        $action = $publish ? 'publish' : 'unpublish';
        echo "<script> alert('Select a module to {$action}'); window.history.go(-1);</script>\n";
        exit;
    }
    mosArrayToInts($cid);
    $cids = 'id=' . implode(' OR id=', $cid);
    $query = "UPDATE #__modules" . "\n SET published = " . (int) $publish . "\n WHERE ( {$cids} )" . "\n AND ( checked_out = 0 OR ( checked_out = " . (int) $my->id . " ) )";
    $database->setQuery($query);
    if (!$database->query()) {
        echo "<script> alert('" . $database->getErrorMsg() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    if (count($cid) == 1) {
        $row = new mosModule($database);
        $row->checkin($cid[0]);
    }
    mosCache::cleanCache('com_content');
    $redirect = mosGetParam($_REQUEST, 'redirect', 'index2.php?option=' . $option . '&client=' . $client);
    mosRedirect($redirect);
}
开发者ID:RangerWalt,项目名称:ecci,代码行数:24,代码来源:modules.php


示例5: removeMessage

function removeMessage($cid, $option)
{
    global $database;
    josSpoofCheck();
    if (!is_array($cid) || count($cid) < 1) {
        echo "<script> alert('Select an item to delete'); window.history.go(-1);</script>\n";
        exit;
    }
    if (count($cid)) {
        mosArrayToInts($cid);
        $cids = 'message_id=' . implode(' OR message_id=', $cid);
        $query = "DELETE FROM #__messages" . "\n WHERE ( {$cids} )";
        $database->setQuery($query);
        if (!$database->query()) {
            echo "<script> alert('" . $database->getErrorMsg() . "'); window.history.go(-1); </script>\n";
        }
    }
    $limit = intval(mosGetParam($_REQUEST, 'limit', 10));
    $limitstart = intval(mosGetParam($_REQUEST, 'limitstart', 0));
    mosRedirect("index2.php?option={$option}&limit={$limit}&limitstart={$limitstart}");
}
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:21,代码来源:admin.messages.php


示例6: publish

 /**
  * Generic Publish/Unpublish function
  * @param	array	An array of id numbers
  * @param	integer	0 if unpublishing, 1 if publishing
  * @param	integer	The id of the user performnig the operation
  * @since	1.0.4
  */
 function publish($cid = null, $publish = 1, $user_id = 0)
 {
     mosArrayToInts($cid, array());
     $user_id = (int) $user_id;
     $publish = (int) $publish;
     $k = $this->_tbl_key;
     if (count($cid) < 1) {
         $this->_error = "No items selected.";
         return false;
     }
     $cids = $this->_tbl_key . '=' . implode(' OR ' . $this->_tbl_key . '=', $cid);
     $query = "UPDATE {$this->_tbl}" . "\n SET published = " . (int) $publish . "\n WHERE ({$cids})" . "\n AND (checked_out = 0 OR checked_out = " . (int) $user_id . ")";
     $this->_db->setQuery($query);
     if (!$this->_db->query()) {
         $this->_error = $this->_db->getErrorMsg();
         return false;
     }
     if (count($cid) == 1) {
         $this->checkin($cid[0]);
     }
     $this->_error = '';
     return true;
 }
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:30,代码来源:database.mysqli.php


示例7: removeNewsFeeds

/**
* Removes records
* @param array An array of id keys to remove
* @param string The current GET/POST option
*/
function removeNewsFeeds(&$cid, $option)
{
    global $database;
    josSpoofCheck();
    if (!is_array($cid) || count($cid) < 1) {
        echo "<script> alert('Select an item to delete'); window.history.go(-1);</script>\n";
        exit;
    }
    if (count($cid)) {
        mosArrayToInts($cid);
        $cids = 'id=' . implode(' OR id=', $cid);
        $query = "DELETE FROM #__newsfeeds" . "\n WHERE ( {$cids} )" . "\n AND checked_out = 0";
        $database->setQuery($query);
        if (!$database->query()) {
            echo "<script> alert('" . $database->getErrorMsg() . "'); window.history.go(-1); </script>\n";
        }
    }
    mosRedirect('index2.php?option=' . $option);
}
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:24,代码来源:admin.newsfeeds.php


示例8: unset

        }
        unset($temp);
        break;
    case 1:
    default:
        //Content Items only
        $whereCatid = '';
        if ($catid) {
            $catids = explode(',', $catid);
            mosArrayToInts($catids);
            $whereCatid = "\n AND ( a.catid=" . implode(" OR a.catid=", $catids) . " )";
        }
        $whereSecid = '';
        if ($secid) {
            $secids = explode(',', $secid);
            mosArrayToInts($secids);
            $whereSecid = "\n AND ( a.sectionid=" . implode(" OR a.sectionid=", $secids) . " )";
        }
        $query = "SELECT a.id, a.title, a.sectionid, a.catid" . "\n FROM #__content AS a" . "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id" . "\n INNER JOIN #__categories AS cc ON cc.id = a.catid" . "\n INNER JOIN #__sections AS s ON s.id = a.sectionid" . "\n WHERE ( a.state = 1 AND a.sectionid > 0 )" . "\n AND ( a.publish_up = " . $database->Quote($nullDate) . " OR a.publish_up <= " . $database->Quote($now) . " )" . "\n AND ( a.publish_down = " . $database->Quote($nullDate) . " OR a.publish_down >= " . $database->Quote($now) . " )" . ($access ? "\n AND a.access <= " . (int) $my->gid . " AND cc.access <= " . (int) $my->gid . " AND s.access <= " . (int) $my->gid : '') . $whereCatid . $whereSecid . ($show_front == '0' ? "\n AND f.content_id IS NULL" : '') . "\n AND s.published = 1" . "\n AND cc.published = 1" . "\n ORDER BY a.created DESC";
        $database->setQuery($query, 0, $count);
        $rows = $database->loadObjectList();
        break;
}
// needed to reduce queries used by getItemid for Content Items
if ($type == 1 || $type == 3) {
    $bs = $mainframe->getBlogSectionCount();
    $bc = $mainframe->getBlogCategoryCount();
    $gbs = $mainframe->getGlobalBlogSectionCount();
}
// Output
?>
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:31,代码来源:mod_latestnews.php


示例9: changeState

/**
* Changes the state of one or more content pages
* @param string The name of the category section
* @param integer A unique category id (passed from an edit form)
* @param array An array of unique category id numbers
* @param integer 0 if unpublishing, 1 if publishing
* @param string The name of the current user
*/
function changeState($cid = null, $state = 0, $option)
{
    global $database, $my;
    josSpoofCheck();
    if (count($cid) < 1) {
        $action = $state == 1 ? 'publish' : ($state == -1 ? 'archive' : 'unpublish');
        echo "<script> alert('Select an item to {$action}'); window.history.go(-1);</script>\n";
        exit;
    }
    mosArrayToInts($cid);
    $total = count($cid);
    $cids = 'id=' . implode(' OR id=', $cid);
    $query = "UPDATE #__content" . "\n SET state = " . (int) $state . "\n WHERE ( {$cids} )" . "\n AND ( checked_out = 0 OR ( checked_out = " . (int) $my->id . " ) )";
    $database->setQuery($query);
    if (!$database->query()) {
        echo "<script> alert('" . $database->getErrorMsg() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    if (count($cid) == 1) {
        $row = new mosContent($database);
        $row->checkin($cid[0]);
    }
    // clean any existing cache files
    mosCache::cleanCache('com_content');
    if ($state == "1") {
        $msg = $total . " Item(s) successfully Published";
    } else {
        if ($state == "0") {
            $msg = $total . " Item(s) successfully Unpublished";
        }
    }
    mosRedirect('index2.php?option=' . $option . '&msg=' . $msg);
}
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:41,代码来源:admin.typedcontent.php


示例10: getUserListFromGroup

 /**
  * Gets the users from a group
  * @param string The value for the group (not used 1.0)
  * @param string The name for the group
  * @param string If RECURSE, will drill into child groups
  * @param string Ordering for the list
  * @return array
  */
 function getUserListFromGroup($value, $name, $recurse = 'NO_RECURSE', $order = 'name')
 {
     global $acl;
     // Change back in
     //$group_id = $acl->get_group_id( $value, $name, $group_type = 'ARO');
     $group_id = $acl->get_group_id($name, $group_type = 'ARO');
     $objects = $acl->get_group_objects($group_id, 'ARO', 'RECURSE');
     if (isset($objects['users'])) {
         mosArrayToInts($objects['users']);
         $gWhere = '(id =' . implode(' OR id =', $objects['users']) . ')';
         $query = "SELECT id AS value, name AS text" . "\n FROM #__users" . "\n WHERE block = '0'" . "\n AND " . $gWhere . "\n ORDER BY " . $order;
         $this->_db->setQuery($query);
         $options = $this->_db->loadObjectList();
         return $options;
     } else {
         return array();
     }
 }
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:26,代码来源:joomla.php


示例11: del_object

    function del_object($object_id, $object_type = NULL, $erase = FALSE)
    {
        switch (strtolower(trim($object_type))) {
            case 'aco':
                $object_type = 'aco';
                $table = $this->_db_table_prefix . 'aco';
                $object_map_table = $this->_db_table_prefix . 'aco_map';
                break;
            case 'aro':
                $object_type = 'aro';
                $table = $this->_db_table_prefix . 'aro';
                $object_map_table = $this->_db_table_prefix . 'aro_map';
                $groups_map_table = $this->_db_table_prefix . 'aro_groups_map';
                $object_group_table = $this->_db_table_prefix . 'groups_aro_map';
                break;
            case 'axo':
                $object_type = 'axo';
                $table = $this->_db_table_prefix . 'axo';
                $object_map_table = $this->_db_table_prefix . 'axo_map';
                $groups_map_table = $this->_db_table_prefix . 'axo_groups_map';
                $object_group_table = $this->_db_table_prefix . 'groups_axo_map';
                break;
            default:
                $this->debug_text('del_object(): Invalid Object Type: ' . $object_type);
                return FALSE;
        }
        $this->debug_text("del_object(): ID: {$object_id} Object Type: {$object_type}, Erase all referencing objects: {$erase}");
        if (empty($object_id)) {
            $this->debug_text("del_object(): Object ID ({$object_id}) is empty, this is required");
            return false;
        }
        if (empty($object_type)) {
            $this->debug_text("del_object(): Object Type ({$object_type}) is empty, this is required");
            return false;
        }
        // <mos> $this->db->BeginTrans();
        // Get Object section_value/value (needed to look for referencing objects)
        $this->db->setQuery('SELECT section_value,value FROM ' . $table . ' WHERE ' . $object_type . '_id=' . (int) $object_id);
        $object = $this->db->loadRow();
        if (empty($object)) {
            $this->debug_text('del_object(): The specified object (' . strtoupper($object_type) . ' ID: ' . $object_id . ') could not be found.<br />SQL = ' . $this->db->stderr());
            return FALSE;
        }
        $section_value = $object[0];
        $value = $object[1];
        // Get ids of acl referencing the Object (if any)
        //$this->db->setQuery( "SELECT acl_id FROM $object_map_table WHERE value=" . $this->db->Quote( $value ) . " AND section_value=" . $this->db->Quote( $section_value ) );
        //$acl_ids = $this->db->loadResultArray();
        $acl_ids = array();
        if ($erase) {
            // We were asked to erase all acl referencing it
            $this->debug_text("del_object(): Erase was set to TRUE, delete all referencing objects");
            if ($object_type == "aro" or $object_type == "axo") {
                // The object can be referenced in groups_X_map tables
                // in the future this branching may become useless because
                // ACO might me "groupable" too
                // Get rid of groups_map referencing the Object
                $this->db->setQuery('DELETE FROM ' . $object_group_table . ' WHERE ' . $object_type . '_id=' . (int) $object_id);
                $rs = $this->db->query();
                if (!$rs) {
                    $this->debug_db('edit_object');
                    // <mos> $this->db->RollBackTrans();
                    return false;
                }
            }
            if ($acl_ids) {
                //There are acls actually referencing the object
                if ($object_type == 'aco') {
                    // I know it's extremely dangerous but
                    // if asked to really erase an ACO
                    // we should delete all acl referencing it
                    // (and relative maps)
                    // Do this below this branching
                    // where it uses $orphan_acl_ids as
                    // the array of the "orphaned" acl
                    // in this case all referenced acl are
                    // orhpaned acl
                    $orphan_acl_ids = $acl_ids;
                } else {
                    // The object is not an ACO and might be referenced
                    // in still valid acls regarding also other object.
                    // In these cases the acl MUST NOT be deleted
                    // Get rid of $object_id map referencing erased objects
                    $this->db->setQuery("DELETE FROM {$object_map_table} WHERE section_value=" . $this->db->Quote($section_value) . " AND value=" . $this->db->Quote($value));
                    $rs = $this->db->query();
                    if (!$rs) {
                        $this->debug_db('edit_object');
                        $this->db->RollBackTrans();
                        return false;
                    }
                    // Find the "orphaned" acl. I mean acl referencing the erased Object (map)
                    // not referenced anymore by other objects
                    mosArrayToInts($acl_ids);
                    $sql_acl_ids = implode(",", $acl_ids);
                    $this->db->setQuery('
						SELECT		a.id
						FROM		' . $this->_db_table_prefix . 'acl a
						LEFT JOIN	' . $object_map_table . ' b ON a.id=b.acl_id
						' . '
						WHERE		value IS NULL
//.........这里部分代码省略.........
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:101,代码来源:gacl_api.class.php


示例12: copyMenu

/**
* Form for copying item(s) to a specific menu
*/
function copyMenu($option, $cid, $menutype)
{
    global $database;
    if (!is_array($cid) || count($cid) < 1) {
        echo "<script> alert('Selecione um item para mover'); window.history.go(-1);</script>\n";
        exit;
    }
    ## query to list selected menu items
    mosArrayToInts($cid);
    $cids = 'a.id=' . implode(' OR a.id=', $cid);
    $query = "SELECT a.name" . "\n FROM #__menu AS a" . "\n WHERE ( {$cids} )";
    $database->setQuery($query);
    $items = $database->loadObjectList();
    $menuTypes = mosAdminMenus::menutypes();
    foreach ($menuTypes as $menuType) {
        $menu[] = mosHTML::makeOption($menuType, $menuType);
    }
    // build the html select list
    $MenuList = mosHTML::selectList($menu, 'menu', 'class="inputbox" size="10"', 'value', 'text', null);
    HTML_menusections::copyMenu($option, $cid, $MenuList, $items, $menutype);
}
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:24,代码来源:admin.menus.php


示例13: removeProfilers

function removeProfilers($cid, $option)
{
    global $database;
    if (!is_array($cid) || count($cid) < 1) {
        echo "<script> alert('Select an item to delete'); window.history.go(-1);</script>\n";
        exit;
    }
    //Delete data from related table
    if (count($cid)) {
        mosArrayToInts($cid);
        $cids = 'profiler_id=' . implode(' OR profiler_id=', $cid);
        //Delete the related field
        $sql = "Delete From #__im_fields Where ({$cids})";
        $database->setQuery($sql);
        if (!$database->query()) {
            echo "<script> alert('" . $database->getErrorMsg() . "'); window.history.go(-1); </script>\n";
        }
        //Delete global setting
        $sql = "Delete From #__im_global Where ({$cids})";
        $database->setQuery($sql);
        if (!$database->query()) {
            echo "<script> alert('" . $database->getErrorMsg() . "'); window.history.go(-1); </script>\n";
        }
        //Delete the global data
        $cids = 'id=' . implode(' OR id=', $cid);
        $query = "DELETE FROM #__im_profiler " . "\n WHERE ( {$cids} )";
        $database->setQuery($query);
        if (!$database->query()) {
            echo "<script> alert('" . $database->getErrorMsg() . "'); window.history.go(-1); </script>\n";
        }
    }
    mosRedirect("index2.php?option={$option}");
}
开发者ID:bizanto,项目名称:Hooked,代码行数:33,代码来源:admin.csv_import.php


示例14: copyCategorySelect

/**
* Form for copying item(s) to a specific menu
*/
function copyCategorySelect($option, $cid, $sectionOld)
{
    global $database;
    $redirect = mosGetParam($_POST, 'section', 'content');
    if (!is_array($cid) || count($cid) < 1) {
        echo "<script> alert('Select an item to move'); window.history.go(-1);</script>\n";
        exit;
    }
    ## query to list selected categories
    mosArrayToInts($cid);
    $cids = 'a.id=' . implode(' OR a.id=', $cid);
    $query = "SELECT a.name, a.section" . "\n FROM #__categories AS a" . "\n WHERE ( {$cids} )";
    $database->setQuery($query);
    $items = $database->loadObjectList();
    ## query to list items from categories
    // mosArrayToInts( $cid ); // Just done a few lines earlier
    $cids = 'a.catid=' . implode(' OR a.catid=', $cid);
    $query = "SELECT a.title, a.id" . "\n FROM #__content AS a" . "\n WHERE ( {$cids} )" . "\n ORDER BY a.catid, a.title";
    $database->setQuery($query);
    $contents = $database->loadObjectList();
    ## query to choose section to move to
    $query = "SELECT a.name AS `text`, a.id AS `value`" . "\n FROM #__sections AS a" . "\n WHERE a.published = 1" . "\n ORDER BY a.name";
    $database->setQuery($query);
    $sections = $database->loadObjectList();
    // build the html select list
    $SectionList = mosHTML::selectList($sections, 'sectionmove', 'class="inputbox" size="10"', 'value', 'text', null);
    categories_html::copyCategorySelect($option, $cid, $SectionList, $items, $sectionOld, $contents, $redirect);
}
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:31,代码来源:admin.categories.php


示例15: defined

* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_VALID_MOS') or die('Restricted access');
// clientids must be an integer
$clientids = $params->get('banner_cids', '');
$banner = null;
$where = '';
if ($clientids != '') {
    $clientidsArray = explode(',', $clientids);
    mosArrayToInts($clientidsArray);
    $where = "\n AND ( cid=" . implode(" OR cid=", $clientidsArray) . " )";
}
$query = "SELECT *" . "\n FROM #__banner" . "\n WHERE showBanner=1 " . $where;
$database->setQuery($query);
$banners = $database->loadObjectList();
$numrows = count($banners);
$bannum = 0;
if ($numrows > 1) {
    $numrows--;
    mt_srand((double) microtime() * 1000000);
    $bannum = mt_rand(0, $numrows);
}
if ($numrows) {
    $banner = $banners[$bannum];
    $query = "UPDATE #__banner" . "\n SET impmade = impmade + 1" . "\n WHERE bid = " . (int) $banner->bid;
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:31,代码来源:mod_banners.php


示例16: publishApplications

function publishApplications()
{
    global $database, $option, $task;
    $cid = mosGetParam($_REQUEST, 'cid', array(0));
    $publish = $task == 'publish' ? 1 : 0;
    if (count($cid) < 1) {
        $action = $publish ? 'publish' : 'unpublish';
        echo "<script>alert('Select an item to {$action}'); window.history.go(-1);</script>";
        exit;
    }
    mosArrayToInts($cid);
    $cids = implode(',', $cid);
    $query = "UPDATE #__jumi SET published = " . intval($publish) . " WHERE id in ({$cids})";
    $database->setQuery($query);
    if (!$database->query()) {
        echo "<script>alert('" . $database->getErrorMsg() . "'); window.history.go(-1);</script>";
        exit;
    }
    mosRedirect('index2.php?option=' . $option, count($cid) . ' item(s) ' . $task . 'ed successfully');
}
开发者ID:jennycraig,项目名称:jumi,代码行数:20,代码来源:admin.jumi.php


示例17: publishMambot

/**
* Publishes or Unpublishes one or more modules
* @param array An array of unique category id numbers
* @param integer 0 if unpublishing, 1 if publishing
*/
function publishMambot($cid = null, $publish = 1, $option, $client)
{
    global $database, $my;
    josSpoofCheck();
    if (count($cid) < 1) {
        $action = $publish ? 'publish' : 'unpublish';
        echo "<script> alert('Selecione um plugin para {$action}'); window.history.go(-1);</script>\n";
        exit;
    }
    mosArrayToInts($cid);
    $cids = 'id=' . implode(' OR id=', $cid);
    $query = "UPDATE #__mambots SET published = " . (int) $publish . "\n WHERE ( {$cids} )" . "\n AND ( checked_out = 0 OR ( checked_out = " . (int) $my->id . " ) )";
    $database->setQuery($query);
    if (!$database->query()) {
        echo "<script> alert('" . $database->getErrorMsg() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    if (count($cid) == 1) {
        $row = new mosMambot($database);
        $row->checkin($cid[0]);
    }
    mosRedirect('index2.php?option=' . $option . '&client=' . $client);
}
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:28,代码来源:admin.mambots.php


示例18: deleteMenu

/**
* Deletes menu items(s) you have selected
*/
function deleteMenu($option, $cid, $type)
{
    global $database;
    josSpoofCheck();
    if ($type == 'mainmenu') {
        echo "<script> alert('You cannot delete the \\'mainmenu\\' menu as it is core menu'); window.history.go(-1); </script>\n";
        exit;
    }
    $mid = mosGetParam($_POST, 'mids');
    mosArrayToInts($mid);
    if (count($mid)) {
        // delete menu items
        $mids = 'id=' . implode(' OR id=', $mid);
        $query = "DELETE FROM #__menu" . "\n WHERE ( {$mids} )";
        $database->setQuery($query);
        if (!$database->query()) {
            echo "<script> alert('" . $database->getErrorMsg() . "');</script>\n";
            exit;
        }
    }
    mosArrayToInts($cid);
    // checks whether any modules to delete
    if (count($cid)) {
        // delete modules
        $cids = 'id=' . implode(' OR id=', $cid);
        $query = "DELETE FROM #__modules" . "\n WHERE ( {$cids} )";
        $database->setQuery($query);
        if (!$database->query()) {
            echo "<script> alert('" . $database->getErrorMsg() . "'); window.history.go(-1); </script>\n";
            exit;
        }
        // delete all module entires in jos_modules_menu
        $cids = 'moduleid=' . implode(' OR moduleid=', $cid);
        $query = "DELETE FROM #__modules_menu" . "\n WHERE ( {$cids} )";
        $database->setQuery($query);
        if (!$database->query()) {
            echo "<script> alert('" . $database->getErrorMsg() . "');</script>\n";
            exit;
        }
        // reorder modules after deletion
        $mod = new mosModule($database);
        $mod->ordering = 0;
        $mod->updateOrder("position='left'");
        $mod->updateOrder("position='right'");
    }
    // clean any existing cache files
    mosCache::cleanCache('com_content');
    $msg = 'Menu Deleted';
    mosRedirect('index2.php?option=' . $option, $msg);
}
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:53,代码来源:admin.menumanager.php


示例19: copySectionSelect

/**
* Form for copying item(s) to a specific menu
*/
function copySectionSelect($option, $cid, $section)
{
    global $database;
    if (!is_array($cid) || count($cid) < 1) {
        echo "<script> alert('Select an item to move'); window.history.go(-1);</script>\n";
        exit;
    }
    ## query to list selected categories
    mosArrayToInts($cid);
    $cids = 'a.section=' . implode(' OR a.section=', $cid);
    $query = "SELECT a.name, a.id" . "\n FROM #__categories AS a" . "\n WHERE ( {$cids} )";
    $database->setQuery($query);
    $categories = $database->loadObjectList();
    ## query to list items from categories
    //mosArrayToInts( $cid ); // Just done a few lines earlier
    $cids = 'a.sectionid=' . implode(' OR a.sectionid=', $cid);
    $query = "SELECT a.title, a.id" . "\n FROM #__content AS a" . "\n WHERE ( {$cids} )" . "\n ORDER BY a.sectionid, a.catid, a.title";
    $database->setQuery($query);
    $contents = $database->loadObjectList();
    sections_html::copySectionSelect($option, $cid, $categories, $contents, $section);
}
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:24,代码来源:admin.sections.php


示例20: copyItem

/**
* Form for copying item(s)
**/
function copyItem($cid, $sectionid, $option)
{
    global $database;
    if (!is_array($cid) || count($cid) < 1) {
        echo "<script> alert('Select an item to move'); window.history.go(-1);</script>\n";
        exit;
    }
    //seperate contentids
    mosArrayToInts($cid);
    $cids = 'a.id=' . implode(' OR a.id=', $cid);
    ## Content Items query
    $query = "SELECT a.title" . "\n FROM #__content AS a" . "\n WHERE ( {$cids} )" . "\n ORDER BY a.title";
    $database->setQuery($query);
    $items = $database->loadObjectList();
    ## Section & Category query
    $query = "SELECT CONCAT_WS(',',s.id,c.id) AS `value`, CONCAT_WS(' // ', s.name, c.name) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . "\n WHERE s.scope = 'content'" . "\n ORDER BY s.name, c.name";
    $database->setQuery($query);
    $rows = $database->loadObjectList();
    // build the html select list
    $sectCatList = mosHTML::selectList($rows, 'sectcat', 'class="inputbox" size="10"', 'value', 'text', NULL);
    HTML_content::copySection($option, $cid, $sectCatList, $sectionid, $items);
}
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:25,代码来源:admin.content.php



注:本文中的mosArrayToInts函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mosCountModules函数代码示例发布时间:2022-05-15
下一篇:
PHP moodle_strtolower函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap