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(); } }
/** * Glossar Addon * < * @author staab[at]public-4u[dot]de Markus Staab * @author <a href="http://www.public-4u.de">www.public-4u.de</a> * @package redaxo3 * @version $Id: function_replace.inc.php,v 1.4 2008/01/25 09:48:36 kills Exp $ */ function rex_glossar_replace($params) { global $REX, $mypage, $I18N_GLOSSAR; $string = $params['subject']; // Aufteilen des Strings, damit nur im Body ersetzt wird $bodystart = strpos($string, '<body>'); $header = substr($string, 0, $bodystart); $body = substr($string, $bodystart); // Bereiche ersetzen, in denen keine Glossar ersetzungen durchgeführt werden sollen // welche nicht innerhalb des Tags sind $back_srch = array(); $back_rplc = array(); $mtchs = array(); if (preg_match_all('/(<textarea.*?>(.*?)<\\/textarea>)/s', $body, $mtchs)) { foreach ($mtchs[2] as $key => $mtch) { $back_srch[$key] = '###SPACER###' . $key . '###'; $back_rplc[$key] = $mtch; $body = str_replace($mtch, '###SPACER###' . $key . '###', $body); } } $sql = new sql(); //$sql->debugsql = true; $sql->setQuery('SELECT * FROM rex_13_glossar, rex_13_glossar_lang WHERE language = lang_id ORDER BY CHAR_LENGTH(shortcut) DESC'); // IE doesnt support <abbr> if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) { $replacetag = 'acronym'; } else { $replacetag = 'abbr'; } $replaceformat = '<' . $replacetag . ' class=\\"abbr\\" title=\\"%desc% (%lang%)\\">%short%</' . $replacetag . '>'; $searches = array(); $replaces = array(); for ($i = 0; $i < $sql->getRows(); $i++) { $language = htmlspecialchars($sql->getValue('lang_name')); $shortcut = htmlspecialchars($sql->getValue('shortcut')); $description = htmlspecialchars($sql->getValue('description')); $casesense = $sql->getValue('casesense'); // Escape Shortcut for preg_match $escapedshortcut = preg_quote($shortcut, '/'); $escapedentitiesshortuct = htmlentities($escapedshortcut); if ($escapedentitiesshortuct == $escapedshortcut) { $search = '/((<[^>]*)|' . $escapedshortcut . ')/e'; } else { $search = '/((<[^>]*)|' . $escapedshortcut . '|' . $escapedentitiesshortuct . ')/e'; } $replacer = _rex_glossar_parse_replace_format($replaceformat, array('lang' => $language, 'desc' => $description, 'short' => $shortcut)); $replace = '"\\2"=="\\1" && strpos( "\\1", "<' . $replacetag . '>") === false ? "\\1":"' . $replacer . '"'; if ($casesense == 0) { $search .= 'i'; } $searches[] = $search; $replaces[] = $replace; $sql->next(); } // Ersetzungen durchführen $body = stripslashes(preg_replace($searches, $replaces, $body)); // Vorher ausgeschlossene Bereiche wieder einpflegen $body = str_replace($back_srch, $back_rplc, $body); return $header . $body; }
public static function getAll() { if (!count(self::$all)) { $sql = new sql(); $sql->query('SELECT name FROM ' . sql::table('addons') . ' WHERE `install` = 1 AND `active` = 1')->result(); while ($sql->isNext()) { self::$all[] = $sql->get('name'); $sql->next(); } } return self::$all; }
function rex_opf($params) { global $REX; $content = $params['subject']; $gv = new sql(); // $gv->debugsql = 1; $gv->setQuery("select * from rex_opf_lang where clang='" . $REX['CUR_CLANG'] . "'"); for ($i = 0; $i < $gv->getRows(); $i++) { $content = str_replace($gv->getValue("replacename"), $gv->getValue("name"), $content); $gv->next(); } return $content; }
function getArticlesByType($article_type_id, $ignore_offlines = false, $clang = false) { global $REX; if ($clang === false) { $clang = $REX[CUR_CLANG]; } $offline = $ignore_offlines ? " and status = 1 " : ""; $artlist = array(); $sql = new sql(); $sql->setQuery("select " . implode(',', OORedaxo::getClassVars()) . " FROM rex_article WHERE type_id = '{$article_type_id}' AND clang='{$clang}' {$offline}"); for ($i = 0; $i < $sql->getRows(); $i++) { foreach (OORedaxo::getClassVars() as $var) { $article_data['_' . $var] = $sql->getValue($var); } $artlist[] = new OOArticle($article_data); $sql->next(); } return $artlist; }
function searchArticles($search) { global $REX; $strings = explode(" ", $search); $counter = 0; foreach ($strings as $s) { if ($counter != 0) { $add .= " AND "; } $add .= "( name like '%{$s}%' OR description like '%{$s}%' OR detaildesc like '%{$s}%' OR artnr like '%{$s}%')"; $counter++; } $sql = new sql(); $sql->debugsql = 0; $sql->setQuery("SELECT * FROM " . $REX[ADDON][tbl][art]["simple_shop"] . "\r\n\t\t\twhere clang='" . $clang . "' AND\r\n\t\t\tstatus>0 AND " . $add . " ORDER BY name"); $return = array(); for ($i = 0; $i < $sql->rows; $i++) { $return[] = new shop_article($sql->getValue("id"), $sql->getValue("clang"), $sql->getValue("name"), $sql->getValue("path"), $sql->getValue("category"), $sql->getValue("description"), $sql->getValue("artnr"), $sql->getValue("mwst"), $sql->getValue("price"), $sql->getValue("old_price"), $sql->getValue("deliver_price"), $sql->getValue("detaildesc"), $sql->getValue("thumbnail"), $sql->getValue("picture"), $sql->getValue("relation_1"), $sql->getValue("relation_2"), $sql->getValue("relation_3"), $sql->getValue("prio"), $sql->getValue("status"), $sql->getValue("instock"), $sql->getValue("stockinfo")); $sql->next(); } return $return; }
function stat() { $this->MAIN['stamp'] = array(); $this->MAIN['ip'] = array(); $this->MAIN['pageviews'] = array(); // which pages in an array under this one $this->MAIN['useragent'] = array(); $this->MAIN['hostname'] = array(); $this->MAIN['referer'] = array(); $this->BROWSER['type'] = array(); $this->BROWSER['os'] = array(); $this->REFERER = array(); $this->SEARCH['engine'] = array(); $this->SEARCH['words'] = array(); $this->evalshows = array("REX_EVAL_DAY", "REX_EVAL_MONTH", "REX_EVAL_ALLARTICLE", "REX_EVAL_TOP10ARTICLE", "REX_EVAL_WORST10ARTICLE", "REX_EVAL_LAENDER", "REX_EVAL_SUCHMASCHINEN", "REX_EVAL_REFERER", "REX_EVAL_BROWSER", "REX_EVAL_OPERATINGSYSTEM", "REX_EVAL_SEARCHWORDS"); $this->evalsnipps = array(); $statartikel = new sql(); $statartikel->setQuery("SELECT id,name FROM rex_article"); for ($i = 0; $i < $statartikel->getRows(); $i++) { $this->ART[$statartikel->getValue("id")] = $statartikel->getValue("name"); $statartikel->next(); } }
$article->setQuery("select * from " . $REX['TABLE_PREFIX'] . "article where id='{$article_id}' and clang='{$clang}'"); if (!isset($message)) { $message = ''; } $err_msg = $I18N->msg("metadata_updated") . $message; rex_generateArticle($article_id); } $typesel = new select(); $typesel->set_name("type_id"); $typesel->set_style("width:100%;"); $typesel->set_size(1); $typesql = new sql(); $typesql->setQuery("select * from " . $REX['TABLE_PREFIX'] . "article_type order by name"); for ($i = 0; $i < $typesql->getRows(); $i++) { $typesel->add_option($typesql->getValue("name"), $typesql->getValue("type_id")); $typesql->next(); } $typesel->set_selected($article->getValue("type_id")); // Artikeltyp-Auswahl nur anzeigen, wenn mehr als ein Typ vorhanden ist if ($typesql->getRows() <= 1) { $out = "<input type=hidden name=type_id value=0>"; } else { $out = "<tr><td class=grey>" . $I18N->msg("article_type_list_name") . "</td><td class=grey>" . $typesel->out() . "</td></tr>"; } echo " <table border=0 cellpadding=5 cellspacing=1 width=100%>\n <form action=index.php method=post ENCTYPE=multipart/form-data name=REX_FORM>\n <input type=hidden name=page value=content>\n <input type=hidden name=article_id value='{$article_id}'>\n <input type=hidden name=mode value='meta'>\n <input type=hidden name=save value=1>\n <input type=hidden name=clang value={$clang}>\n <input type=hidden name=ctype value={$ctype}>\n <tr>\n <td colspan=2>" . $I18N->msg("general") . "</td>\n </tr>"; if (isset($err_msg) and $err_msg != "") { echo '<tr><td colspan="2" class="warning"><font class="warning">' . $err_msg . '</font></td></tr>'; } function selectdate($date, $extens) { $date = date("Ymd", $date);
function showForm() { global $FORM, $REX; // --------------------------------- EDIT: 1. WERTE AUS DB HOLEN for ($i = 0; $i < $this->counter; $i++) { if ($this->value_type[$i] != "multipleselectsql") { if ($FORM[$this->rfid][submit] != 1 && $this->form_type == "edit") { $FORM[$this->rfid][values][$i] = htmlentities($this->sql->getValue($this->value_tbl[$i])); } else { $FORMVAL[$this->rfid][values][$i] = htmlentities($this->sql->getValue($this->value_tbl[$i])); } } else { $selsql = new sql(); $selsql->setQuery("select * from " . $this->type_value5[$i] . " where " . $this->type_value6[$i]); for ($j = 0; $j < $selsql->getRows(); $j++) { if ($FORM[$this->rfid][submit] != 1 && $this->form_type == "edit") { $FORM[$this->rfid][values][$i][] = $selsql->getValue($this->type_value7[$i]); } else { $FORMVAL[$this->rfid][values][$i][] = $selsql->getValue($this->type_value7[$i]); } $selsql->next(); } } } // --------------------------------- ABGESCHICKTE EINGABEN CHECKEN if ($FORM[$this->rfid][submit] == 1) { // ----------------------------- eingaben überprüfen $this->form_show = false; for ($i = 0; $i < $this->counter; $i++) { if ($this->value_check[$i] != "") { if ($FORM[$this->rfid][values][$i] == "") { $errmsg .= "Bitte tragen Sie '" . $this->value_form[$i] . "' ein! <br>"; $this->form_show = true; } } } } // --------------------------------- EDIT: SPEICHERN FALLS MÖGLICH if ($FORM[$this->rfid][submit] == 1 && $this->form_type == "edit") { if ($errmsg == "") { $aa = new sql(); $aa->debugsql = 0; $aa->setTable($this->tbl_name); $aa->where($this->form_where); for ($i = 0; $i < $this->counter; $i++) { if ($this->value_type[$i] == "picjpg") { $folder = $this->type_value1[$i]; $foldertmp = $REX[INCLUDE_PATH] . "/../../ss_pics/"; $fname = $_FILES[FORM][name][$this->rfid][values][$i]; if ($fname != "") { // neues file $nfname = $this->checkFilename($fname, $folder); if ($nfname[ext] == ".jpg") { $ftmpname = $_FILES[FORM][tmp_name][$this->rfid][values][$i]; move_uploaded_file($ftmpname, $foldertmp . $nfname[nname]); $this->resizeJPGImage($foldertmp . $nfname[nname], $folder . $nfname[nname], $this->type_value3[$i], $this->type_value4[$i]); $FORM[$this->rfid][values][$i] = $nfname[nname]; $aa->setValue($this->value_tbl[$i], $FORM[$this->rfid][values][$i]); } } elseif ($FORM[$this->rfid][values][$i][delete] != "") { $FORM[$this->rfid][values][$i] = ""; $aa->setValue($this->value_tbl[$i], $FORM[$this->rfid][values][$i]); } else { $FORM[$this->rfid][values][$i] = $FORMVAL[$this->rfid][values][$i]; } } elseif ($this->value_type[$i] == "file") { $folder = $REX[INCLUDE_PATH] . "/../../ss_pics/"; $fname = $_FILES[FORM][name][$this->rfid][values][$i]; if ($fname != "") { $nfname = $this->checkFilename($fname, $folder); $ftmpname = $_FILES[FORM][tmp_name][$this->rfid][values][$i]; move_uploaded_file($ftmpname, $folder . $nfname[nname]); $FORM[$this->rfid][values][$i] = $nfname[nname]; $aa->setValue($this->value_tbl[$i], $FORM[$this->rfid][values][$i]); } elseif ($FORM[$this->rfid][values][$i][delete] != "") { $FORM[$this->rfid][values][$i] = ""; $aa->setValue($this->value_tbl[$i], $FORM[$this->rfid][values][$i]); } else { $FORM[$this->rfid][values][$i] = $FORMVAL[$this->rfid][values][$i]; } } elseif ($this->value_type[$i] == "multipleselectsql") { // multipleselect $ms = new sql(); $ms->query("delete from " . $this->type_value5[$i] . " where " . $this->type_value6[$i]); if (is_Array($FORM[$this->rfid][values][$i])) { reset($FORM[$this->rfid][values][$i]); for ($j = 0; $j < count($FORM[$this->rfid][values][$i]); $j++) { $val = current($FORM[$this->rfid][values][$i]); $sql = "insert into " . $this->type_value5[$i] . " set " . $this->type_value6[$i] . ", " . $this->type_value7[$i] . "={$val}"; $ms->query($sql); next($FORM[$this->rfid][values][$i]); } } } elseif ($this->value_type[$i] == "subline" || $this->value_type[$i] == "empty") { } elseif ($this->value_type[$i] == "datum") { $tag = substr($FORM[$this->rfid][values][$i], 0, 2); $monat = substr($FORM[$this->rfid][values][$i], 3, 2); $jahr = substr($FORM[$this->rfid][values][$i], 6, 4); $aa->setValue($this->value_tbl[$i], mktime(0, 0, 0, $monat, $tag, $jahr)); } else { $aa->setValue($this->value_tbl[$i], $FORM[$this->rfid][values][$i]); } } $aa->update(); $msg = "Daten wurden gespeichert"; } else { for ($i = 0; $i < $this->counter; $i++) { if ($this->value_type[$i] != "multipleselectsql") { $FORM[$this->rfid][values][$i] = htmlentities(stripslashes($FORM[$this->rfid][values][$i])); } } } for ($i = 0; $i < $this->counter; $i++) { if ($this->value_type[$i] != "multipleselectsql") { $FORM[$this->rfid][values][$i] = htmlentities(stripslashes($FORM[$this->rfid][values][$i])); } else { // multipleselect if (is_Array($FORM[$this->rfid][values][$i])) { reset($FORM[$this->rfid][values][$i]); for ($j = 0; $j < count($FORM[$this->rfid][values][$i]); $j++) { $val = $FORM[$this->rfid][values][$i][j]; } } } } } // --------------------------------- ADD: SPEICHERN FALLS MÖGLICH if ($FORM[$this->rfid][submit] == 1 && $this->form_type == "add") { if ($errmsg == "") { $aa = new sql(); $aa->debugsql = 0; $aa->setTable($this->tbl_name); for ($i = 0; $i < $this->counter; $i++) { if ($this->value_type[$i] == "datum") { $tag = substr($FORM[$this->rfid][values][$i], 0, 2); $monat = substr($FORM[$this->rfid][values][$i], 3, 2); $jahr = substr($FORM[$this->rfid][values][$i], 6, 4); $aa->setValue($this->value_tbl[$i], mktime(0, 0, 0, $monat, $tag, $jahr)); } elseif ($this->value_type[$i] != "multipleselectsql" && $this->value_type[$i] != "subline" && $this->value_type[$i] != "empty") { $aa->setValue($this->value_tbl[$i], $FORM[$this->rfid][values][$i]); } } $aa->insert(); $msg = "Daten wurden gespeichert"; for ($i = 0; $i < $this->counter; $i++) { $FORM[$this->rfid][values][$i] = htmlentities(stripslashes($FORM[$this->rfid][values][$i])); } } else { for ($i = 0; $i < $this->counter; $i++) { $FORM[$this->rfid][values][$i] = htmlentities(stripslashes($FORM[$this->rfid][values][$i])); } } } // --------------------------------- FORMULAR if ($this->form_show || $this->ShowFormAlways) { $ausgabe = "<table width=" . $this->width . " cellpadding=6 cellspacing=1 border=0 >"; $ausgabe .= "<form ENCTYPE='multipart/form-data' action='" . $this->url . "' method='" . $this->method . "' name='" . $this->formname . "'>" . $this->form_header; $ausgabe .= "<input type=hidden name=FORM[{$this->rfid}][submit] value=1>"; // ---------------------- FORM REIHEN $colcounter = $this->cols[0]; for ($i = 0; $i < $this->counter; $i++) { if ($this->cols[$i] != "") { $colcounter = $this->cols[$i]; } else { $this->cols[$i] = $colcounter; } if ($maxcount < $this->cols[$i]) { $maxcount = $this->cols[$i]; } } $colcounter = 0; if ($errmsg != "") { $ausgabe .= "<tr><td colspan=" . ($maxcount + 2) . " class=warning>{$errmsg}<br>Daten wurden noch nicht gespeichert</td></tr>"; } if ($msg != "") { $ausgabe .= "<tr><td colspan=" . ($maxcount + 2) . " class=warning>{$msg}</td></tr>"; } for ($i = 0; $i < $this->counter; $i++) { $name = "FORM[{$this->rfid}][values][{$i}]"; $value = $FORM[$this->rfid][values][$i]; // echo "<br>$i $maxcounter ".$this->cols[$i]." ".$this->cols[$i-1]." ".$this->value_form[$i]; $colcounter++; if ($this->cols[$i - 1] != $this->cols[$i]) { if ($i != 0) { $ausgabe .= "</tr>\n\n"; } $ausgabe .= "\n\n<tr>"; $colcounter = 0; } else { // anfang // ende if ($colcounter == $this->cols[$i]) { $ausgabe .= "</tr>\n\n"; $ausgabe .= "\n\n<tr>"; $colcounter = 0; } } $addcolspawn = 0; if ($this->cols[$i] < $maxcount) { $addcolspawn = 2; } switch ($this->value_type[$i]) { // ---------------------- MULTIPLE SQL SELECT AUSGABE case "multipleselectsql": if ($this->form_type == "add") { $ausgabe .= "<td colspan=2>Multiple Felder nur bei edit möglich\t</td>"; } else { $ausgabe .= "\n\n"; $ausgabe .= "<td valign=middle class=grey width=" . $this->labelwidth . " >" . $this->value_form[$i] . "</td>"; $ssql = new sql(); $ssql->setQuery($this->type_value1[$i]); $ssel = new rexselect(); $ssel->setName($name . "[]"); $ssel->setMultiple(1); $ssel->setSize($this->type_value4[$i]); $ssel->setStyle("width:100%;"); for ($j = 0; $j < $ssql->getRows(); $j++) { $ssel->addOption($ssql->getValue($this->type_value3[$i]), $ssql->getValue($this->type_value2[$i])); $ssql->next(); } // $selsql = new sql; // $selsql->setQuery("select * from ".$this->type_value5[$i]." where ".$this->type_value6[$i]); if (is_Array($FORM[$this->rfid][values][$i])) { reset($FORM[$this->rfid][values][$i]); for ($j = 0; $j < count($FORM[$this->rfid][values][$i]); $j++) { $ssel->setSelected(current($FORM[$this->rfid][values][$i])); next($FORM[$this->rfid][values][$i]); } } $ausgabe .= "<td class=grey colspan=" . (1 + $addcolspawn) . ">" . $ssel->out() . "</td>"; $ausgabe .= ""; } break; // ---------------------- SINGLE SQL SELECT AUSGABE // ---------------------- SINGLE SQL SELECT AUSGABE case "singleselectsql": $ausgabe .= "\n\n"; $ausgabe .= "<td valign=middle class=grey width=" . $this->labelwidth . " >" . $this->value_form[$i] . "</td>"; $ssql = new sql(); $ssql->setQuery($this->type_value1[$i]); $ssel = new rexselect(); $ssel->setName($name); $ssel->setStyle("width:100%;"); if ($this->value_check[$i] != 1) { $ssel->addOption("----------------- keine Angabe -----------------", "0"); } for ($j = 0; $j < $ssql->getRows(); $j++) { $ssel->addOption($ssql->getValue($this->type_value3[$i]), $ssql->getValue($this->type_value2[$i])); $ssql->next(); } $ssel->setSelected($value); $ausgabe .= "<td class=grey colspan=" . (1 + $addcolspawn) . ">" . $ssel->out() . "</td>"; $ausgabe .= ""; break; // ---------------------- SINGLE SELECT AUSGABE // ---------------------- SINGLE SELECT AUSGABE case "singleselect": $ausgabe .= "\n\n"; $ausgabe .= "<td valign=middle class=grey width=" . $this->labelwidth . " >" . $this->value_form[$i] . "</td>"; $stype = explode("|", $this->type_value1[$i]); $ssel = new rexselect(); $ssel->setName($name); $ssel->setStyle("width:100%;"); for ($j = 0; $j < count($stype); $j++) { $svalue = $stype[$j]; $j++; $sname = $stype[$j]; $ssel->addOption($sname, $svalue); } $ssel->setSelected($value); $ausgabe .= "<td class=grey colspan=" . (1 + $addcolspawn) . ">" . $ssel->out() . "</td>"; $ausgabe .= ""; break; // ---------------------- Checkbox // ---------------------- Checkbox case "checkbox": $ausgabe .= "\n\n"; $ausgabe .= "<td valign=middle class=grey width=" . $this->labelwidth . " >" . $this->value_form[$i] . "</td>"; $ausgabe .= "<td class=grey colspan=" . (1 + $addcolspawn) . "><input type=checkbox name={$name} value=1 "; if ($value == 1 || $value == "on") { $ausgabe .= "checked"; } $ausgabe .= "></td>"; $ausgabe .= ""; break; // ---------------------- PIC/JPG // ---------------------- PIC/JPG case "picjpg": if ($value != "") { $ausgabe .= "\n\n"; $ausgabe .= "<td valign=middle class=grey width=" . $this->labelwidth . " >" . $this->value_form[$i] . "</td>"; $ausgabe .= "<td class=grey colspan=" . (1 + $addcolspawn) . "><table cellpadding=2 cellspacing=0><tr><td><input name={$name} type=file size=10></td><td rowspan=2> </td><td rowspan=2><img src=" . $this->type_value2[$i] . "{$value} width=" . $this->type_value3[$i] . " height=" . $this->type_value4[$i] . "></td></tr>"; $ausgabe .= "<tr><td valign=middle align=left class=grey><input type=checkbox name=FORM[{$this->rfid}][values][{$i}][delete]> Datei löschen </td></tr></table>"; $ausgabe .= "</td>"; } else { $ausgabe .= "\n\n"; $ausgabe .= "<td valign=middle class=grey width=" . $this->labelwidth . " >" . $this->value_form[$i] . "</td>"; $ausgabe .= "<td class=grey colspan=" . (1 + $addcolspawn) . "><input name={$name} type=file size=10></td>"; $ausgabe .= ""; } break; // ---------------------- FILE // ---------------------- FILE case "file": $myout = ""; if ($value != "") { $myout = "\n\n<table><tr>"; $myout .= "<td valign=middle align=right class=grey><input type=checkbox name=FORM[{$this->rfid}][values][{$i}][delete]></td>"; $myout .= "<td class=grey>Datei löschen <a href=" . $this->type_value2[$i] . "{$value} target=_blank>{$value}</a></td>"; $myout .= "</tr></table>"; } $ausgabe .= "\n\n"; $ausgabe .= "<td valign=middle class=grey width=" . $this->labelwidth . " >" . $this->value_form[$i] . "<br>{$myout}</td>"; $ausgabe .= "<td class=grey><input name={$name} type=file size=10></td>"; $ausgabe .= ""; break; // ---------------------- HTMLAREA // ---------------------- HTMLAREA case "htmlarea": if ($this->type_value1[$i] == "") { $this->type_value1[$i] = "width:100%; height:100px;"; } $ausgabe .= "\n\n"; $ausgabe .= "<td valign=top class=grey width=" . $this->labelwidth . " >" . $this->value_form[$i] . "</td>"; $ausgabe .= "<td class=grey colspan=" . (1 + $addcolspawn) . ">" . REXHTMLAREA($name, $value) . "</td>"; $ausgabe .= ""; break; // ---------------------- TEXTAREA // ---------------------- TEXTAREA case "textarea": if ($this->type_value1[$i] == "") { $this->type_value1[$i] = "width:100%; height:100px;"; } $ausgabe .= "\n\n"; $ausgabe .= "<td valign=top class=grey width=" . $this->labelwidth . " >" . $this->value_form[$i] . "</td>"; $ausgabe .= "<td class=grey colspan=" . (1 + $addcolspawn) . "><textarea name={$name} cols=30 rows=5 style='" . $this->type_value1[$i] . "'>{$value}</textarea></td>"; $ausgabe .= ""; break; // ---------------------- HIDDEN // ---------------------- HIDDEN case "hidden": $ausgabe .= "<input type=hidden name={$name} value=\"" . $this->type_value1[$i] . "\">"; break; // ---------------------- TEXT // ---------------------- TEXT case "text": if ($this->type_value1[$i] == "") { $this->type_value1[$i] = "width:100%;"; } if ($this->type_value2[$i] != "") { $this->type_value2[$i] = "maxlength=" . $this->type_value2[$i]; } $ausgabe .= "\n\n"; $ausgabe .= "<td valign=middle class=grey width=" . $this->labelwidth . " >" . $this->value_form[$i] . "</td>"; $ausgabe .= "<td class=grey colspan=" . (1 + $addcolspawn) . "><input type=text name={$name} value=\"{$value}\" " . $this->type_value2[$i] . " size=20 style='" . $this->type_value1[$i] . "'></td>"; $ausgabe .= ""; break; // ---------------------- DATUM // ---------------------- DATUM case "datum": if ($this->type_value1[$i] == "") { $this->type_value1[$i] = "width:100%;"; } if ($this->type_value2[$i] != "") { $this->type_value2[$i] = "maxlength=" . $this->type_value2[$i]; } if (!preg_match("![0-9]{2}\\.[0-9]{2}\\.[0-9]{4}!", $value)) { $value = date("d.m.Y", $value); } $ausgabe .= "\n\n"; $ausgabe .= "<td valign=middle class=grey width=" . $this->labelwidth . " >" . $this->value_form[$i] . "</td>"; $ausgabe .= "<td class=grey colspan=" . (1 + $addcolspawn) . "><input type=text name={$name} value=\"{$value}\" " . $this->type_value2[$i] . " size=20 style='" . $this->type_value1[$i] . "'></td>"; $ausgabe .= ""; break; // ---------------------- Überschrift // ---------------------- Überschrift case "subline": $ausgabe .= "\n\n"; $ausgabe .= "<th valign=middle align=" . $this->value_tbl[$i] . " colspan=" . (2 + $addcolspawn) . ">" . $this->value_form[$i] . "</th>\n"; $ausgabe .= "\n"; break; // ---------------------- Überschrift // ---------------------- Überschrift case "empty": $ausgabe .= "\n\n"; $ausgabe .= "<td valign=middle class=grey colspan=" . (2 + $addcolspawn) . "> </td>\n"; $ausgabe .= "\n"; break; // ---------------------- STANDARD AUSGABE - TEXT // ---------------------- STANDARD AUSGABE - TEXT default: $ausgabe .= "\n\n"; $ausgabe .= "<td valign=middle class=grey width=" . $this->labelwidth . " >" . $this->value_form[$i] . "</td>"; $ausgabe .= "<td class=grey colspan=" . (1 + $addcolspawn) . "><input type=text name={$name} value=\"{$value}\" size=20 style='width:100%'></td>"; $ausgabe .= ""; } } $ausgabe .= "</tr>"; // ---------------------- SUBMIT $ausgabe .= "<tr>\n\n"; $ausgabe .= "<td class=dgrey width=" . $this->labelwidth . " > </td>\n\n"; $ausgabe .= "<td align=left class=dgrey colspan=" . ($maxcount + 1) . "><input type=submit value='" . $this->submit_value . "'></td>\n\n"; $ausgabe .= "</tr>\n\n"; $ausgabe .= "</form></table>\n\n"; return $ausgabe; } else { if ($msg != "") { $ausgabe = "<table width=" . $this->width . " cellpadding=6 cellspacing=1 border=0 bgcolor=#ffffff>"; $ausgabe .= "<tr><td class=warning>{$msg}</td></tr>"; $ausgabe .= "</table>"; return $ausgabe; } } }
} else { echo "<td align=right class=grey><input type=checkbox name=checkbox01 value=1></td>"; } echo "\t<td class=grey>" . $I18N->msg("tease_on_startpage") . "</td>\r\n\t\t\t\t</tr>"; echo "\t</tr>\r\n\t\t\t\t{$out}\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=grey> </td>\r\n\t\t\t\t\t<td class=grey><input type=submit value='" . $I18N->msg("update_metadata") . "' size=8></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t</form>\r\n\t\t\t\t</table>"; if ($REX_USER->isValueOf("rights", "advancedMode[]")) { echo "<table border=0 cellpadding=5 cellspacing=1 width=100%>\r\n\t\t\t\t\t<form action=index.php method=get>\r\n\t\t\t\t\t<input type=hidden name=page value=content>\r\n\t\t\t\t\t<input type=hidden name=article_id value='{$article_id}'>\r\n\t\t\t\t\t<input type=hidden name=mode value='meta'>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=2>" . $I18N->msg("other_functions") . "</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<td class=grey width=150>" . $I18N->msg("category") . "</td>\r\n\t\t\t\t\t\t<td class=grey><select name=func_category_id size=1 style='width:100%;'>"; $csql = new sql(); $csql->setQuery("select * from rex_category order by re_category_id"); for ($i = 0; $i < $csql->getRows(); $i++) { echo "<option value=" . $csql->getValue("id"); if ($category_id == $csql->getValue("id")) { echo " selected"; } echo ">" . $csql->getValue("name") . " [" . $csql->getValue("id") . "]" . "</option>"; $csql->next(); } echo "</select></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=grey> </td>\r\n\t\t\t\t\t\t<td class=grey>"; if ($article->getValue("startpage") != 1) { echo "<input type=submit name=FUNC_MOVE value=\"" . $I18N->msg("move_article") . "\" size=8>"; } echo "<input type=submit name=FUNC_COPY value=\"" . $I18N->msg("copy_article") . "\" size=8>"; echo "</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t</form>\r\n\t\t\t\t\t</table>"; } } else { // preview, add, edit, delete , module mode $CONT = new article(); $CONT->setArticleId($article_id); $CONT->setSliceId($slice_id); $CONT->setMode($mode); $CONT->setEval(TRUE);
$echo .= $I18N->msg("category_edit_delete"); } $echo .= " </a></td>\r\n <td>{$kat_status}</td>\r\n </tr>"; } } else { if ($REX_USER->isValueOf("rights", "csr[{$i_category_id}]") || $REX_USER->isValueOf("rights", "csw[{$i_category_id}]")) { // --------------------- KATEGORIE WITH READ $kat_link = "index.php?page=structure&category_id={$i_category_id}&clang={$clang}"; $echo .= "<tr>\r\n <td class=icon><a href={$kat_link}><img src=pics/folder.gif border=0 width=16 height=16 align=middle></a></td>"; if ($REX_USER->isValueOf("rights", "advancedMode[]")) { $echo .= "<td class=grey align=center>{$i_category_id}</td>"; } $echo .= "\r\n <td><a href={$kat_link}>" . $KAT->getValue("catname") . " </a></td>\r\n <td valign=middle width=20>" . htmlspecialchars($KAT->getValue("catprior")) . "</td>\r\n <td>" . $I18N->msg("no_permission_to_edit") . "</td><td class=grey>{$kat_status}</td>\r\n </tr>"; } } $KAT->next(); } echo $echo; echo "</table>"; // --------------------------------------------- ARTIKEL LISTE // --------------------- READ TEMPLATES if ($category_id > -1) { $TEMPLATES = new sql(); $TEMPLATES->setQuery("select * from " . $REX['TABLE_PREFIX'] . "template order by name"); $TMPL_SEL = new select(); $TMPL_SEL->set_name("template_id"); $TMPL_SEL->set_size(1); $TMPL_SEL->set_style("width:150"); $TMPL_SEL->add_option($I18N->msg("option_no_template"), "0"); for ($i = 0; $i < $TEMPLATES->getRows(); $i++) { if ($TEMPLATES->getValue("active") == 1) {
<?php $OUT = TRUE; if ($function == "delete") { $del = new sql(); $del->setQuery("select * from rex_module_action where action_id='{$action_id}'"); // module mit dieser aktion vorhanden ? if ($del->getRows() > 0) { $module = "<font class=black>|</font> "; $modulname = htmlentities($del->getValue("rex_module_action.module_id")); for ($i = 0; $i < $del->getRows(); $i++) { $module .= "<a href=index.php?page=module&function=edit&modul_id=" . $del->getValue("rex_module_action.module_id") . ">" . $del->getValue("rex_module_action.module_id") . "</a> <font class=black>|</font> "; $del->next(); } $message = "<b>" . $I18N->msg("action_cannot_be_deleted", $action_id) . "</b><br> {$module}"; } else { $del->query("delete from rex_action where id='{$action_id}'"); $message = $I18N->msg("action_deleted"); } } if ($function == "add" or $function == "edit") { if ($save == "ja") { $faction = new sql(); if ($function == "add") { $faction->query("insert into rex_action (name,action,prepost,status) VALUES ('{$mname}','{$actioninput}','{$prepost}','{$status}')"); $message = "<p class=warning>" . $I18N->msg("action_added") . "</p>"; } else { $faction->query("update rex_action set name='{$mname}',action='{$actioninput}',prepost='{$prepost}',status='{$status}' where id='{$action_id}'"); $message = "<p class=warning>" . $I18N->msg("action_updated") . "</p>"; } if ($goon != "") {
/** * Erstellt eine Clang * * @param $id Id der Clang * @param $name Name der Clang */ function rex_addCLang($id, $name) { global $REX; $REX['CLANG'][$id] = $name; $content = "// --- DYN\n\r"; reset($REX['CLANG']); for ($i = 0; $i < count($REX['CLANG']); $i++) { $cur = key($REX['CLANG']); $val = current($REX['CLANG']); $content .= "\n\r\$REX['CLANG']['{$cur}'] = \"{$val}\";"; next($REX['CLANG']); } $content .= "\n\r// --- /DYN"; $file = $REX['INCLUDE_PATH'] . "/clang.inc.php"; $h = fopen($file, "r"); $fcontent = fread($h, filesize($file)); $fcontent = ereg_replace("(\\/\\/.---.DYN.*\\/\\/.---.\\/DYN)", $content, $fcontent); fclose($h); $h = fopen($file, "w+"); fwrite($h, $fcontent, strlen($fcontent)); fclose($h); @chmod($file, 0777); $add = new sql(); $add->setQuery("select * from " . $REX['TABLE_PREFIX'] . "article where clang='0'"); $fields = $add->getFieldnames(); for ($i = 0; $i < $add->getRows(); $i++) { $adda = new sql(); // $adda->debugsql = 1; $adda->setTable($REX['TABLE_PREFIX'] . "article"); reset($fields); while (list($key, $value) = each($fields)) { if ($value == "pid") { echo ""; } else { if ($value == "clang") { $adda->setValue("clang", $id); } else { if ($value == "status") { $adda->setValue("status", "0"); } else { $adda->setValue($value, rex_addslashes($add->getValue("{$value}"))); } } } // createuser // updateuser } $adda->insert(); $add->next(); } $add = new sql(); $add->query("insert into " . $REX['TABLE_PREFIX'] . "clang set id='{$id}',name='{$name}'"); // ----- EXTENSION POINT rex_register_extension_point('CLANG_ADDED', '', array('id' => $id, 'name' => $name)); rex_generateAll(); }
function REX_SEARCH($searchtxt, $surroundchars = 20, $categories = "", $surround_tag_start = "<b>", $surround_tag_end = "</b>") { ###### CHECK WHICH PATHES SHOULD BE SEARCHED if (!is_array($categories)) { $ADD_AREA .= "AND rex_article.path like '%-%'"; } else { $ADD_AREA = "AND ("; foreach ($categories as $var) { $ADD_AREA .= " rex_article.path like '%-{$var}%' OR "; } $ADD_AREA = substr($ADD_AREA, 0, -3) . ")"; } ##### TRIM SEARCHTXT $searchtxt = trim($searchtxt, " "); ##### CHECK IF SEARCH STRING IS LONG ENOUGH if (strlen($searchtxt) < 40 and strlen($searchtxt) > 2) { ##### EXPLODE SEARCH STRING $words = explode(" ", $searchtxt); $words_count = 0; if (count($words) > 3) { $words_count = 3; $RETURN[msg] = "Es wurden nur die ersten 3 Begriffe benutzt"; } else { $words_count = count($words); } ##### START SQL CLASS $SUCHE = new sql(); #### SEARCH FOR ALL KEYWORDS for ($i = 0; $i < $words_count; $i++) { $SUCHE->flush(); $KEYWORD = current($words); #### SQL QUERY $sql = "\r\n\t SELECT\r\n\r\n\t rex_article.id,rex_article.name,rex_article.beschreibung,\r\n\r\n\t\t\trex_article_slice.value1,rex_article_slice.value2,rex_article_slice.value3,\r\n\t\t\trex_article_slice.value4,rex_article_slice.value5,rex_article_slice.value6,\r\n\t\t\trex_article_slice.value7,rex_article_slice.value8,rex_article_slice.value9,\r\n\r\n\t (FIND_IN_SET('{$KEYWORD}',REPLACE(rex_article.name,' ',',')) * 10) +\r\n\t (FIND_IN_SET('{$KEYWORD}',REPLACE(rex_article.beschreibung,' ',',')) * 5) +\r\n\t (FIND_IN_SET('{$KEYWORD}',REPLACE(rex_article.suchbegriffe,' ',',')) * 5) +\r\n\t FIND_IN_SET('{$KEYWORD}',REPLACE(rex_article_slice.value1,' ',',')) +\r\n\t FIND_IN_SET('{$KEYWORD}',REPLACE(rex_article_slice.value2,' ',',')) +\r\n\t FIND_IN_SET('{$KEYWORD}',REPLACE(rex_article_slice.value3,' ',',')) +\r\n\t FIND_IN_SET('{$KEYWORD}',REPLACE(rex_article_slice.value4,' ',',')) +\r\n\t FIND_IN_SET('{$KEYWORD}',REPLACE(rex_article_slice.value5,' ',',')) +\r\n\t FIND_IN_SET('{$KEYWORD}',REPLACE(rex_article_slice.value6,' ',',')) +\r\n\t FIND_IN_SET('{$KEYWORD}',REPLACE(rex_article_slice.value7,' ',',')) +\r\n\t FIND_IN_SET('{$KEYWORD}',REPLACE(rex_article_slice.value8,' ',',')) +\r\n\t FIND_IN_SET('{$KEYWORD}',REPLACE(rex_article_slice.value9,' ',','))\r\n\t AS COUNTWORD\r\n\r\n\t FROM rex_article_slice\r\n\r\n\t LEFT JOIN rex_article ON rex_article.id=rex_article_slice.article_id\r\n\r\n\t WHERE\r\n\r\n\t (\r\n\t rex_article.name LIKE ('%{$KEYWORD}%') OR\r\n\t rex_article.beschreibung LIKE ('%{$KEYWORD}%') OR\r\n\t rex_article.suchbegriffe LIKE ('%{$KEYWORD}%') OR\r\n\t rex_article_slice.value1 LIKE ('%{$KEYWORD}%') OR\r\n\t rex_article_slice.value2 LIKE ('%{$KEYWORD}%') OR\r\n\t rex_article_slice.value3 LIKE ('%{$KEYWORD}%') OR\r\n\t rex_article_slice.value4 LIKE ('%{$KEYWORD}%') OR\r\n\t rex_article_slice.value5 LIKE ('%{$KEYWORD}%') OR\r\n\t rex_article_slice.value6 LIKE ('%{$KEYWORD}%') OR\r\n\t rex_article_slice.value7 LIKE ('%{$KEYWORD}%') OR\r\n\t rex_article_slice.value8 LIKE ('%{$KEYWORD}%') OR\r\n\t rex_article_slice.value9 LIKE ('%{$KEYWORD}%')\r\n\t )\r\n\r\n\t AND status = 1\r\n\r\n\t\t\t{$ADD_AREA}\r\n\r\n\t GROUP BY id\r\n\r\n\t ORDER BY COUNTWORD DESC\r\n\r\n\t LIMIT 0,50\r\n\r\n\t "; $SUCHE->setQuery($sql); $count_limit = 0; ###### GO THROUGH RESULTS for ($j = 0; $j < $SUCHE->getRows(); $j++) { $ART[$SUCHE->getValue("rex_article.id")][ID] = $SUCHE->getValue("rex_article.id"); $ART[$SUCHE->getValue("rex_article.id")][NAME] = $SUCHE->getValue("rex_article.name"); $ART[$SUCHE->getValue("rex_article.id")][DESC] = $SUCHE->getValue("rex_article.beschreibung"); $ART[$SUCHE->getValue("rex_article.id")][COUNTWORD] = $SUCHE->getValue("COUNTWORD"); $ART[$SUCHE->getValue("rex_article.id")][URL] = $SUCHE->getValue("rex_article.id") . "-" . ModRewriteName($SUCHE->getValue("rex_article.name")); ###### CHECK OCURRENCE OF KEYWORD for ($val = 1; $val < 10; $val++) { $regex = "/\\b.{0," . $surroundchars . "}" . $KEYWORD . ".{0," . $surroundchars . "}\\b/im"; preg_match_all($regex, strip_tags($SUCHE->getValue("rex_article_slice.value" . $val)), $matches); if ($matches[0][0] != '') { $ART_REGEX[$SUCHE->getValue("rex_article.id")] .= "... " . implode($matches[0], " ... "); } } $SUCHE->next(); } $SEARCH_WORDS[] = $KEYWORD; next($words); } if (is_array($ART_REGEX)) { $replace_string = implode("|", $SEARCH_WORDS); foreach ($ART_REGEX as $key => $var) { $ART[$key][DESC_REGEX] = preg_replace("/(" . $replace_string . ")/im", $surround_tag_start . "\\1" . $surround_tag_end, $var) . " ..."; } } } return $ART; }
} else { echo ' <td class="icon"> </td>' . "\n"; } if (!isset($opener_link)) { $opener_link = ''; } // wenn datei fehlt if (!file_exists($REX["INCLUDE_PATH"] . "/../../files/{$file_name}")) { $thumbnail = "<img src=pics/mime_icons/mime-error.gif width=44 height=38 border=0>"; } echo ' <td style="background-color:#e6e6e6; text-align:center; vertical-align:middle;"><a href="' . $ilink . '">' . $thumbnail . '</a></td>' . "\n"; echo ' <td valign="top" class="grey"><b><a href="' . $ilink . '">' . $file_title . '</a></b><br /><br /><b>' . $file_name . ' [' . $file_size . ']</b>'; echo '<br />' . nl2br(htmlspecialchars($file_description)) . '<br /><br />' . $file_stamp . '|' . $file_updateuser . '</td>' . "\n"; echo ' <td valign="top" class="grey">' . $opener_link . '</td>' . "\n"; echo '</tr>' . "\n\n"; $files->next(); } if ($files->getRows() == 0) { // ----- no items found // print "<tr><td colspan=5> </td>"; print "<tr>\r\n <td class=grey align=center> </td>\r\n <td class=grey colspan=3>" . $I18N->msg('pool_nomediafound') . "</td>\r\n </tr>"; } elseif ($PERMALL) { print "</table>"; print "<table class=rex border=0 cellpadding=5 cellspacing=1 style='width:100%'>\n"; // ----- move and delete selected items print "<tr>\r\n <td align=center class=icon><!-- " . $I18N->msg('pool_select_all') . " --><input type=checkbox name=checkie value=0 onClick=\"SetAllCheckBoxes('rex_file_list','selectedmedia[]',this)\"></td>"; $filecat = new sql(); $filecat->setQuery("SELECT * FROM " . $REX['TABLE_PREFIX'] . "file_category ORDER BY name ASC LIMIT 1"); if ($filecat->getRows() > 0) { print "\r\n <!-- <td class=grey><b>" . $I18N->msg('pool_selectedmedia') . "</b> </td>-->\r\n <td class=grey>" . $cats_sel->out() . "</td>\r\n <td class=grey><input type=submit value=\"" . $I18N->msg('pool_changecat_selectedmedia') . "\" onclick=\"document.rex_file_list.media_method.value='updatecat_selectedmedia';\"></td>\r\n <td class=grey width=150><input type=submit value=\"" . $I18N->msg('pool_delete_selectedmedia') . "\" onclick=\"document.rex_file_list.media_method.value='delete_selectedmedia';return confirm('" . $I18N->msg('delete') . " ?');\"></td>\r\n "; } else {
$create = fread($h, filesize($fname)); $link = mysql_connect($DB[1][HOST], $DB[1][LOGIN], $DB[1][PSW]); $lines = explode(";", $create); array_pop($lines); foreach ($lines as $line) { if (!mysql_db_query($DB[1][NAME], $line, $link)) { $err_msg .= "Folgender Fehler tauchte beim Update auf. MySQL: " . mysql_error() . "<br>"; } } } elseif ($dbanlegen == 2) { // ----- Keine Datenbank anlegen $TBLS = array("rex__article_comment" => 0, "rex__session" => 0, "rex__board" => 0, "rex__user" => 0, "rex__user_comment" => 0, "rex__user_mail" => 0, "rex_action" => 0, "rex_article" => 0, "rex_article_slice" => 0, "rex_article_type" => 0, "rex_category" => 0, "rex_email" => 0, "rex_file" => 0, "rex_file_category" => 0, "rex_modultyp" => 0, "rex_template" => 0, "rex_user" => 0, "rex_file_category" => 0); $gt = new sql(); // $gt->debugsql = 1; $gt->setQuery("show tables"); for ($i = 0; $i < $gt->getRows(); $i++, $gt->next()) { $tblname = $gt->getValue("Tables_in_" . $DB[1][NAME]); if (substr($tblname, 0, 4) == "rex_") { // echo $tblname."<br>"; if (array_key_exists("{$tblname}", $TBLS)) { $TBLS["{$tblname}"] = 1; } } } for ($i = 0; $i < count($TBLS); $i++) { if (current($TBLS) != 1) { $err_msg .= "Tabelle " . key($TBLS) . " wurde nicht gefunden !<br>"; } next($TBLS); } } elseif ($dbanlegen == 1) {
function getSlicesForArticleOfType($an_article_id, $a_type_id) { global $REX; $table = ''; $table = $REX['TABLE_PREFIX'] . "article_slice"; $sql = new sql(); $query = <<<EOD SELECT id,re_article_slice_id,value1,value2,value3,value4,value5,value6, value7,value8,value9,value10,file1,file2,file3,file4,file5,file6, file7,file8,file9,file10,link1,link2,link3,link4,link5,link6,link7, link8,link9,link10,php,html,article_id,modultyp_id FROM {$table} WHERE article_id = {$an_article_id} AND modultyp_id = {$a_type_id} EOD; $sql->setQuery($query); $slices = array(); for ($i = 0; $i < $sql->getRows(); $i++) { $slices[] = new OOArticleSlice($sql->getValue("id"), $sql->getValue("re_article_slice_id"), $sql->getValue("value1"), $sql->getValue("value2"), $sql->getValue("value3"), $sql->getValue("value4"), $sql->getValue("value5"), $sql->getValue("value6"), $sql->getValue("value7"), $sql->getValue("value8"), $sql->getValue("value9"), $sql->getValue("value10"), $sql->getValue("file1"), $sql->getValue("file2"), $sql->getValue("file3"), $sql->getValue("file4"), $sql->getValue("file5"), $sql->getValue("file6"), $sql->getValue("file7"), $sql->getValue("file8"), $sql->getValue("file9"), $sql->getValue("file10"), $sql->getValue("link1"), $sql->getValue("link2"), $sql->getValue("link3"), $sql->getValue("link4"), $sql->getValue("link5"), $sql->getValue("link6"), $sql->getValue("link7"), $sql->getValue("link8"), $sql->getValue("link9"), $sql->getValue("link10"), $sql->getValue("php"), $sql->getValue("html"), $sql->getValue("article_id"), $sql->getValue("modultyp_id")); $sql->next(); } return $slices; }
function getChildren($ignore_offlines = false) { $off = $ignore_offlines ? " and status = 1 " : ""; $catlist = array(); $sql = new sql(); $sql->setQuery("select id, name, description, func, re_category_id, prior, path, status from rex_category where re_category_id = {$this->_id} {$off} order by prior"); for ($i = 0; $i < $sql->getRows(); $i++) { $catlist[] = new OOCategory($sql->getValue("id"), $sql->getValue("name"), $sql->getValue("description"), $sql->getValue("func"), $sql->getValue("re_category_id"), $sql->getValue("prior"), $sql->getValue("path"), $sql->getValue("status")); $sql->next(); } return $catlist; }
function getArticle() { global $module_id, $FORM, $REX_USER, $REX, $REX_SESSION, $I18N; if ($REX[GG]) { if ($this->article_id != 0) { $this->contents = ""; if ($REX[BF]) { $filename = $REX[INCLUDE_PATH] . "/generated/articles/" . $this->article_id . ".bcontent"; } else { $filename = $REX[INCLUDE_PATH] . "/generated/articles/" . $this->article_id . ".content"; } if ($fd = @fopen($filename, "r")) { $this->contents = fread($fd, filesize($filename)); fclose($fd); eval($this->contents); } } } else { if ($this->article_id != 0) { // ---------- select alle slices eines artikels $this->CONT = new sql(); $this->CONT->setQuery("select rex_modultyp.name, rex_modultyp.ausgabe, rex_modultyp.bausgabe, rex_modultyp.eingabe, rex_modultyp.php_enable, rex_modultyp.html_enable, rex_article_slice.*, rex_article.category_id\n from\n rex_article_slice\n left join rex_modultyp on rex_article_slice.modultyp_id=rex_modultyp.id\n left join rex_article on rex_article_slice.article_id=rex_article.id\n where\n rex_article_slice.article_id='" . $this->article_id . "'\n order by\n rex_article_slice.re_article_slice_id"); // ---------- SLICE IDS/MODUL SETZEN for ($i = 0; $i < $this->CONT->getRows(); $i++) { $RE_CONTS[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue("rex_article_slice.id"); if ($REX[BF]) { $RE_MODUL_OUT[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue("rex_modultyp.bausgabe"); } else { $RE_MODUL_OUT[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue("rex_modultyp.ausgabe"); } $RE_MODUL_IN[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue("rex_modultyp.eingabe"); $RE_MODUL_NAME[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue("rex_modultyp.name"); $RE_MODUL_PHP[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue("rex_modultyp.php_enable"); $RE_MODUL_HTML[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue("rex_modultyp.html_enable"); $RE_C[$this->CONT->getValue("re_article_slice_id")] = $i; $this->CONT->nextValue(); } // ---------- moduleselect if ($this->mode == "edit") { // auslesen ob php/html rechte $add_sql = ""; $MODULE_PERM[php] = $REX_USER->isValueOf("rights", "module[php]"); $MODULE_PERM[html] = $REX_USER->isValueOf("rights", "module[html]"); if (!$MODULE_PERM[php]) { $add_sql = "where php_enable='0'"; } if (!$MODULE_PERM[html]) { if ($add_sql != "") { $add_sql .= " and html_enable='0'"; } else { $add_sql = "where html_enable='0'"; } } $MODULE = new sql(); $MODULE->setQuery("select * from rex_modultyp {$add_sql} order by name"); $MODULESELECT = new select(); $MODULESELECT->set_name("module_id"); $MODULESELECT->set_size(1); $MODULESELECT->set_style("width:100%;' onchange='this.form.submit();"); $MODULESELECT->add_option("---------------------------- " . $I18N->msg("add_block"), ''); for ($i = 0; $i < $MODULE->getRows(); $i++) { $MODULESELECT->add_option($MODULE->getValue("name"), $MODULE->getValue("id")); $MODULE->next(); } } // ---------- SLICE IDS SORTIEREN UND AUSGEBEN $I_ID = 0; $PRE_ID = 0; $this->article_content = ""; $this->CONT->resetCounter(); for ($i = 0; $i < $this->CONT->getRows(); $i++) { // ------------- EINZELNER SLICE - AUSGABE $this->CONT->counter = $RE_C[$I_ID]; $slice_content = ""; $SLICE_SHOW = TRUE; if ($this->mode == "edit") { $this->ViewSliceId = $RE_CONTS[$I_ID]; $amodule = "\n <table cellspacing=0 cellpadding=5 border=0 width=100%>\n <form action=index.php"; if ($this->setanker) { $amodule .= "#addslice"; } $amodule .= " method=get>\n <input type=hidden name=article_id value={$this->article_id}>\n <input type=hidden name=page value=content>\n <input type=hidden name=mode value={$this->mode}>\n <input type=hidden name=slice_id value={$I_ID}>\n <input type=hidden name=function value=add>\n <tr>\n <td class=dblue>" . $MODULESELECT->out() . "</td>\n </tr></form></table>"; $fmenue = "\n <a name=slice{$RE_CONTS[$I_ID]}></a>\n <table width=100% cellspacing=0 cellpadding=5 border=0>\n <tr>\n <td class=blue width=380><b>{$RE_MODUL_NAME[$I_ID]}</b></td>\n <td class=llblue align=center><a href=index.php?page=content&article_id={$this->article_id}&mode=edit&slice_id={$RE_CONTS[$I_ID]}&function=edit#slice{$RE_CONTS[$I_ID]} class=green12b><b>" . $I18N->msg('edit') . "</b></a></td>\n <td class=llblue align=center><a href=index.php?page=content&article_id={$this->article_id}&mode=edit&slice_id={$RE_CONTS[$I_ID]}&function=delete#slice{$RE_CONTS[$I_ID]} class=red12b><b>" . $I18N->msg('delete') . "</b></a></td>\n </tr>\n </table>"; $p_menue = "\n <table width=100% cellspacing=0 cellpadding=5 border=0>\n <tr>\n <td class=blue> MODUL: <b>{$RE_MODUL_NAME[$I_ID]}</b> | <b>" . $I18N->msg('no_editing_rights') . "</b></td>\n </tr>\n </table>"; $tbl_head = "<table width=100% cellspacing=0 cellpadding=5 border=0><tr><td class=lblue>"; $tbl_bott = "</td></tr></table>"; // && ( $RE_MODUL_PHP[$module_id] == 0 || $MODULE_PERM[php] ) && ( $RE_MODUL_HTML[$module_id] == 0 || $MODULE_PERM[html] ) if ($this->function == "add" && $this->slice_id == $I_ID) { $slice_content = $this->addSlice($I_ID, $module_id); } else { $slice_content .= $amodule; } if ($this->function == "edit" && $this->slice_id == $RE_CONTS[$I_ID] && ($RE_MODUL_PHP[$I_ID] == 0 || $MODULE_PERM[php]) && ($RE_MODUL_HTML[$I_ID] == 0 || $MODULE_PERM[html])) { $slice_content .= $fmenue . $tbl_head . $this->editSlice($RE_CONTS[$I_ID], $RE_MODUL_IN[$I_ID]) . $tbl_bott; } elseif ($this->function == "delete" && $this->slice_id == $RE_CONTS[$I_ID]) { $slice_content .= $fmenue . $tbl_head . $this->deleteSlice($RE_CONTS[$I_ID], $RE_MODUL_OUT[$I_ID], $PRE_ID) . $tbl_bott; } else { if (!$MODULE_PERM[html] && $RE_MODUL_HTML[$I_ID]) { $this->mode = ""; $slice_content .= $p_menue . $tbl_head . $RE_MODUL_OUT[$I_ID] . $tbl_bott; $slice_content = $this->sliceIn($slice_content); // $slice_content .= "**"; $this->mode = "edit"; } else { if (($RE_MODUL_PHP[$I_ID] == 0 || $MODULE_PERM[php]) && ($RE_MODUL_HTML[$I_ID] == 0 || $MODULE_PERM[html])) { $slice_content .= $fmenue . $tbl_head . $RE_MODUL_OUT[$I_ID] . $tbl_bott; } else { $slice_content .= $p_menue . $tbl_head . $RE_MODUL_OUT[$I_ID] . $tbl_bott; } $slice_content = $this->sliceIn($slice_content); } } } else { // wenn mode nicht edit $slice_content .= $RE_MODUL_OUT[$I_ID]; $slice_content = $this->sliceIn($slice_content); } // --------------- ENDE EINZELNER SLICE // ---------- slice in ausgabe speichern $this->article_content .= $slice_content; // zum nachsten slice $I_ID = $RE_CONTS[$I_ID]; $PRE_ID = $I_ID; } if ($this->mode == "edit") { $amodule = "\n <table cellspacing=0 cellpadding=5 border=0 width=100%>\n <form action=index.php"; if ($this->setanker) { $amodule .= "#addslice"; } $amodule .= " method=get>\n <input type=hidden name=article_id value={$this->article_id}>\n <input type=hidden name=page value=content>\n <input type=hidden name=mode value={$this->mode}>\n <input type=hidden name=slice_id value={$I_ID}>\n <input type=hidden name=function value=add>\n <tr>\n <td class=dblue>" . $MODULESELECT->out() . "</td>\n </tr></form></table>"; if ($this->function == "add" && $this->slice_id == $I_ID) { $slice_content = $this->addSlice($I_ID, $module_id); } else { $slice_content = $amodule; } $this->article_content .= $slice_content; } // -------------------------- schreibe content if ($REX[RC]) { return $this->article_content; } else { eval("?>" . $this->article_content); } } else { return $I18N->msg('no_article_available'); } } }
$SF = true; $mypage = "community"; $subpage = "messages"; $table = " rex_5_user_mail"; $bezeichner = "Private Nachricht"; $userReplaceValue = ""; $fromsql = new sql(); $fromsql->setQuery("SELECT id,user_login FROM rex_5_user"); if ($fromsql->getRows() > 0) { for ($i = 0; $i < $fromsql->getRows(); $i++) { $userReplaceValue .= $fromsql->getValue("id") . "|" . $fromsql->getValue("user_login") . "|"; if (trim(strtoupper($FORM['csuchtxt'])) == trim(strtoupper($fromsql->getValue("user_login")))) { $FORM['csuchid'][] = $fromsql->getValue("id"); } $fromsql->next(); } $userReplaceValue = substr($userReplaceValue, 0, strlen($userReplaceValue) - 1); } //------------------------------> Poll Anlegen|Editieren if ($func == "edit") { $mita = new rexform(); $mita->setWidth(770); $mita->setLabelWidth(160); $mita->setTablename($table); $mita->setFormtype("edit", "id='" . $oid . "'", "Nachricht wurde nicht gefunden"); $mita->setFormheader("<input type=hidden name=page value=" . $mypage . "><input type=hidden name=subpage value=" . $subpage . "><input type=hidden name=func value=" . $func . " /><input type=hidden name=oid value=" . $oid . ">"); $mita->setShowFormAlways(false); $mita->setValue("subline", "{$bezeichner} edieren", "left", 0); $mita->setValue("showtext", "An", "user_id", 0, "width:100%;'"); $mita->setValue("showtext", "Von", "from_user_id", 0, "width:100%;'");
if ($gaa->getRows() > 0) { echo "<tr><td colspan=3></td></tr><tr><td colspan=3 align=left class=dgrey><a name=action></a><b>" . $I18N->msg("actions") . "</b></td></tr>"; $gma = new sql(); $gma->setQuery("select * from rex_module_action,rex_action where rex_module_action.action_id=rex_action.id and rex_module_action.module_id='{$modul_id}'"); for ($i = 0; $i < $gma->getRows(); $i++) { $iaction_id = $gma->getValue("rex_module_action.id"); $action_id = $gma->getValue("rex_module_action.action_id"); echo "<tr>\r\n\t\t\t\t\t\t<td class=grey> </td>\r\n\t\t\t\t\t\t<td class=grey>"; echo "<a href=index.php?page=module&subpage=actions&action_id={$action_id}&function=edit>" . $gma->getValue("name") . "</a>"; echo " ["; echo $PREPOST[$gma->getValue("prepost")] . "|"; echo $ASTATUS[$gma->getValue("status")]; echo "] </td>"; echo "<td class=grey><a href=index.php?page=module&modul_id={$modul_id}&function_action=delete&function=edit&iaction_id={$iaction_id}>" . $I18N->msg("action_delete") . "</a></td>"; echo "</tr>"; $gma->next(); } $gaa_sel = new select(); $gaa_sel->set_name("action_id"); $gaa_sel->set_size(1); $gaa_sel->set_style("' class='inp100"); for ($i = 0; $i < $gaa->getRows(); $i++) { $gaa_sel->add_option($gaa->getValue("name") . " [" . $PREPOST[$gaa->getValue("prepost")] . "|" . $ASTATUS[$gaa->getValue("status")] . "]", $gaa->getValue("id")); $gaa->next(); } echo "<form action=index.php#action method=post>"; echo "<input type=hidden name=page value=module>"; echo "<input type=hidden name=modul_id value={$modul_id}>"; echo "<input type=hidden name=function value=edit>"; echo "<input type=hidden name=function_action value=add>"; echo "<tr><td colspan=3></td></tr><tr>\r\n\t\t\t\t\t<td class=grey> </td>\r\n\t\t\t\t\t<td class=grey>" . $gaa_sel->out() . "</td>\r\n\t\t\t\t\t<td class=grey><input type=submit value='" . $I18N->msg("action_add") . "'></td>\r\n\t\t\t\t\t</tr>";
$MSG = $I18N->msg("setup_error2"); } fclose($h); } elseif ($func == "generate") { // generate all articles,cats,templates,caches $MSG = rex_generateAll(); } elseif ($func == "linkchecker") { unset($LART); for ($j = 1; $j < 11; $j++) { $LC = new sql(); // $LC->debugsql = 1; $LC->setQuery("select rex_article_slice.article_id,rex_article_slice.id from rex_article_slice\r\n\t\t\t\t\tleft join rex_article on rex_article_slice.link{$j}=rex_article.id\r\n\t\t\t\t\twhere\r\n\t\t\t\t\trex_article_slice.link{$j}>0 and rex_article.id IS NULL"); for ($i = 0; $i < $LC->getRows(); $i++) { $LART[$LC->getValue("rex_article_slice.article_id")] = 1; $LSLI[$LC->getValue("rex_article_slice.article_id")] = $LC->getValue("rex_article_slice.id"); $LC->next(); } } if (count($LART) > 0) { reset($LART); } for ($i = 0; $i < count($LART); $i++) { $MSG .= " | <a href=index.php?page=content&article_id=" . key($LART) . "&mode=edit&slice_id=" . $LSLI[key($LART)] . "&function=edit#editslice>" . key($LART) . "</a>"; next($LART); } if (count($LART) == 0) { $MSG = $I18N->msg("links_ok"); } else { $MSG = "<b>" . $I18N->msg("links_not_ok") . "</b> " . $MSG . " |"; } } elseif ($func == 'updateinfos') {
function showall($next) { global $REX; // ------------- FALLS KEIN ROWSELECT ALLE DATENSAETZE HOLEN UND ANZAHL SETZEN if ($this->rows == "") { $this->sql = new sql($this->DB); $this->sql->setQuery($this->query); $this->rows = $this->sql->getRows(); } $echo = "<table width=770 cellpadding=5 cellspacing=1 border=0 bgcolor=#ffffff>"; $echo .= $this->table_header; // ------------- BLAETTERN if (!($next > 0 && $next <= $this->rows)) { $next = 0; } $list_start = $next; $list_end = $next + $this->list_amount; if ($list_end > $this->rows) { $list_end = $this->rows; } $before = $next - $this->list_amount; if ($before < 0) { $before = 0; } $next = $next + $this->list_amount; if ($next > $this->rows) { $next = $next - $this->list_amount; } if ($next < 0) { $next = 0; } $bhead = $this->blaettern_head; $bhead = str_replace("###LINK_BACK###", $this->addonlink . $before, $bhead); $bhead = str_replace("###LINK_NEXT###", $this->addonlink . $next, $bhead); $bhead = str_replace("###LIST_START###", $list_start, $bhead); $bhead = str_replace("###LIST_END###", $list_end, $bhead); $bhead = str_replace("###LIST_ALL###", $this->rows, $bhead); if ($this->blaettern_top) { $echo .= "<tr><td colspan=" . $this->data_num . " class=lgrey>{$bhead}</td></tr>"; } // ------------ QUERY NEU ERSTELLEN MIT LIMIT $limit = "LIMIT " . $list_start . "," . $this->list_amount; $order = ""; if ($this->order_name != "") { $order = " order by " . $this->order_name . " " . $this->order_type; } elseif ($this->default_order_name != "") { $order = " order by " . $this->default_order_name . " " . $this->default_order_type; } $SQL = new sql($this->DB); $SQL->debugsql = $this->debugsql; $SQL->setQuery("{$this->query} {$order} {$limit}"); // ------------ <TH>HEADLINES $echo .= "<tr>"; for ($i = 1; $i <= $this->data_num; $i++) { $echo .= "<th>"; if ($this->data_order[$i]) { $type = $this->order_type; if ($type == "asc") { $type = "desc"; } else { $type = "asc"; } $echo .= " <a href=" . $this->addonlink . "&" . $this->var_ordername . "=" . $this->data[$i] . "&" . $this->var_ordertype . "=" . $type . "&" . $this->var_next . "={$before}><b>" . $this->data_name[$i] . "</b>" . $this->sort_char . "</a>"; } else { $echo .= $this->data_name[$i]; } $echo .= "</th>"; } $echo .= "</tr>"; // ------------ ERSTELLUNG DER LISTE for ($j = 0; $j < $SQL->getRows(); $j++) { for ($i = 1; $i <= $this->data_num; $i++) { // ----- START: DATENSATZ $echo .= "<td class=grey valign=top " . $this->td[$this->data_num] . ">"; // ----- START: FORMAT if (!is_array($this->format[$i])) { $value = htmlentities($SQL->getValue($this->data[$i])); } else { $value = $SQL->getValue($this->data[$i]); $contentvalue = $this->data[$i]; for ($k = 0; $k < count($this->format[$i]); $k++) { switch ($this->format[$i][$k]) { case "link": $linkid = $SQL->getValue($this->format_value2[$i][$k]); $value = '<a href="' . $this->format_value1[$i][$k] . $linkid . $this->format_value3[$i][$k] . '" ' . $this->format_value4[$i][$k] . '>' . $value . '</a>'; break; case "ifvalue": if ($value == $this->format_value1[$i][$k]) { $value = $this->format_value2[$i][$k]; } break; case "ifempty": if ($value == "") { $value = $this->format_value1[$i][$k]; } break; case "prefix": $value = $this->format_value1[$i][$k] . "{$value}"; break; case "suffix": $value = "{$value}" . $this->format_value1[$i][$k]; break; case "callback": $value = call_user_func($this->format_value1[$i][$k], $value); break; case "activestatus": if ($value == 0) { $value = "inactive"; } else { $value = "active"; } break; case "status": if ($value == 0) { $value = "inactive user"; } elseif ($value == 7) { $value = "superadmin"; } elseif ($value > 4) { $value = "admin"; } elseif ($value == 1) { $value = "guest"; } else { $value = "user"; } break; case "dt": $dt = $this->format_value1[$i][$k]; if ($dt == "") { $dt = "M-d Y H:i:s"; } $value = date_from_mydate($value, $dt); break; case "hour": $value = $value . " h"; break; case "minutes": $value = "{$value} min"; break; case "minute2hour": $hours = intval($value / 60); $minutes = ($value - $hours * 60) / 60 * 100; if ($minutes < 10) { $minutes = "0{$minutes}"; } elseif ($minutes == 0) { $minutes = "00"; } $value = "{$hours},{$minutes}"; break; case "date": $format = $this->format_value1[$i][$k]; if ($format == "") { $format = "d.M.Y H:i:s"; } $value = date_from_mydate($value, $format); break; case "time": $value = substr($value, 0, 2) . ":" . substr($value, 2, 2) . ""; break; case "unixToDateTime": $format = $this->format_value1[$i][$k]; if ($format == "") { $format = "d.M.Y H:i:s"; } $value = date($format, $value); break; case "nl2br": $value = nl2br($value); break; case "prozent": $value = "<img src=/pics/p_prozent/" . show_prozent($value) . ".gif height=13 width=50>"; break; case "wrap": $value = $this->format_value1[$i][$k] . $value . $this->format_value2[$i][$k]; break; case "addfield": $value = $value . $this->format_value2[$i][$k] . $SQL->getValue($this->format_value1[$i][$k]) . $this->format_value3[$i][$k]; break; case "clear": $value = ""; break; case "substr": $elements = imap_mime_header_decode($value); $value = ""; for ($l = 0; $l < count($elements); $l++) { // echo "Charset: {$elements[$i]->charset}\n"; $value .= $elements[$l]->text; } $value = substr($value, 0, $this->format_value1[$i][$k]); $value = htmlentities($value); break; case "content": $value = $contentvalue; break; case "size": $value = "<div style='text-align:right;width:auto;'>" . $this->human_file_size($value) . "</div>"; break; case "js": $elements = imap_mime_header_decode($value); $value = ""; for ($l = 0; $l < count($elements); $l++) { // echo "Charset: {$elements[$i]->charset}\n"; $value .= $elements[$l]->text; } if ($value == "") { $value = "<no entry>"; } if ($this->format_value4[$i][$k] == "") { $value = substr($value, 0, 30); } else { if ($this->format_value4[$i][$k] == "nosubstr") { $value = $value; } else { $value = substr($value, 0, $this->format_value4[$i][$k]); } } $value = nl2br(htmlentities($value)); $value = "<a href=javascript:" . $this->format_value1[$i][$k] . $SQL->getValue($this->format_value2[$i][$k]) . $this->format_value3[$i][$k] . ">{$value}</a>"; break; case "boldstatus": // ********************** // Prozer Special: MAIL // zum anzeigen von bold falls TRUE(1) // ********************** $elements = imap_mime_header_decode($value); $value = ""; for ($l = 0; $l < count($elements); $l++) { // echo "Charset: {$elements[$i]->charset}\n"; $value .= $elements[$l]->text; } if ($value == "") { $value = "<no subject entered>"; } $value = substr($value, 0, 30); $value = htmlentities($value); //echo "<!-- ".$SQL->getValue("header")."-->"; if ($SQL->getValue("spam") != 0 && eregi("X-Spam-Flag: YES", $SQL->getValue("header"))) { if (!$SQL->getValue($this->format_value1[$i][$k])) { $value = "<b style=\"color:red\">{$value}</b>"; } else { $value = "<span style=\"color:red\">{$value}</span>"; } } elseif (!$SQL->getValue($this->format_value1[$i][$k])) { $value = "<b>{$value}</b>"; } break; case "image": // ********************** // Prozer Special // zum anzeigen von bold falls TRUE(1) // ********************** if ($SQL->getValue($this->format_value1[$i][$k]) > 0) { $value = $this->format_value2[$i][$k] . " " . htmlentities($value); } else { $value = " "; } break; case "statustodo": // ********************** // Prozer Special // zum anzeigen von bold falls TRUE(1) // ********************** if ($value == 0) { $value = "done"; } elseif ($value == 1) { $value = "in work"; } elseif ($value == 2) { $value = "new"; } break; case "replace_value": $stype = explode("|", $this->format_value1[$i][$k]); $lvalue = $value; $defaultvalue = -1; for ($l = 0; $l < count($stype); $l++) { $svalue = $stype[$l]; $l++; $sname = $stype[$l]; if ($svalue === "") { $defaultvalue = $sname; } if ($lvalue == $svalue) { $lvalue = $sname; } } if ($lvalue == $value && $defaultvalue != -1) { $lvalue = $defaultvalue; } $value = $lvalue; break; case "checkbox": $value = "<input onclick=setTRColor('tr{$j}','#f0efeb','#d8dca5',this.checked); type=checkbox name='" . $this->format_value1[$i][$k] . "' value='" . $value . "'>"; break; } } } // if ($value==""){ $value = "-"; } // ----- END: FORMAT $echo .= $value; $echo .= "</td>\n"; // ----- END: DATENSATZ } $echo .= "</tr>"; // ----- END: REIHE $SQL->next(); } if ($this->blaettern_bottom) { $echo .= "<tr><td colspan=" . $this->data_num . " class=lgrey>{$bhead}</td></tr>"; } $echo .= $this->table_footer; $echo .= "</table>"; return $echo; }
function generateAll() { global $REX, $I18N; // ----------------------------------------------------------- generiere templates deleteDir($REX[INCLUDE_PATH] . "/generated/templates", 0); // mkdir($REX[INCLUDE_PATH]."/generated/templates",0664); $gt = new sql(); $gt->setQuery("select * from rex_template"); for ($i = 0; $i < $gt->getRows(); $i++) { $fp = fopen($REX[INCLUDE_PATH] . "/generated/templates/" . $gt->getValue("rex_template.id") . ".template", "w"); fputs($fp, $gt->getValue("rex_template.content")); fclose($fp); $gt->next(); } // ----------------------------------------------------------- generiere artikel deleteDir($REX[INCLUDE_PATH] . "/generated/articles", 0); // mkdir($REX[INCLUDE_PATH]."/generated/articles",0664); $gc = new sql(); $gc->setQuery("select * from rex_article"); for ($i = 0; $i < $gc->getRows(); $i++) { generateArticle($gc->getValue("id")); $gc->next(); } // ----------------------------------------------------------- generiere categorien deleteDir($REX[INCLUDE_PATH] . "/generated/categories", 0); // mkdir($REX[INCLUDE_PATH]."/generated/categories",0664); $gcc = new sql(); $gcc->setQuery("select * from rex_category"); for ($i = 0; $i < $gcc->getRows(); $i++) { generateCategory($gcc->getValue("id")); $gcc->next(); } // generateCategories(); $MSG = $I18N->msg('articles_generated') . " " . $I18N->msg('old_articles_deleted'); return $MSG; }
function getArticle($curctype = -1) { global $module_id, $FORM, $REX_USER, $REX, $REX_SESSION, $REX_ACTION, $I18N; // ctype var festlegung komischer umweg $a = $this->ctype_var; ${$a} = $curctype; $sliceLimit = ''; if ($this->getSlice) { //$REX['GG'] = 0; $sliceLimit = " and " . $REX['TABLE_PREFIX'] . "article_slice.id = '" . $this->getSlice . "' "; } // ----- start: article caching ob_start(); if ($REX['GG'] && !$this->getSlice) { if ($this->article_id != 0) { $this->contents = ""; $filename = $REX['INCLUDE_PATH'] . "/generated/articles/" . $this->article_id . "." . $this->clang . ".content"; if ($fd = @fopen($filename, "r")) { $this->contents = fread($fd, filesize($filename)); fclose($fd); eval($this->contents); } } } else { if ($this->article_id != 0) { // ---------- alle teile/slices eines artikels auswaehlen $sql = "select " . $REX['TABLE_PREFIX'] . "modultyp.id, " . $REX['TABLE_PREFIX'] . "modultyp.name, " . $REX['TABLE_PREFIX'] . "modultyp.ausgabe, " . $REX['TABLE_PREFIX'] . "modultyp.eingabe, " . $REX['TABLE_PREFIX'] . "modultyp.php_enable, " . $REX['TABLE_PREFIX'] . "modultyp.html_enable, " . $REX['TABLE_PREFIX'] . "article_slice.*, " . $REX['TABLE_PREFIX'] . "article.re_id\r\n from\r\n " . $REX['TABLE_PREFIX'] . "article_slice\r\n left join " . $REX['TABLE_PREFIX'] . "modultyp on " . $REX['TABLE_PREFIX'] . "article_slice.modultyp_id=" . $REX['TABLE_PREFIX'] . "modultyp.id\r\n left join " . $REX['TABLE_PREFIX'] . "article on " . $REX['TABLE_PREFIX'] . "article_slice.article_id=" . $REX['TABLE_PREFIX'] . "article.id\r\n where\r\n " . $REX['TABLE_PREFIX'] . "article_slice.article_id='" . $this->article_id . "' and\r\n " . $REX['TABLE_PREFIX'] . "article_slice.clang='" . $this->clang . "' and\r\n " . $REX['TABLE_PREFIX'] . "article.clang='" . $this->clang . "'"; $sql .= $sliceLimit; $sql .= "order by\r\n " . $REX['TABLE_PREFIX'] . "article_slice.re_article_slice_id"; //print $sql; $this->CONT = new sql(); $this->CONT->setQuery($sql); // ---------- SLICE IDS/MODUL SETZEN - speichern der daten for ($i = 0; $i < $this->CONT->getRows(); $i++) { $RE_CONTS[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue($REX['TABLE_PREFIX'] . "article_slice.id"); $RE_CONTS_CTYPE[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue($REX['TABLE_PREFIX'] . "article_slice.ctype"); $RE_MODUL_OUT[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue($REX['TABLE_PREFIX'] . "modultyp.ausgabe"); $RE_MODUL_IN[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue($REX['TABLE_PREFIX'] . "modultyp.eingabe"); $RE_MODUL_ID[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue($REX['TABLE_PREFIX'] . "modultyp.id"); $RE_MODUL_NAME[$this->CONT->getValue("re_article_slice_id")] = $this->CONT->getValue($REX['TABLE_PREFIX'] . "modultyp.name"); $RE_C[$this->CONT->getValue("re_article_slice_id")] = $i; $this->CONT->nextValue(); } // ---------- moduleselect: nur module nehmen auf die der user rechte hat if ($this->mode == "edit") { $MODULE = new sql(); $MODULE->setQuery("select * from " . $REX['TABLE_PREFIX'] . "modultyp order by name"); $MODULESELECT = new select(); $MODULESELECT->set_name("module_id"); $MODULESELECT->set_size(1); $MODULESELECT->set_style("width:100%;"); $MODULESELECT->set_selectextra("onchange='this.form.submit();'"); $MODULESELECT->add_option("---------------------------- " . $I18N->msg("add_block"), ''); for ($i = 0; $i < $MODULE->getRows(); $i++) { if ($REX_USER->isValueOf("rights", "module[" . $MODULE->getValue("id") . "]") || $REX_USER->isValueOf("rights", "admin[]")) { $MODULESELECT->add_option($MODULE->getValue("name"), $MODULE->getValue("id")); } $MODULE->next(); } } // ---------- SLICE IDS SORTIEREN UND AUSGEBEN $I_ID = 0; $PRE_ID = 0; $LCTSL_ID = 0; $this->article_content = ""; $this->CONT->resetCounter(); $tbl_head = "<table width=100% cellspacing=0 cellpadding=5 border=0><tr><td class=lblue>"; $tbl_bott = "</td></tr></table>"; for ($i = 0; $i < $this->CONT->getRows(); $i++) { // ----- ctype unterscheidung if ($i == 0 && $this->mode != "edit") { $this->article_content = "<?php if (\$" . $this->ctype_var . " == '" . $RE_CONTS_CTYPE[$I_ID] . "' || (\$" . $this->ctype_var . " == '-1')) { ?>"; } // ------------- EINZELNER SLICE - AUSGABE $this->CONT->counter = $RE_C[$I_ID]; $slice_content = ""; $SLICE_SHOW = TRUE; if ($this->mode == "edit") { $this->ViewSliceId = $RE_CONTS[$I_ID]; $amodule = "\r\n <table cellspacing=0 cellpadding=5 border=0 width=100%>\r\n <form action=index.php"; if ($this->setanker) { $amodule .= "#addslice"; } $amodule .= " method=get>\r\n <input type=hidden name=article_id value={$this->article_id}>\r\n <input type=hidden name=page value=content>\r\n <input type=hidden name=mode value={$this->mode}>\r\n <input type=hidden name=slice_id value={$I_ID}>\r\n <input type=hidden name=function value=add>\r\n <input type=hidden name=clang value=" . $this->clang . ">\r\n <input type=hidden name=ctype value=" . $this->ctype . ">\r\n <tr>\r\n <td class=dblue>" . $MODULESELECT->out() . "</td>\r\n </tr></form></table>"; // ----- add select box einbauen if ($this->function == "add" && $this->slice_id == $I_ID) { $slice_content = $this->addSlice($I_ID, $module_id); } else { $slice_content .= $amodule; } // ----- edit / delete if ($REX_USER->isValueOf("rights", "module[" . $RE_MODUL_ID[$I_ID] . "]") || $REX_USER->isValueOf("rights", "admin[]")) { // hat rechte zum edit und delete $mne = "\r\n <a name=slice{$RE_CONTS[$I_ID]}></a>\r\n <table width=100% cellspacing=0 cellpadding=5 border=0>\r\n <tr>\r\n <td class=blue width=380><b>{$RE_MODUL_NAME[$I_ID]}</b></td>\r\n <td class=llblue align=center><a href=index.php?page=content&article_id={$this->article_id}&mode=edit&slice_id={$RE_CONTS[$I_ID]}&function=edit&clang=" . $this->clang . "&ctype=" . $this->ctype . "#slice{$RE_CONTS[$I_ID]} class=green12b>" . $I18N->msg('edit') . "</a></td>\r\n <td class=llblue align=center><a href=index.php?page=content&article_id={$this->article_id}&mode=edit&slice_id={$RE_CONTS[$I_ID]}&function=delete&clang=" . $this->clang . "&ctype=" . $this->ctype . "&save=1#slice{$RE_CONTS[$I_ID]} class=red12b onclick='return confirm(\"" . $I18N->msg('delete') . " ?\")'>" . $I18N->msg('delete') . "</a></td>"; if ($REX_USER->isValueOf("rights", "moveSlice[]")) { $mne .= "<td class=llblue><a href=index.php?page=content&article_id={$this->article_id}&mode=edit&slice_id={$RE_CONTS[$I_ID]}&function=moveup&clang=" . $this->clang . "&ctype=" . $this->ctype . "&upd=" . time() . "#slice{$RE_CONTS[$I_ID]} class=green12b><img src=pics/file_up.gif width=16 height=16 border=0 hspace=5></a><a href=index.php?page=content&article_id={$this->article_id}&mode=edit&slice_id={$RE_CONTS[$I_ID]}&function=movedown&clang=" . $this->clang . "&ctype=" . $this->ctype . "&upd=" . time() . "#slice{$RE_CONTS[$I_ID]} class=green12b><img src=pics/file_down.gif width=16 height=16 border=0></a></td>"; } $mne .= "</tr></table>"; $slice_content .= $mne . $tbl_head; if ($this->function == "edit" && $this->slice_id == $RE_CONTS[$I_ID]) { $slice_content .= $this->editSlice($RE_CONTS[$I_ID], $RE_MODUL_IN[$I_ID], $RE_CONTS_CTYPE[$I_ID]); } else { $slice_content .= $RE_MODUL_OUT[$I_ID]; } $slice_content .= $tbl_bott; $slice_content = $this->sliceIn($slice_content); } else { // ----- hat keine rechte an diesem modul $mne = "\r\n <table width=100% cellspacing=0 cellpadding=5 border=0>\r\n <tr>\r\n <td class=blue><b>{$RE_MODUL_NAME[$I_ID]}</b> | <b>" . $I18N->msg('no_editing_rights') . "</b></td>\r\n </tr>\r\n </table>"; $slice_content .= $mne . $tbl_head . $RE_MODUL_OUT[$I_ID] . $tbl_bott; $slice_content = $this->sliceIn($slice_content); } } else { // ----- wenn mode nicht edit if ($this->getSlice) { while (list($k, $v) = each($RE_CONTS)) { $I_ID = $k; } } $slice_content .= $RE_MODUL_OUT[$I_ID]; $slice_content = $this->sliceIn($slice_content); } // --------------- ENDE EINZELNER SLICE // ---------- slice in ausgabe speichern wenn ctype richtig if ($this->ctype == -1 or $this->ctype == $RE_CONTS_CTYPE[$I_ID]) { $this->article_content .= $slice_content; // last content type slice id $LCTSL_ID = $RE_CONTS[$I_ID]; } // ----- zwischenstand: ctype .. wenn ctype neu dann if if ($this->mode != "edit" && isset($RE_CONTS_CTYPE[$RE_CONTS[$I_ID]]) && $RE_CONTS_CTYPE[$I_ID] != $RE_CONTS_CTYPE[$RE_CONTS[$I_ID]] && $RE_CONTS_CTYPE[$RE_CONTS[$I_ID]] != "") { $this->article_content .= "<?php } if(\$" . $this->ctype_var . " == '" . $RE_CONTS_CTYPE[$RE_CONTS[$I_ID]] . "' || \$" . $this->ctype_var . " == '-1'){ ?>"; } // zum nachsten slice $I_ID = $RE_CONTS[$I_ID]; $PRE_ID = $I_ID; } // ----- end: ctype unterscheidung if ($this->mode != "edit" && $i > 0) { $this->article_content .= "<?php } ?>"; } // ----- add module im edit mode if ($this->mode == "edit") { if ($this->function == "add" && $this->slice_id == $LCTSL_ID) { $slice_content = $this->addSlice($LCTSL_ID, $module_id); } else { $amodule = "\r\n <table cellspacing=0 cellpadding=5 border=0 width=100%>\r\n <form action=index.php"; if ($this->setanker) { $amodule .= "#addslice"; } $amodule .= " method=get>\r\n <input type=hidden name=article_id value={$this->article_id}>\r\n <input type=hidden name=page value=content>\r\n <input type=hidden name=mode value={$this->mode}>\r\n <input type=hidden name=slice_id value={$LCTSL_ID}>\r\n <input type=hidden name=function value=add>\r\n <input type=hidden name=clang value=" . $this->clang . ">\r\n <input type=hidden name=ctype value=" . $this->ctype . ">\r\n <tr>\r\n <td class=dblue>" . $MODULESELECT->out() . "</td>\r\n </tr></form></table>"; $slice_content = $amodule; } $this->article_content .= $slice_content; } // -------------------------- schreibe content if (isset($REX['RC']) and $REX['RC']) { echo $this->article_content; } else { eval("?>" . $this->article_content); } } else { echo $I18N->msg('no_article_available'); } } // ----- end: article caching $CONTENT = ob_get_contents(); ob_end_clean(); return $CONTENT; }
function copyCategory($which, $to_cat) { ## orginal selecten $orig = new sql(); $orig->setQuery("SELECT * FROM rex_category WHERE id={$which}"); if ($to_cat != 0) { ## ziel selecten um den path zu bekomme $ziel = new sql(); $ziel->setQuery("SELECT * FROM rex_category WHERE id={$to_cat}"); $zielpath = $ziel->getValue("path") . "-" . $to_cat; } else { ## ziel is top also path $zielpath = ""; } ## neue kategorie schreiben $add = new sql(); $add->setTable("rex_category"); $add->setValue("name", $orig->getValue("name")); $add->setValue("re_category_id", $to_cat); $add->setValue("prior", $orig->getValue("prior")); $add->setValue("path", $zielpath); $add->setvalue("status", $orig->getValue("status")); $add->insert(); ## artikel kopieren order by !!! da sonst startartikel falsch $articles = new sql(); $articles->setQuery("SELECT * FROM rex_article WHERE category_id={$which} order by startpage desc"); for ($i = 0; $i < $articles->rows; $i++, $articles->next()) { copyArticle($articles->getValue("id"), $add->last_insert_id); } ## suchen nach unterkategorien und diese dann natürlich mitkopieren ## "rekursier on" hier $subcats = new sql(); $subcats->setQuery("SELECT * FROM rex_category WHERE re_category_id={$which}"); for ($i = 0; $i < $subcats->rows; $i++, $subcats->next()) { copyCategory($subcats->getValue("id"), $add->last_insert_id); } }
function getNewArticles($number_of_articles, $ignore_startpages = true, $ignore_offlines = true) { global $REX; $off = $ignore_offlines ? " and status = 1 " : ""; $nostart = $ignore_startpages ? " and startpage = 0 and id != {$REX[STARTARTIKEL_ID]}" : ""; $limit = " LIMIT 0, {$number_of_articles} "; $artlist = array(); $sql = new sql(); $sql->setQuery("select id,name,beschreibung,attribute,file,category_id,type_id,startpage,prior,path,status,online_von,online_bis,erstelldatum,suchbegriffe,template_id,checkbox01,checkbox02,checkbox03,checkbox04 from rex_article where 1=1 {$off} {$nostart} order by erstelldatum desc {$limit}"); for ($i = 0; $i < $sql->getRows(); $i++) { $artlist[] = new OOArticle($sql->getValue("id"), $sql->getValue("name"), $sql->getValue("beschreibung"), $sql->getValue("attribute"), $sql->getValue("file"), $sql->getValue("category_id"), $sql->getValue("type_id"), $sql->getValue("startpage"), $sql->getValue("prior"), $sql->getValue("path"), $sql->getValue("status"), $sql->getValue("online_von"), $sql->getValue("online_bis"), $sql->getValue("erstelldatum"), $sql->getValue("suchbegriffe"), $sql->getValue("template_id"), $sql->getValue("checkbox01"), $sql->getValue("checkbox02"), $sql->getValue("checkbox03"), $sql->getValue("checkbox04")); $sql->next(); } return $artlist; }
<?php echo "<table border=0 cellpadding=0 cellspacing=0 width=770 ><tr><td class=grey><br>"; $boards = new sql(); $boards->setQuery("select distinct board_id from rex_5_board"); if ($boards->getRows() > 0) { $currentboardname = ""; echo "<table border=0 cellpadding=5 cellspacing=1 width=100%>"; for ($i = 0; $i < $boards->getRows(); $i++) { $boardname = $boards->getValue("board_id"); echo "<tr><td class=dgrey><b><a href=index.php?page=community&subpage=board&FORM[boardname]={$boardname} class=black>{$boardname}</a></b></td></tr>"; if ($FORM[boardname] == $boardname) { $currentboardname = $boardname; } $boards->next(); } echo "</table><br>"; if ($currentboardname != "") { $board = new rex_com_board(); $board->addLink("page", "community"); $board->addLink("subpage", "board"); $board->setBoardname($currentboardname); // $board->setUserjoin("rex_2_user on rex_5_board.user_id=rex_2_user.id","rex_2_user.login"); $board->setAdmin(); $board->setAnonymous(true); echo $board->showBoard(); } } else { echo " Kein Board wurde eingetragen !<br>"; } echo "<br></td></tr></table>";
} if ($REX_USER->isValueOf("rights", "expertMode[]")) { $add_on = " [" . $KATs->getValue("id") . "]"; } else { $add_on = ""; } $KATout = " : <a href=index.php?page=structure&category_id=" . $KATs->getValue("id") . ">" . $KATs->getValue("name") . "</a>{$add_on}" . $KATout; $KATSQLpath = "-" . $KATs->getValue("id") . $KATSQLpath; $KATcategory_id = $KATs->getValue("re_category_id"); if ($KATs->getValue("id") == $category_id) { $re_category_id = $KATs->getValue("re_category_id"); } $KATebene++; break; } $KATs->next(); } if ($KATcategory_id == 0) { break; } } $KATout = " " . $I18N->msg("path") . " : <a href={$KATlink}&category_id=0>Homepage</a> " . $KATout; if ($article_id != "" and $page == "content") { if ($article->getValue("startpage") == 1) { $KATout .= " <br> " . $I18N->msg("start_article") . " : "; } else { $KATout .= " <br> " . $I18N->msg("article") . " : "; } $KATout .= "<a href=index.php?page=content&article_id={$article_id}&mode=edit>" . str_replace(" ", " ", $article->getValue("name")) . "</a>"; if ($REX_USER->isValueOf("rights", "expertMode[]")) { $KATout .= " [{$article_id}]";
if (count($key) > 0) { $query .= ", PRIMARY KEY("; for ($k = 0, reset($key); $k < count($key); $k++, next($key)) { // <-- yeah super for schleife, rock 'em hard :) $query .= current($key); if ($k + 1 != count($key)) { $query .= ","; } } $query .= ")"; } $query .= ")TYPE=MyISAM;"; $dump .= $query . "\n"; $cont = new sql(); $cont->setquery("SELECT * FROM " . $tab); for ($j = 0; $j < $cont->rows; $j++, $cont->next()) { $query = "INSERT INTO " . $tab . " VALUES ("; $cols->counter = 0; for ($k = 0; $k < $cols->rows; $k++, $cols->next()) { $con = $cont->getvalue($cols->getvalue("Field")); if (is_numeric($con)) { $query .= "'" . $con . "'"; } else { $query .= "'" . addslashes($con) . "'"; } if ($k + 1 != $cols->rows) { $query .= ","; } } $query .= ");"; $dump .= str_replace(array("\r\n", "\n"), '\\r\\n', $query) . "\n";