e_mir: (Default)
[personal profile] e_mir
Есть вот такой вот кусок PHP-текста. Это, фрагмент из вордпресовского плагина, который делает кроспостинг в ЖЖ. К сожалению, написан он несколько дубово, без учета того, что синтаксис тега "<!--more-->" несколько сложнее, и он может применяться в виде "<!--more Продолжим подробнее. -->"

Я, к стыду своему в php ничего не понимаю, а разбираться сейчас нету желания и времени - если кто в курсе, подскажите, как поправить тут строчку, где идет проверка на more. Идеально было бы конечно всобачивать строку из more в качестве строки-заместителя в lj-cut, но и без этого было бы хорошо.

Заранее благодарю.

if(!$post->post_password) {
// and if there's no <!--more--> tag, we can spit it out and go on our
// merry way
if(strpos($post->post_content, "<!--more-->") === false) {
$the_event .= apply_filters('the_content', $post->post_content);
}
else {
$content = explode("<!--more-->", $post->post_content, 2);
$the_event .= apply_filters('the_content', $content[0]);
switch($options['more']) {
case "copy":
$the_event .= apply_filters('the_content', $content[1]);
break;
case "link":
$the_event .= sprintf('<p><a href="%s#more-%s">', get_permalink($post_id), $post_id) .
__('Read the rest of this entry &raquo;', LJXP_DOMAIN) .
'</a></p>';
break;
case "lj-cut":
$the_event .= '<lj-cut text="' .
__('Read the rest of this entry &amp;raquo;', LJXP_DOMAIN) .
'">' . apply_filters('the_content', $content[1]) . '</lj-cut>';
break;
}
}
}
(will be screened)
(will be screened if not validated)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

Profile

e_mir: (Default)
e_mir

April 2017

S M T W T F S
      1
2345678
9101112131415
16171819202122
232425 26272829
30      

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 17th, 2026 10:39 am
Powered by Dreamwidth Studios