Aritikelliste -> External redirect, how?

Gesperrt
djavet
Beiträge: 264
Registriert: Do 22. Jan 2004, 11:31
Kontaktdaten:

Aritikelliste -> External redirect, how?

Beitrag von djavet »

Hello,

I'm not a php master and I try to include a external redirect like the "Hilfenavigation" into the the module article.
It work and find if my article are redirect in a popup window, but the problem is that I've all the article in the list with target="_blank", not only the one I wish. And If I remove the new window, it remove to all the article in the list...
How can I correct this? Here's the code (in red for th extra code in ouput):
Input:

Code: Alles auswählen

echo "<table cellspacing=\"0\" cellpadding=\"10\" border=\"0\">
        <tr>
          <td>Artikel/Seite:</td>
          <td><input type=\"text\" name=\"CMS_VAR[8]\" value=\"CMS_VALUE[8]\"></td>
        </tr>
        <tr>
          <td>Länge Texteinblendung:</td>
          <td><input type=\"text\" name=\"CMS_VAR[9]\" value=\"CMS_VALUE[9]\"></td>
        </tr>
        <tr>
          <td>Txt detail:</td>
          <td><input type=\"text\" name=\"CMS_VAR[1000]\" value=\"CMS_VALUE[1000]\"></td>
        </tr>
        <tr>
          <td>Page txt:</td>
          <td><input type=\"text\" name=\"CMS_VAR[1001]\" value=\"CMS_VALUE[1001]\"></td>
        </tr>
        <tr>
          <td>Page à txt:</td>
          <td><input type=\"text\" name=\"CMS_VAR[1002]\" value=\"CMS_VALUE[1002]\"></td>
        </tr>
      </table>";
Ouput:

Code: Alles auswählen

<?php
$anzahl = "CMS_VALUE[8]";
if($anzahl<1) {$anzahl=10;}
$laenge = "CMS_VALUE[9]";
if($laenge<1) {$laenge=100;}
$sql = "SELECT ARTLANG.idart, ARTLANG.title, CATART.idcat, ARTLANG.created, CONTENT.value, CONTENT.idtype, CONTENT.typeid
 FROM ".$cfg["tab"]["cat_art"]." AS CATART, ".$cfg["tab"]["art_lang"]." AS ARTLANG, ".$cfg["tab"]["cat"]." AS CAT, ".$cfg["tab"]["content"]." AS CONTENT
 WHERE ARTLANG.idart = CATART.idart AND CATART.idcat = CAT.idcat AND ARTLANG.idartlang=CONTENT.idartlang AND CONTENT.idtype<=2 AND CONTENT.typeid<=2 AND CAT.idcat='$idcat' AND ARTLANG.idlang = '$lang' AND ARTLANG.online = '1' AND CATART.is_start='0'
 ORDER BY ARTLANG.artsort ASC,ARTLANG.created DESC";
$db->query($sql);


