Good afternoon, there is a parser, with a closed code, I want to reshape the output from it additional fields with the release date of the movie
Now displays like this January 25, 2018,"The Twentieth Century Fox CIS"
I want to do what would output like this January 25, 2018 through the extra field {date_full}

I can not figure out what to add to the data from the additional field that is indicated, which are now displayed after parsing via premiere_eng

tell me what to add

//Release date
		if($xfieldsdata['premiere_rus']) {

			$date_full=array(

            

			);

			$tpl->set('{date_full}', date("Y-m", $row['premiere_rus']));
			
		} else
			$tpl->set('{date_full}', date("Y-m", $row['premiere_rus']));

1 Answers 1

Instead of
$tpl->set('{date_full}', date("Ym", $row['premiere_rus']));

try this

$tpl->set('{date_full}', langdate("d FY", strtotime($xfieldsdata['premiere_rus']))));
  • It seems to have happened, but there is a problem, I can not say for sure whether it is so or not, through the main field that the parser fills in, displays the date January 25, 2018, “The Twentieth Century Fox CIS”
    through this solution doesn’t do much else January 30, 2018
    – Vegetarian Penguin Jan 30 '18 at 11:10
  • Vegetarian Penguin, and what value does the $xfieldsdata['premiere_rus'] field contain? – Poor Peccary Jan 30 '18 at 11:12
  • Poor Peccary, Here are the data from a table in the database | premiere_rus | January 25, 2018,"The Twentieth Century Fox CIS" | – Vegetarian Penguin Jan 30 '18 at 11:14
  • Poor Peccary, Could write the full code that needs to be replaced) – Vegetarian Penguin Jan 30 '18 at 11:21
  • Poor Peccary, I mean, what should be the result)

    like this ?
    – Vegetarian Penguin Jan 30 '18 at 11:22
  • Vegetarian Penguin,

    $tpl->set('{date_full}', $xfieldsdata['premiere_rus']);
    – Poor Peccary Jan 30 '18 at 11:23
  • Poor Peccary,
    //Release Date
    		if($xfieldsdata['premiere_rus']) {
    			$date_full=array();
    			$tpl->set('{date_full}', $xfieldsdata['premiere_rus']);
    		} else
    		$tpl->set('{date_full}', $xfieldsdata['premiere_rus']);


    So?) I mean that where to insert the code that you just wrote above
    – Vegetarian Penguin Jan 30 '18 at 11:26
  • Vegetarian Penguin, what I wrote a little higher, you do not need to insert anywhere, there is a lot of superfluous.You wrote an almost correct version.Here is the final version.

    ($xfieldsdata['premiere_rus']] {
          $date_full=array();
          $tpl->set('{date_full}', $xfieldsdata['premiere_rus']);
        } else
        $tpl->set('{date_full}','Unknown');
    – Poor Peccary Jan 30 '18 at 11:28
  • Poor Peccary, now everything has returned that displays the standard field premiere_rus, January 25, 2018, “The Twentieth Century Fox CIS” – Vegetarian Penguin Jan 30 '18 at 11:36
  • Vegetarian Penguin, do so

    if($xfieldsdata['premiere_rus']] {
          list($date, $trash)=explode(','$xfieldsdata['premiere_rus']);
          $tpl->set('{date_full}', $date);
    } else {
        $tpl->set('{date_full}','Unknown');
    }
    – Poor Peccary Jan 30 '18 at 11:40
  • Poor Peccary, white page) – Vegetarian Penguin Jan 30 '18 at 11:41
  • Vegetarian Penguin, look for an error, somewhere you missed something, maybe a bracket or a semicolon. – Poor Peccary Jan 30 '18 at 11:44
  • Vegetarian Penguin, add this to the top of the file after<?Php

    ini_set("display_errors", 1);
    error_reporting(E_ALL);


    see an error
    – Poor Peccary Jan 30 '18 at 11:50
  • Poor Peccary, in this line the error is
    list($date, $trash)=explode(','$xfieldsdata['premiere_rus']];
    – Vegetarian Penguin Jan 30 '18 at 11:55
  • syntax error, unexpected'$xfieldsdata'(T_VARIABLE), expecting','or')'in – Vegetarian Penguin Jan 30 '18 at 11:57
  • Vegetarian Penguin, missed comma

    list($date, $trash)=explode(',', $xfieldsdata['premiere_rus']);
    – Poor Peccary Jan 30 '18 at 12:04