»Forumlar »SE ? Core Labs »Seditio 125 + Sürümlerde Bbcode Ekleme.
  https://seditio.com.tr/eski1/forums.php?m=posts&q=876
          Geri Dön      -      Sayfayı Yazdırmak için tıklayın
Author: Kaan, Posted: 2010-09-08 15:49 GMT.
Seditio 125 + S?r?mlerde Bbcode Ekleme.

system/fonksiyon.php yi a??yorsunuz Alttakini buluyorsunuz.
Kod:
function sed_bbcode($text)
{
global $L, $skin, $sys, $cfg, $sed_groups, $sed_parser;

$text = sed_bbcode_autourls($text);
$text = " ".$text;

foreach($sed_parser[0] as $bbcode => $bbcodehtml)
{
if (!empty($bbcodehtml['bb1']))
{ $text = str_replace($bbcodehtml['bb1'], $bbcodehtml['code1'], $text); }
if (!empty($bbcodehtml['bb2']))
{ $text = str_replace($bbcodehtml['bb2'], $bbcodehtml['code2'], $text); }
}

foreach($sed_parser[1] as $bbcode => $bbcodehtml)
{
if (!empty($bbcodehtml['bb1']))
{ $text = preg_replace($bbcodehtml['bb1'], $bbcodehtml['code1'], $text); }
if (!empty($bbcodehtml['bb2']))
{ $text = preg_replace($bbcodehtml['bb2'], $bbcodehtml['code2'], $text); }
}

return(substr($text,1));
}