if ($db->num_rows() != 0)
{
 echo "<table border=0 cellspacing=0 cellpadding=0 id=\"font\">";

$moredetailtxt = "CMS_VALUE[1000]";
$pagetxt = "CMS_VALUE[1001]";
$pagetxta = "CMS_VALUE[1002]";

$artikel = array(array());
$j=0;
 $db->next_record();
 $idart_last=$db->f("idart");
for ($i=0; $i<$db->num_rows(); $i++)
{
 $artikel[$j][0] = $db->f("idart");
 $artikel[$j][1] = $db->f("idcat");
 $artikel[$j][2] = substr($db->f("created"),8,2).".".substr($db->f("created"),5,2).".".substr($db->f("created"),2,2);
 //$artikel[$j][2] = substr($db->f("created"),8,2).".".substr($db->f("created"),5,2).".";

 while ( $idart_last==$db->f("idart") )
 {
  if ( $db->f("idtype") == 2 && $db->f("typeid") == 1 )
  {
   $html_text = strip_tags(urldecode($db->f("value")));
   $array = array ("&auml;" => "ä", "&ouml;" => "ö", "&uuml;" => "ü", "&szlig;" => "ß", "&Auml;" => "Ä", "&Ouml;" => "Ö", "&Uuml;" => "ü", "&nbsp;" => " ", """ => "\"", "<" => "<", ">" => ">", "&" => "&");
   $html_text = strtr($html_text, $array);
   $artikel[$j][5] = htmlentities(substr($html_text,0,$laenge))."...";
  } elseif ( $db->f("idtype") == 1 && $db->f("typeid") == 1 )
  {
   $artikel[$j][3] = strip_tags(urldecode($db->f("value")));
  } elseif ( $db->f("idtype") == 1 && $db->f("typeid") == 2 )
  {
   $artikel[$j][4] = strip_tags(urldecode($db->f("value")));
  }
  $idart_last=$db->f("idart");
  $db->next_record();
  $i++;
 }
 $idart_last=$db->f("idart");
 $j++;
 $i--;
}

if($blatt=="") {$blatt=0;}
$blattmax=ceil($j/$anzahl)-1;
$blatt1 = $blatt+1;
$blattmax1 = $blattmax+1;
if ($j>$anzahl)
{
 echo " <tr>
  <td colspan=3 align=\"right\">".$pagetxt." ".$blatt1." ".$pagetxta." ".$blattmax1."  – <b>";
 for ($i=0; $i<=$blattmax; $i++)
 {
  $k = $i+1;
  if($i==$blatt) {
   echo " ".$k." ";
  } else {
   $navmod_link ="front_content.php?client=$client&lang=$lang&idcat=$idcat&blatt=".$i."";
   echo ' <a href="'.$sess->url("$navmod_link").'" id="font">'.$k.'</a> ';
  }
 }
 echo "</b><br> </td>
 </tr>";
}
for ($i=$anzahl*$blatt; $i < min($j,$anzahl*$blatt+$anzahl); $i++)
{
 $k = $i-1;
 $navmod_link ="front_content.php?client=$client&lang=$lang&idcat=".$artikel[$i][1]."&idart=".$artikel[$i][0]."";
 echo '<tr>';
 if ( $i>0 && $artikel[$i][2] == $artikel[$k][2] )
 {
  echo '<td> </td>';
 } else
 {
  echo '<td valign="top">>></td>';
 }
My extra code here in output:

Code: Alles auswählen

       $db2 = new DB_Contenido;
        $db2->query($sql);
          if ($db2->next_record())
          {
                $cidart = $db2->f("idart");
                $sql = "SELECT external_redirect FROM ".$cfg["tab"]["art_lang"]." WHERE idart = '$cidart' AND idlang='$lang'";
                $db2->query($sql);
                if ($db2->next_record())
                {
                    $target = ( $db2->f("external_redirect") == 0 ) ? '_self' : '_blank';
                }
          }
The rest of the outpu code:

Code: Alles auswählen

echo '<td><img border="0" src="images/spacer.gif" width="7" height="1"></td>
 <td>
 <b><a target="'.$target.'" href="'.$sess->url("$navmod_link").'" id="font">'.$artikel[$i][3].'</a></b> <span class="credits">['.$artikel[$i][2].']</span>
 <br>'.$artikel[$i][5].' <span class="credits">[<a target="'.$target.'" href="'.$sess->url("$navmod_link").'" id="font">'.$moredetailtxt.'</a>]</span></td>
</tr>
<tr>
<td colspan=3><img src="images/spacer.gif" width="1" height="6"></td>
</tr>';
}

if ($j>$anzahl)
{
 echo " <tr>
  <td colspan=3 align=\"right\"><br>".$pagetxt." ".$blatt1." ".$pagetxta." ".$blattmax1."  – <b>";
 for ($i=0; $i<=$blattmax; $i++)
 {
  $k = $i+1;
  if($i==$blatt) {
   echo " ".$k." ";
  } else {
   $navmod_link ="front_content.php?client=$client&lang=$lang&idcat=$idcat&blatt=".$i."";
   echo ' <a href="'.$sess->url("$navmod_link").'" id="font">'.$k.'</a> ';
  }
 }
 echo "</b></td>
 </tr>";
}

 echo '</table>';
}
?>
Many thx for your help.
Regards, Dom
emergence
Beiträge: 10653
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence »

a very old post...

is your problem solved ?
*** make your own tools (wishlist :: thx)
djavet
Beiträge: 264
Registriert: Do 22. Jan 2004, 11:31
Kontaktdaten:

Beitrag von djavet »

Thx for writing back.
I've solve the problem in a other way.

Regards, Dom
Gesperrt