Помогите найти ошибку, выводиться код в порядке, но нету между цифрами пробелов и в конец "бел. руб.".
Вроде все есть но выходит только не красивое число
function rpwe_excerpt( $length ) {
global $post, $id;
$post_id = (int)$post_id;
$price = 0;
if (!$post_id) $post_id = $id;
$cena_values = get_post_custom_values( 'cena',$post_id );
if (!empty($cena_values)){
foreach($cena_values as $key => $value ) {
$price = $value * get_current_rate();
}
}
return $price;
}
function get_nice_rpwe_excerpt($price){
if (!empty($price) && $price>0)
return number_format($length,0,',',' ')." бел. руб.";
else
return '';
}
function art_post_rpwe_excerpt($title, $content, $id = '', $class = '', $args = array()){
if ($title != "") {
$title = '<h2 class="art-postheader">'. $title . '</h2>';
}
if (art_option('metadata.title')) {
$content = $title . $content;
$title = '';
}
if ($class != '') {
$class = ' ' .$class;
}
if($id != ''){
$id = 'id="' . $id. '"';
$price = get_nice_rpwe_excerpt(rpwe_excerpt($id));
}
echo art_parse_template("post", array_merge(array(
'post_class' => $class,
'post_id' => $length,
'post_thumbnail' => '',
'post_title' => $title,
'post_metadataheader' => '',
'post_content' => $content,
'post_metadatafooter' => '',
'price' => $price,
), $args));
}
Вроде все есть но выходит только не красивое число
function rpwe_excerpt( $length ) {
global $post, $id;
$post_id = (int)$post_id;
$price = 0;
if (!$post_id) $post_id = $id;
$cena_values = get_post_custom_values( 'cena',$post_id );
if (!empty($cena_values)){
foreach($cena_values as $key => $value ) {
$price = $value * get_current_rate();
}
}
return $price;
}
function get_nice_rpwe_excerpt($price){
if (!empty($price) && $price>0)
return number_format($length,0,',',' ')." бел. руб.";
else
return '';
}
function art_post_rpwe_excerpt($title, $content, $id = '', $class = '', $args = array()){
if ($title != "") {
$title = '<h2 class="art-postheader">'. $title . '</h2>';
}
if (art_option('metadata.title')) {
$content = $title . $content;
$title = '';
}
if ($class != '') {
$class = ' ' .$class;
}
if($id != ''){
$id = 'id="' . $id. '"';
$price = get_nice_rpwe_excerpt(rpwe_excerpt($id));
}
echo art_parse_template("post", array_merge(array(
'post_class' => $class,
'post_id' => $length,
'post_thumbnail' => '',
'post_title' => $title,
'post_metadataheader' => '',
'post_content' => $content,
'post_metadatafooter' => '',
'price' => $price,
), $args));
}