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


PHP sql::setTable方法代码示例

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


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

示例1: rex_opf_sync

function rex_opf_sync()
{
    global $REX;
    // abgleich der replacevalue felder..
    $s = new sql();
    // $s->debugsql = 1;
    $s->setQuery("select clang, replacename, name, count(replacename) from rex_opf_lang group by replacename");
    for ($i = 0; $i < $s->getRows(); $i++) {
        if (count($REX['CLANG']) != $s->getValue("count(replacename)")) {
            reset($REX['CLANG']);
            while (list($key, $val) = each($REX['CLANG'])) {
                $lclang = $key;
                $replacename = $s->getValue("replacename");
                $name = $s->getValue("name");
                $gs = new sql();
                $gs->setQuery("select clang from rex_opf_lang where clang={$lclang} and replacename='{$replacename}'");
                if ($gs->getRows() == 0) {
                    // erstelle
                    $us = new sql();
                    $us->setTable("rex_opf_lang");
                    $us->setValue("clang", $lclang);
                    $us->setValue("replacename", $replacename);
                    $us->setValue("name", $name);
                    $us->insert();
                }
            }
        }
        $s->next();
    }
}
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:30,代码来源:index.inc.php

示例2: isSaved

 public static function isSaved($addon, $save = true)
 {
     $sql = new sql();
     $num = $sql->num('SELECT 1 FROM ' . sql::table('addons') . ' WHERE `name` = "' . $addon . '"');
     if (!$num && $save) {
         $save = new sql();
         $save->setTable('addons');
         $save->addPost('name', $addon);
         $save->save();
     }
     return $num;
 }
开发者ID:DINKIN,项目名称:rokket,代码行数:12,代码来源:config.php

