Seite 1 von 1
Content Allocation
Verfasst: Mo 16. Jun 2008, 19:25
von mario0511
Servus alle zusammen!
Brauche dringend Hilfe mit Content Allocation!
Ich habe versucht laut Anleitung wie in
http://forum.contenido.org/viewtopic.ph ... n&start=15 beschrieben mit dieser Technik zu arbeiten, aber ich bekomm das net hin.
Ich hab mir das Contenido installiert mit allem drum und dran,
dann habe ich versucht mit den Beispielinhalten zu arbeiten bzw. das Modul Content Allocation zu testen.
Welche Rolle dabei das Article_Include spielt blicke ich auch net. Ich bekomme da immer folgende Fehlermeldung:
Fatal error: Cannot redeclare totpl() (previously declared in D:\xampp\htdocs\contenido48\cms\front_content.php(926) : eval()'d code:272) in D:\xampp\htdocs\contenido48\cms\front_content.php(926) : eval()'d code(588) : eval()'d code on line 277
Ich habe mir nen Baum in Content Allocation angelegt, im Template habe ich das Modul Article_Include einbezogen und diverse Artikel zu bestimmten Themen hinzugefügt, aber nix da...
Kann mir Bitte jemand weiterhelfen. Ich blicks net...
Bin für jede Hilfe dankbar!!!
Verfasst: Fr 27. Jun 2008, 05:23
von emergence
ähm poste das modul...
Verfasst: Fr 27. Jun 2008, 07:12
von mario0511
Code: Alles auswählen
?><?php
/**
* $RCSfile$
*
* Description: Article Include Input
*
* @version 1.0.0
* @author Willi Man
* @copyright four for business AG <www.4fb.de>
*
* {@internal
* created 2003-12-18
* modified 2004-01-02
* modified 2005-08-05 Andreas Lindner
* }}
*
* $Id$
*/
#Get current settings
$name = "CMS_VAR[1]";
$cms_idcat = "CMS_VALUE[1]";
$cms_idcatart = "CMS_VALUE[2]";
#Cat selector
echo buildCategorySelect($name, $cms_idcat);
$bDebug = false;
if ($bDebug)
echo "<pre>cat $cms_idcat catart $cms_idcatart client $client lang $lang <br>webpath ".$cfgClient[$client]['path']['htmlpath']."</pre>";
echo '<table cellpadding="0" cellspacing="0" border="0">';
#Article selector
echo '
<tr><td class="text_medium" style="padding:5px">'.mi18n("Artikel wählen").': </td></tr>
<tr><td class="text_medium" style="padding:5px">';
echo '<select name="CMS_VAR[2]" style="width:240px">';
echo '<option value="" selected>'.i18n("Please choose").'</option>';
if ($cms_idcat != "0" && strlen($cms_idcat) > 0) {
$sql = "SELECT
a.title AS title,
b.idcatart AS idcatart
FROM
".$cfg["tab"]["art_lang"]." AS a,
".$cfg["tab"]["cat_art"]." AS b
WHERE
b.idcat = '".$cms_idcat."' AND
a.idart = b.idart AND
a.idlang = '".$lang."'";
$db->query($sql);
while ($db->next_record()) {
$catartid = $db->f('idcatart');
$title = $db->f('title');
if ($cms_idcatart != $catartid) {
echo '<option value="'.$catartid.'"> '.$title.'</option>';
} else {
echo '<option selected="selected" value="'.$catartid.'"> '.$title.'</option>';
}
}
}
echo '</select> <input type="image" src="images/submit.gif">';
echo '</td></tr></table>';
?><?php
Code: Alles auswählen
<?php
/**
* $RCSfile$
*
* Description: Article Include Output
*
* @version 1.0.0
* @author Willi Man
* @copyright four for business AG <www.4fb.de>
*
* {@internal
* created 2003-12-18
* modified 2004-01-02
* modified 2005-08-05 Andreas Lindner
* }}
*
* $Id$
*/
#Get current settings
$cms_idcat = "CMS_VALUE[1]";
$cms_idcatart = "CMS_VALUE[2]";
$bDebug = false;
#Check data
$cms_idcat = (int)$cms_idcat;
$cms_idcatart = (int)$cms_idcatart;
if ($bDebug) {
echo "<pre> cat $cms_idcat catart $cms_idcatart</pre>";
}
if ($cms_idcat >= 0 && $cms_idcatart >= 0)
{
$bArticleAvailable = false;
# Get idcat, idcatart, idart and lastmodified from the database
$sql = "SELECT A.idart AS idart, A.idcat AS idcat, A.createcode AS createcode,
A.idcatart AS idcatart, B.lastmodified AS lastmodified
FROM ".$cfg["tab"]["cat_art"]." AS A, ".$cfg["tab"]["art_lang"]." AS B
WHERE
A.idart = B.idart AND
B.online = 1 AND ";
if ($cms_idcatart == 0)
{
$sql .= "A.idcat = '" . $cms_idcat . "' ORDER BY B.lastmodified DESC"; # Only idcat specified, get latest article of category
} else {
$sql .= "A.idcatart = '" . $cms_idcatart . "'"; # Article specified
}
if ($bDebug)
{
echo "<pre>";
print_r($sql);
echo "</pre>";
}
$db->query($sql);
if ($db->next_record())
{
$bArticleAvailable = true;
$iIDCatArt = $db->f("idcatart");
$iIDCat = $db->f("idcat");
$iIDArt = $db->f("idart");
$iCreateCode = $db->f("createcode");
$sModified = $db->f("lastmodified");
}
$db->free();
# Check if category is online or protected
$sql = "SELECT public, visible
FROM " . $cfg["tab"]["cat_lang"] . "
WHERE idcat = '" . $iIDCat . "' AND idlang = '" . $lang . "'";
if ($bDebug)
{
echo "<pre>";
print_r($sql);
echo "</pre>";
}
$db->query($sql);
$db->next_record();
$iPublic = $db->f("public");
$iVisible = $db->f("visible");
$db->free();
# Check if article is online
# Not needed anymore, as only online articles are used
/* $sql = "SELECT online FROM " . $cfg["tab"]["art_lang"] . "
WHERE idart = '" . $cms_artid . "' AND idlang = '" . $lang . "'";
if ($bDebug)
{
echo "<pre>";
print_r($sql);
echo "</pre>";
}
$db->query($sql);
$db->next_record();
$online = $db->f("online");
$db->free(); */
# If the article is online and the according category is not protected and visible, include the article
if ($bArticleAvailable && $iPublic == 1 && $iVisible == 1)
{
# Check, if code creation is necessary
# Note, that createcode may be 0, but no code is available (all code for other languages will be deleted in
# front_content, if code for one language will be created). This "bug" may be fixed in future releases.
if ($iCreateCode == 0)
{
$sql = "SELECT count(*) AS CodeCount FROM " . $cfg["tab"]["code"] . "
WHERE idcatart = '" . $iIDCatArt . "' AND idlang = '" . $lang . "'";
if ($bDebug)
{
echo "<pre>";
print_r($sql);
echo "</pre>";
}
$db->query($sql);
$db->next_record();
if ($db->f("CodeCount") == 0) {
$iCreateCode = 1;
}
$db->free();
}
# Create code if necessary
if ($iCreateCode == 1)
{
cInclude('includes', 'functions.con.php');
cInclude('includes', 'functions.tpl.php');
cInclude('includes', 'functions.mod.php');
conGenerateCode($iIDCat, $iIDArt, $lang, $client);
}
# Get code from database and execute it
$sql = "SELECT code FROM " . $cfg["tab"]["code"] . "
WHERE idcatart = '" . $iIDCatArt . "' AND idlang = '" . $lang . "'";
if ($bDebug)
{
echo "<pre>";
print_r($sql);
echo "</pre>";
}
$db->query($sql);
if ($db->next_record())
{
$sCode = stripslashes($db->f("code"));
$db->free();
ob_start();
eval("?>
".$sCode."
<?php
");
$sCode = ob_get_contents();
# Clean buffer
ob_end_clean();
$iStartPos = strpos($sCode, "<!--start:content-->");
$iEndPos = strpos($sCode, "<!--end:content-->");
$iDiffLen = $iEndPos - $iStartPos;
$sCode = substr($sCode, $iStartPos, $iDiffLen);
echo $sCode;
} else {
echo "<!-- ERROR in module Article Include<pre>no code created for article to include!<br>idcat $cms_catid, idart $cms_artid, idlang $lang, idclient $client</pre>-->";
}
}
}
?>
Verfasst: Fr 27. Jun 2008, 08:06
von emergence
ähm, das modul das du da einsetzt hat aber nichts mit der content allocation zu tun...
nach deiner beschreibung nach
bzw. das Modul Content Allocation
dachte ich du hast ein bereits fertiges modul...
ein referenz modul für die content allocation gibt es leider noch nicht...
es muss aber wie eine normale artikelliste funktionieren...
die fehlermeldung seitens des moduls das du da einsetzt, hängt damit zusammen das funktionen mehrfach definiert werden...
zb du hast eine seite mit einen modul hauptnavigation und mittels article include auf der selben seite, bindest du nochmals eine seite mit dem modul hauptnavigation ein... und kurz gesagt da krachts... sprich das geht so nicht...
Verfasst: Fr 27. Jun 2008, 10:32
von mario0511
Soweit alles klar! Ich dachte mir schon das dieses Modul nichts mit dem Content Allocation zu tun hat.
...also ran an die Arbeit und ein eigenes Modul für Content Allocation schreiben! ...oder hat jemand bereits was verwertbares?!
eines versteh ich noch net so ganz:
Wieso dann der bereits erwähnte Beitrag im Forum?!
Dort wird ja Content Allocation mit dem Article Include zusammengewürfelt, ..oder? Hab ich da was falsch verstanden?
Verfasst: Sa 28. Jun 2008, 07:01
von emergence
mario0511 hat geschrieben:Dort wird ja Content Allocation mit dem Article Include zusammengewürfelt, ..oder?
also eigentlich nicht..
entwickelte 4fb die „Content Allocation“ und „Content include Technik"
die „Content include Technik" kann mittels Article Include genutzt werden, das hat aber mit der „Content Allocation“ nichts zu tun...