pragmaMx Support Forum

pragmaMx => integrierte Module => Thema gestartet von: tallar in 14 Februar 2006, 19:51:37

Titel: Content Block bearbeiten
Beitrag von: tallar in 14 Februar 2006, 19:51:37
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!
Titel: Re: Content Block bearbeiten
Beitrag von: tallar in 15 Februar 2006, 22:09:23
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?
Titel: Re: Content Block bearbeiten
Beitrag von: jubilee in 16 Februar 2006, 20:44:46
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
Titel: Re: Content Block bearbeiten
Beitrag von: tallar in 16 Februar 2006, 22:44:51
Jo Danke , das hat mir sehr geholfen
Titel: Re: Content Block bearbeiten
Beitrag von: xcode in 27 April 2006, 08:26:58
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 (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?