getUrlParams bringt nur Fehler

goto;

Erfahrenes Mitglied
Hallo liebe Community.
Ich habe auf meiner Seite eine Kategorien Liste. Die je nach Bereich eine ID besitzen. Nun Soll auf der Seite Browse.php die einzelnen Kategorien aufgerufen werden können und die Unterkategorien noch aufgerufen werden, die in meiner Datenbank stehen. Nur wenn ich ein Bereich öffnen möchte kommt folgende Fehler Meldung ( Fatal error: Call to undefined function: geturlparams() in /hp/ax/ac/bo/www/browse.php on line 10 ) Sprich :
PHP:
.....
$params = getUrlParams("=");
Ich verteh nur nicht was daran falsch sein soll. Hier nochmal der Komplette Code
PHP:
r.....
equire('./includes/config.inc.php');
include $include_path."auctionstoshow.inc.php";
$params = getUrlParams("=");
if(empty($_GET['id']))
        $_GET['id'] = $params['id'];
else
        $params['id'] = $_GET['id'];
$id = intval($params['id']);

#// #############################################################################
function getsubtree($catsubtree,$i) {
        global $catlist;
        $res=mysql_query("SELECT cat_id FROM AUCTION_categories WHERE parent_id=".intval($catsubtree[$i]));
        while($row=mysql_fetch_assoc($res)) {
                $catlist[]=$row['cat_id'];
                $catsubtree[$i+1]=$row['cat_id'];
                getsubtree($catsubtree,$i+1);
        }
}

$catsubtree[0]=$id;
$catlist[]=$catsubtree[0];
getsubtree($catsubtree,0);
$catalist="(";
$catalist.=join(",",$catlist);
$catalist.=")";
$NOW = date("YmdHis",mktime(date("H")+$SETTINGS['timecorrection'],date("i"),date("s"),date("m"), date("d"),date("Y")));
if ($id==0) {
        $result = mysql_query ( "SELECT * FROM AUCTION_categories WHERE parent_id='0' ORDER BY cat_name" );
        if (!$result) {
                print "database error";
                exit;
        } else {
                $need_to_continue = 1;
                $cycle = 1;

                $TPL_main_value = "";
                $TPL_categories_string = $MGS_2__0027;
                while ($row=mysql_fetch_array($result)) {
                        if ($cycle==1 ) {
                                $TPL_main_value.="<tr WIDTH=100% ALIGN=LEFT>\n";
                        }
                        $sub_counter = (int)$row['sub_counter'];
                        $cat_counter = (int)$row['counter'];
                        if ($sub_counter!=0) $count_string = "(".$sub_counter.")";
                        else {
                                $count_string = "";
                        }
                        $row['cat_name'] = @mysql_result(mysql_query("SELECT cat_name FROM AUCTION_cats_translated WHERE cat_id=".$row['cat_id']." AND lang='".$language."'"),0,"cat_name");
                        $TPL_main_value .=!empty($row['cat_colour']) ? "        <td BGCOLOR=\"".$row['cat_colour']."\" WIDTH=\"33%\"><a href=\"".$SETTINGS['siteurl']."browse.php?id=".$row['cat_id']."\">".$row['cat_name'].$count_string."</a></td>\n" : "        <td WIDTH=\"33%\"><a href=\"".$SETTINGS['siteurl']."browse.php?id=".$row['cat_id']."\">".$row['cat_name'].$count_string."</a></td>\n";

                        ++$cycle;
                        if ($cycle==4) { $cycle=1; $TPL_main_value.="</tr>\n"; }
                }

                if ( $cycle>=2 && $cycle<=3 ) {
                        while ( $cycle<4 ) {
                                $TPL_main_value .= "        <td WIDTH=\"33%\">&nbsp;</td>\n";
                                ++$cycle;
                        }
                        $TPL_main_value .= "</tr>\n";
                }
                $TPL_auctions_list_value = array();
                include "header.php";
                include phpa_include("template_browse_header_php.html");
                include phpa_include("template_browse_php.html");
                include "footer.php";
                exit;
        }
} else {
Ist ziemlich umfrangreich wenn Ihr noch Fragen habt ich bin immer da, Danke euch schonmal für die Hilfe
 
Hiho,

die Funktion getUrlParams(), die du aufrufst scheint nicht vorher definiert zu sein. Von Haus aus gibt es diese Funktion in PHP nämlich nicht und (zumindest in dem Code den du gezeigt hast) wird diese auch nicht definiert ;)

Lg
 
