PDA

Orijinalini görmek için tıklayınız : Code tag kullanırken istediğiniz kod parçacıklarına renk vermek



bolubeyi
23.Nisan.2014, 23:00
Subs.php
Bul: (2 yerde geçiyor. İkisine de uygulayın.)
Kod:
// Older browsers are annoying, aren\'t they?
Üstüne ekle:
Kod:
if (!isset($disabled[\'color\']))
{
// Explode the data on each end tag.
$color_parts = explode(\'[/color]\', $data);

$last = count($color_parts) - 1;
$data = \'\';

foreach ($color_parts as $id => $part)
{
// If it\'s not the last one, try to parse the tag and add it on to the data.
if ($id != $last)
{
$data .= preg_replace(\'~\{3}|#[\da-fA-F]{6}|[A-Za-z]{1,12})\]~i\', \'\', $part, 1, $count);

// If we parsed the start tag we should also parse the end tag.
if ($count)
$data .= \'\';
else
$data .= \'\';
}
// Else just add on the data.
else
$data .= $part;
}
}
Örnek kullanım:
Kod:
if (empty($context['current_board']))
echo '
GORUNMESI ISTENEN İCERİK BURAYA YAZILACAK
';
Orjinal konu: Code tag kullan (https://www.smfdestek.com/2-0-modifikasyonlari/code-tag-kullanirken-istediginiz-kod-parcaciklarina-renk-vermek/)


Kaynak (https://webmasterlord.net/smf-eklentiler/2547-code-tag-kullanirken-istediginiz-kod-parcaciklarina-renk-vermek-new-post.html)