V4.1.x plugin function.new_listings.php

Discussion in 'Modules / Plugins / Modifications' started by magicosta, Aug 1, 2010.

  1. magicosta Customer

    Hello there,

    In order to get a date for the new listings displayed on my home page, I have added the following line of code in function.new_listings.php

    //date
    $output.=$loop[$x][dateadded];
    $output.="</td>\n";
    $output .= "<td" . smarty_function_html_table_cycle_newlistings('td', $td_attr, $c) . ">\n";


    after these lines of code (on line 96):

    //opening tr
    $output .= "<tr" . smarty_function_html_table_cycle_newlistings('tr', $tr_attr, $c) . ">\n";
    //opening td
    $output .= "<td" . smarty_function_html_table_cycle_newlistings('td', $td_attr, $c) . ">\n";
    //title
    $link = $modules->call_hook('listing_url', $loop[$x]);
    if($link == '')
    {
    $link="viewlisting.php?view=".$loop[$x][id];
    }


    It is working fine, I have the date of publication for each listing and as well the hour of publiction which I don't want!

    I have looked around but I didn't find out anything to remove the hour!

    Any idea where I have to look at ?

    Thank you
  2. Lhotch curmudgeon

    Depends on the format of the date. You can probably just strip off X number of characters or use the date/time with the proper php function.

    PHP: Date/Time Functions - Manual
  3. magicosta Customer

    Thank you Larry for your reply.

    I have tried to find out the solution with your advices but till now I am not successful!

    As you can see on my image, I got the dates with the hours and I would like to remove theses hours to get more space between cols.

    Thank you in advance for any more help

    Attached Files:

  4. Lhotch curmudgeon

    //date
    $output.=substr($loop[$x][dateadded],0,10);
    $output.="</td>\n";
    $output .= "<td" . smarty_function_html_table_cycle_newlistings('td', $td_attr, $c) . ">\n";
  5. magicosta Customer

    Thank you very much Larry.

    there is no way I would have sorted it out by myself

    Thanks again, I appreciate a lot your help.
  6. magicosta Customer

    Hello again,

    My regional sttings for the date is correctly set up but my date is still written in the english way and I will be better to get it like: Day-Month-Year with a code like that I suppose: %d %m %Y

    Anyone can point me to the right direction to alter this date, thank you in advance.

Share This Page