当前位置: 首页>>代码示例>>PHP>>正文


PHP rex_sql::getArray方法代码示例

本文整理汇总了PHP中rex_sql::getArray方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_sql::getArray方法的具体用法?PHP rex_sql::getArray怎么用?PHP rex_sql::getArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rex_sql的用法示例。


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

示例1: execute

 function execute()
 {
     $table = $this->action["elements"][2];
     // Tabelle vorhanden ?
     $sql = new rex_sql();
     $sql->debug = 1;
     $sql->setQuery('show tables');
     $table_exists = FALSE;
     foreach ($sql->getArray() as $k => $v) {
         if ($table == $v) {
             $table_exists = TRUE;
             break;
         }
     }
     if (!$table_exists) {
         $sql->setQuery('CREATE TABLE `' . $table . '` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY);');
     }
     // Welche Felder sind vorhanden ?
     $sql->setQuery('show columns from ' . $table);
     $sql_cols = $sql->getArray();
     $cols = array();
     foreach ($sql_cols as $k => $v) {
         $cols[] = $v['Field'];
     }
     // wenn Feld nicht in Datenbank, dann als TEXT anlegen.
     foreach ($this->elements_sql as $key => $value) {
         if (!in_array($key, $cols)) {
             $sql->setQuery('ALTER TABLE `' . $table . '` ADD `' . $key . '` TEXT NOT NULL;');
         }
     }
     return;
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:32,代码来源:class.xform.action_createdb.inc.php

示例2: rex_a128_historyHandler

function rex_a128_historyHandler($params)
{
    global $page, $subpage, $REX_USER, $REX;
    $mypage = $params['mypage'];
    require $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/classes/class.rex_historyManager.inc.php';
    require $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/classes/class.rex_history.inc.php';
    require $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/classes/class.rex_historyItem.inc.php';
    $function = rex_request('function', 'string');
    $mode = rex_request('mode', 'string');
    // Alle Histories registrierens
    $articleHistory =& rexHistoryManager::getHistory('articles');
    $templateHistory =& rexHistoryManager::getHistory('templates');
    $moduleHistory =& rexHistoryManager::getHistory('modules');
    $actionHistory =& rexHistoryManager::getHistory('actions');
    $sql = new rex_sql();
    $sql->debugsql = true;
    if ($page == 'module' && $function == 'edit' && ($module_id = rex_get('modul_id', 'int')) != 0) {
        $result = $sql->getArray('SELECT name FROM ' . $REX['TABLE_PREFIX'] . 'modultyp WHERE id=' . $module_id);
        if (isset($result[0])) {
            $link = 'index.php?page=' . $page . '&function=' . $function . '&modul_id=' . $module_id;
            $title = $result[0]['name'];
            if ($REX_USER->hasPerm('advancedMode[]')) {
                $title .= ' [' . $module_id . ']';
            }
            $moduleHistory->addItem(new rexHistoryItem($title, $link));
        }
    } elseif ($page == 'module' && $subpage == 'actions' && $function == 'edit' && ($action_id = rex_get('action_id', 'int')) != 0) {
        $result = $sql->getArray('SELECT name FROM ' . $REX['TABLE_PREFIX'] . 'action WHERE id=' . $action_id);
        if (isset($result[0])) {
            $link = 'index.php?page=' . $page . '&subpage=' . $subpage . '&function=' . $function . '&modul_id=' . $action_id;
            $title = $result[0]['name'];
            if ($REX_USER->hasPerm('advancedMode[]')) {
                $title .= ' [' . $action_id . ']';
            }
            $actionHistory->addItem(new rexHistoryItem($title, $link));
        }
    } elseif ($page == 'template' && $function == 'edit' && ($template_id = rex_get('template_id', 'int')) != 0) {
        $result = $sql->getArray('SELECT name FROM ' . $REX['TABLE_PREFIX'] . 'template WHERE id=' . $template_id);
        if (isset($result[0])) {
            $link = 'index.php?page=' . $page . '&function=' . $function . '&template_id=' . $template_id;
            $title = $result[0]['name'];
            if ($REX_USER->hasPerm('advancedMode[]')) {
                $title .= ' [' . $template_id . ']';
            }
            $templateHistory->addItem(new rexHistoryItem($title, $link));
        }
    } elseif ($page == 'content' && $mode == 'edit' && ($article_id = rex_get('article_id', 'int')) != 0) {
        $art = OOArticle::getArticleById($article_id);
        if (OOArticle::isValid($art)) {
            $link = 'index.php?page=' . $page . '&mode=' . $mode . '&article_id=' . $article_id;
            $title = $art->getName();
            if ($REX_USER->hasPerm('advancedMode[]')) {
                $title .= ' [' . $article_id . ']';
            }
            $articleHistory->addItem(new rexHistoryItem($title, $link));
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:58,代码来源:extension_historyHandler.inc.php

示例3: a587_getCategories

function a587_getCategories($_ignoreoffline = true, $_onlyIDs = false, $_cats = false)
{
    global $REX;
    $return = array();
    if (!empty($_cats)) {
        $whereCats = array();
        $sqlCats = array();
        if (is_array($_cats)) {
            foreach ($_cats as $catID) {
                $whereCats[] = "path LIKE '%|" . intval($catID) . "|%'";
                $sqlCats[] = intval($catID);
            }
        }
        $return = array();
        $query = 'SELECT id,catname,path FROM ' . $REX['TABLE_PREFIX'] . 'article WHERE startpage = 1';
        if (empty($REX['ADDON']['settings']['rexsearch']['indexoffline']) and $_ignoreoffline) {
            $query .= ' AND status = 1';
        }
        if (!empty($whereCats)) {
            $query .= ' AND (' . implode(' OR ', $whereCats) . ' OR (id IN (' . implode(',', $sqlCats) . ')))';
        }
        $query .= ' GROUP BY id ORDER BY id';
        $sql = new rex_sql();
        foreach ($sql->getArray($query) as $cat) {
            if ($_onlyIDs) {
                $return[] = $cat['id'];
            } else {
                $return[$cat['id']] = $cat['catname'];
            }
        }
    } else {
        $query = 'SELECT id,re_id,catname,path FROM ' . $REX['TABLE_PREFIX'] . 'article WHERE startpage = 1 AND re_id=%d';
        if (empty($REX['ADDON']['settings']['rexsearch']['indexoffline']) and $_ignoreoffline) {
            $query .= ' AND status = 1';
        }
        $query .= ' GROUP BY id ORDER BY catprior,id';
        $sql = new rex_sql();
        $cats = $sql->getArray(sprintf($query, 0));
        while (!empty($cats)) {
            $cat = array_shift($cats);
            if ($_onlyIDs) {
                $return[] = $cat['id'];
            } else {
                $return[$cat['id']] = str_repeat(' ', substr_count($cat['path'], '|') * 2 - 2) . $cat['catname'];
            }
            array_splice($cats, 0, 0, $sql->getArray(sprintf($query, $cat['id'])));
        }
    }
    return $return;
}
开发者ID:olien,项目名称:rexsearch,代码行数:50,代码来源:functions.inc.php

示例4: showList

 private function showList($cat)
 {
     $addSql = "";
     $cats = explode("~~", $cat);
     if (!in_array(999, $cats)) {
         $addSql = 'AND category LIKE \'%|';
         $addSql .= implode('|%\' OR category LIKE \'%|', $cats);
         $addSql .= '|%\'';
     }
     $addWhere = ' WHERE (
             ((offline_date = "0000-00-00") OR (REPLACE(offline_date, "-", "") > CURDATE() + 0))
             AND
             ((archive_date = "0000-00-00") OR REPLACE(archive_date, "-", "") > CURDATE() + 0)
             AND 
             ((online_date = "0000-00-00") OR REPLACE(online_date, "-", "") <= CURDATE() + 0)
     )';
     $qry = "\tSELECT * \r\n\t\t\t\t\tFROM " . TBL_NEWS . " \r\n                    " . $addWhere . "\r\n\t\t\t\t\tAND status=1 \r\n                    " . $addSql . "\r\n\t\t\t\t\tORDER BY online_date DESC\r\n\t\t\t\t";
     $sql = new rex_sql();
     #$sql->debugsql = true;
     $data = $sql->getArray($qry);
     /* create one master array of the records */
     $posts = array();
     foreach ($data as $row) {
         $posts[] = array('post' => $row);
     }
     return $posts;
 }
开发者ID:brt-tito,项目名称:rex-news,代码行数:27,代码来源:rss_news.php

示例5: rex_a63_installAction2Modul

/**
 * Vorgehensweise
 * Die install.sql muss bereits ausgeführt worden sein und die Module und
 * Action somit bereits in der Datenbank stehen.
 * Als erstes werden die IDs des Modules "Gästebuch - Eintragsliste" und der
 * Action "Gästebuch - Eintragsliste StatusPerdatei" ausgelesen und dann nachgesehen,
 * ob es dazu schon eine Zuweisung in der Tabelle rex_module_action gibt.
 * Ist das nicht der Fall, werden die IDs entsprechend eingetragen.
 *
 * Die automatische Zuweisung zwischen Action und Modul ist damit erledigt.
 * Im Fehlerfalle muss eine Meldung ausgegeben werden.
 * Die Action könnte dann evtl. per Hand noch zugewiesen werden.
 *
 *
 * @param   string  Name des Modules (auf richtige Schreibweise achten!)
 * @param   string  Name der Action (auf richtige Schreibweise achten!)
 * @return  mixed   TRUE oder ein Fehlertext
 */
function rex_a63_installAction2Modul($modul_name, $action_name)
{
    global $REX;
    if (!isset($modul_name) or $modul_name == '' or !isset($action_name) or $action_name == '') {
        return 'rex_a63_installAction2Modul: Keinen Modul- oder Aktionname übergeben.';
    }
    /**
     * Diese Abfrage gibt zurück
     * - wenn es bereits eine Verküpfung in der Tabelle rex_module_action gibt:
     * m_id  a_id  mod_action_m_id   mod_action_a_id
     *  42     9       true             true
     *
     * - gibt es noch keine Verknüpfung, sieht die Rückgabe so aus:
     * m_id  a_id  mod_action_m_id   mod_action_a_id
     *  42     9       false             false
     *
     * m_id und a_id sind von MySQL vergebene IDs und entsprechen nicht diesem Beispiel hier!
     *
     */
    $qry = 'SELECT `' . $REX['TABLE_PREFIX'] . 'module`.`id` AS m_id, `' . $REX['TABLE_PREFIX'] . 'action`.`id` AS a_id,
            IF(`' . $REX['TABLE_PREFIX'] . 'module_action`.`module_id` != 0, "true", "false") AS mod_action_m_id,
            IF(`' . $REX['TABLE_PREFIX'] . 'module_action`.`action_id` != 0, "true", "false") AS mod_action_a_id
          FROM (`' . $REX['TABLE_PREFIX'] . 'module` , `' . $REX['TABLE_PREFIX'] . 'action`)
          LEFT JOIN `' . $REX['TABLE_PREFIX'] . 'module_action` ON ( `' . $REX['TABLE_PREFIX'] . 'module_action`.`module_id` = `' . $REX['TABLE_PREFIX'] . 'module`.`id`
            AND `' . $REX['TABLE_PREFIX'] . 'module_action`.`action_id` = `' . $REX['TABLE_PREFIX'] . 'action`.`id` )
          WHERE `' . $REX['TABLE_PREFIX'] . 'module`.`name` = "' . $modul_name . '"
            AND `' . $REX['TABLE_PREFIX'] . 'action`.`name` = "' . $action_name . '"
          LIMIT 1';
    $sql = new rex_sql();
    //$sql->debugsql = true;
    $data = $sql->getArray($qry);
    if (is_array($data) and $sql->getRows() == 1) {
        foreach ($data as $row) {
            // prüfe IDs auf vorhandensein
            // sind diese IDs in dieser Kombination noch nicht in der Verknüpfungstabelle
            // dann können sie dort eingetragen werden
            if ($row['mod_action_m_id'] == 'false' and $row['mod_action_a_id'] == 'false') {
                $qry = 'INSERT INTO `' . $REX['TABLE_PREFIX'] . 'module_action` ( `id` , `module_id` , `action_id` )
                VALUES (NULL , "' . $row['m_id'] . '", "' . $row['a_id'] . '")';
                $sql2 = new rex_sql();
                //$sql->debugsql = true;
                $sql2->setQuery($qry);
                if (!$REX['a63_sql_compare']) {
                    $sql2->freeResult();
                }
            } else {
                return 'rex_a63_installAction2Modul: Es exitiert bereits eine Zuweisung zwischen dem Modul "' . $modul_name . '" und der Aktion "' . $action_name . '".';
            }
        }
    } else {
        return 'rex_a63_installAction2Modul: Fehler in der Datenbankabfrage. Ist der Modulname "' . $modul_name . '" und der Aktionname "' . $action_name . '" richtig?';
    }
    if (!$REX['a63_sql_compare']) {
        $sql->freeResult();
    }
    return true;
}
开发者ID:BackupTheBerlios,项目名称:gbforredaxo,代码行数:75,代码来源:install.php

示例6: execute

 function execute()
 {
     $subject_key = $this->action["elements"][2];
     $body_key = $this->action["elements"][3];
     $user_id_key = $this->action["elements"][4];
     foreach ($this->elements_sql as $key => $value) {
         if ($subject_key == $key) {
             $subject = $value;
         }
         if ($body_key == $key) {
             $body = $value;
         }
         if ($user_id_key == $key) {
             $from_user_id = $value;
         }
         // echo "<br /> $key => $value";
     }
     if ($subject == "" or $body == "" or $from_user_id == "") {
         return FALSE;
     }
     // User auslesen
     $gu = new rex_sql();
     // $gu->debugsql = 1;
     // $gu->setQuery('select * from rex_com_user where id<>"'.$from_user_id.'" order by id');
     $gu->setQuery('select * from rex_com_user order by id');
     foreach ($gu->getArray() as $user) {
         $user_body = $body;
         $user_subject = $subject;
         $to_user_id = $user["id"];
         // Empfaenger einbauen
         $in = new rex_sql();
         // $in->debugsql = 1;
         $in->setTable("rex_com_message");
         $in->setValue("user_id", $to_user_id);
         $in->setValue("from_user_id", $from_user_id);
         $in->setValue("to_user_id", $to_user_id);
         $in->setValue("subject", $user_subject);
         $in->setValue("body", $user_body);
         $in->setValue("create_datetime", time());
         $in->insert();
         /*
         $in = new rex_sql;
         // $in->debugsql = 1;
         $in->setTable("rex_com_message");
         $in->setValue("user_id",$from_user_id);
         $in->setValue("from_user_id",$from_user_id);
         $in->setValue("to_user_id",$to_user_id);
         $in->setValue("subject",$user_subject);
         $in->setValue("body",$user_body);
         $in->setValue("create_datetime",time());
         $in->insert();
         */
         rex_com_user::exeAction($to_user_id, "sendemail_newmessage", $user);
     }
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:55,代码来源:class.xform.action_com_send_msg2all.inc.php

示例7: enterObject

    function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
    {
        // ***** SELECT FESTLEGEN
        $SEL = new rex_select();
        $SEL->setName('FORM[' . $this->params["form_name"] . '][el_' . $this->id . '][]');
        $SEL->setId("el_" . $this->id);
        $SEL->setSize(5);
        $SEL->setMultiple(1);
        // ***** SQL - ROHDATEN ZIEHEN
        $sql = $this->elements[5];
        $teams = new rex_sql();
        $teams->debugsql = $this->params["debug"];
        $teams->setQuery($sql);
        for ($t = 0; $t < $teams->getRows(); $t++) {
            $SEL->addOption($teams->getValue($this->elements[7]), $teams->getValue($this->elements[6]));
            $teams->next();
        }
        $wc = "";
        // if (isset($warning["el_" . $this->getId()])) $wc = $warning["el_" . $this->getId()];
        $SEL->setStyle('class="multipleselect ' . $wc . '"');
        // ***** EINGELOGGT ODER NICHT SETZEN
        if ($send == 0) {
            // erster aufruf
            // Daten ziehen
            if ($this->params["main_id"] > 0) {
                $this->value = array();
                $g = new rex_sql();
                $g->debugsql = $this->params["debug"];
                $g->setQuery('select ' . $this->elements[3] . ' from ' . $this->elements[1] . ' where ' . $this->elements[2] . '=' . $this->params["main_id"]);
                $gg = $g->getArray();
                if (is_array($gg)) {
                    foreach ($gg as $g) {
                        $this->value[] = $g[$this->elements[3]];
                    }
                }
            }
        }
        // ***** AUSWAHL SETZEN
        if (is_array($this->value)) {
            foreach ($this->value as $val) {
                $SEL->setSelected($val);
            }
        }
        // ***** AUSGEBEN
        $form_output[] = '
			<p class="formmultipleselect">
				<label class="multipleselect ' . $wc . '" for="el_' . $this->id . '" >' . $this->elements[4] . '</label>
				' . $SEL->get() . '
			</p>';
    }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:50,代码来源:class.xform.select_multiple_sql.inc.php

示例8: getContactsAsArray

 function getContactsAsArray()
 {
     if (is_array($this->contacts)) {
         return $this->contacts;
     }
     $this->contacts = array();
     $gc = new rex_sql();
     // $gc->debugsql = 1;
     $gc->setQuery('select * from rex_com_contact where user_id=' . $this->user_id . ' and accepted=1');
     $res = $gc->getArray();
     foreach ($res as $con) {
         $this->contacts[] = $con["to_user_id"];
     }
     return $this->contacts;
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:15,代码来源:functions.rex_com_user.inc.php

示例9: execute

 function execute()
 {
     foreach ($this->elements_email as $k => $v) {
         if ($this->action["elements"][4] == $k) {
             $value = $v;
         }
     }
     $gd = new rex_sql();
     // $gd->debugsql = 1;
     $gd->setQuery('select * from ' . $this->action["elements"][2] . ' where ' . $this->action["elements"][3] . '="' . addslashes($value) . '"');
     if ($gd->getRows() == 1) {
         $ar = $gd->getArray();
         foreach ($ar[0] as $k => $v) {
             $this->elements_email[$k] = $v;
         }
     }
     // $email_elements[$this->elements[1]] = stripslashes($this->value);
     // if ($this->elements[4] != "no_db") $sql_elements[$this->elements[1]] = $this->value;
     return;
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:20,代码来源:class.xform.action_readtable.inc.php

示例10: array

 function a724_generatePathnamesFromTable($params)
 {
     $debug = false;
     $sql = new rex_sql();
     $results = $sql->getArray('SELECT article_id, url_table, url_table_parameters FROM rex_a724_frau_schultze WHERE url_table != "" AND url_table_parameters != ""');
     $URLPATH = array();
     if ($sql->getRows() >= 1) {
         a724_deletePathnamesFromTable();
         foreach ($results as $result) {
             if (is_array($result) && count($result) > 0) {
                 $path = rex_getUrl($result['article_id']) . '/';
                 $path = str_replace('.html', '', $path);
                 $table = $result['url_table'];
                 $params = unserialize($result['url_table_parameters']);
                 $col_name = $params[$table][$table . "_name"];
                 $col_id = $params[$table][$table . "_id"];
                 // Daten zum Aufbau der Urls holen
                 $sqlu = new rex_sql();
                 $sqlu->setDebug($debug);
                 $res = $sqlu->getArray('SELECT ' . $col_name . ' AS name, ' . $col_id . ' AS id FROM ' . $table);
                 if ($sqlu->getRows() >= 1) {
                     // Urls in die Datenbank schreiben
                     $sqli = new rex_sql();
                     $sqli->setDebug($debug);
                     foreach ($res as $re) {
                         $table_path = $path . strtolower(rex_parse_article_name($re['name'])) . '.html';
                         $table_id = $re['id'];
                         $URLPATH[$result['url_table']][$table_id] = $table_path;
                         $sqli->setTable('rex_a724_frau_schultze');
                         $sqli->setValue('article_id', $result['article_id']);
                         $sqli->setValue('status', '1');
                         $sqli->setValue('url_table', $result['url_table']);
                         $sqli->setValue('name', $table_path);
                         $sqli->insert();
                     }
                 }
             }
         }
     }
     rex_put_file_contents(A724_URL_TABLE_PATHLIST, "<?php\n\$URLPATH = " . var_export($URLPATH, true) . ";\n");
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:41,代码来源:extension_common.inc.php

示例11: a587_getArticleIds

function a587_getArticleIds($cats = false)
{
    global $REX;
    $whereCats = array();
    if (is_array($cats)) {
        foreach ($cats as $catID) {
            $whereCats[] = "path LIKE '%|" . $catID . "|%'";
        }
    }
    $return = array();
    $query = 'SELECT id FROM ' . $REX['TABLE_PREFIX'] . 'article';
    if (empty($REX['ADDON']['settings']['rexsearch']['indexoffline'])) {
        $query .= ' WHERE status = 1';
    }
    if (!empty($whereCats)) {
        $query .= ' AND (' . implode(' OR ', $whereCats) . ' OR (id IN (' . implode(',', $cats) . ') AND startpage = 1))';
    }
    $query .= ' GROUP BY id ORDER BY id';
    $sql = new rex_sql();
    foreach ($sql->getArray($query) as $art) {
        $return[] = $art['id'];
    }
    return $return;
}
开发者ID:olien,项目名称:rexsearch,代码行数:24,代码来源:generate.inc.php

示例12: date

// ---------- Versand an alle
if ($method == "start" && $method_all == "all" && count($error) == 0 && $send) {
    $nl = new rex_sql();
    // $nl->debugsql = 1;
    // $nl->setQuery('select * from rex_com_user where newsletter_last_id<>"'.$nl_id.'" and email<>"" and newsletter=1 LIMIT 50');
    $nl->setQuery('select * from rex_com_user where newsletter_last_id<>"' . $nl_id . '" and email<>"" and newsletter=1 and profile=' . $nl_filter_profile . ' and status=' . $nl_filter_status . ' LIMIT 50');
    if ($nl->getRows() > 0) {
        $i = "" . date("H:i:s") . "h Bitte noch nicht abbrechen. Automatischer Reload. Es werden noch weitere E-Mails versendet";
        ?>
<script>
			function win_reload(){ window.location.reload(); }
			setTimeout("win_reload()",5000); // Millisekunden 1000 = 1 Sek * 80
			</script><?php 
        $i .= "<br />An folgende E-Mails wurde der Newsletter versendet: ";
        $up = new rex_sql();
        foreach ($nl->getArray() as $userinfo) {
            $i .= ", " . $userinfo["email"];
            $up->setQuery('update rex_com_user set newsletter_last_id="' . $nl_id . '" where id=' . $userinfo["id"]);
            $r = rex_newsletter_sendmail($userinfo, $nl_from_email, $nl_from_name, $nl_subject, $nl_body_text, $nl_body_html);
            $nl->next();
        }
        $info[] = $i;
    } else {
        $info[] = "Alle eMails wurden verschickt";
    }
}
// ---------- Fehlermeldungen
if (count($error) > 0) {
    foreach ($error as $e) {
        echo rex_warning($e);
    }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:index.inc.php

示例13: addslashes

<?php

// Ist Modul schon vorhanden ?
$searchtext = '$xform = new rex_xform';
$gm = new rex_sql();
$gm->setQuery('select * from rex_module where ausgabe LIKE "%' . $searchtext . '%"');
$module_id = 0;
$module_name = "";
foreach ($gm->getArray() as $module) {
    $module_id = $module["id"];
    $module_name = $module["name"];
}
if (isset($_REQUEST["install"]) && $_REQUEST["install"] == 1) {
    $xform_module_name = "rex - X-Form";
    // Daten einlesen
    $in = rex_get_file_contents($REX["INCLUDE_PATH"] . "/addons/xform/module/module_in.inc");
    $out = rex_get_file_contents($REX["INCLUDE_PATH"] . "/addons/xform/module/module_out.inc");
    $mi = new rex_sql();
    // $mi->debugsql = 1;
    $mi->setTable("rex_module");
    $mi->setValue("eingabe", addslashes($in));
    $mi->setValue("ausgabe", addslashes($out));
    // altes Module aktualisieren
    if (isset($_REQUEST["module_id"]) && $module_id == $_REQUEST["module_id"]) {
        $mi->setWhere('id="' . $module_id . '"');
        $mi->update();
        echo rex_info('Modul "' . $module_name . '" wurde aktualisiert');
    } else {
        $mi->setValue("name", $xform_module_name);
        $mi->insert();
        echo rex_info('XForm Modul wurde angelegt unter "' . $xform_module_name . '"');
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:module.inc.php

示例14: array

/**
 *
 * @package redaxo4
 * @version svn:$Id$
 */
// *************************************** CONFIG
$thumbs = true;
$thumbsresize = true;
if (!OOAddon::isAvailable('image_resize')) {
    $thumbsresize = false;
}
// *************************************** KATEGORIEN CHECK UND AUSWAHL
// ***** kategorie auswahl
$db = new rex_sql();
$file_cat = $db->getArray('SELECT * FROM ' . $REX['TABLE_PREFIX'] . 'file_category ORDER BY name ASC');
// ***** select bauen
$sel_media = new rex_select();
$sel_media->setId("rex_file_category");
$sel_media->setName("rex_file_category");
$sel_media->setSize(1);
$sel_media->setStyle('class="rex-form-select"');
$sel_media->setSelected($rex_file_category);
$sel_media->setAttribute('onchange', 'this.form.submit();');
$sel_media->addOption($I18N->msg('pool_kats_no'), "0");
$mediacat_ids = array();
if ($rootCats = OOMediaCategory::getRootCategories()) {
    foreach ($rootCats as $rootCat) {
        rex_mediapool_addMediacatOptions($sel_media, $rootCat, $mediacat_ids);
    }
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:30,代码来源:mediapool.media.inc.php

示例15: foreach

 if ($selectedmedia[0] > 0) {
     $msg = "";
     foreach ($selectedmedia as $file_id) {
         $gf = new rex_sql();
         $gf->setQuery("select * from " . $REX['TABLE_PREFIX'] . "file where file_id='{$file_id}'");
         if ($gf->getRows() == 1) {
             $file_name = $gf->getValue("filename");
             // check if file is in an article slice
             $file_search = '';
             for ($c = 1; $c < 11; $c++) {
                 $file_search .= "OR file{$c}='{$file_name}' ";
                 $file_search .= "OR value{$c} LIKE '%{$file_name}%' ";
             }
             $file_search = substr($file_search, 2);
             $sql = "SELECT " . $REX['TABLE_PREFIX'] . "article.name," . $REX['TABLE_PREFIX'] . "article.id FROM " . $REX['TABLE_PREFIX'] . "article_slice LEFT JOIN " . $REX['TABLE_PREFIX'] . "article on " . $REX['TABLE_PREFIX'] . "article_slice.article_id=" . $REX['TABLE_PREFIX'] . "article.id WHERE " . $file_search . " AND " . $REX['TABLE_PREFIX'] . "article_slice.article_id=" . $REX['TABLE_PREFIX'] . "article.id";
             $res1 = $db->getArray($sql);
             $sql = "SELECT " . $REX['TABLE_PREFIX'] . "article.name," . $REX['TABLE_PREFIX'] . "article.id FROM " . $REX['TABLE_PREFIX'] . "article where file='{$file_name}'";
             $res2 = $db->getArray($sql);
             if (count($res1) == 0 and count($res2) == 0) {
                 $sql = "DELETE FROM " . $REX['TABLE_PREFIX'] . "file WHERE file_id = '{$file_id}'";
                 $db->setQuery($sql);
                 // fehler unterdrücken, falls die Datei nicht mehr vorhanden ist
                 @unlink($REX['MEDIAFOLDER'] . "/" . $file_name);
                 $msg .= "\"{$file_name}\" " . $I18N->msg('pool_file_deleted');
                 $subpage = "";
             } else {
                 $msg .= $I18N->msg('pool_file_delete_error_1', $file_name) . " ";
                 $msg .= $I18N->msg('pool_file_delete_error_2') . "<br>";
                 if (is_array($res1)) {
                     foreach ($res1 as $var) {
                         $msg .= " | <a href=../index.php?article_id={$var['id']} target=_blank>{$var['name']}</a>";
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:medienpool.inc.php


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