示例3: insertOrder

 function insertOrder()
 {
     $sql = new sql();
     $sql->debugsql = 0;
     $sql->setTable("rex_4_order");
     $sql->setValue("overallsum", $this->_overallsum);
     $sql->setValue("status", $this->_status);
     $sql->setValue("date", date("Y-m-d H:i:s"));
     $sql->setValue("name", $this->_name);
     $sql->setValue("mailtext", $this->_mailtxt);
     $sql->insert();
     if ($sql->error == "") {
         $order_id = $sql->last_insert_id;
         $sql->flush();
         $counter = 0;
         if (is_array($this->_product)) {
             for ($i = 0; $i < count($this->_product['pid']); $i++) {
                 $sql->setTable("rex_4_order_product");
                 $sql->setValue("order_id", $order_id);
                 $sql->setValue("product_id", $this->_product['pid'][$i]);
                 $sql->setValue("product_name", $this->_product['name'][$i]);
                 $sql->setValue("amount", $this->_product['amount'][$i]);
                 $sql->setValue("price", $this->_product['price'][$i]);
                 $sql->insert();
                 $sql->flush();
                 if ($sql->error == "") {
                     $counter++;
                 }
             }
         }
         if ($counter == count($this->_product['pid'])) {
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:39,代码来源:class.shop_order.inc.php

示例4: write

 function write()
 {
     global $REX, $REX_USER;
     $sql = new sql();
     $sql->setTable($REX['TABLE_PREFIX'] . '51_cache_article');
     foreach ($this->vars as $key => $value) {
         $sql->setValue($key, $value);
     }
     $user = $REX['REDAXO'] ? $REX_USER->getValue('login') : '';
     if ($this->exists()) {
         $sql->where('article_id=' . $this->article_id . ' AND clang=' . $this->clang);
         $sql->setValue('updatedate', time());
         $sql->setValue('updateuser', $user);
         $sql->update();
     } else {
         $sql->setValue('article_id', $this->article_id);
         $sql->setValue('clang', $this->clang);
         $sql->setValue('createdate', time());
         $sql->setValue('createuser', $user);
         $sql->insert();
     }
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:22,代码来源:class.config.inc.php

示例5: sql

 if (isset($save) and $save == "ja") {
     if ($function == "add") {
         $ITPL = new sql();
         $ITPL->setTable("rex_template");
         $ITPL->setValue("name", $templatename);
         $ITPL->setValue("active", $active);
         $ITPL->setValue("content", $content);
         $ITPL->insert();
         $template_id = $ITPL->last_insert_id;
         $message = $I18N->msg("template_added");
     } else {
         if (!isset($active)) {
             $active = 0;
         }
         $TMPL = new sql();
         $TMPL->setTable("rex_template");
         $TMPL->where("id='{$template_id}'");
         $TMPL->setValue("name", $templatename);
         $TMPL->setValue("content", $content);
         $TMPL->setValue("active", $active);
         $TMPL->update();
         $message = $I18N->msg("template_added");
     }
     $gt = new sql();
     $gt->setQuery("SELECT * FROM rex_template WHERE id = '{$template_id}'");
     $fp = fopen($REX['INCLUDE_PATH'] . "/generated/templates/" . $template_id . ".template", "w");
     fputs($fp, $gt->getValue("content"));
     fclose($fp);
     if (isset($goon) and $goon != "") {
         $function = "edit";
         $save = "nein";
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:template.inc.php

示例6: sql

     $DBshowHighlight = '';
 }
 if (isset($_POST['editorWindow'])) {
     $EDITeditorWindow = $_POST['editorWindow'];
 } else {
     $EDITeditorWindow = '';
 }
 if ($EDITeditorWindow <= "99") {
     $DBeditorWindow = $EDITeditorWindow;
     $errorMsg .= '<p class="warning">Für benutzerfreundliches Arbeiten ist<br /> ein Wert unter 100 Pixel nicht sinnvoll.<br /><br />Bitte geben Sie einen Wert von <strong>100 oder mehr</strong> ein.</p>';
     $update = false;
 }
 if ($update) {
     $SETTINGSQL = new sql();
     //$SETTINGSQL->debugsql=1;
     $SETTINGSQL->setTable("rex_14_setting");
     $SETTINGSQL->setValue("showJsElements", $DBshowJsElements);
     $SETTINGSQL->setValue("showProperty", $DBshowProperty);
     $SETTINGSQL->setValue("showColor", $DBshowColor);
     $SETTINGSQL->setValue("showHighlight", $DBshowHighlight);
     $SETTINGSQL->setValue("editorWindow", $EDITeditorWindow);
     $SETTINGSQL->setValue("hltSelector", $EDIThltSel);
     $SETTINGSQL->setValue("hltProperty", $EDIThltPro);
     $SETTINGSQL->setValue("hltValue", $EDIThltVal);
     $SETTINGSQL->setValue("hltDeclaration", $EDIThltDec);
     $SETTINGSQL->setValue("color1", $DBcolor1);
     $SETTINGSQL->setValue("color2", $DBcolor2);
     $SETTINGSQL->setValue("color3", $DBcolor3);
     $SETTINGSQL->setValue("color4", $DBcolor4);
     $SETTINGSQL->setValue("color5", $DBcolor5);
     $SETTINGSQL->setValue("color6", $DBcolor6);
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:31,代码来源:setting.inc.php

示例7: saveMedia

function saveMedia($FILE, $rex_file_category, $FILEINFOS)
{
    global $REX, $REX_USER;
    $FILENAME = $FILE['name'];
    $FILESIZE = $FILE['size'];
    $FILETYPE = $FILE['type'];
    $NFILENAME = "";
    $message = '';
    // ----- neuer filename und extension holen
    $NFILENAME = strtolower(preg_replace("/[^a-zA-Z0-9.\\-\$\\+]/", "_", $FILENAME));
    if (strrpos($NFILENAME, ".") != "") {
        $NFILE_NAME = substr($NFILENAME, 0, strlen($NFILENAME) - (strlen($NFILENAME) - strrpos($NFILENAME, ".")));
        $NFILE_EXT = substr($NFILENAME, strrpos($NFILENAME, "."), strlen($NFILENAME) - strrpos($NFILENAME, "."));
    } else {
        $NFILE_NAME = $NFILENAME;
        $NFILE_EXT = "";
    }
    // ---- ext checken
    $ERROR_EXT = array(".php", ".php3", ".php4", ".php5", ".phtml", ".pl", ".asp", ".aspx", ".cfm");
    if (in_array($NFILE_EXT, $ERROR_EXT)) {
        $NFILE_NAME .= $NFILE_EXT;
        $NFILE_EXT = ".txt";
    }
    $NFILENAME = $NFILE_NAME . $NFILE_EXT;
    // ----- datei schon vorhanden -> namen aendern -> _1 ..
    if (file_exists($REX['MEDIAFOLDER'] . "/{$NFILENAME}")) {
        for ($cf = 1; $cf < 1000; $cf++) {
            $NFILENAME = $NFILE_NAME . "_{$cf}" . "{$NFILE_EXT}";
            if (!file_exists($REX['MEDIAFOLDER'] . "/{$NFILENAME}")) {
                break;
            }
        }
    }
    // ----- dateiupload
    $upload = true;
    if (!@move_uploaded_file($FILE['tmp_name'], $REX['MEDIAFOLDER'] . "/{$NFILENAME}")) {
        if (!@copy($FILE['tmp_name'], $REX['MEDIAFOLDER'] . "/{$NFILENAME}")) {
            $message .= "move file {$FILENAME} failed | ";
            $ok = 0;
            $upload = false;
        }
    }
    if ($upload) {
        chmod($REX['MEDIAFOLDER'] . "/{$NFILENAME}", $REX['FILEPERM']);
        // get widht height
        $size = @getimagesize($REX['MEDIAFOLDER'] . "/{$NFILENAME}");
        $FILESQL = new sql();
        // $FILESQL->debugsql=1;
        $FILESQL->setTable($REX['TABLE_PREFIX'] . "file");
        $FILESQL->setValue("filetype", $FILETYPE);
        $FILESQL->setValue("title", $FILEINFOS['title']);
        $FILESQL->setValue("description", $FILEINFOS['description']);
        $FILESQL->setValue("copyright", $FILEINFOS['copyright']);
        $FILESQL->setValue("filename", $NFILENAME);
        $FILESQL->setValue("originalname", $FILENAME);
        $FILESQL->setValue("filesize", $FILESIZE);
        $FILESQL->setValue("width", $size[0]);
        $FILESQL->setValue("height", $size[1]);
        $FILESQL->setValue("category_id", $rex_file_category);
        $FILESQL->setValue("createdate", time());
        $FILESQL->setValue("createuser", $REX_USER->getValue("login"));
        $FILESQL->setValue("updatedate", time());
        $FILESQL->setValue("updateuser", $REX_USER->getValue("login"));
        $FILESQL->insert();
        $ok = 1;
    }
    $RETURN['title'] = $FILEINFOS['title'];
    $RETURN['width'] = $size[0];
    $RETURN['height'] = $size[1];
    $RETURN['type'] = $FILETYPE;
    $RETURN['msg'] = $message;
    $RETURN['ok'] = $ok;
    $RETURN['filename'] = $NFILENAME;
    return $RETURN;
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:75,代码来源:medienpool.inc.php

示例8: article

     $CONT = new article();
     $CONT->setArticleId($article_id);
     $CONT->setSliceId($slice_id);
     $CONT->setMode($mode);
     $CONT->setCLang($clang);
     $CONT->setCType($ctype);
     $CONT->setEval(TRUE);
     $CONT->setFunction($function);
     eval("?>" . $CONT->getArticle());
     // ------------------------------------------ END: MODULE EDITIEREN/ADDEN ETC.
 } elseif ($mode == "meta") {
     // ------------------------------------------ START: META VIEW
     $extens = "";
     if (isset($save) and $save == "1") {
         $meta_sql = new sql();
         $meta_sql->setTable($REX['TABLE_PREFIX'] . "article");
         // $meta_sql->debugsql = 1;
         $meta_sql->where("id='{$article_id}' and clang={$clang}");
         $meta_sql->setValue("online_from", mktime(0, 0, 0, $monat_von, $tag_von, $jahr_von));
         $meta_sql->setValue("online_to", mktime(0, 0, 0, $monat_bis, $tag_bis, $jahr_bis));
         $meta_sql->setValue("keywords", $meta_keywords);
         $meta_sql->setValue("description", $meta_description);
         $meta_sql->setValue("name", $meta_article_name);
         $meta_sql->setValue("type_id", $type_id);
         if (!isset($meta_teaser)) {
             $meta_teaser = 0;
         }
         $meta_sql->setValue("teaser", $meta_teaser);
         $meta_sql->setValue("updatedate", time());
         $meta_sql->setValue("updateuser", $REX_USER->getValue("login"));
         // -------------------------- FILE UPLOAD META BILD/FILE
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:31,代码来源:content.inc.php

示例9: deleteMessage

 function deleteMessage($message_id)
 {
     // reply
     $r_sql = new sql();
     $r_sql->setQuery("select * from rex_5_board where message_id='{$message_id}' and board_id='" . $this->boardname . "'");
     if ($r_sql->getRows() == 1) {
         if ($r_sql->getValue("re_message_id") != 0) {
             // reply
             $ur_sql = new sql();
             $ur_sql->setTable("rex_5_board");
             $ur_sql->where("message_id='{$message_id}'");
             $ur_sql->setValue("status", 0);
             $ur_sql->update();
             $message_id = $r_sql->getValue("re_message_id");
             // update topic
             $u_sql = new sql();
             $u_sql->setQuery("select * from rex_5_board where re_message_id='{$message_id}' and status='1'");
             $u_sql->setTable("rex_5_board");
             $u_sql->where("message_id='{$message_id}'");
             $u_sql->setValue("replies", $u_sql->getRows());
             $u_sql->update();
             $this->msg["bb_msg_id"] = $r_sql->getValue("re_message_id");
             $return = $this->showMessage();
         } else {
             // topic
             $u_sql = new sql();
             $u_sql->setTable("rex_5_board");
             $u_sql->where("message_id='{$message_id}' or re_message_id='{$message_id}'");
             $u_sql->setValue("status", 0);
             $u_sql->update();
             $this->errmsg = $this->text[250];
             $return = $this->showMessages();
         }
     } else {
         $this->errmsg = $this->text[260];
         $return = $this->showMessages();
     }
     return $return;
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:39,代码来源:class.rex_com_board.inc.php

示例10: foreach

             $message = $I18N->msg("article_type_still_used") . "<br>";
             foreach ($result as $var) {
                 $message .= '<br /><a href="index.php?page=content&amp;article_id=' . $var['id'] . '&amp;mode="meta" target="_blank">' . $var['name'] . '</a>';
             }
             $message .= '<br /><br />';
         } else {
             $delete->query("DELETE FROM " . $REX['TABLE_PREFIX'] . "article_type WHERE type_id = '{$type_id}' LIMIT 1");
             $delete->query("UPDATE " . $REX['TABLE_PREFIX'] . "article SET type_id = '1' WHERE type_id = '{$type_id}'");
             $message = $I18N->msg("article_type_deleted");
         }
     } else {
         $message = $I18N->msg("article_type_could_not_be_deleted");
     }
 } elseif (isset($function) and $function == $I18N->msg('add') && isset($save) and $save == 1) {
     $add = new sql();
     $add->setTable($REX['TABLE_PREFIX'] . "article_type");
     $add->setValue("name", $typname);
     $add->setValue("type_id", $type_id);
     $add->setValue("description", $description);
     $add->insert();
     $type_id = 0;
     $function = "";
     $message = $I18N->msg("article_type_added");
 }
 echo '  <table class="rex" style="table-layout:auto;" cellpadding="5" cellspacing="1">
 <tr>
   <th class="icon"><a href="index.php?page=specials&amp;subpage=type&amp;function=add">+</a></th>
   <th class="icon">' . $I18N->msg("article_type_list_id") . '</th>
   <th width="250">' . $I18N->msg("article_type_list_name") . '</th>
   <th colspan="2">' . $I18N->msg("article_type_list_description") . '</th>
 </tr>
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:specials.inc.php

示例11: generateArticle

    generateArticle($article_id);
}
if ($function == "edit_article" && ($STRUCTURE_PERM || $REX_USER->isValueOf("rights", "article[{$article_id}]"))) {
    $amessage = $I18N->msg("article_updated");
    $KAT->query("update rex_article set name='{$article_name}',template_id='{$template_id}' where id='{$article_id}'");
    generateArticle($article_id);
}
if ($function == "delete_article" && $STRUCTURE_PERM) {
    $message = deleteArticle($article_id);
}
if ($function == "add_article" and $STRUCTURE_PERM) {
    $amessage = $I18N->msg("article_added");
    $AART = new sql();
    // vscope prior script
    $article_prior = $AART->new_order('rex_article', 'prior', 'category_id', $category_id);
    $AART->setTable("rex_article");
    $AART->setValue("name", $article_name);
    $AART->setValue("category_id", $category_id);
    $AART->setValue("prior", $article_prior);
    $AART->setValue("path", $KATSQLpath);
    $AART->setValue("startpage", 0);
    $AART->setValue("status", 0);
    $AART->setValue("online_von", date("YmdHis"));
    $AART->setValue("online_bis", "20100101");
    $AART->setValue("erstelldatum", date("Ymd"));
    $AART->setValue("template_id", $template_id);
    $AART->insert();
    // now set right position
    $sql = new sql();
    $sql->order_position($Position_New_Article, $AART->last_insert_id, "id", "rex_article", "prior", "category_id", $category_id);
    generateArticle($AART->last_insert_id);
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:31,代码来源:structure.inc.php

示例12: sql

<?php

$mypage = "simple_shop";
$stats[0] = "<span style=\"color:red\">" . $I18N_SIMPLE_SHOP->msg("status_0") . "</span>";
$stats[1] = "<span style=\"color:orange\">" . $I18N_SIMPLE_SHOP->msg("status_1") . "</span>";
$stats[2] = "<span style=\"color:green\">" . $I18N_SIMPLE_SHOP->msg("status_2") . "</span>";
$sql = new sql();
if ($function == "delete") {
    $sql->setTable("rex_4_order");
    $sql->where("id=" . $aid . "");
    $sql->delete();
    $sql->setTable("rex_4_order_product");
    $sql->where("order_id=" . $aid . "");
    $sql->delete();
    $function = "";
}
if ($function == "edit_article" && $send == 1) {
    $sql->setTable("rex_4_order");
    $sql->setValue("status", $article[status]);
    $sql->where("id=" . $aid . "");
    $sql->update();
    $function = "";
}
if ($function == "edit_article") {
    $sql->setQuery("SELECT *,DATE_FORMAT(rex_4_order.date, '%d.%m.%Y %H:%i') as datum\r\n\tFROM rex_4_order LEFT JOIN rex_4_order_product ON rex_4_order.id = rex_4_order_product.order_id WHERE rex_4_order.id='" . $aid . "'");
    $mailtext = nl2br($sql->getValue("mailtext"));
    $status = $sql->getValue("status");
    echo "<a href=\"index.php?page=simple_shop&subpage=" . $subpage . "\" target=\"_self\">&#171; " . $I18N_SIMPLE_SHOP->msg("back_overview") . "</a><br /><br />\r\n\t\t\t<form action='index.php' method=post>\r\n\t\t\t<input type=hidden name='page' value='simple_shop' />\r\n\t\t\t<input type=hidden name='subpage' value='{$subpage}' />\r\n\t\t\t<input type=hidden name='clang' value='{$clang}' />\r\n\t\t\t<input type=hidden name='aid' value='" . $aid . "' />\r\n\t\t\t<input type=hidden name='function' value='edit_article' />\r\n\t\t\t<input type=hidden name='send' value='1' />\r\n\t\t\t<table width=770 border=0 cellpadding=5 cellspacing=1 />\r\n\t\t\t<tr>\r\n\t\t\t\t<th width=30>&nbsp;</th>\r\n\t\t\t\t<th colspan=2>" . $I18N_SIMPLE_SHOP->msg("header_order") . "</th>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class=grey width=30>&nbsp;</td>\r\n\t\t\t\t<td class=grey width=170>" . $I18N_SIMPLE_SHOP->msg("date") . "</td>\r\n\t\t\t\t<td class=grey width=550>" . $sql->getValue("datum") . "</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class=grey width=30>&nbsp;</td>\r\n\t\t\t\t<td class=grey width=170>" . $I18N_SIMPLE_SHOP->msg("customer") . "</td>\r\n\t\t\t\t<td class=grey width=550>" . $sql->getValue("name") . "</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class=grey width=30>&nbsp;</td>\r\n\t\t\t\t<td class=grey width=170 valign=top>" . $I18N_SIMPLE_SHOP->msg("products") . "</td>\r\n\t\t\t\t<td class=grey width=550>";
    for ($i = 0; $i < $sql->rows; $i++) {
        echo $sql->getValue("amount") . " x " . $sql->getValue("product_name") . ", " . number_format($sql->getValue("price"), 2, ".", "") . "€ <br />";
        $sql->next();
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:orders.inc.php

示例13: sql

     $content = '';
 }
 if ($function == "add") {
     $ITPL = new sql();
     $ITPL->setTable($REX['TABLE_PREFIX'] . "template");
     $ITPL->setValue("name", $templatename);
     $ITPL->setValue("active", $active);
     $ITPL->setValue("content", $content);
     $ITPL->setValue("createdate", time());
     $ITPL->setValue("createuser", $REX_USER->getValue("login"));
     $ITPL->insert();
     $template_id = $ITPL->last_insert_id;
     $message = $I18N->msg("template_added");
 } else {
     $TMPL = new sql();
     $TMPL->setTable($REX['TABLE_PREFIX'] . "template");
     $TMPL->where("id='{$template_id}'");
     $TMPL->setValue("name", $templatename);
     $TMPL->setValue("content", $content);
     $TMPL->setValue("active", $active);
     $TMPL->setValue("updatedate", time());
     $TMPL->setValue("updateuser", $REX_USER->getValue("login"));
     $TMPL->update();
     $message = $I18N->msg("template_added");
 }
 $gt = new sql();
 $gt->setQuery("SELECT * FROM " . $REX['TABLE_PREFIX'] . "template WHERE id = '{$template_id}'");
 $fp = fopen($REX['INCLUDE_PATH'] . "/generated/templates/" . $template_id . ".template", "w");
 fputs($fp, $gt->getValue("content"));
 fclose($fp);
 if (isset($goon) and $goon != "") {
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:31,代码来源:template.inc.php

示例14: media_savefile

function media_savefile($FILE, $rex_file_category, $FILEINFOS)
{
    $FILENAME = $FILE[name];
    $FILESIZE = $FILE[size];
    $FILETYPE = $FILE[type];
    $NFILENAME = "";
    $REX = $GLOBALS[REX];
    // generiere neuen dateinamen
    for ($cn = 0; $cn < strlen($FILENAME); $cn++) {
        $char = substr($FILENAME, $cn, 1);
        if (preg_match("([_A-Za-z0-9\\.-])", $char)) {
            $NFILENAME .= strtolower($char);
        } else {
            if ($char == " ") {
                $NFILENAME .= "_";
            }
        }
    }
    if (strrpos($NFILENAME, ".") != "") {
        $NFILE_NAME = substr($NFILENAME, 0, strlen($NFILENAME) - (strlen($NFILENAME) - strrpos($NFILENAME, ".")));
        $NFILE_EXT = substr($NFILENAME, strrpos($NFILENAME, "."), strlen($NFILENAME) - strrpos($NFILENAME, "."));
    } else {
        $NFILE_NAME = $NFILENAME;
        $NFILE_EXT = "";
    }
    if ($NFILE_EXT == ".php" || $NFILE_EXT == ".php3" || $NFILE_EXT == ".php4" || $NFILE_EXT == ".php5" || $NFILE_EXT == ".phtml" || $NFILE_EXT == ".pl" || $NFILE_EXT == ".asp" || $NFILE_EXT == ".aspx" || $NFILE_EXT == ".cfm") {
        $NFILE_EXT .= ".txt";
    }
    $NFILENAME = $NFILE_NAME . $NFILE_EXT;
    if (file_exists($REX[MEDIAFOLDER] . "/{$NFILENAME}")) {
        // datei schon vorhanden ? wenn ja dann _1
        for ($cf = 0; $cf < 1000; $cf++) {
            $NFILENAME = $NFILE_NAME . "_{$cf}" . "{$NFILE_EXT}";
            if (!file_exists($REX[MEDIAFOLDER] . "/{$NFILENAME}")) {
                break;
            }
        }
    }
    if (!move_uploaded_file($FILE[tmp_name], $REX[MEDIAFOLDER] . "/{$NFILENAME}")) {
        if (!copy($FILE[tmp_name], $REX[MEDIAFOLDER] . "/{$NFILENAME}")) {
            $message .= "move file {$FILENAME} failed | ";
            $ok = 0;
            $nocopy = true;
        }
    }
    if (!$nocopy) {
        if ($REX[MEDIAFOLDERPERM] == "") {
            $REX[MEDIAFOLDERPERM] = "0777";
        }
        chmod($REX[MEDIAFOLDER] . "/{$NFILENAME}", 0777);
        // get widht height
        $size = @getimagesize($REX[MEDIAFOLDER] . "/{$NFILENAME}");
        $FILESQL = new sql();
        //$FILESQL->debugsql=1;
        $FILESQL->setTable("rex_file");
        $FILESQL->setValue("filetype", $FILETYPE);
        $FILESQL->setValue("title", $FILEINFOS[title]);
        $FILESQL->setValue("description", $FILEINFOS[description]);
        $FILESQL->setValue("copyright", $FILEINFOS[copyright]);
        $FILESQL->setValue("filename", $NFILENAME);
        $FILESQL->setValue("originalname", $FILENAME);
        $FILESQL->setValue("filesize", $FILESIZE);
        $FILESQL->setValue("width", $size[0]);
        $FILESQL->setValue("height", $size[1]);
        $FILESQL->setValue("category_id", $rex_file_category);
        $FILESQL->setValue("stamp", time());
        $FILESQL->insert();
        $ok = 1;
    }
    $RETURN[msg] = $message;
    $RETURN[ok] = $ok;
    $RETURN[filename] = $NFILENAME;
    return $RETURN;
}
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:74,代码来源:function_rex_mediapool.inc.php

示例15: sql

     $subject = str_replace("###FIRSTNAME###", $gu->getValue("user_firstname"), $subject);
     $subject = str_replace("###LOGIN###", $gu->getValue("user_login"), $subject);
     $body = str_replace("###EMAIL###", $gu->getValue("user_email"), $body);
     $body = str_replace("###NAME###", $gu->getValue("user_name"), $body);
     $body = str_replace("###FIRSTNAME###", $gu->getValue("user_firstname"), $body);
     $body = str_replace("###LOGIN###", $gu->getValue("user_login"), $body);
     $body = str_replace("###PSW###", $gu->getValue("user_password"), $body);
     $mail->Subject = $subject;
     $mail->AltBody = $body;
     $mail->Send();
     echo "Mail wurde versendet<br /><br />";
     $aktionen = $mails[$mail_id]["action"];
     if (is_array($aktionen)) {
         $uu = new sql();
         $uu->debugsql = 0;
         $uu->setTable("rex_5_user");
         $uu->where("id='" . $oid . "'");
         foreach ($aktionen as $key => $value) {
             $uu->setValue($key, $value);
         }
         $uu->update();
         echo "Aktion/en wurden ausgeführt!<br /><br />";
     }
 } else {
     foreach ($mails as $key => $value) {
         echo "<br /><br /><a href=index.php?page=community&subpage=user&oid={$oid}&func=sendmail&subfunc=send&mail_id={$key}>&raquo; " . $value["name"] . "</a>";
     }
     echo "<br /><br />";
 }
 echo "</td></tr></table>";
 echo "<br /><table cellpadding=5 class=rex><tr><td><a href=index.php?page=" . $mypage . "&subpage=" . $subpage . "&func=edit&oid={$oid}><b>&laquo; Zurück zum User</b></a></td></tr></table>";
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:31,代码来源:user_email.inc.php


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