Seditio 121 fonksiyon.php den a?ag?daki kodu al?p seditio 125+ fonksiyondaki ile de?i?tiriyorsunuz.
Kod:
function sed_bbcode($text)
{
global $L, $skin, $sys, $cfg, $sed_groups;

$text = sed_bbcode_autourls($text);
$text = " ".$text;

$bbcodes = array(
'$' => '$',
'[b]' => '<strong>',
'[/b]' => '</strong>',
'[p]' => '<p>',
'[/p]' => '</p>',
'[u]' => '<u>',
'[/u]' => '</u>',
'[i]' => '<em>',
'[/i]' => '</em>',
'[hr]' => '<hr />',
'[_]' => '&nbsp;',
'[__]' => '&nbsp; &nbsp;',
'[list]' => '<ul type="square">',
'[/list]' => '</ul>',
'[red]' => '<span style="color:#F93737">',
'[/red]' => '</span>',
'[white]' => '<span style="color:#FFFFFF">',
'[/white]' => '</span>',
'[green]' => '<span style="color:#09DD09">',
'[/green]' => '</span>',
'[blue]' => '<span style="color:#018BFF">',
'[/blue]' => '</span>',
'[orange]' => '<span style="color:#FF9900">',
'[/orange]' => '</span>',
'[yellow]' => '<span style="color:#FFFF00">',
'[/yellow]' => '</span>',
'[purple]' => '<span style="color:#A22ADA">',
'[/purple]' => '</span>',
'[black]' => '<span style="color:#000000">',
'[/black]' => '</span>',
'[grey]' => '<span style="color:#B9B9B9">',
'[/grey]' => '</span>',
'[pink]' => '<span style="color:#FFC0FF">',
'[/pink]' => '</span>',
'[sky]' => '<span style="color:#D1F4F9">',
'[/sky]' => '</span>',
'[sea]' => '<span style="color:#171A97">',
'[/sea]' => '</span>',
'[quote]' => '<blockquote>'.$L['bbcodes_quote'].'<hr />',
'[/quote]' => '<hr /></blockquote>',
'[br]' => '<br />',
'[more]' => ''
);

foreach($bbcodes as $bbcode => $bbcodehtml)
{ $text = str_replace($bbcode,$bbcodehtml,$text); }

$bbcodes = array(
'\\[img\\]([^\\\'\;\?([]*)\.(jpg|jpeg|gif|png)\\[/img\\]' => '<img src="\\1.\\2" alt="" />',
'\\[img=([^\\\'\;\?([]*)\.(jpg|jpeg|gif|png)\\]([^\\[]*)\.(jpg|jpeg|gif|png)\\[/img\\]' => '<a href="\\1.\\2"><img src="\\3.\\4" alt="" /></a>',
'\\[thumb=([^\\\'\;\?([]*)\.(jpg|jpeg|gif|png)\\]([^\\[]*)\.(jpg|jpeg|gif|png)\\[/thumb\\]' => ' <a href="pfs.php?m=view&amp;v=\\3.\\4"><img src="\\1.\\2" alt="" /></a>',
'\\[pfs]([^\\[]*)\\[/pfs\\]' => '<a href="'.$cfg['pfs_dir'].'\\1"><img src="system/img/admin/pfs.gif" alt="" /> \\1</a>',
'\\[t=([^\\\'\;\?([]*)\.(jpg|jpeg|gif|png)\\]([^\\[]*)\.(jpg|jpeg|gif|png)\\[/t\\]' => '<a href="\\3.\\4"><img src="\\1.\\2" alt="" /></a>',
'\\[url=([^\\\'\;([]*)\\]([^\\[]*)\\[/url\\]' => '<a href="\\1">\\2</a>',
'\\[url\\]([^\\([]*)\\[/url\\]' => '<a href="\\1">\\1</a>',
'\\[color=([0-9A-F]{6})\\]([^\\[]*)\\[/color\\]' => '<span style="color:#\\1">\\2</span>',
'\\[style=([1-9]{1})\\]([^\\[]*)\\[/style\\]' => '<span class="bbstyle\\1">\\2</span>',
'\\[email=([._A-z0-9-]+@[A-z0-9-]+\.[.a-z]+)\\]([^\\[]*)\\[/email\\]' => '<a href="mailto:\\1">\\2</a>',
'\\[email\\]([._A-z0-9-]+@[A-z0-9-]+\.[.a-z]+)\\[/email\\]' => '<a href="mailto:\\1">\\1</a>',
'\\[user=([0-9]+)\\]([A-z0-9_\. -]+)\\[/user\\]' => '<a href="users.php?m=details&amp;id=\\1">\\2</a>',
'\\[page=([0-9]+)\\]([^\\[]*)\\[/page\\]' => '<a href="page.php?id=\\1">\\2</a>',
'\\[page\\]([0-9]+)\\[/page\\]' => '<a href="page.php?id=\\1">'.$L['Page'].' #\\1</a>',
'\\[group=([0-9]+)\\]([^\\([]*)\\[/group\\]' => '<a href="users.php?g=\\1">\\2</a>',
'\\[topic\\]([0-9]+)\\[/topic\\]' => '<a href="forums.php?m=posts&amp;q=\\1">'.$L['Topic'].' #\\1</a>',
'\\[post\\]([0-9]+)\\[/post\\]' => '<a href="forums.php?m=posts&amp;p=\\1#\\1">'.$L['Post'].' #\\1</a>',
'\\[pm\\]([0-9]+)\\[/pm\\]' => '<a href="pm.php?m=send&amp;to=\\1"><img src="skins/'.$skin.'/img/system/icon-pm.gif" alt=""></a>',
'\\[f\\]([a-z][a-z])\\[/f\\]' => '<a href="users.php?f=country_\\1"><img src="system/img/flags/f-\\1.gif" alt="" /></a>',
'\\[ac=([^\\[]*)\\]([^\\[]*)\\[/ac\\]' => '<acronym title="\\1">\\2</acronym>',
'\\[del\\]([^\\[]*)\\[/del\\]' => '<del>\\1</del>',
'\\[quote=([^\\[]*)\\]' => '<blockquote>\\1<hr />',
'\\[spoiler\\]' => '<div style="margin:0; margin-top:8px"><div style="margin-bottom:4px"><input type="button" value="'.$L['Show'].'" onClick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\'; this.innerText = \'\'; this.value = \''.$L['Hide'].'\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \''.$L['Show'].'\'; }"></div><div class="spoiler"><div style="display: none;">',
'\\[spoiler=([A-z0-9_\. -]+)\\]' => '<div style="margin:0; margin-top:8px"><div style="margin-bottom:4px"><input type="button" value="'.$L['Show'].':\\1" onClick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\'; this.innerText = \'\'; this.value = \''.$L['Hide'].':\\1\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \''.$L['Show'].':\\1\'; }"></div><div class="spoiler"><div style="display: none;">',

'\\[/spoiler\\]' => '</div></div></div>');

foreach($bbcodes as $bbcode => $bbcodehtml)
{ $text = eregi_replace($bbcode,$bbcodehtml,$text); }

if ($cfg['parser_vid'])
{
$bbcodes = array(
'\\[youtube=([^\\[]*)\\]' => '<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/\\1"></param>
<embed src="http://www.youtube.com/v/\\1" type="application/x-shockwave-flash" width="425" height="350"></embed>
</object>',
'\\[googlevideo=([^\\[]*)\\]' => '<embed style="width:425px; height:326px;" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=\\1&hl=en-GB"> </embed>',
'\\[metacafe=([^\\[]*)\\]' => '<embed style="width:425px; height:345px;" src="http://www.metacafe.com/fplayer/\\1" width="400" height="345" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');

foreach($bbcodes as $bbcode => $bbcodehtml)
{ $text = eregi_replace($bbcode,$bbcodehtml,$text); }
}

$bbcodes = array(
'\\[colleft\\]([^\\[]*)\\[/colleft\\]' => '<div class="colleft">\\1</div>',
'\\[colright\\]([^\\[]*)\\[/colright\\]' => '<div class="colright">\\1</div>',
'\\[center\\]([^\\[]*)\\[/center\\]' => '<div style="text-align:center;">\\1</div>',
'\\[right\\]([^\\[]*)\\[/right\\]' => '<div style="text-align:right;">\\1</div>',
'\\[left\\]([^\\[]*)\\[/left\\]' => '<div style="text-align:left;">\\1</div>',
'\\[c1\\:([^\\[]*)\\]([^\\[]*)\\[c2\\:([^\\[]*)\\]([^\\[]*)\\[c3\\]' => '<table style="margin:0; vertical-align:top; width:100%;"><tr><td style="padding:8px; vertical-align:top; width:\\1%;">\\2</td><td  style="padding:8px; vertical-align:top; width:\\3%;">\\4</td></tr></table>'
);

foreach($bbcodes as $bbcode => $bbcodehtml)
{ $text = eregi_replace($bbcode,$bbcodehtml,$text); }

return(substr($text,1));
}

B?ylelikle Manuel Bbbcode Ekleme ?zelli?ine kavu?mu? oluyorsunuz..
Seditio 150 de test edildi her hangi bir soruna rastlanmam??t?r..
Author: aLcatraZ, Posted: 2010-09-08 15:57 GMT.
Deprecated: Function eregi_replace() is deprecated in C:\xampp\htdocs\system\functions.php on line 301

hatas? verdi 130 kullan?yorum
Author: Kaan, Posted: 2010-09-08 16:00 GMT. This post was edited by Kaan (2020-12-31 14:58 GMT, 1934 Gün ago)
Ondada sorun olmamas? gerekiyor sen yanl?? bir uygulama yapm?? olabilirsin 150 ile 130 daki fonksiyon ayn?..

Deprecated: Function eregi_replace() is deprecated
Burada diyorki bu fonksiyon art?k kullan?lm?yor diyor..
Author: aLcatraZ, Posted: 2010-09-09 02:34 GMT.
pardon kaan kulland???m localhost serverden kaynakl?ym?? free hostta denedim oldu te?ekk?rler

Powered by SeditioPrint version