1
Venezia
xDirectory Module bugfix for Modify Listing
  • 2003/11/10 2:05

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


xDirectory module not updating modified fields correctly.

1. From user side:

Reason: missing variable assignments from posted values.

Solution:
File: modlink.php
lines 64-68 replace with:

$url = $myts->makeTboxData4Save($HTTP_POST_VARS["url"]);
$logourl = $myts->makeTboxData4Save($HTTP_POST_VARS["logourl"]);
$cid = intval($HTTP_POST_VARS["cid"]);
$title = $myts->makeTboxData4Save($HTTP_POST_VARS["title"]);
$address = $myts->makeTboxData4Save($HTTP_POST_VARS["address"]);
$address2 = $myts->makeTboxData4Save($HTTP_POST_VARS["address2"]);
$city = $myts->makeTboxData4Save($HTTP_POST_VARS["city"]);
$state = $myts->makeTboxData4Save($HTTP_POST_VARS["state"]);
$zip = $myts->makeTboxData4Save($HTTP_POST_VARS["zip"]);
$country = $myts->makeTboxData4Save($HTTP_POST_VARS["country"]);
$phone = $myts->makeTboxData4Save($HTTP_POST_VARS["phone"]);
$fax = $myts->makeTboxData4Save($HTTP_POST_VARS["fax"]);
$email = $myts->makeTboxData4Save($HTTP_POST_VARS["email"]);
$url = $myts->makeTboxData4Save($HTTP_POST_VARS["url"]);
$description = $myts->makeTareaData4Save($HTTP_POST_VARS["description"]);




2. From admin side:

Reason: Too many parameters in sprintf within SQL statement - db is trying to find a record id = time().

Solution:
File: /admin/index.php
Function: changeModReq()

Approx line 742 ~ Change the main update statement to the following (omit status param from sprintf param list):

$sql= sprintf("UPDATE %s SET cid = %u, title = '%s', address = '%s', address2 = '%s', city = '%s', state = '%s', zip = '%s', country = '%s', phone = '%s', fax = '%s', email = '%s', url = '%s', logourl = '%s', status = 2, date = %u WHERE lid = %u", $xoopsDB->prefix("xdir_links"), $cid, $title, $address, $address2, $city, $state, $zip, $country, $phone, $fax, $email, $url, $logourl, time(), $lid);

Note: the description field is handled in seperate statement, which appears ok.

2
Anonymous
Re: xDirectory Module bugfix for Modify Listing
  • 2003/11/10 8:45

  • Anonymous

  • Posts: 0

  • Since:


I don't know if this bug was mentioned before in a posting. Some parts of the approve form are missing.

In admin/index.php there is the function "listNewLinks()"

Quote:
echo "