two problems in pn_zclassifieds
-
- Inscrit en : 06.12.03
- Dernière visite : 15.08.09
- Messages : 4294967292
Hi there,
I have two problems with pn_zclassifieds.
1) Block: When I choose to show wanted and for sale, only the for sale section shows in the block. How do I make it show both?
2) People often confuse "suggest a category" with "suggest an ad". How do I change "suggest an ad" to "create an ad"?
thanks,
json -
- Rang : Site Admin
- Inscrit en : 06.12.03
- Dernière visite : 25.02.10
- Messages : 274
Hello,
1)
First thing to know is that blocks in my version have been rewritten to work with recent PostNuke versions and so that the files can be in the modules/PN-zClassifieds/pnblocks subdirectory. The situation is completely different with original blocks from Technivore so the first thing to do is to check that you don't have old Technivore versions of the blocks in your includes/blocks directory and if you find such files, to delete them.
There are 5 different blocks in my version here are the names that are displayed when you create a new block and when you look at the activated block's list, and also the name of the file for that block:
PN_zClassifieds featured ad block PN_featured_ad featured_ad.php
zclassifieds last ads by cat lastads_bycat lastads_bycat.php
zclassifieds last ads by type lastads_bytype lastads_bytype.php
zclassifieds last ads images lastads_img lastads_img.php
PN_zClassifieds ads/cats block zclassifieds zclassifieds.php
First thing I need to be sure is thee one you are having a problem with.
I guess it is the zclassifieds last ads by type block becaus eit is the only one where you can select the type of the ads to display. I will look at the code to see if I find any bug or typo.
2)
In the modules/PN_zClassifieds/lang/eng/global.php change the line:
define('_SUGGESTADS', 'Suggest an ad');
to:
define('_SUGGESTADS', 'Create a new ad'); -
- Rang : Site Admin
- Inscrit en : 06.12.03
- Dernière visite : 25.02.10
- Messages : 274
Well in fact there were at least 2 bugs in the ads by type block preventing it from displaying both wanted and for sale ads, and also only half of the ads were displayed for each type due to a duplicated line !!
I have now corrected the zip archives in the downloads section of this website.
Please report any other problem on this forum.
Thanks for reporting these bugs. -
- Inscrit en : 06.12.03
- Dernière visite : 15.08.09
- Messages : 4294967292
Hi there vedrine,
Thanks very much for correcting the blocks. I'm going to download it now and give it a shot. I appreciate you looking at it very much!
thanks,
json -
- Inscrit en : 06.12.03
- Dernière visite : 15.08.09
- Messages : 4294967292
I think I might have tried to update it incorrectly. Either that, or I've found a bug :)
PN .762
First, I tried to overwrite latest(by type), and I got an error. Then I deleted the original block, and reinstalled the new one. I get the same error.
This is what shows up in place of the block:
Citation
database error query:SELECT ad_id, cat_id, subject, price FROM , WHERE root_id=cat_id AND (lang='eng' OR lang='') AND exp_date>1162783677 AND valid=1 AND type = 0 ORDER BY add_date DESC LIMIT 5 error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' WHERE root_id=cat_id AND (lang='eng' OR lang='') AND exp_date>1162783677 AND v' at line 1
Reinstalling the original block works fine.
thanks,
json -
- Rang : Site Admin
- Inscrit en : 06.12.03
- Dernière visite : 25.02.10
- Messages : 274
Hello,
The error message explains the problem: the table names are missing, should be "SELECT ad_id, cat_id, subject, price FROM nuke_classifieds_ads, nuke_classifieds_category WHERE ..."
But I don't see why the table names are missing.
Everything is working as expected on my test site.
verify that you have a correct pntables.php file in your modules/PN_zClassifieds directory (but it should be there because the older version is working !)
The strange thing is that I made no change in that part of the code !!
-
- Inscrit en : 06.12.03
- Dernière visite : 15.08.09
- Messages : 4294967292
Hi there vedrine,
the tables are there. If I create the new block(with the updated code), I get the error, however if I replace the new block back with the old one, it begins working again, so the tables are there, the new block just isn't finding it.
thanks,
json -
- Rang : Site Admin
- Inscrit en : 06.12.03
- Dernière visite : 25.02.10
- Messages : 274
Hi,
the problem isn't the tables themselves. I know the tables are there because your module is working.
To find the table the block need a (correct) modules/PN_zClassifieds/pntables.php file .
The module itself doesn't need the modules/PN_zClassifieds/pntables.php file to work because it is very outdated and badly written code. But as the block is brand new code it absolutely need this file.
Can you check that this file modules/PN_zClassifieds//pntables.php is present on your server ?
If you are unsure if your pntables.php is OK, I can send you a verified one (I just find a typo between PN_zClassifieds and PN_ZClassifieds in some files so better to verify).
Just send me your mail address to vedrine _AT_vedrine _DOT_ net if you want this file.
Using the old block isn't an option because there were several bugs in it. -
- Inscrit en : 06.12.03
- Dernière visite : 15.08.09
- Messages : 4294967292
Hi there vedrine,
I don't have that file. I've sent you an email. Thank you very much for taking the time to help.
thanks,
json -
- Inscrit en : 06.12.03
- Dernière visite : 15.08.09
- Messages : 4294967292
Hi there vedrine,
I checked the download of pn_zclassifieds, and it doesn't have a pntables.php in the module's directory either. Should it have?
thanks,
json -
- Inscrit en : 06.12.03
- Dernière visite : 15.08.09
- Messages : 4294967292
Is there anyone else that might be able to post a link to the pntables.php file that I need for this block to work?
thanks,
json -
- Rang : Site Admin
- Inscrit en : 06.12.03
- Dernière visite : 25.02.10
- Messages : 274
Looking at the version of PN_zClassifieds in the downloads section of this website, I realized it lacks a lot of features I did for the one used on this website.
Unfortunately I work more than 10 hours per day for my real job so I am unable to do a "real" release.
What I did was to call this version 2.3 beta, zip it and put it in the downloads section.
But beware ! I didn't really tested it ! So if you choose to install this version (or upgrade from the 2.2 version), I don't want to have any responsability if you loose som data, the only thing I can say is that it works for me on my own website. So if you choose to use it :
- backup your website and database first
- delete all the old modules files in modules/PN_zClassifieds
- upload the new files
- in Administration upgrade, then activate (no more need to run a speciel upgrade.php file as in the old 2.2 version)
- report in this forum any problem.
You can find this version here:http://www.vedrine.net/index.php?name=Downloads&req=viewsdownload&sid=2&min=15&orderby=titleA&show=15 -
- Rang : Site Admin
- Inscrit en : 06.12.03
- Dernière visite : 25.02.10
- Messages : 274
For PN_zClassifieds' users not wanting to upgrade to the 2.3 version but just have the blocks working, I have modified the zip file "Modifieds blocks for PN_zClassifieds" in the downloads section to include the missing pntables.php, so now you have the choice
- to continue using the 2.2 version, just downloading the new zip file for the blocks to work
- upgrade to the 2.3 version wich also include the working blocks -
- Inscrit en : 05.01.07
- Dernière visite : 05.01.07
- Messages : 1
What about this problem
in PN-0764: PN_zClassifieds 2.3. during installation
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in F:\xampp\xampp\htdocs\xampp\intakus\modules\PN_zClassifieds\pninit.php on line 350
Fragment kodu
Code
$table = $pntable['classifieds_ads'];
$column = $pntable['classifieds_ads_column'];
$sql = "ALTER TABLE $table CHANGE condition $column['itemcondition'] varchar(50) DEFAULT '' NOT NULL";
line 350 $dbconn->Execute($sql);
// Check for an error with the database code, and if so set an
// appropriate error message and return
if ($dbconn->ErrorNo() != 0) {
pnSessionSetVar('errormsg',"query: $sql error: " . $dbconn->ErrorMsg());
return false;
-
- Rang : Site Admin
- Inscrit en : 06.12.03
- Dernière visite : 25.02.10
- Messages : 274
Hello,
in the pninit.php file downloadable from this website line 350 of pninit.php isCode
$sql = "ALTER TABLE $table CHANGE condition $column['itemcondition'] varchar(50) DEFAULT '' NOT NULL";
And not :
Code
$dbconn->Execute($sql);
Did you make any change to that file ?
Anyway if this line is giving you an error I need to know the version of MySQL your website is using because all the problem of PN_zClassifieds was that one of the fields in the classifieds_ads table was using "condition" as name and this is a reserved name underMySQL 5 (it wasn't in previous MySQL versions !) so I decided to change this field name to "itemcondition" and this is what the upgrade is trying to do. But the problem is that I don't have any website running under MySQL 5 so I am not currently able to test that code !
A workaround would be to use PhpMyAdmin to change by hand the name of the field from condtion to itemcondtion and to edit the pninit.php so that the upgrade do nothing replacing all the lines :
Code
function PN_zClassifieds_upgrade($oldversion)
{
// Upgrade dependent on old version number
switch($oldversion) {
case '2.1':
case '2.2':
$dbconn = pnDBGetConn(true);
$pntable = pnDBGetTables();
$table = $pntable['classifieds_ads'];
$column = $pntable['classifieds_ads_column'];
$sql = "ALTER TABLE $table CHANGE condition $column['itemcondition'] varchar(50) DEFAULT '' NOT NULL";
$dbconn->Execute($sql);
// Check for an error with the database code, and if so set an
// appropriate error message and return
if ($dbconn->ErrorNo() != 0) {
pnSessionSetVar('errormsg',"query: $sql error: " . $dbconn->ErrorMsg());
return false;
}
return PN_zClassifieds_upgrade('2.3');
break;
case '2.3':
break;
}
// Update successful
return true;
}
With just :
Code
function PN_zClassifieds_upgrade($oldversion)
{
// Update successful
return true;
}
If you try this and it works can you please report oin this forum ? Thanks.