Achso, dann hab ich irgendwas falsch verstanden. Und wie definiert man diese Funktion, hab mit der Funktion vorher nie gearbeitet. :(
 
Da ich nicht weiß, was genau die Funktion bringen soll, kann ich dir nur die allgemeine Form sagen:

PHP:
function funktionsName($argumente,...) {
// jede menge code
}

Wo ist denn der restliche Code her? Da müsste dann ja auch eigentlich die Funktion zu finden sein :D (Villeicht eine Datei vergessen zu includen?)

Lg
 
ich hab alle includes durchgesehen aber nichts gefunden, wüsste auch nicht das ich schonmal getUrlParams getippt hätte. Der Restliche Code hat mit der funktion nichts mehr zu tun. ich kann sie dir ja mal post aber da steht nichts interessantes nur die auflistung der categorien und counter
PHP:
<?#//v.3.1.3
require('./includes/config.inc.php');
include $include_path."auctionstoshow.inc.php";
$params = getUrlParams("=");
if(empty($_GET['id']))
        $_GET['id'] = $params['id'];
else
        $params['id'] = $_GET['id'];
$id = intval($params['id']);

#// #############################################################################
function getsubtree($catsubtree,$i) {
        global $catlist;
        $res=mysql_query("SELECT cat_id FROM AUCTION_categories WHERE parent_id=".intval($catsubtree[$i]));
        while($row=mysql_fetch_assoc($res)) {
                $catlist[]=$row['cat_id'];
                $catsubtree[$i+1]=$row['cat_id'];
                getsubtree($catsubtree,$i+1);
        }
}

$catsubtree[0]=$id;
$catlist[]=$catsubtree[0];
getsubtree($catsubtree,0);
$catalist="(";
$catalist.=join(",",$catlist);
$catalist.=")";
$NOW = date("YmdHis",mktime(date("H")+$SETTINGS['timecorrection'],date("i"),date("s"),date("m"), date("d"),date("Y")));
if ($id==0) {

        $result = mysql_query ( "SELECT * FROM AUCTION_categories WHERE parent_id='0' ORDER BY cat_name" );
        if (!$result) {
                print "database error";
                exit;
        } else {
                $need_to_continue = 1;
                $cycle = 1;

                $TPL_main_value = "";
                $TPL_categories_string = $MGS_2__0027;
                while ($row=mysql_fetch_array($result)) {
                        if ($cycle==1 ) {
                                $TPL_main_value.="<tr WIDTH=100% ALIGN=LEFT>\n";
                        }
                        $sub_counter = (int)$row['sub_counter'];
                        $cat_counter = (int)$row['counter'];
                        if ($sub_counter!=0) $count_string = "(".$sub_counter.")";
                        else {
                                $count_string = "";
                        }
                        $row['cat_name'] = @mysql_result(mysql_query("SELECT cat_name FROM AUCTION_cats_translated WHERE cat_id=".$row['cat_id']." AND lang='".$language."'"),0,"cat_name");
                        $TPL_main_value .=!empty($row['cat_colour']) ? "        <td BGCOLOR=\"".$row['cat_colour']."\" WIDTH=\"33%\"><a href=\"".$SETTINGS['siteurl']."browse.php?id=".$row['cat_id']."\">".$row['cat_name'].$count_string."</a></td>\n" : "        <td WIDTH=\"33%\"><a href=\"".$SETTINGS['siteurl']."browse.php?id=".$row['cat_id']."\">".$row['cat_name'].$count_string."</a></td>\n";

                        ++$cycle;
                        if ($cycle==4) { $cycle=1; $TPL_main_value.="</tr>\n"; }
                }

                if ( $cycle>=2 && $cycle<=3 ) {
                        while ( $cycle<4 ) {
                                $TPL_main_value .= "        <td WIDTH=\"33%\">&nbsp;</td>\n";
                                ++$cycle;
                        }
                        $TPL_main_value .= "</tr>\n";
                }
                $TPL_auctions_list_value = array();
                include "header.php";
                include phpa_include("template_browse_header_php.html");
                include phpa_include("template_browse_php.html");
                include "footer.php";
                exit;
        }
} else {


        $result = mysql_query ( "SELECT * FROM AUCTION_categories WHERE cat_id=".intval($id) );
        if ($result)
        $category = mysql_fetch_array($result);
        else
        $category = false;
        $category['cat_name'] = @mysql_result(mysql_query("SELECT cat_name FROM AUCTION_cats_translated WHERE cat_id=".$category['cat_id']." AND lang='".$language."'"),0,"cat_name");
        if (!$category) {

                header ( "Location: browse.php?id=0" );
                exit;
        } else {
                $TPL_categories_string = "".$category["cat_name"];
                $par_id = (int)$category['parent_id'];

                while ( $par_id!=0 ) {
                        // get next parent
                        $res = mysql_query ( "SELECT * FROM AUCTION_categories WHERE cat_id=".intval($par_id));
                        if ($res) {
                                $rw = mysql_fetch_array($res);
                                if ($rw) $par_id = (int)$rw['parent_id'];
                                else $par_id = 0;
                        } else $par_id = 0;

                        $rw['cat_name'] = @mysql_result(mysql_query("SELECT cat_name FROM AUCTION_cats_translated WHERE cat_id=".$rw['cat_id']." AND lang='".$language."'"),0,"cat_name");
                        $TPL_categories_string = "<a href=\"".$SETTINGS['siteurl']."browse.php?id=".$rw["cat_id"]."\">".$rw["cat_name"]."</a> &gt; ".$TPL_categories_string;
                }

                $subcat_count = 0;
                $result = mysql_query ( "SELECT * FROM AUCTION_categories WHERE parent_id=".intval($id)." ORDER BY cat_name" );
                if (!$result) {
                } else {
                        $need_to_continue = 1;
                        $cycle = 1;

                        $TPL_main_value = "";
                        while ($row=mysql_fetch_array($result)) {
                                ++$subcat_count;
                                if ($cycle==1 ) {
                                        $TPL_main_value.="<tr ALIGN=LEFT>\n";
                                }
                                $sub_counter = (int)$row['sub_counter'];
                                $cat_counter = (int)$row['counter'];
                                if ($sub_counter!=0) $count_string = "(".$sub_counter.")";
                                else {
                                        if ($cat_counter!=0) {
                                                $count_string = "(".$cat_counter.")";
                                        } else $count_string = "";
                                }
                                if($row['cat_colour'] != "") {
                                        $BG ="BGCOLOR=".$row['cat_colour'];
                                } else {
                                        $BG = "";
                                }
                                #// Retrieve the translated category name
                                $row['cat_name'] = @mysql_result(mysql_query("SELECT cat_name FROM AUCTION_cats_translated WHERE cat_id=".$row['cat_id']." AND lang='".$language."'"),0,"cat_name");
                                $TPL_main_value .= "        <td $BG WIDTH=\"33%\"><a href=\"".$SETTINGS['siteurl']."browse.php/id=".$row['cat_id']."\">".$row['cat_name'].$count_string."</a></td>\n";

                                ++$cycle;
                                if ($cycle==4) {
                                        $cycle=1;
                                        $TPL_main_value.="</tr>\n";
                                }
                        }

                        if ( $cycle>=2 && $cycle<=3 ) {
                                while ( $cycle<4 ) {
                                        $TPL_main_value .= "        <td WIDTH=\"33%\">&nbsp;</td>\n";
                                        ++$cycle;
                                }
                                $TPL_main_value .= "</tr>\n";
                        }
                }
                /* determine limits for SQL query */
                $left_limit = ($page-1)*$lines;

                $page = (int)$page;
                if ($page==0)        $page = 1;
                $lines = (int)$lines;
                if ($lines==0)        $lines = 50;


                $qs = "SELECT count(*) FROM AUCTION_auctions
                                                WHERE category IN $catalist
                                                AND        starts<=".$NOW."
                                                AND closed='0'
                                                AND private='n'
                                                AND suspended ='0'";
                 if($SETTINGS['adultonly']=='y' && !isset($_SESSION["PHPAUCTION_LOGGED_IN"])){
                         $qs .= "AND adultonly='n'";
                 }

                if(!empty($_POST['catkeyword'])){
                        $qs .= " AND title like '%".addslashes($_POST['catkeyword'])."'%";
                }
                $rsl = mysql_query ($qs);
                if ($rsl) {
                        $hash = mysql_fetch_array($rsl);
                        $total = !$hash[0] ? 1 : (int)$hash[0];
                } else $total = 1;
                #// Handle pagination
                $TOTALAUCTIONS = $total;
                if(!isset($PAGE) || $PAGE == 1) {
                        $OFFSET = 0;
                        $PAGE = 1;
                } else {
                        $OFFSET = ( $PAGE - 1) * $LIMIT;
                }
                $PAGES = ceil($TOTALAUCTIONS / $LIMIT);

                $qs = "SELECT * FROM AUCTION_auctions
                                                                        WHERE category IN $catalist
                                                                        AND        starts<=".$NOW."
                                                                        AND closed='0'
                                                                        AND private='n'
                                                                        AND suspended ='0' ";
                 if($SETTINGS['adultonly']=='y' && !isset($_SESSION["AUCTION_LOGGED_IN"])){
                         $qs .= " AND adultonly='n'";
                 }
                if(!empty($_POST['catkeyword'])){
                        $qs .= " AND title like '%".addslashes($_POST['catkeyword'])."%' ";
                }
                $qs .= "ORDER BY ends ASC LIMIT ".intval($OFFSET).",".intval($LIMIT);
                $result = mysql_query ($qs);
                /* get list of auctions of this category */
                $auctions_count = 0;
                /* selectd items formatter */
                include $include_path."browseitems.inc.php";

                $TPL_auctions_list_value=browseItems($result);
                $auctions_count=count($TPL_auctions_list_value);

                /*$TPL_auctions_total_value .= "<br />".
                "$MSG_290 $total<br />".
                "$MSG_289 $pages ($lines $MSG_291)<br />".
                "Pages: ";

                for ($i=1; $i<=$pages; ++$i) {
                        $TPL_auctions_total_value .=
                        ($page==$i)        ?
                        " $i "        :
                        " <a href=\"".$SETTINGS['siteurl']."browse.php?id=".$id."&page=$i\">$i</a> ";
                }
                */
                $TPL_auctions_total_value .="";
                if ($auctions_count==0) {
                        $TPL_auctions_total_value = $ERR_114;
                }
        }

        include "header.php";
        include phpa_include("template_browse_header_php.html");
        if ( $subcat_count>0 ) {
                include phpa_include("template_browse_php.html");
        }
        if ($subcat_count==0) {
                include phpa_include("template_auctions_no_cat.html");
        }
        include "footer.php";
}
?>
 
Zurück