/* ---------- Comments ---------- */ function op_cm_iphash(){ $ip=isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:''; return substr(md5($ip.'|op-cm'),0,16); } function op_cm_avatar(){ return ''; } function op_cm_is_editorial($name){ $n=function_exists('mb_strtolower')?mb_strtolower($name):strtolower($name); return (strpos($n,'редакц')!==false || strpos($n,'orthoped')!==false || strpos($n,'врач')!==false); } function op_cm_icons(){ $b=wp_upload_dir(); return array('up'=>$b['baseurl'].'/op-icons/thumb-up.png','down'=>$b['baseurl'].'/op-icons/thumb-down.png'); } function op_cm_plural($n,$f){$n=abs($n)%100;$n1=$n%10;if($n>10&&$n<20)return $f[2];if($n1>1&&$n1<5)return $f[1];if($n1==1)return $f[0];return $f[2];} function op_cm_render_item($c,&$byParent,$depth,$ic){ $id=(int)$c->comment_ID; $name=$c->comment_author!==''?$c->comment_author:'Аноним'; $date=date_i18n('j M Y, H:i',strtotime($c->comment_date)); $like=(int)get_comment_meta($id,'op_like',true); $dis=(int)get_comment_meta($id,'op_dislike',true); $editor=op_cm_is_editorial($name); $body=nl2br(esc_html($c->comment_content)); $h ='