Lynx
Пользователь
Фрагмент кода в index.php:
PHP:
// Poster_Mod
if($bb_cfg['lenta'])
{
$template -> assign_vars(array(
'POSTER_MOD_ON' => true,
));
$poster_mod = $datastore->get('poster_mod');
foreach ($poster_mod as $row_mod)
{
preg_match_all('/\[img=right\](.*?)\[\/img\]/i', $row_mod['post_text'], $poster, PREG_SET_ORDER);
preg_match_all('/\[img=left\](.*?)\[\/img\]/i', $row_mod['post_text'], $poster2, PREG_SET_ORDER);
preg_match_all('/\[img\](.*?)\[\/img\]/i', $row_mod['post_text'], $poster3, PREG_SET_ORDER);
preg_match_all('/\[poster\](.*?)\[\/poster\]/i', $row_mod['post_text'], $poster4, PREG_SET_ORDER);
$url = '';
if (@$poster[0][1])
{
$url = $poster[0][1];
}
elseif (@$poster2[0][1])
{
$url = $poster2[0][1];
}
elseif (@$poster3[0][1])
{
$url = $poster3[0][1];
}
elseif (@$poster4[0][1])
{
$url = $poster4[0][1];
}
$template->assign_block_vars('PosterMod', array(
'TITLE' => $row_mod['topic_title'],
'TOPIC_ID' => $row_mod['topic_id'],
'FORUM' => $row_mod['forum_name'],
'SIZE' => humn_size($row_mod['size']),
'POSTER' => profile_url(array('username' => $row_mod['username'], 'user_rank' => $row_mod['user_rank'])),
'POSTER_IMG' => $row_mod['topic_image'],
'POSTER_IMG_TITLE' => $url,
));
}
}
// Poster_Mod