Support Forums

Date Renewal = Date Added

This is a discussion on Date Renewal = Date Added within the Technical Support forums, part of the Technical Support Forums category; Hi, There is an easer way that when user upgrade an Ad or Renewal an Ad changes the Date Added ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 10-26-2009, 12:34 PM   #1
Customer
 
Join Date: Jun 2009
Posts: 127
Rep Power: 12
pipelin is on a distinguished road
Default Date Renewal = Date Added

Hi,

There is an easer way that when user upgrade an Ad or Renewal an Ad changes the Date Added by new date.

Date Added May 01 2009

Date renewal Oct 01 2009


New Date Added = Oct 01 2009
pipelin is offline  
Old 10-26-2009, 12:52 PM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 135
Eric Barnes is just really nice Eric Barnes is just really nice
Default

The only way to do it would be to manually edit the Listings class when the listing is edited. Basically update the dateadded field then.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 10-26-2009, 01:05 PM   #3
Customer
 
Join Date: Jun 2009
Posts: 127
Rep Power: 12
pipelin is on a distinguished road
Default

Thanks Eric,

Do you remember the lines to modify?
pipelin is offline  
Old 10-26-2009, 01:13 PM   #4
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 135
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Around line 1174:
Code:
$sSQL=sprintf("UPDATE ".PREFIX."listings SET ".$updateSQL." title=%s,shortDescription=%s,desc.......
to:
Code:
$sSQL=sprintf("UPDATE ".PREFIX."listings SET ".$updateSQL." title=%s,shortDescription=%s,dateadded=NOW(),desc.......
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 10-26-2009, 02:45 PM   #5
Customer
 
Join Date: Jun 2009
Posts: 127
Rep Power: 12
pipelin is on a distinguished road
Default

thank you very much.
pipelin is offline  
Old 10-28-2009, 01:02 PM   #6
Customer
 
Join Date: Jun 2009
Posts: 127
Rep Power: 12
pipelin is on a distinguished road
Default

Quote:
Originally Posted by Eric Barnes
Around line 1174:
Code:
$sSQL=sprintf("UPDATE ".PREFIX."listings SET ".$updateSQL." title=%s,shortDescription=%s,desc.......
to:
Code:
$sSQL=sprintf("UPDATE ".PREFIX."listings SET ".$updateSQL." title=%s,shortDescription=%s,dateadded=NOW(),desc.......
Hi,

I found this in includes/classes/kernel/listings.php V4.1.6, around 1174, but $updateSQL isn't included. Also I added dateadded=NOW(), after that, I upgraded an Ad, but the field "Date Added" in the showlistings and viewlisting show up the older date.

I'm not sure if I did something wrong.


Code:
if(!defined('IN_ADMIN')) 
		{
			$sSQL=sprintf("UPDATE ".PREFIX."listings SET title=%s,shortDescription=%s,dateadded=NOW(),description=%s,featured=%s,price=%s,display=%s,url=%s,pBold=%s,pHighlighted=%s WHERE id=%s AND owner=%s",
		         	GetSQLValueString(htmlspecialchars($data['title']),"text"),
					GetSQLValueString(htmlspecialchars($data['shortDescription']),"text"),
					GetSQLValueString(htmlspecialchars($data['description']),"text"),
					GetSQLValueString($data['featured'], "text"),
					GetSQLValueString($data['price'], "double"),
					GetSQLValueString($data['display'], "text"),
					GetSQLValueString($data['url'], "text"),
					GetSQLValueString($data['bold'], "text"),
					GetSQLValueString($data['highlighted'], "text"),
					GetSQLValueString($data['id'], "int"),
					GetSQLValueString($data['owner'],"int"));
		}
		else
		{
			$sSQL=sprintf("UPDATE ".PREFIX."listings SET owner=%s,title=%s,section=%s,shortDescription=%s,description=%s,featured=%s,price=%s,display=%s,dateadded=%s,expiration=%s,url=%s,pBold=%s,pHighlighted=%s WHERE id=%s",
		         	GetSQLValueString($data['owner'],"int"),
		         	GetSQLValueString(htmlspecialchars($data['title']),"text"),
		         	GetSQLValueString($data['section'], "int"),
pipelin is offline  
Old 10-28-2009, 02:42 PM   #7
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 135
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Sounds like you may have an old file.

At any rate for issues like this I also just add debugging code below and then run a test. Something like:
echo $sSQL;die;

Then it will print what the exact query and better show you what is going on.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 10-28-2009, 05:03 PM   #8
Customer
 
Join Date: Jun 2009
Posts: 127
Rep Power: 12
pipelin is on a distinguished road
Default

Hi Eric,

I have downloaded 68Classifieds V.4.1.6 and this file comes with the same lines. I think you took the file from an older or new version.


I'm stacked in the debugging text because my localhost isn't working properly.

Last edited by pipelin; 10-28-2009 at 09:47 PM.
pipelin is offline  
Old 10-29-2009, 09:54 AM   #9
Customer
 
Join Date: Jun 2009
Posts: 127
Rep Power: 12
pipelin is on a distinguished road
Default

I tried many ways but I couldn't.
Is there something to do in the ../core/renew spet1.php or step2.php?
thanks.
pipelin is offline  
Old 10-29-2009, 10:29 AM   #10
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 135
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Sorry. That was for editing only.

View original Listings.php and and change this:
PHP Code:
function addFeatures($id$data)
    {
        global 
$db;
        
$sSQL="UPDATE ".PREFIX."listings SET ";
        
$insertSQL="display='N', "
To:
PHP Code:
function addFeatures($id$data)
    {
        global 
$db;
        
$sSQL="UPDATE ".PREFIX."listings SET ";
        
$insertSQL="display='N', ";
$insertSQL.="dateadded = NOW(), "
Yours may be different because of this bug report:
http://www.68classifieds.com/forums/issue-361/
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date added in Order History magicosta Technical Support 11 09-19-2009 02:03 PM
Date Added and Expiration Date suav Technical Support 2 09-10-2008 12:48 AM
Changing the renewal date seymourjames Technical Support 15 07-03-2008 04:45 PM


All times are GMT -4. The time now is 10:04 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0