ich verwende das standard artikelmodul von contenido mit ein paar änderungen.
ausserdem setze ich google adsense auf meiner seite ein, dass ja bekanntlich den inhalt einer seite "versteht" und z.b. anhand der verwendeten links spezifische suchergebnisse liefert.
aus diesem grund habe ich an die links der artiklelliste rigeros die jeweilige headline des artikels angehängt - und siehe da, die suchergebnisse von google-adsense passen sich viel besser dem entsprechenden inhalt an.
mein problem ist aber, dass $head (die headline des jeweiligen artikels - siehe code) erst bei einem zweiten aufruf der artikelliste gefüllt wird.
d.h. wenn man das erste mal auf meine startseite geht, sind die links noch ohne headline. klickt man aber einen artikel im teil "AKTUELLES" an, verändern sich die links wie gewünscht, und google-adsense bringt auch die besseren ergebnisse. (http://www.allrad-test.de)
leider weiss ich nicht wie man das ändern kann, dass auch beim aufruf der startseit die links so dargestellt werden wie oben beschrieben und hoffe daher auf hilfe.
joe
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* REFERENZ MODUL / ARTIKELLISTE
*
* Artikelliste mit Img 1, Head 1, Head 2
*
* Erstellt eine Liste mit allen Artikel bis
* auf den Startartikel.
*
* Author : Jan Lengowski
* Copyright : four for business AG
************************************************/
// second db class instance
$db2 = new DB_Contenido;
// selected category
$selcat = "CMS_VALUE[0]";
if($selcat!="0" && $selcat!=""){
// select all articles in category widthout start article
$query = "SELECT ARTLANG.idart, ARTLANG.idartlang FROM ".$cfg["tab"]["cat_art"]." AS CATART, ".
$cfg["tab"]["art_lang"]." AS ARTLANG ".
"WHERE CATART.idcat = '$selcat' AND ARTLANG.idart = CATART.idart AND ARTLANG.idlang = '$lang' AND ".
"ARTLANG.online = '1' ORDER BY ARTLANG.lastmodified DESC";
// execute query
$db->query($query);
unset($articleID);
unset($linkID);
// get id's of sub articles
while ($db->next_record()) {
if (!isStartArticle($db->f("idartlang"), $selcat, $lang))
{
$articleID[] = $db->f("idartlang");
$linkID[] = $db->f("idart");
}
} // end while
// loop through subarticles
echo '
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr></tr>';
if (is_array($articleID)) {
foreach ($articleID as $key => $value) {
// select all CMS variables of the article
$sql = "SELECT * FROM ".$cfg["tab"]["content"]." WHERE idartlang = '$value' AND idtype = '1' AND typeid = '1'";
$db->query($sql);
$db->next_record();
$head = $db->f("value");
// joe
$date=$db->f("lastmodified");
// $date umwandeln in deutsches datumsformat
list($jahr, $monat,$taguhr)=split("-",$date);
list($tag, $uhr)=split(" ",$taguhr);
$date=$tag.".".$monat.".".$jahr;
if ( strlen($head) > "CMS_VALUE[3]") {
$head = substr($head, 0, "CMS_VALUE[3]");
$head .= '..';
}
// link
$link = $sess->url("front_content.php?client=$client&lang=$lang&idcat=$selcat&idart=$linkID[$key]&m=$head");
// joe
echo '<tr><td colspan="2" class="textgruen" height="22" style="border:0px; padding-left:10px"><br><font size="1">'.$date.'</font><br><a class="news" href="'.$link.'">'.urldecode($db->f("value")).'</a><br></td></tr>';
} // end while
unset($headline);
unset($text);
} // end foreach
echo '</table>';
} // end if (is_array)
?>