Original AdvancedMod Rewrite 4.6.15
keine ahnung - suche mal bitte im modrewrite.de/forum und falls du was gefunden hast, lass es uns bitte wissen ...
ich denke es sollte so gehen wie bei den verzeichnissen:
RewriteRule /pfad/zum/file.html - [L]
ich denke es sollte so gehen wie bei den verzeichnissen:
RewriteRule /pfad/zum/file.html - [L]
Suchmaschinenfreundliche URLS durch Advanced ModRewrite 4.6.x
Module: Modul Download Liste 4.6 | Halbautomatischer Artikel-Seitenwechsel 4.6.x
Amazon Wunschzettel
Module: Modul Download Liste 4.6 | Halbautomatischer Artikel-Seitenwechsel 4.6.x
Amazon Wunschzettel
-
- Beiträge: 70
- Registriert: Do 21. Sep 2006, 10:56
- Kontaktdaten:
Hallo Stefan;
Ich habe gerade ein Modul geschrieben welches aus den Artikel das PDF erzeugt und auf dem server ablegt! Nun aber mein Problem:
also im /cms verzeichniss habe ich den Order "PDF" angelegt und in diesem order befinden sich die PDF tmp's.
Wenn wenn ich jetzt meine seite besuchen:
cms/front_content.php?idcat=17&idart=33&client=1&lang=1&pdf=1
komme ich dann auf cms/pdf/tmp/17.PDF
So wenn ich aber mr einschalte futzt das ganze nicht mehr weil er dann einfach das verzeichniss /pdf/tmp hinter der URL anhängt!
Ich habe folgenden code für den Export der PDF
Die Output Variable wird hier definiert:
Hier findest du den ganzen Code des Output Moduls
http://contenido.org/forum/viewtopic.php?t=14353
Hoffe du kannst mir helfen! weil ich würde das gern mit mr version machen!
Ich habe gerade ein Modul geschrieben welches aus den Artikel das PDF erzeugt und auf dem server ablegt! Nun aber mein Problem:
also im /cms verzeichniss habe ich den Order "PDF" angelegt und in diesem order befinden sich die PDF tmp's.
Wenn wenn ich jetzt meine seite besuchen:
cms/front_content.php?idcat=17&idart=33&client=1&lang=1&pdf=1
komme ich dann auf cms/pdf/tmp/17.PDF
So wenn ich aber mr einschalte futzt das ganze nicht mehr weil er dann einfach das verzeichniss /pdf/tmp hinter der URL anhängt!
Ich habe folgenden code für den Export der PDF
Code: Alles auswählen
$pdfFile = $lang."_".$idcat.".pdf";
$pdf->Output($pdfFile, 'I');
Code: Alles auswählen
function Output($name='',$dest='')
{
//Output PDF to some destination
global $HTTP_SERVER_VARS;
//Finish document if necessary
if($this->state < 3) $this->Close();
//Normalize parameters
if(is_bool($dest)) $dest=$dest ? 'D' : 'F';
$dest=strtoupper($dest);
if($dest=='')
{
if($name=='')
{
$name='doc.pdf';
$dest='I';
}
else
$dest='F';
}
switch($dest)
{
case 'I':
//Send to standard output
if(isset($HTTP_SERVER_VARS['SERVER_NAME']))
{
//We send to a browser
Header('Content-Type: application/pdf');
if(headers_sent())
$this->Error('Some data has already been output to browser, can\'t send PDF file');
Header('Content-Length: '.strlen($this->buffer));
Header('Content-disposition: inline; filename='.$name);
}
echo $this->buffer;
break;
case 'D':
//Download file
if(isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']) and strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'],'MSIE'))
Header('Content-Type: application/force-download');
else
Header('Content-Type: application/octet-stream');
if(headers_sent())
$this->Error('Some data has already been output to browser, can\'t send PDF file');
Header('Content-Length: '.strlen($this->buffer));
Header('Content-disposition: attachment; filename='.$name);
echo $this->buffer;
break;
case 'F':
//Save to local file
$f=fopen($name,'wb');
if(!$f) $this->Error('Unable to create output file: '.$name);
fwrite($f,$this->buffer,strlen($this->buffer));
fclose($f);
break;
case 'S':
//Return as a string
return $this->buffer;
default:
$this->Error('Incorrect output destination: '.$dest);
}
return '';
}
http://contenido.org/forum/viewtopic.php?t=14353
Hoffe du kannst mir helfen! weil ich würde das gern mit mr version machen!
prob nach installation ...8.15.MR
hi,
ich habe die neueste Version mit mr installiert, modrewrite läuft aber noch nicht. kann ich auch erst ab dem wochenende (muß auf dem server noch freigeschalten werden). nun wollte ich schon mal ein paar artikel anlegen und wenn ich in den editor gehe, dort text oder html oder die front_content.php aufrufe bekomme ich folgende fehlermeldung:
wenn ich es richtig sehe, fängt dort der bereich für modrewrite an.
danke schon mal
ich habe die neueste Version mit mr installiert, modrewrite läuft aber noch nicht. kann ich auch erst ab dem wochenende (muß auf dem server noch freigeschalten werden). nun wollte ich schon mal ein paar artikel anlegen und wenn ich in den editor gehe, dort text oder html oder die front_content.php aufrufe bekomme ich folgende fehlermeldung:
Code: Alles auswählen
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/htdocs/web6/html/cms/front_content.php on line 1170
Parse error: parse error in /home/htdocs/web6/html/cms/front_content.php on line 1170
danke schon mal
Gruß nicnac
---------------
arbeite seit Contenido Version 4.4.5 mit dem System, ca. 30 Websites mit Contenido umgesetzt auf domainfactory, Strato und 1und1.
---------------
arbeite seit Contenido Version 4.4.5 mit dem System, ca. 30 Websites mit Contenido umgesetzt auf domainfactory, Strato und 1und1.
fängt dort in der zeile der bereich des modrewrite direkt in der geöffneten front_content.php an oder direkt im ausgabeoutput inkl. modulen?
vor allem welche mr version setzt du ein? die 4.6.15 oder eine vorangegangene?
ich brauche den exakten code output um was festzustellen - aber meiner ansicht nach spielt dir da ein modul einen streich, nicht modrewrite.
für mehr infos habe ich derzeit keine zeit ...
vor allem welche mr version setzt du ein? die 4.6.15 oder eine vorangegangene?
ich brauche den exakten code output um was festzustellen - aber meiner ansicht nach spielt dir da ein modul einen streich, nicht modrewrite.
für mehr infos habe ich derzeit keine zeit ...
Suchmaschinenfreundliche URLS durch Advanced ModRewrite 4.6.x
Module: Modul Download Liste 4.6 | Halbautomatischer Artikel-Seitenwechsel 4.6.x
Amazon Wunschzettel
Module: Modul Download Liste 4.6 | Halbautomatischer Artikel-Seitenwechsel 4.6.x
Amazon Wunschzettel
verstehe leider nicht was du meinst.stese hat geschrieben:fängt dort in der zeile der bereich des modrewrite direkt in der geöffneten front_content.php an oder direkt im ausgabeoutput inkl. modulen?
also ich habe am 19.10. die .15er Version runtergeladen.
hm bei den modulen wird aber nirgendwo was angemeckert. wäre natürlich auch ne variante. guido hatte mir empfohlen bei
Code: Alles auswählen
$tpl->generate('templates/'.$template);
Code: Alles auswählen
, 0,0
das wäre die zeile die angemeckert wird in der front_content.php
Code: Alles auswählen
// edit by stese - ModRewrite
ob_start();
-->> Zeile 1170 eval ("?>\n".$code."\n<?php\n");
$strAll = ob_get_contents();
ob_end_clean();
Code: Alles auswählen
<?php
/******************************************
* File : front_content.php
* Project : Contenido
* Descr : Contenido Frontend
*
* Author : Olaf Niemann,
* Jan Lengowski
*
* Created : 21.01.2003
* Modified : 21.01.2003
*
* © four for business AG
******************************************/
include_once ("config.php");
include_once ($contenido_path."includes/startup.php");
cInclude("includes", "functions.con.php");
cInclude("includes", "functions.con2.php");
cInclude("includes", "functions.api.php");
cInclude("includes", "functions.pathresolver.php");
if ($cfg["use_pseudocron"] == true)
{
/* Include cronjob-Emulator */
$oldpwd = getcwd();
chdir($cfg["path"]["contenido"].$cfg["path"]["cronjobs"]);
cInclude("includes", "pseudo-cron.inc.php");
chdir($oldpwd);
}
if ($contenido)
{
//Backend
page_open(array ('sess' => 'Contenido_Session', 'auth' => 'Contenido_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm'));
i18nInit($cfg["path"]["contenido"].$cfg["path"]["locale"], $belang);
}
else
{
//Frontend
page_open(array ('sess' => 'Contenido_Frontend_Session', 'auth' => 'Contenido_Frontend_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm'));
}
$db = new DB_Contenido;
$sess->register("cfgClient");
$sess->register("errsite_idcat");
$sess->register("errsite_idart");
$sess->register("encoding");
if ($cfgClient["set"] != "set")
{
rereadClients();
}
$sql = "SELECT
idlang,
encoding
FROM
".$cfg["tab"]["lang"];
$db->query($sql);
while ($db->next_record())
{
$encoding[$db->f("idlang")] = $db->f("encoding");
}
if (is_numeric($tmpchangelang) && $tmpchangelang > 0)
{
$savedlang = $lang;
$lang = $tmpchangelang;
}
// Change client
if (isset($changeclient)){
$client = $changeclient;
unset($lang);
unset($load_lang);
}
// Change language
if (isset($changelang)) $lang = $changelang;
// Initialize client
if (!isset($client)) {
//load_client defined in frontend/config.php
$client = $load_client;
}
// Initialize language
if (!isset($lang)) {
//if there is an entry load_lang in frontend/config.php use it, else use the first language of this client
if(isset($load_lang)){
//load_client is set in frontend/config.php
$lang = $load_lang;
}else{
$sql = "SELECT
B.idlang
FROM
".$cfg["tab"]["clients_lang"]." AS A,
".$cfg["tab"]["lang"]." AS B
WHERE
A.idclient='$client' AND
A.idlang = B.idlang
LIMIT
0,1";
$db->query($sql);
$db->next_record();
$lang = $db->f("idlang");
}
}
if (!$sess->is_registered("lang") ) $sess->register("lang");
if (!$sess->is_registered("client") ) $sess->register("client");
if (isset ($username))
{
$auth->login_if(true);
}
header("Content-Type: text/html; charset={$encoding[$lang]}");
if (isset ($logout))
{
$auth->logout(true);
$auth->unauth(true);
$auth->auth["uname"] = "nobody";
}
if (file_exists("config.local.php"))
{
@ include ("config.local.php");
}
/* If the path variable was passed, try to resolve it */
if (isset ($path))
{
/* Which resolve method is configured? */
if ($cfg["urlpathresolve"] == true)
{
$idcat = prResolvePathViaURLNames($path);
}
else
{
$idcat = prResolvePathViaCategoryNames($path);
}
}
// Fehlerseite
$errsite = "Location: front_content.php?client=$client&idcat=".$errsite_idcat[$client]."&idart=".$errsite_idart[$client]."&lang=$lang&error=1";
if ($idart && !$idcat && !$idcatart)
{
/* Try to fetch the first idcat */
$sql = "SELECT idcat FROM ".$cfg["tab"]["cat_art"]." WHERE idart='$idart'";
$db->query($sql);
if ($db->next_record())
{
$idcat = $db->f("idcat");
}
}
/* Initialize variables */
unset ($code);
unset ($markscript);
if (!$idcatart)
{
if (!$idart)
{
if (!$idcat)
{
if ($cfg["is_start_compatible"] == true)
{
$sql = "SELECT
idart,
B.idcat
FROM
".$cfg["tab"]["cat_art"]." AS A,
".$cfg["tab"]["cat_tree"]." AS B,
".$cfg["tab"]["cat"]." AS C
WHERE
A.idcat=B.idcat AND
B.idcat=C.idcat AND
is_start='1' AND
idclient='$client'
ORDER BY
idtree ASC";
}
else
{
$sql = "SELECT
A.idart,
B.idcat
FROM
".$cfg["tab"]["cat_art"]." AS A,
".$cfg["tab"]["cat_tree"]." AS B,
".$cfg["tab"]["cat"]." AS C,
".$cfg["tab"]["cat_lang"]." AS D,
".$cfg["tab"]["art_lang"]." AS E
WHERE
A.idcat=B.idcat AND
B.idcat=C.idcat AND
D.startidartlang = E.idartlang AND
D.idlang='$lang' AND
E.idart=A.idart AND
E.idlang='$lang' AND
idclient='$client'
ORDER BY
idtree ASC";
}
$db->query($sql);
if ($db->next_record())
{
$idart = $db->f("idart");
$idcat = $db->f("idcat");
}
else
{
if ($contenido)
{
cInclude("includes", "functions.i18n.php");
die(i18n("No start article for this category"));
}
else
{
if ($error == 1)
{
echo "Fatal error: Could not display error page. Error to display was: 'No start article in this category'";
}
else
{
header($errsite);
}
}
}
}
else
{
$idart = -1;
if ($cfg["is_start_compatible"] == true)
{
$sql = "SELECT idart FROM ".$cfg["tab"]["cat_art"]." WHERE idcat='".$idcat."' AND is_start='1'";
$db->query($sql);
if ($db->next_record())
{
$idart = $db->f("idart");
}
}
else
{
$sql = "SELECT startidartlang FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat='".$idcat."' AND idlang='$lang'";
$db->query($sql);
if ($db->next_record())
{
if ($db->f("startidartlang") != 0)
{
$sql = "SELECT idart FROM ".$cfg["tab"]["art_lang"]." WHERE idartlang='".$db->f("startidartlang")."'";
$db->query($sql);
$db->next_record();
$idart = $db->f("idart");
}
}
}
if ($idart != -1)
{
}
else
{
//im backend richtige Fehlermeldung
if ($contenido)
{
cInclude("includes", "functions.i18n.php");
die(i18n("No start article for this category"));
}
else
{
if ($error == 1)
{
echo "Fatal error: Could not display error page. Error to display was: 'No start article in this category'";
}
else
{
header($errsite);
}
}
}
}
}
}
else
{
$sql = "SELECT idcat, idart FROM ".$cfg["tab"]["cat_art"]." WHERE idcatart='".$idcatart."'";
$db->query($sql);
$db->next_record();
$idcat = $db->f("idcat");
$idart = $db->f("idart");
}
/* Get idcatart */
if (0 != $idart && 0 != $idcat)
{
$sql = "SELECT idcatart FROM ".$cfg["tab"]["cat_art"]." WHERE idart = '".$idart."' AND idcat = '".$idcat."'";
$db->query($sql);
$db->next_record();
$idcatart = $db->f("idcatart");
}
$idartlang = getArtLang($idart, $lang);
if ($idartlang === false)
{
header($errsite);
}
/* If user hast contenido-
backend rights. */
if ($contenido)
{
cInclude("classes", 'class.inuse.php');
cInclude("classes", 'class.user.php');
cInclude("classes", 'class.table.php');
cInclude("classes", 'class.notification.php');
$perm->load_permissions();
/* Change mode edit / view */
if (isset ($changeview))
{
$sess->register("view");
$view = $changeview;
}
$col = new InUseCollection;
if ($overrideid != "" && $overridetype != "")
{
$col->removeItemMarks($overridetype, $overrideid);
}
/* Remove all own marks */
$col->removeSessionMarks($sess->id);
/* If the override flag is set, override a specific InUseItem */
list ($inUse, $message) = $col->checkAndMark("article", $idartlang, true, i18n("Article is in use by %s (%s)"), true, "front_content.php?changeview=edit&action=con_editart&idartlang=$idartlang&type=$type&typenr=$typenr&idart=$idart&idcat=$idcat&idcatart=$idcatart&client=$client&lang=$lang");
if ($inUse == true)
{
$disabled = 'disabled="disabled"';
echo $message;
}
$sql = "SELECT locked FROM ".$cfg["tab"]["art_lang"]." WHERE idart='".$idart."' AND idlang = '".$lang."'";
$db->query($sql);
$db->next_record();
$locked = $db->f("locked");
if ($locked == 1)
{
$inUse = true;
$disabled = 'disabled="disabled"';
}
/* Check if the user
has permission to edit
articles in this category */
$allow = true;
$iterator = $_cecRegistry->getIterator("Contenido.Frontend.AllowEdit");
while ($chainEntry = $iterator->next())
{
$value = $chainEntry->execute($lang, $idcat, $idart, $auth->auth["uid"]);
if ($value === false)
{
$allow = false;
break;
}
}
if ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat) && $inUse == false && $allow == true)
{
/* Create buttons for editing */
$edit_preview = '<table cellspacing="0" cellpadding="4" border="0">';
if ($view == "edit")
{
$edit_preview = ' <tr>
<td width="18">
<a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="'.$sess->url("front_content.php?changeview=prev&idcat=$idcat&idart=$idart").'"><img src="'.$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"].'but_preview.gif" alt="Preview" title="Preview" border="0"></a>
</td>
<td width="18">
<a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="'.$sess->url("front_content.php?changeview=prev&idcat=$idcat&idart=$idart").'">Preview</a>
</td>
</tr>';
}
else
{
$edit_preview = ' <tr>
<td width="18">
<a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="'.$sess->url("front_content.php?changeview=edit&idcat=$idcat&idart=$idart").'"><img src="'.$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"].'but_edit.gif" alt="Preview" title="Preview" border="0"></a>
</td>
<td width="18">
<a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="'.$sess->url("front_content.php?changeview=edit&idcat=$idcat&idart=$idart").'">Edit</a>
</td>
</tr>';
}
/* Display articles */
if ($cfg["is_start_compatible"] == true)
{
$sql = "SELECT idart,is_start FROM ".$cfg["tab"]["cat_art"]." WHERE idcat='".$idcat."' ORDER BY idart";
$db->query($sql);
}
else
{
$sql = "SELECT idart FROM ".$cfg["tab"]["cat_art"]." WHERE idcat='".$idcat."' ORDER BY idart";
$db->query($sql);
}
$a = 1;
$edit_preview .= '<tr><td colspan="2"><table cellspacing="0" cellpadding="2" border="0"></tr><td style="font-family: verdana; font-size:10; color:#000000; text-decoration:none">Articles in category:<br>';
while ($db->next_record() && ($db->affected_rows() != 1))
{
$class = "font-family:'Verdana'; font-size:10; color:#000000; text-decoration: underline; font-weight:normal";
if (!isset ($idart))
{
if (isStartArticle(getArtLang($idart, $lang), $idcat, $lang))
{
$class = "font-family: verdana; font-size:10; color:#000000; text-decoration: underline ;font-weight:bold";
}
}
else
{
if ($idart == $db->f("idart"))
{
$class = "font-family: verdana; font-size:10; color:#000000; text-decoration: underline; font-weight:bold";
}
}
$edit_preview .= "<a style="$class" href="".$sess->url("front_content.php?idart=".$db->f("idart")."&idcat=$idcat")."">$a</a> ";
$a ++;
}
$edit_preview .= '</td></tr></table></td></tr></table>';
}
} // end if $contenido
/* If mode is 'edit' and user has permissoion
edit articles in this idcat */
if ($inUse == false && $allow == true && $view == "edit" && ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat)))
{
cInclude("includes", "functions.tpl.php");
cInclude("includes", "functions.con.php");
include ($cfg["path"]["contenido"].$cfg["path"]["includes"]."include.con_editcontent.php");
}
else
{
/* Mark submenuitem 'Preview' */
if ($contenido)
{
$markscript = markSubMenuItem(4, true);
}
unset($edit); // disable editmode
/* 'mode' is preview or article displayed
in the front-end */
$sql = "SELECT
createcode
FROM
".$cfg["tab"]["cat_art"]."
WHERE
idcat = '".$idcat."' AND
idart = '".$idart."'";
$db->query($sql);
$db->next_record();
/* Check if code is expired,
create new code if needed */
if ($db->f("createcode") == 0 && $force == 0)
{
$sql = "SELECT code FROM ".$cfg["tab"]["code"]." WHERE idcatart = '".$idcatart."' AND idlang = '".$lang."'";
$db->query($sql);
if ($db->num_rows() == 0)
{
/* Include here for performance reasons */
cInclude("includes", "functions.tpl.php");
conGenerateCode($idcat, $idart, $lang, $client);
$sql = "SELECT code FROM ".$cfg["tab"]["code"]." WHERE idcatart = '".$idcatart."' AND idlang = '".$lang."'";
$db->query($sql);
}
if ($db->next_record())
{
$code = stripslashes($db->f("code"));
}
else
{
if ($contenido)
$code = "echo "No code available.";";
else
{
if ($error == 1)
{
echo "Fatal error: Could not display error page. Error to display was: 'No code available'";
}
else
{
header($errsite);
}
}
}
}
else
{
$sql = "DELETE FROM ".$cfg["tab"]["code"]." WHERE idcatart = '".$idcatart."'";
$db->query($sql);
// echo "creating code for idcat:$idcat, idart:$idart, lang:$lang, client:$client<br><br>";
cInclude("includes", "functions.con.php");
cInclude("includes", "functions.tpl.php");
cInclude("includes", "functions.mod.php");
conGenerateCode($idcat, $idart, $lang, $client);
$sql = "SELECT code FROM ".$cfg["tab"]["code"]." WHERE idcatart = '".$idcatart."' AND idlang = '".$lang."'";
$db->query($sql);
$db->next_record();
$code = stripslashes($db->f("code"));
}
/* Add mark Script to code */
$code = preg_replace("/<\/head>/i", "$markscript\n</head>", $code);
/* Check if category is public */
$sql = "SELECT public FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat='".$idcat."' AND idlang='".$lang."'";
$db->query($sql);
$db->next_record();
$public = $db->f("public");
if ($public == 0)
{
if ($auth->auth["uid"] == "nobody")
{
$sql = "SELECT user_id, value FROM ".$cfg["tab"]["user_prop"]." WHERE type='frontend' and name='allowed_ip'";
$db->query($sql);
while ($db->next_record())
{
$user_id = $db->f("user_id");
$range = urldecode($db->f("value"));
$slash = strpos($range, "/");
if ($slash == false)
{
$netmask = "255.255.255.255";
$network = $range;
}
else
{
$network = substr($range, 0, $slash);
$netmask = substr($range, $slash +1, strlen($range) - $slash -1);
}
if (IP_match($network, $netmask, $_SERVER["REMOTE_ADDR"]))
{
$sql = "SELECT idright
FROM ".$cfg["tab"]["rights"]." AS A,
".$cfg["tab"]["actions"]." AS B,
".$cfg["tab"]["area"]." AS C
WHERE B.name = 'front_allow' AND C.name = 'str' AND A.user_id = '".$user_id."' AND A.idcat = '$idcat'
AND A.idarea = C.idarea AND B.idaction = A.idaction";
$db2 = new DB_Contenido;
$db2->query($sql);
if ($db2->num_rows() > 0)
{
$auth->auth["uid"] = $user_id;
$validated = 1;
}
}
}
if ($validated != 1)
{
$allow = false;
$iterator = $_cecRegistry->getIterator("Contenido.Frontend.CategoryAccess");
while ($chainEntry = $iterator->next())
{
$value = $chainEntry->execute($lang, $idcat, $auth->auth["uid"]);
if ($value === true)
{
$allow = true;
break;
}
}
$auth->login_if(!$allow);
}
}
else
{
$allow = false;
$iterator = $_cecRegistry->getIterator("Contenido.Frontend.CategoryAccess");
while ($chainEntry = $iterator->next())
{
$value = $chainEntry->execute($lang, $idcat, $auth->auth["uid"]);
if ($value === true)
{
$allow = true;
break;
}
}
if (!$allow)
{
header($errsite);
}
}
}
/* Sanity: If the stat table doesn't contain an entry, create one */
$sql = "SELECT idcatart FROM ".$cfg["tab"]["stat"]." WHERE idcatart = '$idcatart' AND idlang='$lang'";
$db->query($sql);
if ($db->next_record())
{
/* Update the statistics. */
$sql = "UPDATE ".$cfg["tab"]["stat"]." SET visited = visited + 1 WHERE idcatart = '".$idcatart."' AND idclient = '$client' AND idlang = '".$lang."'";
$db->query($sql);
}
else
{
/* Insert new record */
$next = $db->nextid($cfg["tab"]["stat"]);
$sql = "INSERT INTO ".$cfg["tab"]["stat"]." (visited, idcatart, idlang, idstat, idclient) VALUES ('1', '$idcatart', '$lang', '$next', '$client')";
$db->query($sql);
}
/* Check for redirect.
Properties for the redirect are
choosen in the article properties */
if ($cfg["is_start_compatible"] == true)
{
$sql = "SELECT is_start FROM ".$cfg["tab"]["cat_art"]." WHERE idcatart='".$idcatart."'";
$db->query($sql);
$db->next_record();
$isstart = $db->f("is_start");
}
else
{
$sql = "SELECT startidartlang FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat='$idcat' AND idlang = '$lang'";
$db->query($sql);
$db->next_record();
if ($db->f("idartlang") == $idartlang)
{
$isstart = 1;
}
else
{
$isstart = 0;
}
}
$sql = "SELECT timemgmt FROM ".$cfg["tab"]["art_lang"]." WHERE idart='".$idart."' AND idlang = '".$lang."'";
$db->query($sql);
$db->next_record();
if (($db->f("timemgmt") == "1") && ($isstart != 1))
{
$sql = "SELECT online, redirect, redirect_url FROM ".$cfg["tab"]["art_lang"]." WHERE idart='".$idart."' AND idlang = '".$lang."' AND NOW() > datestart AND NOW() < dateend";
}
else
{
$sql = "SELECT online, redirect, redirect_url FROM ".$cfg["tab"]["art_lang"]." WHERE idart='".$idart."' AND idlang = '".$lang."'";
}
$db->query($sql);
$db->next_record();
$online = $db->f("online");
$redirect = $db->f("redirect");
$redirect_url = $db->f("redirect_url");
@ eval ("\$"."redirect_url = "$redirect_url";"); // transform variables
$insert_base = getEffectiveSetting('generator', 'basehref', true);
if ($insert_base == "true")
{
$is_XHTML = getEffectiveSetting('generator', 'xhtml', false);
if ($is_XHTML == true) {
$baseCode = '<base href="'.$cfgClient[$client]["path"]["htmlpath"].'" />';
} else {
$baseCode = '<base href="'.$cfgClient[$client]["path"]["htmlpath"].'">';
}
$code = str_ireplace_once("<head>", "<head>\n".$baseCode, $code);
}
if ($online)
{
if ($redirect == '1' && $redirect_url != '')
{
page_close();
header("Location: $redirect_url");
exit;
}
else
{
if ($cfg["debug"]["codeoutput"])
{
echo "<textarea>".htmlspecialchars($code)."</textarea>";
}
eval ("?>\n".$code."\n<?php\n");
}
}
else
{
if ($contenido)
{
eval ("?>\n".$code."\n<?php\n");
}
else
{
if ($error == 1)
{
echo "Fatal error: Could not display error page. Error to display was: 'No contenido session variable set. Probable error cause: Start article in this category is not set on-line.'";
}
else
{
header($errsite);
}
}
}
}
if (file_exists("config.after.php"))
{
@ include ("config.after.php");
}
function IP_match($network, $mask, $ip)
{
bcscale(3);
$ip_long = ip2long($ip);
$mask_long = ip2long($network);
#
# Convert mask to divider
#
if (ereg("^[0-9]+$", $mask))
{
/// 212.50.13.0/27 style mask (Cisco style)
$divider = bcpow(2, (32 - $mask));
}
else
{
/// 212.50.13.0/255.255.255.0 style mask
$xmask = ip2long($mask);
if ($xmask < 0)
$xmask = bcadd(bcpow(2, 32), $xmask);
$divider = bcsub(bcpow(2, 32), $xmask);
}
#
# Test is IP within specified mask
#
if (floor(bcdiv($ip_long, $divider)) == floor(bcdiv($mask_long, $divider)))
{
# match - this IP is within specified mask
return true;
}
else
{
# fail - this IP is NOT within specified mask
return false;
}
}
if (isset ($savedlang))
{
$lang = $savedlang;
}
page_close();
?>
& $force == 0)
{
$sql = "SELECT code FROM ".$cfg["tab"]["code"]." WHERE idcatart = '".$idcatart."' AND idlang = '".$lang."'";
$db->query($sql);
if ($db->num_rows() == 0)
{
/* Include here for performance reasons */
cInclude("includes", "functions.tpl.php");
conGenerateCode($idcat, $idart, $lang, $client);
$sql = "SELECT code FROM ".$cfg["tab"]["code"]." WHERE idcatart = '".$idcatart."' AND idlang = '".$lang."'";
$db->query($sql);
}
if ($db->next_record())
{
$code = stripslashes($db->f("code"));
}
else
{
if ($contenido)
$code = "echo "No code available.";";
else
{
if ($error == 1)
{
echo "Fatal error: Could not display error page. Error to display was: 'No code available'";
}
else
{
header($errsite);
}
}
}
}
else
{
$sql = "DELETE FROM ".$cfg["tab"]["code"]." WHERE idcatart = '".$idcatart."'";
$db->query($sql);
cInclude("includes", "functions.con.php");
cInclude("includes", "functions.tpl.php");
cInclude("includes", "functions.mod.php");
conGenerateCode($idcat, $idart, $lang, $client);
$sql = "SELECT code FROM ".$cfg["tab"]["code"]." WHERE idcatart = '".$idcatart."' AND idlang = '".$lang."'";
$db->query($sql);
$db->next_record();
$code = stripslashes($db->f("code"));
}
/* Add mark Script to code if user is in the backend */
$code = preg_replace("/<\/head>/i", "$markscript\n</head>", $code);
/* Check if category is public */
$sql = "SELECT public FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat='".$idcat."' AND idlang='".$lang."'";
$db->query($sql);
$db->next_record();
$public = $db->f("public");
##############################################
# protected categories
##############################################
if ($public == 0)
{
if ($auth->auth["uid"] == "nobody")
{
$sql = "SELECT user_id, value FROM ".$cfg["tab"]["user_prop"]." WHERE type='frontend' and name='allowed_ip'";
$db->query($sql);
while ($db->next_record())
{
$user_id = $db->f("user_id");
$range = urldecode($db->f("value"));
$slash = strpos($range, "/");
if ($slash == false)
{
$netmask = "255.255.255.255";
$network = $range;
}
else
{
$network = substr($range, 0, $slash);
$netmask = substr($range, $slash +1, strlen($range) - $slash -1);
}
if (IP_match($network, $netmask, $_SERVER["REMOTE_ADDR"]))
{
$sql = "SELECT idright
FROM ".$cfg["tab"]["rights"]." AS A,
".$cfg["tab"]["actions"]." AS B,
".$cfg["tab"]["area"]." AS C
WHERE B.name = 'front_allow' AND C.name = 'str' AND A.user_id = '".$user_id."' AND A.idcat = '$idcat'
AND A.idarea = C.idarea AND B.idaction = A.idaction";
$db2 = new DB_Contenido;
$db2->query($sql);
if ($db2->num_rows() > 0)
{
$auth->auth["uid"] = $user_id;
$validated = 1;
}
}
}
if ($validated != 1)
{
$allow = false;
$iterator = $_cecRegistry->getIterator("Contenido.Frontend.CategoryAccess");
while ($chainEntry = $iterator->next())
{
$value = $chainEntry->execute($lang, $idcat, $auth->auth["uid"]);
if ($value === true)
{
$allow = true;
break;
}
}
$auth->login_if(!$allow);
}
}
else
{
$allow = false;
$iterator = $_cecRegistry->getIterator("Contenido.Frontend.CategoryAccess");
while ($chainEntry = $iterator->next())
{
$value = $chainEntry->execute($lang, $idcat, $auth->auth["uid"]);
if ($value === true)
{
$allow = true;
break;
}
}
if (!$allow)
{
header($errsite);
}
}
}
##############################################
# statistic
##############################################
/* Sanity: If the statistic table doesn't contain an entry, create one */
$sql = "SELECT idcatart FROM ".$cfg["tab"]["stat"]." WHERE idcatart = '$idcatart' AND idlang='$lang'";
$db->query($sql);
if ($db->next_record())
{
/* Update the statistics. */
$sql = "UPDATE ".$cfg["tab"]["stat"]." SET visited = visited + 1 WHERE idcatart = '".$idcatart."' AND idclient = '$client' AND idlang = '".$lang."'";
$db->query($sql);
}
else
{
/* Insert new record */
$next = $db->nextid($cfg["tab"]["stat"]);
$sql = "INSERT INTO ".$cfg["tab"]["stat"]." (visited, idcatart, idlang, idstat, idclient) VALUES ('1', '$idcatart', '$lang', '$next', '$client')";
$db->query($sql);
}
/*
* Check if an article is start article of the category
*/
if ($cfg["is_start_compatible"] == true)
{
$sql = "SELECT is_start FROM ".$cfg["tab"]["cat_art"]." WHERE idcatart='".$idcatart."'";
$db->query($sql);
$db->next_record();
$isstart = $db->f("is_start");
}
else
{
$sql = "SELECT startidartlang FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat='$idcat' AND idlang = '$lang'";
$db->query($sql);
$db->next_record();
if ($db->f("idartlang") == $idartlang)
{
$isstart = 1;
}
else
{
$isstart = 0;
}
}
##############################################
# time management
##############################################
$sql = "SELECT timemgmt FROM ".$cfg["tab"]["art_lang"]." WHERE idart='".$idart."' AND idlang = '".$lang."'";
$db->query($sql);
$db->next_record();
if (($db->f("timemgmt") == "1") && ($isstart != 1))
{
$sql = "SELECT online, redirect, redirect_url FROM ".$cfg["tab"]["art_lang"]." WHERE idart='".$idart."' AND idlang = '".$lang."' AND NOW() > datestart AND NOW() < dateend";
}
else
{
$sql = "SELECT online, redirect, redirect_url FROM ".$cfg["tab"]["art_lang"]." WHERE idart='".$idart."' AND idlang = '".$lang."'";
}
$db->query($sql);
$db->next_record();
$online = $db->f("online");
$redirect = $db->f("redirect");
$redirect_url = $db->f("redirect_url");
@ eval ("\$"."redirect_url = "$redirect_url";"); // transform variables
$insert_base = getEffectiveSetting('generator', 'basehref', "true");
/*
* generate base url
*/
if ($insert_base == "true")
{
$is_XHTML = getEffectiveSetting('generator', 'xhtml', "false");
$str_base_uri = $cfgClient[$client]["path"]["htmlpath"];
$_cecIterator = $_cecRegistry->getIterator("Contenido.Frontend.BaseHrefGeneration");
if ($_cecIterator->count() > 0)
{
while ($chainEntry = $_cecIterator->next())
{
$str_base_uri = $chainEntry->execute($str_base_uri);
}
}
if ($is_XHTML == "true") {
$baseCode = '<base href="'.$str_base_uri.'" />';
} else {
$baseCode = '<base href="'.$str_base_uri.'">';
}
$code = str_ireplace_once("<head>", "<head>\n".$baseCode, $code);
}
/*
* Handle online (offline) articles
*/
if ($online)
{
if ($redirect == '1' && $redirect_url != '')
{
// edit by stese - ModRewrite
if ( $cfg['mod_rewrite']['use'] == 1 ) {
if ( preg_match ( "/^front_content\.php(.*|.+?)/i", $redirect_url, $arr_hits ) == 1 ) {
$redirect_url = ModRewrite::build_new_url($arr_hits[1], false);
}
}
// end edit
page_close();
/*
* Redirect to the URL defined in article properties
*/
header("Location: $redirect_url");
exit;
}
else
{
if ($cfg["debug"]["codeoutput"])
{
echo "<textarea>".htmlspecialchars($code)."</textarea>";
}
/*
* That's it! The code of an article will be evaluated.
* The code of an article is basically a PHP script which is cached in the database.
* Layout and Modules are merged depending on the Container definitions of the Template.
*/
// edit by stese - ModRewrite
ob_start();
eval ("?>\n".$code."\n<?php\n");
$strAll = ob_get_contents();
ob_end_clean();
// mod rewrite is activated
if ( $cfg['mod_rewrite']['use'] == 1 ) {
$sseStarttime = getmicrotime();
// edit 060603 - anchor hack
$strAll = preg_replace_callback(
"/<a([^>]*)href\s*=\s*["|\']#(.?|.+?)["|\']([^>]*)>/i",
create_function( '$arr_matches' , 'return ModRewrite::rewrite_html_anchor($arr_matches);' ),
$strAll
);
// ok let it beginn, start mod rewrite class
$strAll = preg_replace_callback(
"/(["|\'|=])front_content\.php(.?|.+?)(["|\'|>])/i",
create_function( '$arr_matches' , 'return $arr_matches[1] . ModRewrite::build_new_url($arr_matches[2]) . $arr_matches[3];' ),
$strAll
);
$sseEndtime = getmicrotime();
} else {
// anchor hack for non modrewrite websites
$strAll = preg_replace_callback(
"/<a([^>]*)href\s*=\s*["|\']#(.?|.+?)["|\']([^>]*)>/i",
create_function( '$arr_matches' , 'return ModRewrite::contenido_html_anchor($arr_matches, $GLOBALS["is_XHTML"]);' ),
$strAll
);
}
print ($strAll);
// print "\n\n<!-- modrewrite generation time: " . ($sseEndtime - $sseStarttime) . " seconds -->";
// end edit
}
}
else
{
# if user is in the backend display offline articles
if ($contenido)
{
eval ("?>\n".$code."\n<?php\n");
}
else
{
if ($error == 1)
{
echo "Fatal error: Could not display error page. Error to display was: 'No contenido session variable set. Probable error cause: Start article in this category is not set on-line.'";
}
else
{
header($errsite);
}
}
}
}
/*
* configuration settings after the site is displayed.
*/
if (file_exists("config.after.php"))
{
@ include ("config.after.php");
}
if (isset ($savedlang))
{
$lang = $savedlang;
}
page_close();
/**
* IP_match
*
* @param string $network
* @param string $mask
* @param string $ip
* @return boolean
*/
function IP_match($network, $mask, $ip)
{
bcscale(3);
$ip_long = ip2long($ip);
$mask_long = ip2long($network);
#
# Convert mask to divider
#
if (ereg("^[0-9]+$", $mask))
{
/// 212.50.13.0/27 style mask (Cisco style)
$divider = bcpow(2, (32 - $mask));
}
else
{
/// 212.50.13.0/255.255.255.0 style mask
$xmask = ip2long($mask);
if ($xmask < 0)
$xmask = bcadd(bcpow(2, 32), $xmask);
$divider = bcsub(bcpow(2, 32), $xmask);
}
#
# Test is IP within specified mask
#
if (floor(bcdiv($ip_long, $divider)) == floor(bcdiv($mask_long, $divider)))
{
# match - this IP is within specified mask
return true;
}
else
{
# fail - this IP is NOT within specified mask
return false;
}
}
?>
Gruß nicnac
---------------
arbeite seit Contenido Version 4.4.5 mit dem System, ca. 30 Websites mit Contenido umgesetzt auf domainfactory, Strato und 1und1.
---------------
arbeite seit Contenido Version 4.4.5 mit dem System, ca. 30 Websites mit Contenido umgesetzt auf domainfactory, Strato und 1und1.
irgendwie schaut meine front_content anders aus, denn da sind die ersten
50 zeilen nur kommentare von 4fb.
sprich erstens scheinst du beim upgrade vergessen zu haben den inhalt des
cms ordners (also die php dateien) mit zu kopieren und 2. meinte ich nicht
den quellcode der datei front_content.php sondern den kompletten
zusammengefügten ausgabebereich mit inkl. der module.
das stellt man ein indem man in der contenido/includes/config.misc.php
die variable: $cfg["debug"]["codeoutput"] = false; auf true setzt, so dass im
frontend dann beim aufruf der website ganz oben als allererstes ein kleines
textaera feld auftaucht, wo der komplette code der seite erscheint. dann
muss man dort in zeile 1170 schauen
50 zeilen nur kommentare von 4fb.
sprich erstens scheinst du beim upgrade vergessen zu haben den inhalt des
cms ordners (also die php dateien) mit zu kopieren und 2. meinte ich nicht
den quellcode der datei front_content.php sondern den kompletten
zusammengefügten ausgabebereich mit inkl. der module.
das stellt man ein indem man in der contenido/includes/config.misc.php
die variable: $cfg["debug"]["codeoutput"] = false; auf true setzt, so dass im
frontend dann beim aufruf der website ganz oben als allererstes ein kleines
textaera feld auftaucht, wo der komplette code der seite erscheint. dann
muss man dort in zeile 1170 schauen
Suchmaschinenfreundliche URLS durch Advanced ModRewrite 4.6.x
Module: Modul Download Liste 4.6 | Halbautomatischer Artikel-Seitenwechsel 4.6.x
Amazon Wunschzettel
Module: Modul Download Liste 4.6 | Halbautomatischer Artikel-Seitenwechsel 4.6.x
Amazon Wunschzettel
stese hat geschrieben:sprich erstens scheinst du beim upgrade vergessen zu haben den inhalt des cms ordners (also die php dateien) mit zu kopieren
habe gerade mal nachgeschaut, sind die aktuellen dateien...
genau das hatte ich ja nicht verstanden. danke für den tipp wie man das macht.stese hat geschrieben:und 2. meinte ich nicht
den quellcode der datei front_content.php sondern den kompletten
zusammengefügten ausgabebereich mit inkl. der module.
Gruß nicnac
---------------
arbeite seit Contenido Version 4.4.5 mit dem System, ca. 30 Websites mit Contenido umgesetzt auf domainfactory, Strato und 1und1.
---------------
arbeite seit Contenido Version 4.4.5 mit dem System, ca. 30 Websites mit Contenido umgesetzt auf domainfactory, Strato und 1und1.
hm. da kriege ich im frontend trotzdem nur die fehlermeldung...
Code: Alles auswählen
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/htdocs/web6/html/cms/front_content.php on line 1170
Parse error: parse error in /home/htdocs/web6/html/cms/front_content.php on line 1170
Gruß nicnac
---------------
arbeite seit Contenido Version 4.4.5 mit dem System, ca. 30 Websites mit Contenido umgesetzt auf domainfactory, Strato und 1und1.
---------------
arbeite seit Contenido Version 4.4.5 mit dem System, ca. 30 Websites mit Contenido umgesetzt auf domainfactory, Strato und 1und1.
bist du sicher? meine front_content.php
fängt so an:
und dann poste mal die betreffende zeile 1150 - 1190 aus dem textfeld damit man weiss welche zeilen nun tatsächlich verantwortlich sind
fängt so an:
Code: Alles auswählen
<?php
/****************************************************************
* $RCSfile: front_content.php,v $
*
* Project: Contenido Content Management System
*
* Description:
*
* This file handles the view of an article.
*
* To handle the page we use the Database Abstraction Layer, the Session, Authentication and Permissions Handler of the
* PHPLIB application development toolkit.
*
* The Client Id and the Language Id of an article will be determined depending on file __FRONTEND_PATH__/config.php where
* $load_lang and $load_client are defined.
* Depending on http globals via e.g. front_content.php?idcat=41&idart=34
* the most important Contenido globals $idcat (Category Id), $idart (Article Id), $idcatart, $idartlang will be determined.
*
* The article can be displayed and edited in the Backend or the Frontend.
* The attributes of an article will be considered (an article can be online, offline or protected ...).
*
* It is possible to customize the behavior by including the file __FRONTEND_PATH__/config.local.php or
* the file __FRONTEND_PATH__/config.after.php
*
* If you use 'Frontend User' for protected areas, the category access permission will by handled via the
* Contenido Extension Chainer.
*
* Finally the 'code' of an article will by evaluated and displayed.
*
* @author Olaf Niemann, Jan Lengowski, Timo A. Hummel et al.
* @version 4.6.0
* @see http://www.contenido.org
* @see ./docs/techref/
* @see ./docs/techref/plugins/Contenido Extension Chainer.pdf
*
* TODO:
* The startup process and the way to handle the view of an article has to be redesigned.
* A coding convention has to be implemented. Obviously the code below is old programming style.
* The Contenido Architecture has to be redesigned.
*
* NOTE:
* If you edit this file you must synchronise the files
* ./contenido/external/frontend/front_content.php
* and
* ./contenido/external/backendedit/front_content.php
*
* created 2003/01/21
* modified $Date: 2006/08/04 16:33:51 $
*
* © four for business AG, www.4fb.de
*
* This file is part of the Contenido Content Management System.
*
* $Id: front_content.php,v 1.79 2006/08/04 16:33:51 willi.man Exp $
****************************************************************/
Suchmaschinenfreundliche URLS durch Advanced ModRewrite 4.6.x
Module: Modul Download Liste 4.6 | Halbautomatischer Artikel-Seitenwechsel 4.6.x
Amazon Wunschzettel
Module: Modul Download Liste 4.6 | Halbautomatischer Artikel-Seitenwechsel 4.6.x
Amazon Wunschzettel
so. ich habe es noch mal geprüft. Die Variable ist richtig auf true gesetzt und zusätzlich habe ich alle Module ausgestellt (um zu checken ob ein Modul eine fehlerhafte Ausgabe hervorruft) und wenn ich die .../cms/front_content.php aufrufe erhalte ich kein textarea sondern nur die besagte Fehlermeldung. also kann ich auch nichts posten.
Gruß nicnac
---------------
arbeite seit Contenido Version 4.4.5 mit dem System, ca. 30 Websites mit Contenido umgesetzt auf domainfactory, Strato und 1und1.
---------------
arbeite seit Contenido Version 4.4.5 mit dem System, ca. 30 Websites mit Contenido umgesetzt auf domainfactory, Strato und 1und1.
sorry da kann ich nicht helfen. schon mal versucht eine normal 4.6.15 zu
installieren? meine front_content ist nichtmal 1170 zeilen lang. ich vermute
es liegt nicht an MR. eher an irgend nem upload problem oder falschen
modulen oder fehlerhaften db einträgen oder sowas. denn das aktuelle
bundle läuft auf mehreren servern von mir einwandfrei.
installieren? meine front_content ist nichtmal 1170 zeilen lang. ich vermute
es liegt nicht an MR. eher an irgend nem upload problem oder falschen
modulen oder fehlerhaften db einträgen oder sowas. denn das aktuelle
bundle läuft auf mehreren servern von mir einwandfrei.
Suchmaschinenfreundliche URLS durch Advanced ModRewrite 4.6.x
Module: Modul Download Liste 4.6 | Halbautomatischer Artikel-Seitenwechsel 4.6.x
Amazon Wunschzettel
Module: Modul Download Liste 4.6 | Halbautomatischer Artikel-Seitenwechsel 4.6.x
Amazon Wunschzettel
genau das gleiche habe ich auch gerade gedacht. ich spiel einfach ne normale version rüber. sollte auch ausreichen. danke dir für die hilfe. schönen abend noch
Gruß nicnac
---------------
arbeite seit Contenido Version 4.4.5 mit dem System, ca. 30 Websites mit Contenido umgesetzt auf domainfactory, Strato und 1und1.
---------------
arbeite seit Contenido Version 4.4.5 mit dem System, ca. 30 Websites mit Contenido umgesetzt auf domainfactory, Strato und 1und1.
Mehrere Mandanten
Hallo,
In der Installationsdatei steht
wie soll dann bitte in der config.php Datei des Mandanten dieser Eintrag noch greifen?
Somit klappt doch dann garnichts mehr.
In der Installationsdatei steht
Code: Alles auswählen
3.) Domains direkt auf Mandantenverzeichnis zeigen lassen
Code: Alles auswählen
$contenido_path = "../contenido/";