PDA

View Full Version : FAQDesk, Change date format??



HollyRidge
09-28-2005, 02:50 PM
I am trying to figure out how to change the date format in the faq listings in the FAQDesk 1.01.1 contrib (http://www.oscommerce.com/community/contributions,1106). I found the line but for the life of me I can not figure our how to change the way the date & time are formated. I want it to show the date using the same format as the rest of my cart which is determined in the top of english.php in the languages directory. Here is the section of code it is in (includes/modules/faqdesk/faqdesk_listing.php)...


if ( ($number_of_products/2) == floor($number_of_products/2) ) {
// if ( ($number_of_faqs/2) == floor($number_of_faqs/2) ) {
$list_box_contents[] = array('params' => 'class="productListing-even"');
} else {
$list_box_contents[] = array('params' => 'class="productListing-odd"');
}

$cur_row = sizeof($list_box_contents) - 1;
$cl_size = sizeof($column_list);
for ($col=0; $col<$cl_size; $col++) {
$lc_align = '';
switch ($column_list[$col]) {
case 'FAQDESK_DATE_AVAILABLE':
$lc_text = ' <a href="' . tep_href_link(FILENAME_FAQDESK_INFO, ($faqPath ? 'faqPath=' . $faqPath . '&' : '')
. 'faqdesk_id=' . $listing_values['faqdesk_id']) . '">' . $listing_values['faqdesk_date_added'] . '</a> ';
break;
case 'FAQDESK_ANSWER_LONG':
$lc_text = ' <a href="' . tep_href_link(FILENAME_FAQDESK_INFO, ($faqPath ? 'faqPath=' . $faqPath . '&' : '')
. 'faqdesk_id=' . $listing_values['faqdesk_id']) . '">' . $listing_values['faqdesk_answer_long'] . '</a> ';
break;
case 'FAQDESK_ANSWER_SHORT':
$lc_text = ' <a href="' . tep_href_link(FILENAME_FAQDESK_INFO, ($faqPath ? 'faqPath=' . $faqPath . '&' : '')
. 'faqdesk_id=' . $listing_values['faqdesk_id']) . '">' . $listing_values['faqdesk_answer_short'] . '</a> ';
break;
case 'FAQDESK_QUESTION':
$lc_text = ' <a href="' . tep_href_link(FILENAME_FAQDESK_INFO, ($faqPath ? 'faqPath=' . $faqPath . '&' : '')
. 'faqdesk_id=' . $listing_values['faqdesk_id']) . '">' . $listing_values['faqdesk_question'] . '</a> ';
break;
}

$list_box_contents[$cur_row][] = array(
'align' => $lc_align,
'params' => 'class="productListing-data"',
'text' => $lc_text
);

}
}

This is the line (109) that controls that...

. 'faqdesk_id=' . $listing_values['faqdesk_id']) . '">' . $listing_values['faqdesk_date_added'] . '</a> ';

This is the part of that code that controls it...

$listing_values['faqdesk_date_added']

I am trying to get it to use the same as the faqpages themselves (faqdesk_info.php) like is controlled by this line...

<?php echo sprintf(TEXT_FAQDESK_DATE, tep_date_long($product_info_values['faqdesk_date_a dded']));; ?>

I know this is way different than it but that is the type of format I need. Anyone have any ideas of how to change that line of code to make it work to use the standard format?