moghanoghlo
Forum Replies Created
-
Forum: Plugins
In reply to: [Parsi Date] مشکل تاریخ با افزونه دکانسلام، مشکل با تغییر کدها به این شکل حل شد هم این راه حل را اینجا و هم در افزونه دکان انتشار دادم تا آنهایی که این مشکل را داشتند مشکلشان برطرف شود
در فایل listing.php
<td class=”dokan-order-date” data-title=”<?php _e( ‘Date’, ‘dokan-lite’ ); ?>” >
<?php
if ( ‘0000-00-00 00:00:00’ == $the_order->order_date ) {
$t_time = $h_time = __( ‘Unpublished’, ‘dokan-lite’ );
} else {
$t_time = get_the_time( __( ‘Y/m/d g:i:s A’, ‘dokan-lite’ ), $the_order );
$gmt_time = strtotime( $the_order->order_date . ‘ UTC’ );
$time_diff = current_time( ‘timestamp’, 1 ) – $gmt_time;
if ( $time_diff > 0 && $time_diff < 24 * 60 * 60 )
$h_time = sprintf( __( ‘%s ago’, ‘dokan-lite’ ), human_time_diff( $gmt_time, current_time( ‘timestamp’, 1 ) ) );
else
$h_time = get_the_time( __( ‘Y/m/d’, ‘dokan-lite’ ), $the_order->id );
}
echo ‘<abbr title=”‘ . esc_attr( $t_time ) . ‘”>’ . esc_html( apply_filters( ‘post_date_column_time’, $h_time, $the_order->id ) ) . ‘</abbr>’;
?>
</td>و در فایل products-listing-row.php
<td class=”post-date” data-title=”<?php _e( ‘Date’, ‘dokan-lite’ ); ?>”>
<?php
if ( ‘0000-00-00 00:00:00’ == $post->post_date ) {
$t_time = $h_time = __( ‘Unpublished’, ‘dokan-lite’ );
$time_diff = 0;
} else {
$t_time = get_the_time( __( ‘Y/m/d g:i:s A’, ‘dokan-lite’ ) );
$m_time = $post->post_date;
$time = get_post_time( ‘G’, true, $post );$time_diff = time() – $time;
if ( $time_diff > 0 && $time_diff < 24 * 60 * 60 ) {
$h_time = sprintf( __( ‘%s ago’, ‘dokan-lite’ ), human_time_diff( $time ) );
} else {
$h_time = mysql2date( __( ‘Y/m/d’, ‘dokan-lite’ ), $m_time );
}
}echo ‘<abbr title=”‘ . $t_time . ‘”>’ . apply_filters( ‘post_date_column_time’, $h_time, $post, ‘date’, ‘all’ ) . ‘</abbr>’;
echo ‘<div class=”status”>’;
if ( ‘publish’ == $post->post_status ) {
_e( ‘Published’, ‘dokan-lite’ );
} elseif ( ‘future’ == $post->post_status ) {
if ( $time_diff > 0 ) {
echo ‘<strong class=”attention”>’ . __( ‘Missed schedule’, ‘dokan-lite’ ) . ‘‘;
} else {
_e( ‘Scheduled’, ‘dokan-lite’ );
}
} else {
_e( ‘Last Modified’, ‘dokan-lite’ );
}
?>
</div>
</td>Hello, the problem with changing the code is solved this way, and you will be in the future editions
in listing.php
<td class=”dokan-order-date” data-title=”<?php _e( ‘Date’, ‘dokan-lite’ ); ?>” >
<?php
if ( ‘0000-00-00 00:00:00’ == $the_order->order_date ) {
$t_time = $h_time = __( ‘Unpublished’, ‘dokan-lite’ );
} else {
$t_time = get_the_time( __( ‘Y/m/d g:i:s A’, ‘dokan-lite’ ), $the_order );
$gmt_time = strtotime( $the_order->order_date . ‘ UTC’ );
$time_diff = current_time( ‘timestamp’, 1 ) – $gmt_time;
if ( $time_diff > 0 && $time_diff < 24 * 60 * 60 )
$h_time = sprintf( __( ‘%s ago’, ‘dokan-lite’ ), human_time_diff( $gmt_time, current_time( ‘timestamp’, 1 ) ) );
else
$h_time = get_the_time( __( ‘Y/m/d’, ‘dokan-lite’ ), $the_order->id );
}
echo ‘<abbr title=”‘ . esc_attr( $t_time ) . ‘”>’ . esc_html( apply_filters( ‘post_date_column_time’, $h_time, $the_order->id ) ) . ‘</abbr>’;
?>
</td>and products-listing-row.php
<td class=”post-date” data-title=”<?php _e( ‘Date’, ‘dokan-lite’ ); ?>”>
<?php
if ( ‘0000-00-00 00:00:00’ == $post->post_date ) {
$t_time = $h_time = __( ‘Unpublished’, ‘dokan-lite’ );
$time_diff = 0;
} else {
$t_time = get_the_time( __( ‘Y/m/d g:i:s A’, ‘dokan-lite’ ) );
$m_time = $post->post_date;
$time = get_post_time( ‘G’, true, $post );$time_diff = time() – $time;
if ( $time_diff > 0 && $time_diff < 24 * 60 * 60 ) {
$h_time = sprintf( __( ‘%s ago’, ‘dokan-lite’ ), human_time_diff( $time ) );
} else {
$h_time = mysql2date( __( ‘Y/m/d’, ‘dokan-lite’ ), $m_time );
}
}echo ‘<abbr title=”‘ . $t_time . ‘”>’ . apply_filters( ‘post_date_column_time’, $h_time, $post, ‘date’, ‘all’ ) . ‘</abbr>’;
echo ‘<div class=”status”>’;
if ( ‘publish’ == $post->post_status ) {
_e( ‘Published’, ‘dokan-lite’ );
} elseif ( ‘future’ == $post->post_status ) {
if ( $time_diff > 0 ) {
echo ‘<strong class=”attention”>’ . __( ‘Missed schedule’, ‘dokan-lite’ ) . ‘‘;
} else {
_e( ‘Scheduled’, ‘dokan-lite’ );
}
} else {
_e( ‘Last Modified’, ‘dokan-lite’ );
}
?>
</div>
</td>Thank you