Problem mit einen PHP-Prg... HILFE....

Fragen zur Implementierung und/oder Anpassung von ConPresso 3.x werden in diesem Forum diskutiert.
Antworten
RaynAnderson
ConPresso-Newbie
Beiträge: 18
Registriert: 01.01.1970 01:00

Problem mit einen PHP-Prg... HILFE....

Beitrag von RaynAnderson »

HILFE... Habe ein riesen Problem...

Ich habe ein PHP-Program das mir die Artikel in der mySQL zusammenzäht und mir diesen wert auswirft... nun ist es so, das ein Artikel abgezogen werden muß... Also statt z.B. 3 Artikel, muß das nur 2 Artikel stehen... Kenne mich leider in PHP nicht aus... Kannst du mir helden wie ich das machen kann?

hier das PHP-Prg.

<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap: */
// $Id$
define('CPO', true);
if (file_exists("../_cfg/const.php")) require("../_cfg/const.php");
else require("../_cfg/const.php.dist");

require(CPO_BASEDIR."_include/category_rubric.inc.php");
require(CPO_BASEDIR."_include/var_category.php");
$Artikel_header = $Rubric_header;

require(CPO_BASEDIR."_include/secure.php");

$jetzt = time();

// if this is a personalized rubric, set the string that only fetches
// articles corresponding to the group of the logged in user
if ( $Rubric_secure == 1 ) {
if ( $_SESSION['SID_Group'] != '' ) {
$auth_string = "auth = '' OR auth LIKE '%".$_SESSION['SID_Group']."%'";
} else {
$auth_string = "auth = ''";
}
} else {
$auth_string = "1";
}

if ( $System_release == 1 ) {
$query_count = "SELECT COUNT(*) FROM ".$dbPrefix."_news "
."WHERE artikel_archiv < 2 AND freigabe = 0 AND pub_datum < '".$jetzt."' AND verfallsdatum > '".$jetzt
."' AND kategorie = '".$directory."' AND ( ".$auth_string." )";
} else {
$query_count = "SELECT COUNT(*) FROM ".$dbPrefix."_news "
."WHERE artikel_archiv < 1 AND freigabe != 2 AND pub_datum < '".$jetzt."' AND verfallsdatum > '".$jetzt
."' AND kategorie = '".$directory."' AND ( ".$auth_string." )";
}

$db = new DB;
$db->query($query_count);
$db->next_record();
$max_anzahl = $db->v('COUNT(*)');

echo $max_anzahl;
?>
Benutzeravatar
MarkusR
Handbuchversteher
Beiträge: 7362
Registriert: 01.01.1970 01:00
Hat sich bedankt: 111 Mal
Danksagung erhalten: 934 Mal
Kontaktdaten:

Beitrag von MarkusR »

Ändere die letzte Zeile in

Code: Alles auswählen

echo ($max_anzahl - 1);
Ciao Markus
ConPresso-Module

Kein Support per PN!!! Für Fragen und Diskussionen ist das Forum da!

Succi recentis officinalis
Hochwertige Kräutersäfte und -Öle
RaynAnderson
ConPresso-Newbie
Beiträge: 18
Registriert: 01.01.1970 01:00

Beitrag von RaynAnderson »

DANKE - funkt super..
Antworten