Content Block bearbeiten

Begonnen von tallar, 14 Februar 2006, 19:51:37

⏪ vorheriges - nächstes ⏩

0 Mitglieder und 3 Gäste betrachten dieses Thema.

tallar

Hallo

ich habe mir mal den Conten Block zur brust genommen und wollte das nur ein bestimmter Conten im Block angezeigt wird! Nur erscheinen bei mir alle geschrieben Contents im Block woran liegt habe das Linit rausgenommen und auf des Spezielle Content verlinkt.

if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");

global $prefix;

$result = sql_query("SELECT pid, page_header, title, text FROM ".$prefix."_pages WHERE active='1'");
while(list($pid ,$page_header, $title ,$text) = sql_fetch_row($result)) {
   $content .= '
   <div style="text-indent: -8px; margin-left: 8px;">
   <strong></strong>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=3">'.$title.'</a>
   <strong></strong>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=3">'.$page_header.'</a>
   <strong></strong>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=3">'.$text.'</a>
   </div>';
   }

Ich möchte vom 3 Content nur die Überschrift dern Header und den Text in einem Block angezeigt haben!

tallar

Hallo, habe mich nochmal dran gemacht bekomme es aber nicht hin das nur der inhal von einen Conten Beitrag in einen block angezeigt wird.

wie bekomme ich es hin das nur der inhalt aus modules.php?name=Content&pa=showpage&pid=3 in einem block angezeigt wird?

jubilee

Hallo !
Dies hier :
Zitat$result = sql_query("SELECT pid, page_header, title, text FROM ".$prefix."_pages WHERE active='1'");
while(list($pid ,$page_header, $title ,$text) = sql_fetch_row($result)) {
Lädt ALLE Pages die im Content vorhanden sind.
Diese werden dann jeweils in einem DIV-Conteiner ausgegeben.
Wenn Du nur einen bestimmten Content im Block haben möchtest , machst Du das so :

$result = sql_query("SELECT pid, page_header, title, text  FROM ".$prefix."_pages WHERE pid=3");
while(list($pid, $page_header, $title, $text ) = sql_fetch_row($result)) {
$content .= '
<div style="text-indent: -8px; margin-left: 8px;">
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name='.$module_name.'&amp;pa=showpage&amp;pid='.$pid.'">'.$title.'</a>
    <strong><big>&middot;</big></strong>&nbsp;'.$page_header.'
    <strong><big>&middot;</big></strong>&nbsp;'.$title.'
    <strong><big>&middot;</big></strong>&nbsp;'.$text.'
</div>';
}


Nur als ganz vereinfachtes Beispiel !
MfG
jubilee

tallar

Jo Danke , das hat mir sehr geholfen

xcode

Hallo,

das hat mir auch geholfen... allerdings wollte ich eine spezielle Category angezeigt bekommen.... das geht dann mit  ...where (a.cid=3) AND (..) ... usw. (ich benutze den Block "gg" http://www.pragmamx.net/forum-topic-16022.0.html

Allerdings hab ich da noch eine Frage: Wie bekomme ich das hin, das nur die 10 neuesten Inhalte/Content angezeigt werden?