mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Removed wbr() (#1387)
This commit is contained in:
parent
c0117d3616
commit
80fe5a5e60
13 changed files with 22 additions and 28 deletions
|
@ -250,7 +250,7 @@ foreach ($cat_forums as $cid => $c) {
|
|||
$template->assign_block_vars('c.f.last', [
|
||||
'LAST_TOPIC_ID' => $f['last_topic_id'],
|
||||
'LAST_TOPIC_TIP' => $f['last_topic_title'],
|
||||
'LAST_TOPIC_TITLE' => wbr(str_short($f['last_topic_title'], $last_topic_max_len)),
|
||||
'LAST_TOPIC_TITLE' => str_short($f['last_topic_title'], $last_topic_max_len),
|
||||
'LAST_POST_TIME' => bb_date($f['last_post_time'], $bb_cfg['last_post_date_format']),
|
||||
'LAST_POST_USER' => profile_url(['username' => str_short($f['last_post_username'], 15), 'user_id' => $f['last_post_user_id'], 'user_rank' => $f['last_post_user_rank']]),
|
||||
]);
|
||||
|
|
|
@ -88,7 +88,7 @@ if ($tor_auth_reg || $tor_auth_del) {
|
|||
$tracker_link = ($tor_reged) ? $unreg_tor_url : $reg_tor_url;
|
||||
}
|
||||
|
||||
$display_name = wbr($t_data['topic_title']) . ' [' . $bb_cfg['server_name'] . '-' . $bt_topic_id . ']' . '.' . TORRENT_EXT;
|
||||
$display_name = $t_data['topic_title'] . ' [' . $bb_cfg['server_name'] . '-' . $bt_topic_id . ']' . '.' . TORRENT_EXT;
|
||||
|
||||
if (!$tor_reged) {
|
||||
$template->assign_block_vars('postrow.attach.tor_not_reged', [
|
||||
|
|
|
@ -790,11 +790,6 @@ function str_short($text, $max_length, $space = ' ')
|
|||
return $text ?? '';
|
||||
}
|
||||
|
||||
function wbr($text, $max_word_length = HTML_WBR_LENGTH)
|
||||
{
|
||||
return preg_replace("/([\w\->;:.,~!?(){}@#$%^*\/\\\\]{" . $max_word_length . "})/ui", '$1<wbr>', $text);
|
||||
}
|
||||
|
||||
function generate_user_info($row, bool $have_auth = IS_ADMIN): array
|
||||
{
|
||||
global $userdata, $lang, $images, $bb_cfg;
|
||||
|
|
|
@ -81,10 +81,10 @@ if ($watch_count > 0) {
|
|||
'ROW_CLASS' => (!($i % 2)) ? 'row1' : 'row2',
|
||||
'POST_ID' => $watch[$i]['topic_first_post_id'],
|
||||
'TOPIC_ID' => $watch[$i]['topic_id'],
|
||||
'TOPIC_TITLE' => wbr(str_short($watch[$i]['topic_title'], 70)),
|
||||
'FULL_TOPIC_TITLE' => wbr($watch[$i]['topic_title']),
|
||||
'TOPIC_TITLE' => str_short($watch[$i]['topic_title'], 70),
|
||||
'FULL_TOPIC_TITLE' => $watch[$i]['topic_title'],
|
||||
'U_TOPIC' => TOPIC_URL . $watch[$i]['topic_id'],
|
||||
'FORUM_TITLE' => wbr($watch[$i]['forum_name']),
|
||||
'FORUM_TITLE' => $watch[$i]['forum_name'],
|
||||
'U_FORUM' => FORUM_URL . $watch[$i]['forum_id'],
|
||||
'REPLIES' => $watch[$i]['topic_replies'],
|
||||
'AUTHOR' => profile_url($watch[$i]),
|
||||
|
|
|
@ -49,7 +49,7 @@ foreach ($sql as $rowset) {
|
|||
|
||||
if ($releasing) {
|
||||
foreach ($releasing as $i => $row) {
|
||||
$topic_title = wbr($row['topic_title']);
|
||||
$topic_title = $row['topic_title'];
|
||||
|
||||
$template->assign_block_vars('released', [
|
||||
'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
|
||||
|
@ -69,7 +69,7 @@ if ($releasing) {
|
|||
|
||||
if ($seeding) {
|
||||
foreach ($seeding as $i => $row) {
|
||||
$topic_title = wbr($row['topic_title']);
|
||||
$topic_title = $row['topic_title'];
|
||||
|
||||
$template->assign_block_vars('seed', [
|
||||
'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
|
||||
|
@ -89,9 +89,9 @@ if ($seeding) {
|
|||
|
||||
if ($leeching) {
|
||||
foreach ($leeching as $i => $row) {
|
||||
$compl_size = ($row['remain'] && $row['size'] && $row['size'] > $row['remain']) ? ($row['size'] - $row['remain']) : 0;
|
||||
$compl_perc = ($compl_size) ? floor($compl_size * 100 / $row['size']) : 0;
|
||||
$topic_title = wbr($row['topic_title']);
|
||||
$compl_size = ($row['remain'] && $row['size'] && ($row['size'] > $row['remain'])) ? ($row['size'] - $row['remain']) : 0;
|
||||
$compl_perc = $compl_size ? floor($compl_size * 100 / $row['size']) : 0;
|
||||
$topic_title = $row['topic_title'];
|
||||
|
||||
$template->assign_block_vars('leech', [
|
||||
'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
|
||||
|
|
|
@ -564,7 +564,7 @@ switch ($mode) {
|
|||
|
||||
$template->assign_block_vars('postrow', [
|
||||
'ROW_CLASS' => $row_class,
|
||||
'POSTER_NAME' => wbr($poster),
|
||||
'POSTER_NAME' => $poster,
|
||||
'POST_DATE' => $post_date,
|
||||
'MESSAGE' => $message,
|
||||
'CHECKBOX' => defined('BEGIN_CHECKBOX'),
|
||||
|
@ -674,7 +674,7 @@ switch ($mode) {
|
|||
|
||||
$template->assign_block_vars('userrow', [
|
||||
'ROW_CLASS' => !($i % 2) ? 'row4' : 'row5',
|
||||
'USERNAME' => wbr($username),
|
||||
'USERNAME' => $username,
|
||||
'POSTS' => $row['postings'],
|
||||
'U_PROFILE' => ($id == GUEST_UID) ? "modcp.php?mode=ip&p=$post_id&t=$topic_id" : PROFILE_URL . $id,
|
||||
'U_SEARCHPOSTS' => "search.php?search_author=1&uid=$id",
|
||||
|
|
|
@ -441,7 +441,7 @@ if ($refresh || $error_msg || ($submit && $topic_has_new_posts)) {
|
|||
|
||||
$template->assign_vars([
|
||||
'TPL_PREVIEW_POST' => true,
|
||||
'TOPIC_TITLE' => wbr($preview_subject),
|
||||
'TOPIC_TITLE' => $preview_subject,
|
||||
'POST_SUBJECT' => $preview_subject,
|
||||
'POSTER_NAME' => $preview_username,
|
||||
'POST_DATE' => bb_date(TIMENOW),
|
||||
|
@ -618,7 +618,7 @@ $template->assign_vars([
|
|||
'PAGE_TITLE' => $page_title,
|
||||
'POSTING_TYPE_TITLE' => $page_title,
|
||||
'POSTING_TOPIC_ID' => ($mode != 'newtopic') ? $topic_id : '',
|
||||
'POSTING_TOPIC_TITLE' => ($mode != 'newtopic') ? wbr($post_info['topic_title']) : '',
|
||||
'POSTING_TOPIC_TITLE' => ($mode != 'newtopic') ? $post_info['topic_title'] : '',
|
||||
'U_VIEW_FORUM' => FORUM_URL . $forum_id,
|
||||
|
||||
'USERNAME' => @$username,
|
||||
|
|
|
@ -1074,7 +1074,7 @@ if ($mode == 'read') {
|
|||
|
||||
$template->assign_vars([
|
||||
'TPL_PREVIEW_POST' => true,
|
||||
'TOPIC_TITLE' => wbr($preview_subject),
|
||||
'TOPIC_TITLE' => $preview_subject,
|
||||
'POST_SUBJECT' => $preview_subject,
|
||||
'MESSAGE_TO' => $to_username,
|
||||
'MESSAGE_FROM' => $userdata['username'],
|
||||
|
|
|
@ -801,7 +801,7 @@ else {
|
|||
'FORUM_NAME' => $forum_name_html[$forum_id],
|
||||
'TOPIC_ID' => $topic_id,
|
||||
'HREF_TOPIC_ID' => $moved ? $topic['topic_moved_id'] : $topic['topic_id'],
|
||||
'TOPIC_TITLE' => wbr($topic['topic_title']),
|
||||
'TOPIC_TITLE' => $topic['topic_title'],
|
||||
'IS_UNREAD' => $is_unread,
|
||||
'TOPIC_ICON' => get_topic_icon($topic, $is_unread),
|
||||
'PAGINATION' => $moved ? '' : build_topic_pagination(TOPIC_URL . $topic_id, $topic['topic_replies'], $bb_cfg['posts_per_page']),
|
||||
|
|
|
@ -149,7 +149,7 @@ class Atom
|
|||
@unlink($file_path);
|
||||
return false;
|
||||
}
|
||||
if (self::create_atom($file_path, 'u', $user_id, wbr($username), $topics)) {
|
||||
if (self::create_atom($file_path, 'u', $user_id, $username, $topics)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -210,8 +210,7 @@ class Atom
|
|||
if (\count($orig_word)) {
|
||||
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
|
||||
}
|
||||
$topic_title = wbr($topic_title);
|
||||
$author_name = $topic['first_username'] ? wbr($topic['first_username']) : $lang['GUEST'];
|
||||
$author_name = $topic['first_username'] ?: $lang['GUEST'];
|
||||
$last_time = $topic['topic_last_post_time'];
|
||||
if ($topic['topic_last_post_edit_time']) {
|
||||
$last_time = $topic['topic_last_post_edit_time'];
|
||||
|
|
|
@ -732,7 +732,7 @@ if ($allowed_forums) {
|
|||
'FORUM_ID' => $forum_id,
|
||||
'FORUM_NAME' => $forum_id ? $forum_name_html[$forum_id] : '',
|
||||
'TOPIC_ID' => $tor['topic_id'],
|
||||
'TOPIC_TITLE' => wbr($tor['topic_title']),
|
||||
'TOPIC_TITLE' => $tor['topic_title'],
|
||||
'TOPIC_TIME' => bb_date($tor['topic_time'], 'd-M-y') . ' <b>·</b> ' . delta_time($tor['topic_time']),
|
||||
'POST_ID' => $tor['post_id'],
|
||||
'POSTER_ID' => $poster_id,
|
||||
|
|
|
@ -444,7 +444,7 @@ foreach ($topic_rowset as $topic) {
|
|||
'FORUM_ID' => $forum_id,
|
||||
'TOPIC_ID' => $topic_id,
|
||||
'HREF_TOPIC_ID' => $moved ? $topic['topic_moved_id'] : $topic['topic_id'],
|
||||
'TOPIC_TITLE' => wbr($topic['topic_title']),
|
||||
'TOPIC_TITLE' => $topic['topic_title'],
|
||||
'TOPICS_SEPARATOR' => $separator,
|
||||
'IS_UNREAD' => $is_unread,
|
||||
'TOPIC_ICON' => get_topic_icon($topic, $is_unread),
|
||||
|
|
|
@ -475,7 +475,7 @@ $template->assign_vars([
|
|||
'FORUM_NAME' => htmlCHR($forum_name),
|
||||
'TOPIC_ID' => $topic_id,
|
||||
'PAGE_TITLE' => $page_title,
|
||||
'TOPIC_TITLE' => wbr($topic_title),
|
||||
'TOPIC_TITLE' => $topic_title,
|
||||
'PORNO_FORUM' => $t_data['allow_porno_topic'],
|
||||
'REPLY_IMG' => $reply_img,
|
||||
'SHOW_BOT_NICK' => $bb_cfg['show_bot_nick'],
|
||||
|
@ -569,7 +569,7 @@ for ($i = 0; $i < $total_posts; $i++) {
|
|||
$post_date = bb_date($postrow[$i]['post_time'], $bb_cfg['post_date_format']);
|
||||
$max_post_time = max($max_post_time, $postrow[$i]['post_time']);
|
||||
$poster_posts = !$poster_guest ? $postrow[$i]['user_posts'] : '';
|
||||
$poster_from = ($postrow[$i]['user_from'] && !$poster_guest) ? wbr($postrow[$i]['user_from']) : '';
|
||||
$poster_from = ($postrow[$i]['user_from'] && !$poster_guest) ? $postrow[$i]['user_from'] : '';
|
||||
$poster_joined = !$poster_guest ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], 'Y-m-d H:i') : '';
|
||||
$poster_longevity = !$poster_guest ? delta_time($postrow[$i]['user_regdate']) : '';
|
||||
$post_id = $postrow[$i]['post_id'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue