Hi TheCat, sorry for not responding to you promptly this morning and thank you for your patience with me.
Ok now, I turned on PHP debugging and after I tried to submit an ad I get this:
Catads
There was an error. Your ad has not been added
Array
Notice [PHP]: Undefined variable: photos_dir in file modules/catads/submit1.php line 205
Also on the the catads main page at the bottom I get a whole bunch of this:
Notice [PHP]: Use of undefined constant _MI_CATADS_NAME - assumed '_MI_CATADS_NAME' in file modules/catads/xoops_version.php line 26
Notice [PHP]: Use of undefined constant _MI_CATADS_DESC - assumed '_MI_CATADS_DESC' in file modules/catads/xoops_version.php line 28
Notice [PHP]: Use of undefined constant _MI_CATADS_BNAME1 - assumed '_MI_CATADS_BNAME1' in file modules/catads/xoops_version.php line 62
Notice [PHP]: Use of undefined constant _MI_CATADS_BNAME2 - assumed '_MI_CATADS_BNAME2' in file modules/catads/xoops_version.php line 70
Notice [PHP]: Use of undefined constant _MI_CATADS_BNAME3 - assumed '_MI_CATADS_BNAME3' in file modules/catads/xoops_version.php line 76
Notice [PHP]: Use of undefined constant _MI_CATADS_SMENU2 - assumed '_MI_CATADS_SMENU2' in file modules/catads/xoops_version.php line 86
Notice [PHP]: Use of undefined constant _MI_CATADS_LIN - assumed '_MI_CATADS_LIN' in file modules/catads/xoops_version.php line 220
Notice [PHP]: Use of undefined constant _MI_CATADS_COL - assumed '_MI_CATADS_COL' in file modules/catads/xoops_version.php line 220
Notice [PHP]: Use of undefined constant _MI_CATADS_GLOBAL_NOTIFY - assumed '_MI_CATADS_GLOBAL_NOTIFY' in file modules/catads/xoops_version.php line 289
Notice [PHP]: Use of undefined constant _MI_CATADS_GLOBAL_NOTIFYDSC - assumed '_MI_CATADS_GLOBAL_NOTIFYDSC' in file modules/catads/xoops_version.php line 290
Notice [PHP]: Use of undefined constant _MI_CATADS_CATEGORY_NOTIFY - assumed '_MI_CATADS_CATEGORY_NOTIFY' in file modules/catads/xoops_version.php line 294
Notice [PHP]: Use of undefined constant _MI_CATADS_CATEGORY_NOTIFYDSC - assumed '_MI_CATADS_CATEGORY_NOTIFYDSC' in file modules/catads/xoops_version.php line 295
Notice [PHP]: Use of undefined constant _MI_CATADS_ADS_NOTIFY - assumed '_MI_CATADS_ADS_NOTIFY' in file modules/catads/xoops_version.php line 301
Notice [PHP]: Use of undefined constant _MI_CATADS_ADS_NOTIFYDSC - assumed '_MI_CATADS_ADS_NOTIFYDSC' in file modules/catads/xoops_version.php line 302
Notice [PHP]: Use of undefined constant _MI_CATADS_GLOBAL_ADSSUBMIT_NOTIFY - assumed '_MI_CATADS_GLOBAL_ADSSUBMIT_NOTIFY' in file modules/catads/xoops_version.php line 310
Notice [PHP]: Use of undefined constant _MI_CATADS_GLOBAL_ADSSUBMIT_NOTIFYCAP - assumed '_MI_CATADS_GLOBAL_ADSSUBMIT_NOTIFYCAP' in file modules/catads/xoops_version.php line 311
Notice [PHP]: Use of undefined constant _MI_CATADS_GLOBAL_ADSSUBMIT_NOTIFYDSC - assumed '_MI_CATADS_GLOBAL_ADSSUBMIT_NOTIFYDSC' in file modules/catads/xoops_version.php line 312
Notice [PHP]: Use of undefined constant _MI_CATADS_GLOBAL_ADSSUBMIT_NOTIFYSBJ - assumed '_MI_CATADS_GLOBAL_ADSSUBMIT_NOTIFYSBJ' in file modules/catads/xoops_version.php line 314
Notice [PHP]: Use of undefined constant _MI_CATADS_GLOBAL_NEWADS_NOTIFY - assumed '_MI_CATADS_GLOBAL_NEWADS_NOTIFY' in file modules/catads/xoops_version.php line 318
Notice [PHP]: Use of undefined constant _MI_CATADS_GLOBAL_NEWADS_NOTIFYCAP - assumed '_MI_CATADS_GLOBAL_NEWADS_NOTIFYCAP' in file modules/catads/xoops_version.php line 319
Notice [PHP]: Use of undefined constant _MI_CATADS_GLOBAL_NEWADS_NOTIFYDSC - assumed '_MI_CATADS_GLOBAL_NEWADS_NOTIFYDSC' in file modules/catads/xoops_version.php line 320
Notice [PHP]: Use of undefined constant _MI_CATADS_GLOBAL_NEWADS_NOTIFYSBJ - assumed '_MI_CATADS_GLOBAL_NEWADS_NOTIFYSBJ' in file modules/catads/xoops_version.php line 322
Notice [PHP]: Use of undefined constant _MI_CATADS_CATEGORY_SUBMIT_NOTIFY - assumed '_MI_CATADS_CATEGORY_SUBMIT_NOTIFY' in file modules/catads/xoops_version.php line 327
Notice [PHP]: Use of undefined constant _MI_CATADS_CATEGORY_SUBMIT_NOTIFYCAP - assumed '_MI_CATADS_CATEGORY_SUBMIT_NOTIFYCAP' in file modules/catads/xoops_version.php line 328
Notice [PHP]: Use of undefined constant _MI_CATADS_CATEGORY_SUBMIT_NOTIFYDSC - assumed '_MI_CATADS_CATEGORY_SUBMIT_NOTIFYDSC' in file modules/catads/xoops_version.php line 329
Notice [PHP]: Use of undefined constant _MI_CATADS_CATEGORY_SUBMIT_NOTIFYSBJ - assumed '_MI_CATADS_CATEGORY_SUBMIT_NOTIFYSBJ' in file modules/catads/xoops_version.php line 331
Notice [PHP]: Use of undefined constant _MI_CATADS_CATEGORY_NEWADS_NOTIFY - assumed '_MI_CATADS_CATEGORY_NEWADS_NOTIFY' in file modules/catads/xoops_version.php line 335
Notice [PHP]: Use of undefined constant _MI_CATADS_CATEGORY_NEWADS_NOTIFYCAP - assumed '_MI_CATADS_CATEGORY_NEWADS_NOTIFYCAP' in file modules/catads/xoops_version.php line 336
Notice [PHP]: Use of undefined constant _MI_CATADS_CATEGORY_NEWADS_NOTIFYDSC - assumed '_MI_CATADS_CATEGORY_NEWADS_NOTIFYDSC' in file modules/catads/xoops_version.php line 337
Notice [PHP]: Use of undefined constant _MI_CATADS_CATEGORY_NEWADS_NOTIFYSBJ - assumed '_MI_CATADS_CATEGORY_NEWADS_NOTIFYSBJ' in file modules/catads/xoops_version.php line 339
Notice [PHP]: Use of undefined constant _MI_CATADS_ADS_APPROVE_NOTIFY - assumed '_MI_CATADS_ADS_APPROVE_NOTIFY' in file modules/catads/xoops_version.php line 344
Notice [PHP]: Use of undefined constant _MI_CATADS_ADS_APPROVE_NOTIFYCAP - assumed '_MI_CATADS_ADS_APPROVE_NOTIFYCAP' in file modules/catads/xoops_version.php line 345
Notice [PHP]: Use of undefined constant _MI_CATADS_ADS_APPROVE_NOTIFYDSC - assumed '_MI_CATADS_ADS_APPROVE_NOTIFYDSC' in file modules/catads/xoops_version.php line 346
Notice [PHP]: Use of undefined constant _MI_CATADS_ADS_APPROVE_NOTIFYSBJ - assumed '_MI_CATADS_ADS_APPROVE_NOTIFYSBJ' in file modules/catads/xoops_version.php line 348
Here is the code for the ads.php file that I am using:
// $Id: class/ads.php,v 1.2 2005/03/06 C. Felix AKA the Cat
// ------------------------------------------------------------------------- //
// Catads for XOOPS //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
//---------------------------------------------------------------------------//
class CatadsAds extends XoopsObject
{
var $_catTitle;
var $_displayPrice;
var $commentstable;
function CatadsAds()
{
$this->XoopsObject();
$this->initVar('ads_id', XOBJ_DTYPE_INT, null, false);
$this->initVar('cat_id', XOBJ_DTYPE_INT, null, true);
$this->initVar('ads_title', XOBJ_DTYPE_TXTBOX, null, true, 100);
$this->initVar('ads_type', XOBJ_DTYPE_TXTBOX, null, true, 40);
$this->initVar('ads_desc', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('price', XOBJ_DTYPE_INT, 0, false);
$this->initVar('monnaie', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('price_option', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('email', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('uid', XOBJ_DTYPE_INT, 0, false);
$this->initVar('phone', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('town', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('codpost', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('created', XOBJ_DTYPE_INT, 0, false);
$this->initVar('published', XOBJ_DTYPE_INT, 0, false);
$this->initVar('expired', XOBJ_DTYPE_INT, 0, false);
$this->initVar('photo', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('view', XOBJ_DTYPE_INT, 0, false);
$this->initVar('notify_pub', XOBJ_DTYPE_INT, 0, false);
$this->initVar('poster_ip', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('contact_mode', XOBJ_DTYPE_INT, 0, false);
$this->initVar('countpub', XOBJ_DTYPE_INT, 0, false);
$this->initVar('suspend', XOBJ_DTYPE_INT, 0, false);
//add v1.30
$this->initVar('waiting', XOBJ_DTYPE_INT, 0, false);
}
function setCatTitle($value)
{
$this->_catTitle = $value;
}
function getCatTitle()
{
return $this->_catTitle;
}
function setDisplayPrice($value)
{
$this->_displayPrice = $value;
}
function getDisplayPrice()
{
return $this->_displayPrice;
}
}
function insert(&$ads)
{
if (get_class($ads) != 'CatadsAds') {
echo "Error 1 br>";
return false;
}
if (!$ads->cleanVars()) {
echo "Error 2 br>";
return false;
}
foreach ($ads->cleanVars as $k => $v) {
${$k} = $v;
}
if (empty($ads_id)) {
$ads_id = $this->db->genId('catads_ads_ads_id_seq');
$sql = 'INSERT INTO '.$this->db->prefix('catads_ads').' (ads_id, cat_id, ads_title, ads_type, ads_desc, price, monnaie, price_option, email, uid, phone, town, codpost, created, published, expired, photo, view, notify_pub, poster_ip, contact_mode, countpub, suspend, waiting) VALUES ('.$ads_id.', '.$cat_id.', '.$this->db->quoteString($ads_title).', '.$this->db->quoteString($ads_type).', '.$this->db->quoteString($ads_desc).', '.$price.', '.$this->db->quoteString($monnaie).', '.$this->db->quoteString($price_option).', '.$this->db->quoteString($email).', '.$uid.', '.$this->db->quoteString($phone).', '.$this->db->quoteString($town).', '.$this->db->quoteString($codpost).', '.$created.', '.$published.', '.$expired.', '.$this->db->quoteString($photo).', '.$view.', '.$notify_pub.', '.$this->db->quoteString($poster_ip).', '.$contact_mode.', '.$countpub.', '.$suspend.', '.$waiting.')';
} else {
$sql = 'UPDATE '.$this->db->prefix('catads_ads').' SET cat_id='.$cat_id.', ads_title='.$this->db->quoteString($ads_title).', ads_type='.$this->db->quoteString($ads_type).', ads_desc='.$this->db->quoteString($ads_desc).', price='.$price.', monnaie='.$this->db->quoteString($monnaie).', price_option='.$this->db->quoteString($price_option).', email='.$this->db->quoteString($email).', uid='.$uid.', phone='.$this->db->quoteString($phone).', town='.$this->db->quoteString($town).', codpost='.$this->db->quoteString($codpost).', created='.$created.', published='.$published.', expired='.$expired.', photo='.$this->db->quoteString($photo).', view='.$view.', notify_pub = '.$notify_pub.', poster_ip='.$this->db->quoteString($poster_ip).', contact_mode='.$contact_mode.', countpub='.$countpub.', suspend='.$suspend.', waiting='.$waiting.' WHERE ads_id='.$ads_id;
}
if (!$result = $this->db->queryF($sql)) {
echo $sql." br>";
echo "Error 3 br>";
return false;
}
if (empty($ads_id)) {
$ads_id = $this->db->getInsertId();
}
$ads->assignVar('ads_id', $ads_id);
return $ads_id;
}
class CatadsAdsHandler
{
var $db;
function CatadsAdsHandler(&$db)
{
$this->db =& $db;
}
function &getInstance(&$db)
{
static $instance;
if (!isset($instance)) {
$instance = new CatadsAdsHandler($db);
}
return $instance;
}
function &create()
{
return new CatadsAds();
}
function &get($id)
{
$id = intval($id);
if ($id > 0) {
$sql = 'SELECT * FROM '.$this->db->prefix('catads_ads').' WHERE ads_id='.$id;
if (!$result = $this->db->query($sql)) {
return false;
}
$numrows = $this->db->getRowsNum($result);
if ($numrows == 1) {
$ads = new CatadsAds();
$ads->assignVars($this->db->fetchArray($result));
return $ads;
}
}
return false;
}
function insert(&$ads)
{
if (get_class($ads) != 'CatadsAds') {
return false;
}
if (!$ads->cleanVars()) {
return false;
}
foreach ($ads->cleanVars as $k => $v) {
${$k} = $v;
}
if (empty($ads_id)) {
$ads_id = $this->db->genId('catads_ads_ads_id_seq');
$sql = 'INSERT INTO '.$this->db->prefix('catads_ads').' (ads_id, cat_id, ads_title, ads_type, ads_desc, price, monnaie, price_option, email, uid, phone, town, codpost, created, published, expired, photo, view, notify_pub, poster_ip, contact_mode, countpub, suspend, waiting) VALUES ('.$ads_id.', '.$cat_id.', '.$this->db->quoteString($ads_title).', '.$this->db->quoteString($ads_type).', '.$this->db->quoteString($ads_desc).', '.$price.', '.$this->db->quoteString($monnaie).', '.$this->db->quoteString($price_option).', '.$this->db->quoteString($email).', '.$uid.', '.$this->db->quoteString($phone).', '.$this->db->quoteString($town).', '.$this->db->quoteString($codpost).', '.$created.', '.$published.', '.$expired.', '.$this->db->quoteString($photo).', '.$view.', '.$notify_pub.', '.$this->db->quoteString($poster_ip).', '.$contact_mode.', '.$countpub.', '.$suspend.', '.$waiting.')';
} else {
$sql = 'UPDATE '.$this->db->prefix('catads_ads').' SET cat_id='.$cat_id.', ads_title='.$this->db->quoteString($ads_title).', ads_type='.$this->db->quoteString($ads_type).', ads_desc='.$this->db->quoteString($ads_desc).', price='.$price.', monnaie='.$this->db->quoteString($monnaie).', price_option='.$this->db->quoteString($price_option).', email='.$this->db->quoteString($email).', uid='.$uid.', phone='.$this->db->quoteString($phone).', town='.$this->db->quoteString($town).', codpost='.$this->db->quoteString($codpost).', created='.$created.', published='.$published.', expired='.$expired.', photo='.$this->db->quoteString($photo).', view='.$view.', notify_pub = '.$notify_pub.', poster_ip='.$this->db->quoteString($poster_ip).', contact_mode='.$contact_mode.', countpub='.$countpub.', suspend='.$suspend.', waiting='.$waiting.' WHERE ads_id='.$ads_id;
}
if (!$result = $this->db->queryF($sql)) {
return false;
}
if (empty($ads_id)) {
$ads_id = $this->db->getInsertId();
}
$ads->assignVar('ads_id', $ads_id);
return $ads_id;
}
function delete(&$ads){
global $xoopsModule;
if (get_class($ads) != 'CatadsAds') {
return false;
}
$sql = sprintf("DELETE FROM %s WHERE ads_id = %u", $this->db->prefix('catads_ads'), $ads->getVar('ads_id'));
if (isset($this->commentstable) && $this->commentstable != "") {
xoops_comment_delete($xoopsModule->getVar('mid'), $ads_id);
}
if (!$result = $this->db->query($sql)) {
return false;
}
return true;
}
function &getObjects($criteria = null)
{
$ret = array();
$limit = $start = 0;
$sql = 'SELECT * FROM '.$this->db->prefix('catads_ads');
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
$sql .= ' '.$criteria->renderWhere();
$sort = ($criteria->getSort() != '') ? $criteria->getSort() : 'ads_id';
$sql .= ' ORDER BY '.$sort.' '.$criteria->getOrder();
$limit = $criteria->getLimit();
$start = $criteria->getStart();
}
$result = $this->db->query($sql, $limit, $start);
if (!$result) {
return $ret;
}
while ($myrow = $this->db->fetchArray($result)) {
$ads = new CatadsAds();
$ads->assignVars($myrow);
$ret[] =& $ads;
unset($ads);
}
return $ret;
}
function getAllAds($criteria = null)
{
$ret = array();
$limit = $start = 0;
$sql = 'SELECT a.*, c.display_price, c.title FROM '.$this->db->prefix("catads_ads ").'a LEFT JOIN '.$this->db->prefix('catads_cat').' c ON c.cat_id = a.cat_id ';
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
$sql .= ' '.$criteria->renderWhere();
$sort = ($criteria->getSort() != '') ? $criteria->getSort() : 'ads_id';
$sql .= ' ORDER BY '.$sort.' '.$criteria->getOrder();
$limit = $criteria->getLimit();
$start = $criteria->getStart();
}
$result = $this->db->query($sql, $limit, $start);
if (!$result) {
return $ret;
}
while ($myrow = $this->db->fetchArray($result)) {
$ads = new CatadsAds();
$ads->assignVars($myrow);
$ads->setCatTitle($myrow['title']);
$ads->setDisplayPrice($myrow['display_price']);
$ret[] =& $ads;
unset($ads);
}
return $ret;
}
function getCount($criteria = null)
{
$sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('catads_ads');
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
$sql .= ' '.$criteria->renderWhere();
}
if (!$result =& $this->db->query($sql)) {
return 0;
}
list($count) = $this->db->fetchRow($result);
return $count;
}
function incView($ads_id)
{
$sql = "UPDATE ".$this->db->prefix("catads_ads ")." SET view=view+1 WHERE ads_id = '$ads_id'";
if (!$result =& $this->db->queryF($sql)) {
return false;
}
return true;
}
function getCountAdsByCat($criteria = null)
{
$arr = array();
$sql = "SELECT cat_id, count(*) FROM ".$this->db->prefix("catads_ads ");
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
$sql .= ' '.$criteria->renderWhere();
}
$sql .= " GROUP BY cat_id";
if (!$result =& $this->db->query($sql)) {
return 0;
}
while ($myrow = $this->db->fetchArray($result)) {
$arr[$myrow['cat_id']] = $myrow['count(*)'];
}
return $arr;
}
}
?>
Lastly I can PM you an FTP account password to access my site if you wish. Thank you again.