Demo

Probiere ClanSphere aus und teste daran herum. Demo

Codepaste - Details
Weitere Infos zum Codepaste

Name Videos im Board
Autor de Sickboy
CMS-Version ClanSphere 2007
Datei system/core/abcode.php
Datum 04.07.2007 um 19:21 Uhr
Beschreibung Fügt über Abcode Youtube, MyVideo und Streetfire Videos ins Board ein!
Beispiele:
Youtube Abcode [yt]Youtube ID[/yt]
MyVideo [mv]MyVideo ID[/mv]
Streetfire [st]Streetfire ID[/st]
Alter Code Alter Code +-
 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
1. / 2. / ... 
// ClanSphere 2007 - www.clansphere.net
// $Id: abcode.php 345 2006-09-23 01:54:39Z hajo $

function cs_abcode_features($name, $html = 0) {

  $cs_lang = cs_translate('system/abcodes');

  global $cs_main;
  $coop = 'symbols/' . $cs_main['img_path'] . '/openoffice/lc_';
  $ext = '.' . $cs_main['img_ext'];

  $img = cs_html_img($coop . 'alignleft' . $ext,0,0,0,$cs_lang['left']);
  $var = cs_html_anchor('left', $img, "onclick="javascript:abc_insert('[left]','[/left]','" . $name . "','')" title="".$cs_lang['left'].""");
  $img = cs_html_img($coop . 'alignhorizontalcenter' . $ext,0,0,0,$cs_lang['center']);
  $var .= cs_html_anchor('center', $img, "onclick="javascript:abc_insert('[center]','[/center]','" . $name . "','')" title="".$cs_lang['center'].""");
  $img = cs_html_img($coop . 'alignright' . $ext,0,0,0,$cs_lang['right']);
  $var .= cs_html_anchor('right', $img, "onclick="javascript:abc_insert('[right]','[/right]','" . $name . "','')" title="".$cs_lang['right'].""");
  $img = cs_html_img($coop . 'alignblock' . $ext,0,0,0,$cs_lang['justify']);
  $var .= cs_html_anchor('justify', $img, "onclick="javascript:abc_insert('[justify]','[/justify]','" . $name . "','')" title="".$cs_lang['justify'].""");
  $img = cs_html_img($coop . 'bold2' . $ext,0,0,0,$cs_lang['bold']);
  $var .= cs_html_anchor('b', $img, "onclick="javascript:abc_insert('[b]','[/b]','" . $name . "','')" title="".$cs_lang['bold'].""");
  $img = cs_html_img($coop . 'italic2' . $ext,0,0,0,$cs_lang['italic']);
  $var .= cs_html_anchor('i', $img, "onclick="javascript:abc_insert('[i]','[/i]','" . $name . "','')" title="".$cs_lang['italic'].""");
  $img = cs_html_img($coop . 'underline2' . $ext,0,0,0,$cs_lang['underline']);
  $var .= cs_html_anchor('u', $img, "onclick="javascript:abc_insert('[u]','[/u]','" . $name . "','')" title="".$cs_lang['underline'].""");
  $img = cs_html_img($coop . 'strike' . $ext,0,0,0,$cs_lang['strike']);
  $var .= cs_html_anchor('s', $img, "onclick="javascript:abc_insert('[s]','[/s]','" . $name . "','')" title="".$cs_lang['strike'].""");
  $img = cs_html_img($coop . 'hr2' . $ext,0,0,0,$cs_lang['horizontal_rule']);
  $var .= cs_html_anchor('hr', $img, "onclick="javascript:abc_insert('[hr]','','" . $name . "','')" title="".$cs_lang['horizontal_rule'].""");
  $img = cs_html_img($coop . 'headline' . $ext,0,0,0,$cs_lang['headline']);
  $var .= cs_html_anchor('h', $img, "onclick="javascript:abc_insert('[h=1]','[/h]','" . $name . "','')" title="".$cs_lang['headline'].""");
  $img = cs_html_img($coop . 'incrementindent' . $ext,0,0,0,$cs_lang['indent']);
  $var .= cs_html_anchor('indent', $img, "onclick="javascript:abc_insert('[indent=15]','[/indent]','" . $name . "','')" title="".$cs_lang['indent'].""");
  $img = cs_html_img($coop . 'quote' . $ext,0,0,0,$cs_lang['quote']);
  $var .= cs_html_anchor('quote', $img, "onclick="javascript:abc_insert('[quote]','[/quote]','" . $name . "','')" title="".$cs_lang['quote'].""");
  #$img = cs_html_img($coop . 'setdocumentproperties' . $ext,0,0,0,$cs_lang['php']);
  $img = cs_html_img($coop . 'sourcecode' . $ext,0,0,0,$cs_lang['php']);
  $var .= cs_html_anchor('php', $img, "onclick="javascript:abc_insert('[php]<?php ',' ?>
','" . $name . "','')" title="".$cs_lang['php'].""");
$img = cs_html_img($coop . 'list' . $ext,0,0,0,$cs_lang['list']);
$var .= cs_html_anchor('list', $img, "onclick="javascript:abc_insert('
    n
  • ','n
','" . $name . "','')" title="".$cs_lang['list'].""");
$img = cs_html_img($coop . 'grafmode' . $ext,0,0,0,$cs_lang['image']);
$var .= cs_html_anchor('img', $img, "onclick="javascript:abc_insert('','" . $name . "','')" title="".$cs_lang['image'].""");
$img = cs_html_img($coop . 'openurl' . $ext,0,0,0,$cs_lang['link']);
$var .= cs_html_anchor('url', $img, "onclick="javascript:abc_insert('','','" . $name . "','')" title="".$cs_lang['link'].""");
$img = cs_html_img($coop . 'sendmail' . $ext,0,0,0,$cs_lang['mail']);
$var .= cs_html_anchor('mail', $img, "onclick="javascript:abc_insert('','','" . $name . "','')" title="".$cs_lang['mail'].""");
$img = cs_html_img($coop . 'datainrows' . $ext,0,0,0,$cs_lang['clip']);
$var .= cs_html_anchor('clip', $img, "onclick="javascript:abc_insert('[clip=" .$cs_lang['more']. "]','
','" . $name . "','')" title="".$cs_lang['clip'].""");
$img = cs_html_img($coop . 'inserthyperlink' . $ext,0,0,0,$cs_lang['thread']);
$var .= cs_html_anchor('threadid', $img, "onclick="javascript:abc_insert('','','" . $name . "','')" title="".$cs_lang['thread'].""");

if(!empty($html)) {
$img = cs_html_img($coop . 'editdoc' . $ext,0,0,0,$cs_lang['html']);
$var .= cs_html_anchor('html', $img, "onclick="javascript:abc_insert('[html]','[/html]' ,'" . $name . "','')" title="".$cs_lang['html'].""");
}
$var .= cs_html_br(1);

$size = "javascript:abc_insert('[size=' + this.form.size_";
$size .= $name . ".options[this.form.size_" . $name . ".selectedIndex].value + ']";
$size .= "','[/size]','" . $name . "');this.selectedIndex=0";
$var .= cs_html_select(1,'size_' . $name,"onchange="" . $size . """);
$var .= cs_html_option($cs_lang['font_size'],'');
$var .= cs_html_option($cs_lang['tiny'],8);
$var .= cs_html_option($cs_lang['small'],10);
$var .= cs_html_option($cs_lang['medium'],12);
$var .= cs_html_option($cs_lang['large'],18);
$var .= cs_html_option($cs_lang['giant'],24);
$var .= cs_html_select(0);

$color = "javascript:abc_insert('[color=' + this.form.color_";
$color .= $name . ".options[this.form.color_" . $name . ".selectedIndex].value + ']'";
$color .= ",'[/color]','" . $name . "');this.selectedIndex=0";
$var .= cs_html_select(1,'color_' . $name,"onchange="" . $color . """);
$var .= cs_html_option($cs_lang['font_color'],'');
$var .= cs_html_option($cs_lang['aqua'],'aqua',0,'color:aqua');
$var .= cs_html_option($cs_lang['black'],'black',0,'color:black ');
$var .= cs_html_option($cs_lang['blue'],'blue',0,'color:blue');
$var .= cs_html_option($cs_lang['fuchsia'],'fuchsia',0,'color:f uchsia');
$var .= cs_html_option($cs_lang['gray'],'gray',0,'color:gray');
$var .= cs_html_option($cs_lang['green'],'green',0,'color:green ');
$var .= cs_html_option($cs_lang['lime'],'lime',0,'color:lime');
$var .= cs_html_option($cs_lang['maroon'],'maroon',0,'color:mar oon');
$var .= cs_html_option($cs_lang['navy'],'navy',0,'color:navy');
$var .= cs_html_option($cs_lang['olive'],'olive',0,'color:olive ');
$var .= cs_html_option($cs_lang['orange'],'orange',0,'color:ora nge');
$var .= cs_html_option($cs_lang['purple'],'purple',0,'color:pur ple');
$var .= cs_html_option($cs_lang['red'],'red',0,'color:red');
$var .= cs_html_option($cs_lang['silver'],'silver',0,'color:sil ver');
$var .= cs_html_option($cs_lang['teal'],'teal',0,'color:teal');
$var .= cs_html_option($cs_lang['white'],'white',0,'color:white ');
$var .= cs_html_option($cs_lang['yellow'],'yellow',0,'color:yel low');
$var .= cs_html_select(0);

return $var;
}

function cs_abcode_smileys($name) {

$cs_lang = cs_translate('system/abcodes');
$select = 'abcode_pattern, abcode_file';
$loop_abc = cs_sql_select(__FILE__,'abcode',$select,"abcode_func = 'img'",0,0,10);
$abc_count = count($loop_abc);

$run = 0;
$col = 0;
$var = cs_html_table(1,'forum',1,'100%');
while(9 > $run) {
$col++;
if($col == 4) {
$var .= cs_html_roco(0);
$col = 1;
}
$var .= cs_html_roco($col,'centerb');
$link = cs_html_img('uploads/abcode/' . $loop_abc[$run]['abcode_file']);
$url = "javascript:abc_insert('" . $loop_abc[$run]['abcode_pattern'] . "','','" . $name . "')";
$var .= cs_html_link($url,$link,0);
$run++;
}
$var .= cs_html_roco(0);
if($abc_count == 10) {
$var .= cs_html_roco(1,'centerc',0,3);
$win = " onclick="window.open('features.php?name=".$name."', '" . $cs_lang['abclist'];
$win .= "', 'width=450,height=600,scrollbars=yes')"";
$var .= cs_html_anchor($cs_lang['abclist'],$cs_lang['abclist'],$win);
$var .= cs_html_roco(0);
}
$var .= cs_html_table(0);
return $var;
}

function cs_abcode_mode($set = 0) {
static $mode = 1;
if(!empty($set)) {
$mode = empty($mode) ? 1 : 0;
}
return $mode;
}

function cs_abcode_php($matches) {

global $com_lang;
static $lop = 1;
static $php;
$mode = cs_abcode_mode();
if(empty($mode)) {
$php_code = html_entity_decode($matches[1], ENT_QUOTES, $com_lang['charset']);
$php_code = highlight_string($php_code,TRUE);
$php_code = cs_html_div(1,'overflow:auto') . $php_code . cs_html_div(0);
$php_code = str_replace('<br />','',$php_code);
$lines = substr_count($php_code,"r") + 2;
$lin_code = '';
for($run = 1; $run < $lines; $run++) {
$lin_code .= $run . "r";
}
$start = cs_html_table(2) . cs_html_roco(1,'rightc');
$middle = cs_html_roco(2,'leftb');
$end = cs_html_roco(0) . cs_html_table(0);
$result = $start . $lin_code . $middle . $php_code . $end;
$result = str_replace('<br />','',$result);
$php[$lop] = str_replace("n",'',$result);
$data = '
 
1.
1. / 2. / ... 
 ' . $lop . '
';
$lop++;
}
else {
$use = $matches[1];
$data = nl2br($php[$use]);
}
return $data;
}

function cs_abcode_u($matches) {

return cs_html_underline(1) . $matches[1] . cs_html_underline(0);
}

function cs_abcode_b($matches) {

return cs_html_big(1) . $matches[1] . cs_html_big(0);
}

function cs_abcode_i($matches) {

return cs_html_italic(1) . $matches[1] . cs_html_italic(0);
}

function cs_abcode_indent($matches) {

return cs_html_div(1,'margin-left:'.$matches[1].'px') . $matches[2] . cs_html_div(0);
}

function cs_abcode_s($matches) {

return cs_html_span(1,'text-decoration: line-through') . $matches[1] . cs_html_span(0);
}

function cs_abcode_h($matches) {

return cs_html_span(1,'','class="h'.$matches[1].'"') . $matches[2] . cs_html_span(0);
}

function cs_abcode_hr() {

return cs_html_hr('100%');
}

function cs_abcode_hr_width($matches) {

return cs_html_hr($matches[1]);
}

function cs_abcode_list($matches) {

$style = empty($matches[2]) ? 0 : $matches[1];
$list = empty($matches[2]) ? $matches[1] : $matches[2];
$list = cs_html_list($list,$style);
return str_replace('<br />','',$list);
}

function cs_abcode_img($matches) {

if ($matches[0]{4} == ']') {
return cs_html_img($matches[1]);
} else {
$img = cs_html_img($matches[3],$matches[2],$matches[1]);
return cs_html_link($matches[3],$img);
}
}

function cs_abcode_urlimg ($matches) {
return '.']'.cs_html_img($matches[4],$matches[3],$matches[2]).'';
}

function cs_abcode_mail($matches) {

if (strpos($matches[0],'</a>') !== false)
return $matches[0];
if ($matches[0]{0} != '[')
$matches[1] = $matches[0];
return cs_html_mail($matches[1],$matches[1]);
}

function cs_abcode_color($matches) {

return cs_html_span(1,'color:' . $matches[1]) . $matches[2] . cs_html_span(0);
}

function cs_abcode_size($matches) {

$matches[1] = $matches[1] > 50 ? 50 : $matches[1];
return cs_html_span(1,'font-size:' . $matches[1] . 'pt') . $matches[2] . cs_html_span(0);
}

function cs_abcode_align($matches) {

return cs_html_div(1,'text-align:' . $matches[1]) . $matches[2] . cs_html_div(0);
}

function cs_abcode_urlauto($matches) {

if (strpos($matches[0],'</a>') !== false || strpos($matches[0],'[/threadid]') !== false)
return $matches[0];
$url = substr($matches[0],0,4) == 'www.' ? 'http://' . $matches[0] : $matches[0];
return cs_html_link($url,$matches[0]);
}

function cs_abcode_url($matches) {

if(empty($matches[2])) {
$matches[2] = $matches[1];
}
$matches[1] = strpos($matches[1],'www.') === 0 ? 'http://' . $matches[1] : $matches[1];
return cs_html_link($matches[1],$matches[2],1);
}

function cs_abcode_quote($matches) {

if ($matches[0] == '[/quote]') {
$return = cs_html_div(0);
}
elseif(empty($matches[1])) {
$return = cs_html_div(1,0,'class="quote"');
}
else {
$name = cs_html_big(1).$matches[1].cs_html_big(0);
$return = cs_html_div(1,0,'class="quote"').$name.':'.cs_html_br(1);
}
return $return;
}

function cs_abcode_clip($matches) {

static $clip_id;
$clip_id++;
$var = cs_html_img('symbols/clansphere/plus.gif',0,0,'id="img_' . $clip_id . '"') . ' ';
$var .= cs_html_link("javascript:cs_clip('" . $clip_id . "')",$matches[1],0);
$var .= cs_html_br(1);
$var .= cs_html_div(1,'display:none','id="span_' . $clip_id . '"');
$var .= $matches[2] . cs_html_div(0);
return $var;
}

function cs_abcode_html($matches) {

global $com_lang;

$string = html_entity_decode($matches[1], ENT_QUOTES, $com_lang['charset']);
$string = str_replace(array("rn","n","r"),'',$string);

return $string;

}

function cs_abcode_eval($matches) {

$matches[1] = str_replace('<br />',"rn",$matches[1]);
$matches[1] = cs_abcode_html($matches);

$matches[1] = str_replace(array('<?php','<?','?>'),'',$matches[1]);

ob_start();
eval($matches[1]);
$content = ob_get_contents();
ob_end_clean();

return $content;

}

function cs_abcode_flag ($matches) {

$path = 'symbols/countries/' . $matches[1] . '.png';

return file_exists($path) ? cs_html_img($path) : '';

}

function cs_abcode_threadid($matches) {

return cs_link($matches[2],'board','thread','where='.$matches[1]);
}

function cs_abcode_decode($matches) {

global $com_lang;

return html_entity_decode($matches[1], ENT_QUOTES, $com_lang['charset']);
}


function cs_secure($replace,$features = 0,$smileys = 0, $clip = 1, $html = 0, $phpeval = 0) {

global $com_lang, $cs_main;

$op_abcode = cs_sql_option(__FILE__,'abcode');

$replace = str_replace(array('{','}'),array('{' ,'}'),$replace);

if(!empty($smileys)) {
static $loop, $loop_abc;
if(empty($loop_abc)) {
$select = 'abcode_func, abcode_pattern, abcode_result, abcode_file';
$loop_abc = cs_sql_select(__FILE__,'abcode',$select,0,0,0,0);
$loop = count($loop_abc);
}
for($run=0; $run<$loop; $run++) {
if($loop_abc[$run]['abcode_func'] == 'img') {
$img_file = 'uploads/abcode/' . $loop_abc[$run]['abcode_file'];
$img_src = cs_html_img($img_file);
$replace = str_replace($loop_abc[$run]['abcode_pattern'],'{'.$img_ src.'}',$replace);
}
elseif($loop_abc[$run]['abcode_func'] == 'str') {
$pattern = $loop_abc[$run]['abcode_pattern'];
$replace = str_replace($pattern,'{'.$loop_abc[$run]['abcode_result' ].'}',$replace);
}
}
}

$replace = htmlentities($replace, ENT_QUOTES, $com_lang['charset']);
$replace = preg_replace('=&#(d+);=si', '', $replace);
$replace = preg_replace_callback('={(.*?)}=si','cs_abcode_decode',$replace);

if(!empty($features)) {

cs_abcode_mode(1);

if(!empty($html))
$replace = preg_replace_callback("=[html](.*?)[/html]=si","cs_abcode_html",$replace);

if (!empty($phpeval))
$replace = preg_replace_callback("=[phpcode](.*?)[/phpcode]=si",'cs_abcode_eval',$replace);

$replace = preg_replace_callback("=
 
1.
1. / 2. / ... 
 (.*?)
=si","cs_abcode_php",$replace);
$replace = nl2br($replace);
$replace = preg_replace_callback("=(.*?)=si","cs_abcode_u",$replace);
$replace = preg_replace_callback("=(.*?)=si","cs_abcode_b",$replace);
$replace = preg_replace_callback("=(.*?)=si","cs_abcode_i",$replace);
$replace = preg_replace_callback("=(.*?)=si","cs_abcode_s",$replace);
$replace = preg_replace_callback("==si","cs_abcode_img",$replace);
$replace = preg_replace_callback("==si",
"cs_abcode_urlimg",$replace);
$replace = preg_replace_callback("=[img width=([d]*?) height=([d]*?)](.*?)[/img]=si", "cs_abcode_img",$replace);
$replace = preg_replace_callback("=( (dot) *?)=si","cs_abcode_mail",$replace);
$replace = preg_replace_callback('=([^s]{3,}) (at) ( (dot) *?) (dot) ([^s]{2,7})(?![^<]+>|[^&]*;)=si','cs_abcode_mail',$replace);
$replace = preg_replace_callback("=[color=([w]*?)](.*?)[/color]=si","cs_abcode_color",$replace);
$replace = preg_replace_callback("=[size=([d]*?)](.*?)[/size]=si","cs_abcode_size",$replace);
$replace = preg_replace_callback("=[(left|center|right|justify)](.*?)[/(left|center|right|justify)]=si",
"cs_abcode_align",$replace);
$replace = preg_replace_callback("=[list=(.*?)](.*?)[/list]=si","cs_abcode_list",$replace);
$replace = preg_replace_callback("=
    =si","cs_abcode_list",$replace);
    $replace = preg_replace_callback("=(.*?)=si","cs_abcode_url",$replace);
    $replace = preg_replace_callback("=(.*?)=si","cs_abcode_url",$replace);
    $replace = preg_replace_callback('=[flag=(.*?)]=si','cs_abcode_flag',$replace);
    $replace = preg_replace_callback('/(www.|http://|ftp://)([^s,]*)(?![^<]+>|[^&]*;)/i','cs_abcode_urlauto',$replace);
    $replace = preg_replace_callback("=[indent=([d]*?)](.*?)[/indent]=si","cs_abcode_indent",$replace);
    $replace = preg_replace_callback("=[threadid=(.*?)](.*?)[/threadid]=si","cs_abcode_threadid",$replace);
    $replace = preg_replace_callback("=[h=([d]*?)](.*?)[/h]=si","cs_abcode_h",$replace);
    $replace = preg_replace_callback("=
    =si","cs_abcode_hr",$replace);
    preg_match_all('=[quote=?(.*?)]=si', $replace, $quote_sub);
    $quote_start_count = count($quote_sub[0]);
    $quote_end_count = substr_count($replace, '[/quote]');
    if ($quote_start_count !== 0 && $quote_start_count == $quote_end_count) {
    $replace = preg_replace_callback('=[quote=?(.*?)]=si',"cs_abcode_quote",$replace);
    $replace = preg_replace_callback('=[/quote]=si',"cs_abcode_quote",$replace);
    }
    if(!empty($clip)) {
    $replace = preg_replace_callback("=(.*?) +-
    (.*?)
    =si","cs_abcode_clip",$replace);
    }

    if(!empty($op_abcode['word_cut']))
    $replace = preg_replace("=([^s*?]{".$op_abcode['word_cut']."})(?![^<]+>|[^&]*;)=","� ",$replace);
    }

    if(!empty($features)) {
    cs_abcode_mode(1);
    $replace = preg_replace_callback("=
     
    1.
    1. / 2. / ... 
     (.*?)
    =si","cs_abcode_php",$replace);
    }
    return $replace;
    }


    function cs_abcode_resize ($matches) {

    $options = cs_sql_option(__FILE__,'abcode');

    $max_width = $options['image_width'];
    $max_height = $options['image_height'];

    if ($matches[0]{4} == ']') {
    $img = $matches[1];
    if ($size = getimagesize($matches[1])) {
    if ($size[0] > $max_width) {
    $new_width = $max_width;
    $new_height = round($size[1] / $size[0] * $max_width);
    $change = 1;
    } else {
    $new_height = $size[1];
    $new_width = $size[0];
    }
    if ($new_height > $max_height) {
    $new_height = $max_height;
    $new_width = round($size[0] / $size[1] * $max_height);
    $change = 1;
    }
    }
    } else {
    $img = $matches[3];
    if ($matches[1] > $max_width) {
    $change = 1;
    $new_width = $max_width;
    }
    if ($matches[2] > $max_height) {
    $change = 1;
    $new_height = $max_height;
    }
    if (!empty($change)) {
    $new_width = empty($new_width) ? $matches[1] : $new_width;
    $new_height = empty($new_height) ? $matches[2] : $new_height;
    }
    }

    if (!empty($change)) {
    $var = '[img width='.$new_width.' height='.$new_height.']'.$img.'[/img]';
    } else {
    $var = $matches[0];
    }

    return $var;
    }

    [/php][/clip]
    Neuer Code Neuer Code +-
     
    1.
    2.
    3.
    4.
    5.
    6.
    7.
    8.
    9.
    10.
    11.
    12.
    13.
    14.
    15.
    16.
    17.
    18.
    19.
    20.
    21.
    22.
    23.
    24.
    25.
    26.
    27.
    28.
    29.
    30.
    31.
    32.
    33.
    34.
    35.
    36.
    37.
    38.
    39.
    40.
    41.
    42.
    43.
    44.
    45.
    46.
    47.
    48.
    49.
    50.
    51.
    52.
    53.
    54.
    55.
    56.
    57.
    58.
    59.
    60.
    61.
    62.
    63.
    64.
    1. / 2. / ... 
    // Sickboy

    function cs_abcode_features($name, $html = 0) {

      $cs_lang = cs_translate('system/abcodes');

      $size = "javascript:abc_insert('[size=' + this.form.size_";
      $size .= $name . ".options[this.form.size_" . $name . ".selectedIndex].value + ']";
      $size .= "','[/size]','" . $name . "');this.selectedIndex=0";
      $var = cs_html_select(1,'size_' . $name,"onchange="" . $size . """);
      $var .= cs_html_option($cs_lang['font_size'],'');
      $var .= cs_html_option($cs_lang['tiny'],8);
      $var .= cs_html_option($cs_lang['small'],10);
      $var .= cs_html_option($cs_lang['medium'],12);
      $var .= cs_html_option($cs_lang['large'],18);
      $var .= cs_html_option($cs_lang['giant'],24);
      $var .= cs_html_select(0);

      $color = "javascript:abc_insert('[color=' + this.form.color_";
      $color .= $name . ".options[this.form.color_" . $name . ".selectedIndex].value + ']'";
      $color .= ",'[/color]','" . $name . "');this.selectedIndex=0";
      $var .= cs_html_select(1,'color_' . $name,"onchange="" . $color . """);
      $var .= cs_html_option($cs_lang['font_color'],'');
      $var .= cs_html_option($cs_lang['aqua'],'aqua',0,'color:aqua');
      $var .= cs_html_option($cs_lang['black'],'black',0,'color:black');
      $var .= cs_html_option($cs_lang['blue'],'blue',0,'color:blue');
      $var .= cs_html_option($cs_lang['fuchsia'],'fuchsia',0,'color:fuchsia');
      $var .= cs_html_option($cs_lang['gray'],'gray',0,'color:gray');
      $var .= cs_html_option($cs_lang['green'],'green',0,'color:green');
      $var .= cs_html_option($cs_lang['lime'],'lime',0,'color:lime');
      $var .= cs_html_option($cs_lang['maroon'],'maroon',0,'color:maroon');
      $var .= cs_html_option($cs_lang['navy'],'navy',0,'color:navy');
      $var .= cs_html_option($cs_lang['olive'],'olive',0,'color:olive');
      $var .= cs_html_option($cs_lang['orange'],'orange',0,'color:orange');
      $var .= cs_html_option($cs_lang['purple'],'purple',0,'color:purple');
      $var .= cs_html_option($cs_lang['red'],'red',0,'color:red');
      $var .= cs_html_option($cs_lang['silver'],'silver',0,'color:silver');
      $var .= cs_html_option($cs_lang['teal'],'teal',0,'color:teal');
      $var .= cs_html_option($cs_lang['white'],'white',0,'color:white');
      $var .= cs_html_option($cs_lang['yellow'],'yellow',0,'color:yellow');
      $var .= cs_html_select(0);

      $align = "javascript:abc_insert('[' + this.form.align_" . $name . ".options[this.form.align_";
      $align .= $name . ".selectedIndex].value + ']','[/' + this.form.align_";
      $align .= $name . ".options[this.form.align_" . $name . ".selectedIndex].value + ']','";
      $align .= $name . "');this.selectedIndex=0";
      $var .= cs_html_select(1,'align_' . $name,"onchange="" . $align . """);
      $var .= cs_html_option($cs_lang['text_align'],'');
      $var .= cs_html_option($cs_lang['left'],'left');
      $var .= cs_html_option($cs_lang['center'],'center');
      $var .= cs_html_option($cs_lang['right'],'right');
      $var .= cs_html_option($cs_lang['justify'],'justify');
      $var .= cs_html_select(0);

      $on = "onclick="javascript:abc_";
      $var .= cs_html_vote('b','b','button',0,$on . "insert('[b]','[/b]','" . $name . "','')"");
      $var .= cs_html_vote('i','i','button',0,$on . "insert('[i]','[/i]','" . $name . "','')"");
      $var .= cs_html_vote('u','u','button',0,$on . "insert('[u]','[/u]','" . $name . "','')"");
      $var .= cs_html_vote('s','s','button',0,$on . "insert('[s]','[/s]','" . $name . "','')"");
      $var .= cs_html_vote('hr','hr','button',0,$on . "insert('[hr]','','" . $name . "','')"");
      $var .= cs_html_vote('h','headline','button',0,$on . "insert('[h=1]','[/h]','" . $name . "','')"");
      $var .= cs_html_vote('indent','indent','button',0,$on . "insert('[indent=15]','[/indent]','" . $name . "','')"");
      $var .= cs_html_vote('quote','quote','button',0,$on . "insert('[quote]','[/quote]','" . $name . "','')"");
      $var .= cs_html_vote('php','php','button',0,$on . "insert('[php]<?php ',' ?>
    ','" . $name . "','')"");
    $var .= cs_html_vote('list','list','button',0,$on . "insert('
      n
    • ','n
    ','" . $name . "','')"");
    $var .= cs_html_vote('img','img','button',0,$on . "insert('','" . $name . "','')"");
    $var .= cs_html_vote('url','url','button',0,$on . "insert('','','" . $name . "','')"");
    $var .= cs_html_vote('mail','mail','button',0,$on . "insert('','','" . $name . "','')"");
    $var .= cs_html_vote('clip','clip','button',0,$on . "insert('[clip=" .$cs_lang['more']. "]','
    ','" . $name . "','')"");
    $var .= cs_html_vote('youtube','youtube','button',0,$on . "insert('[yt]','[/yt]','" . $name . "','')"");
    $var .= cs_html_vote('myvideo','myvideo','button',0,$on . "insert('[mv]','[/mv]','" . $name . "','')"");
    $var .= cs_html_vote('streetfire','streetfire','button',0, $on . "insert('[st]','[/st]','" . $name . "','')"");
    $var .= cs_html_vote('threadid','threadlink','button',0,$o n . "insert('','','" . $name . "','')"");
    if(!empty($html))
    $var .= cs_html_vote('html','html','button',0,$on . "insert('[html]','[/html]','" . $name . "','')"");
    $var .= cs_html_br(1);
    return $var;
    }

    function cs_abcode_smileys($name) {

    $cs_lang = cs_translate('system/abcodes');
    $select = 'abcode_pattern, abcode_file';
    $loop_abc = cs_sql_select(__FILE__,'abcode',$select,"abcode_func = 'img'",0,0,10);
    $abc_count = count($loop_abc);

    $run = 0;
    $col = 0;
    $var = cs_html_table(1,'forum',1,'100%');
    while(9 > $run) {
    $col++;
    if($col == 4) {
    $var .= cs_html_roco(0);
    $col = 1;
    }
    $var .= cs_html_roco($col,'centerb');
    $link = cs_html_img('uploads/abcode/' . $loop_abc[$run]['abcode_file']);
    $url = "javascript:abc_insert('" . $loop_abc[$run]['abcode_pattern'] . "','','" . $name . "')";
    $var .= cs_html_link($url,$link,0);
    $run++;
    }
    $var .= cs_html_roco(0);
    if($abc_count == 10) {
    $var .= cs_html_roco(1,'centerc',0,3);
    $win = " onclick="window.open('features.php?name=".$name."', '" . $cs_lang['abclist'];
    $win .= "', 'width=450,height=600,scrollbars=yes')"";
    $var .= cs_html_anchor($cs_lang['abclist'],$cs_lang['abclist'],$win);
    $var .= cs_html_roco(0);
    }
    $var .= cs_html_table(0);
    return $var;
    }

    function cs_abcode_mode($set = 0) {
    static $mode = 1;
    if(!empty($set)) {
    $mode = empty($mode) ? 1 : 0;
    }
    return $mode;
    }

    function cs_abcode_php($matches) {

    global $com_lang;
    static $lop = 1;
    static $php;
    $mode = cs_abcode_mode();
    if(empty($mode)) {
    $php_code = html_entity_decode($matches[1], ENT_QUOTES, $com_lang['charset']);
    $php_code = highlight_string($php_code,TRUE);
    $php_code = cs_html_div(1,'overflow:auto') . $php_code . cs_html_div(0);
    $php_code = str_replace('<br />','',$php_code);
    $lines = substr_count($php_code,"r") + 2;
    $lin_code = '';
    for($run = 1; $run < $lines; $run++) {
    $lin_code .= $run . "r";
    }
    $start = cs_html_table(2) . cs_html_roco(1,'rightc');
    $middle = cs_html_roco(2,'leftb');
    $end = cs_html_roco(0) . cs_html_table(0);
    $result = $start . $lin_code . $middle . $php_code . $end;
    $result = str_replace('<br />','',$result);
    $php[$lop] = str_replace("n",'',$result);
    $data = '
     
    1.
    1. / 2. / ... 
     ' . $lop . '
    ';
    $lop++;
    }
    else {
    $use = $matches[1];
    $data = nl2br($php[$use]);
    }
    return $data;
    }

    function cs_abcode_u($matches) {

    return cs_html_underline(1) . $matches[1] . cs_html_underline(0);
    }

    function cs_abcode_b($matches) {

    return cs_html_big(1) . $matches[1] . cs_html_big(0);
    }

    function cs_abcode_i($matches) {

    return cs_html_italic(1) . $matches[1] . cs_html_italic(0);
    }

    function cs_abcode_indent($matches) {

    return cs_html_div(1,'margin-left:'.$matches[1].'px') . $matches[2] . cs_html_div(0);
    }

    function cs_abcode_s($matches) {

    return cs_html_span(1,'text-decoration: line-through') . $matches[1] . cs_html_span(0);
    }

    function cs_abcode_h($matches) {

    return cs_html_span(1,'','class="h'.$matches[1].'"') . $matches[2] . cs_html_span(0);
    }

    function cs_abcode_hr() {

    return cs_html_hr('100%');
    }

    function cs_abcode_hr_width($matches) {

    return cs_html_hr($matches[1]);
    }

    function cs_abcode_list($matches) {

    $style = empty($matches[2]) ? 0 : $matches[1];
    $list = empty($matches[2]) ? $matches[1] : $matches[2];
    $list = cs_html_list($list,$style);
    return str_replace('<br />','',$list);
    }

    function cs_abcode_img($matches) {

    if ($matches[0]{4} == ']') {
    return cs_html_img($matches[1]);
    } else {
    $img = cs_html_img($matches[3],$matches[2],$matches[1]);
    return cs_html_link($matches[3],$img);
    }
    }

    function cs_abcode_urlimg ($matches) {
    return '.']'.cs_html_img($matches[4],$matches[3],$matches[2]).'';
    }

    function cs_abcode_mail($matches) {

    if (strpos($matches[0],'</a>') !== false)
    return $matches[0];
    if ($matches[0]{0} != '[')
    $matches[1] = $matches[0];
    return cs_html_mail($matches[1],$matches[1]);
    }

    function cs_abcode_color($matches) {

    return cs_html_span(1,'color:' . $matches[1]) . $matches[2] . cs_html_span(0);
    }

    function cs_abcode_size($matches) {

    $matches[1] = $matches[1] > 50 ? 50 : $matches[1];
    return cs_html_span(1,'font-size:' . $matches[1] . 'pt') . $matches[2] . cs_html_span(0);
    }

    function cs_abcode_align($matches) {

    return cs_html_div(1,'text-align:' . $matches[1]) . $matches[2] . cs_html_div(0);
    }

    function cs_abcode_urlauto($matches) {

    if (strpos($matches[0],'</a>') !== false || strpos($matches[0],'[/threadid]') !== false)
    return $matches[0];
    $url = substr($matches[0],0,4) == 'www.' ? 'http://' . $matches[0] : $matches[0];
    return cs_html_link($url,$matches[0]);
    }

    function cs_abcode_url($matches) {

    if(empty($matches[2])) {
    $matches[2] = $matches[1];
    }
    $matches[1] = strpos($matches[1],'www.') === 0 ? 'http://' . $matches[1] : $matches[1];
    return cs_html_link($matches[1],$matches[2],1);
    }

    function cs_abcode_quote($matches) {

    if ($matches[0] == '[/quote]') {
    $return = cs_html_div(0);
    }
    elseif(empty($matches[1])) {
    $return = cs_html_div(1,0,'class="quote"');
    }
    else {
    $name = cs_html_big(1).$matches[1].cs_html_big(0);
    $return = cs_html_div(1,0,'class="quote"').$name.':'.cs_html_br(1);
    }
    return $return;
    }

    function cs_abcode_yt($matches) {

    if ($matches[0] == '[/yt]') {
    $return = cs_html_div(0);
    }
    elseif(empty($matches[1])) {
    $return = cs_html_div(1,0,1);
    }
    else {
    $name = '<embed src="http://www.youtube.com/v/'.$matches[1].'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>';
    $return = cs_html_div(1,0,1).$name.cs_html_br(1);
    }
    return $return;
    }

    function cs_abcode_mv($matches) {

    if ($matches[0] == '[/mv]') {
    $return = cs_html_div(0);
    }
    elseif(empty($matches[1])) {
    $return = cs_html_div(1,0,1);
    }
    else {
    $name = '<embed src="http://www.myvideo.de/movie/'.$matches[1].'" width="425" height="350" type="application/x-shockwave-flash"></embed></object>';
    $return = cs_html_div(1,0,1).$name.cs_html_br(1);
    }
    return $return;
    }

    function cs_abcode_st($matches) {

    if ($matches[0] == '[/st]') {
    $return = cs_html_div(0);
    }
    elseif(empty($matches[1])) {
    $return = cs_html_div(1,0,1);
    }
    else {
    $name = '<embed src="http://videos.streetfire.net/vidiac.swf" FlashVars="video='.$matches[1].'" quality="high" bgcolor="#ffffff" width="425" height="350" name="ePlayer" align="middle" type="application/x-shockwave-flash"></embed>';
    $return = cs_html_div(1,0,1).$name.cs_html_br(1);
    }
    return $return;
    }

    function cs_abcode_clip($matches) {

    static $clip_id;
    $clip_id++;
    $var = cs_html_img('symbols/clansphere/plus.gif',0,0,'id="img_' . $clip_id . '"') . ' ';
    $var .= cs_html_link("javascript:cs_clip('" . $clip_id . "')",$matches[1],0);
    $var .= cs_html_br(1);
    $var .= cs_html_div(1,'display:none','id="span_' . $clip_id . '"');
    $var .= $matches[2] . cs_html_div(0);
    return $var;
    }

    function cs_abcode_html($matches) {

    global $com_lang;

    $string = html_entity_decode($matches[1], ENT_QUOTES, $com_lang['charset']);
    $string = str_replace(array("rn","n","r"),'',$string);

    return $string;

    }

    function cs_abcode_eval($matches) {

    $matches[1] = str_replace('<br />',"rn",$matches[1]);
    $matches[1] = cs_abcode_html($matches);

    $matches[1] = str_replace(array('<?php','<?','?>'),'',$matches[1]);

    ob_start();
    eval($matches[1]);
    $content = ob_get_contents();
    ob_end_clean();

    return $content;

    }

    function cs_abcode_flag ($matches) {

    $path = 'symbols/countries/' . $matches[1] . '.png';

    return file_exists($path) ? cs_html_img($path) : '';

    }

    function cs_abcode_threadid($matches) {

    return cs_link($matches[2],'board','thread','where='.$matches[1]);
    }

    function cs_abcode_decode($matches) {

    global $com_lang;

    return html_entity_decode($matches[1], ENT_QUOTES, $com_lang['charset']);
    }


    function cs_secure($replace,$features = 0,$smileys = 0, $clip = 1, $html = 0, $phpeval = 0) {

    global $com_lang, $cs_main;

    $op_abcode = cs_sql_option(__FILE__,'abcode');

    $replace = str_replace(array('{','}'),array('{' ,'}'),$replace);

    if(!empty($smileys)) {
    static $loop, $loop_abc;
    if(empty($loop_abc)) {
    $select = 'abcode_func, abcode_pattern, abcode_result, abcode_file';
    $loop_abc = cs_sql_select(__FILE__,'abcode',$select,0,0,0,0);
    $loop = count($loop_abc);
    }
    for($run=0; $run<$loop; $run++) {
    if($loop_abc[$run]['abcode_func'] == 'img') {
    $img_file = 'uploads/abcode/' . $loop_abc[$run]['abcode_file'];
    $img_src = cs_html_img($img_file);
    $replace = str_replace($loop_abc[$run]['abcode_pattern'],'{'.$img_ src.'}',$replace);
    }
    elseif($loop_abc[$run]['abcode_func'] == 'str') {
    $pattern = $loop_abc[$run]['abcode_pattern'];
    $replace = str_replace($pattern,'{'.$loop_abc[$run]['abcode_result' ].'}',$replace);
    }
    }
    }

    $replace = htmlentities($replace, ENT_QUOTES, $com_lang['charset']);
    $replace = preg_replace('=&#(d+);=si', '', $replace);
    $replace = preg_replace_callback('={(.*?)}=si','cs_abcode_decode',$replace);

    if(!empty($features)) {

    cs_abcode_mode(1);

    if(!empty($html))
    $replace = preg_replace_callback("=[html](.*?)[/html]=si","cs_abcode_html",$replace);

    if (!empty($phpeval))
    $replace = preg_replace_callback("=[phpcode](.*?)[/phpcode]=si",'cs_abcode_eval',$replace);

    $replace = preg_replace_callback("=
     
    1.
    1. / 2. / ... 
     (.*?)
    =si","cs_abcode_php",$replace);
    $replace = nl2br($replace);
    $replace = preg_replace_callback("=(.*?)=si","cs_abcode_u",$replace);
    $replace = preg_replace_callback("=(.*?)=si","cs_abcode_b",$replace);
    $replace = preg_replace_callback("=(.*?)=si","cs_abcode_i",$replace);
    $replace = preg_replace_callback("=(.*?)=si","cs_abcode_s",$replace);
    $replace = preg_replace_callback("==si","cs_abcode_img",$replace);
    $replace = preg_replace_callback("==si",
    "cs_abcode_urlimg",$replace);
    $replace = preg_replace_callback("=[img width=([d]*?) height=([d]*?)](.*?)[/img]=si", "cs_abcode_img",$replace);
    $replace = preg_replace_callback("=( (dot) *?)=si","cs_abcode_mail",$replace);
    $replace = preg_replace_callback('=([^s]{3,}) (at) ( (dot) *?) (dot) ([^s]{2,7})(?![^<]+>|[^&]*;)=si','cs_abcode_mail',$replace);
    $replace = preg_replace_callback("=[color=([w]*?)](.*?)[/color]=si","cs_abcode_color",$replace);
    $replace = preg_replace_callback("=[size=([d]*?)](.*?)[/size]=si","cs_abcode_size",$replace);
    $replace = preg_replace_callback("=[(left|center|right|justify)](.*?)[/(left|center|right|justify)]=si",
    "cs_abcode_align",$replace);
    $replace = preg_replace_callback("=[list=(.*?)](.*?)[/list]=si","cs_abcode_list",$replace);
    $replace = preg_replace_callback("=
      =si","cs_abcode_list",$replace);
      $replace = preg_replace_callback("=(.*?)=si","cs_abcode_url",$replace);
      $replace = preg_replace_callback("=(.*?)=si","cs_abcode_url",$replace);
      $replace = preg_replace_callback("=[yt](.*?)[/yt]=si","cs_abcode_yt",$replace);
      $replace = preg_replace_callback("=[mv](.*?)[/mv]=si","cs_abcode_mv",$replace);
      $replace = preg_replace_callback("=[st](.*?)[/st]=si","cs_abcode_st",$replace);
      $replace = preg_replace_callback('=[flag=(.*?)]=si','cs_abcode_flag',$replace);
      $replace = preg_replace_callback('/(www.|http://|ftp://)([^s,]*)(?![^<]+>|[^&]*;)/i','cs_abcode_urlauto',$replace);
      $replace = preg_replace_callback("=[indent=([d]*?)](.*?)[/indent]=si","cs_abcode_indent",$replace);
      $replace = preg_replace_callback("=[threadid=(.*?)](.*?)[/threadid]=si","cs_abcode_threadid",$replace);
      $replace = preg_replace_callback("=[h=([d]*?)](.*?)[/h]=si","cs_abcode_h",$replace);
      $replace = preg_replace_callback("=
      =si","cs_abcode_hr",$replace);
      preg_match_all('=[quote=?(.*?)]=si', $replace, $quote_sub);
      $quote_start_count = count($quote_sub[0]);
      $quote_end_count = substr_count($replace, '[/quote]');
      if ($quote_start_count !== 0 && $quote_start_count == $quote_end_count) {
      $replace = preg_replace_callback('=[quote=?(.*?)]=si',"cs_abcode_quote",$replace);
      $replace = preg_replace_callback('=[/quote]=si',"cs_abcode_quote",$replace);
      }
      if(!empty($clip)) {
      $replace = preg_replace_callback("=(.*?) +-
      (.*?)
      =si","cs_abcode_clip",$replace);
      }

      if(!empty($op_abcode['word_cut']))
      $replace = preg_replace("=([^s*?]{".$op_abcode['word_cut']."})(?![^<]+>|[^&]*;)=","� ",$replace);
      }

      if(!empty($features)) {
      cs_abcode_mode(1);
      $replace = preg_replace_callback("=
       
      1.
      1. / 2. / ... 
       (.*?)
      =si","cs_abcode_php",$replace);
      }
      return $replace;
      }


      function cs_abcode_resize ($matches) {

      $options = cs_sql_option(__FILE__,'abcode');

      $max_width = $options['image_width'];
      $max_height = $options['image_height'];

      if ($matches[0]{4} == ']') {
      $img = $matches[1];
      if ($size = getimagesize($matches[1])) {
      if ($size[0] > $max_width) {
      $new_width = $max_width;
      $new_height = round($size[1] / $size[0] * $max_width);
      $change = 1;
      } else {
      $new_height = $size[1];
      $new_width = $size[0];
      }
      if ($new_height > $max_height) {
      $new_height = $max_height;
      $new_width = round($size[0] / $size[1] * $max_height);
      $change = 1;
      }
      }
      } else {
      $img = $matches[3];
      if ($matches[1] > $max_width) {
      $change = 1;
      $new_width = $max_width;
      }
      if ($matches[2] > $max_height) {
      $change = 1;
      $new_height = $max_height;
      }
      if (!empty($change)) {
      $new_width = empty($new_width) ? $matches[1] : $new_width;
      $new_height = empty($new_height) ? $matches[2] : $new_height;
      }
      }

      if (!empty($change)) {
      $var = '[img width='.$new_width.' height='.$new_height.']'.$img.'[/img]';
      } else {
      $var = $matches[0];
      }

      return $var;
      }

      [/php][/clip]
      Zurück - Übersicht

      Kommentare: 6
      Seite [1]
      Sickboy

      05.03.2017

      Ort: -
      Beiträge: 327
      # 1 - 04.07.2007 um 19:26 Uhr

      Hi admin, irgendwas stimmt mit der anzeige nicht!!!
      Fr33z3m4n ClanSphere Team

      16.03.2022

      Ort: Hamm
      Beiträge: 11700
      # 2 - 04.07.2007 um 20:20 Uhr

      poste nur das was du geändert hast, mit zeilenangabe usw. nicht die ganze abcode. Wenn nicht stell es als Download rein
      Sickboy

      05.03.2017

      Ort: -
      Beiträge: 327
      # 3 - 04.07.2007 um 20:35 Uhr

      Ok, wie kann ich das lösche bzw. bearbeiten?
      Fidan

      06.03.2009

      Ort: -----
      Beiträge: 349
      # 4 - 04.07.2007 um 20:42 Uhr

      stells mal plz als download ein wäre nett thx
      Sickboy

      05.03.2017

      Ort: -
      Beiträge: 327
      # 5 - 04.07.2007 um 20:48 Uhr

      ja mach ich, aber wo??? ich will hier nichts falsch machen!
      Am besten löscht das ein Admin hier und ich mach es nochmal.
      MFG


      Zuletzt editiert von sickboyflip, am 04.07.2007 um 20:55 Uhr (1x Editiert)
      Fidan

      06.03.2009

      Ort: -----
      Beiträge: 349
      # 6 - 04.07.2007 um 23:00 Uhr

      dann machs gleich rein will nciht so lange warten benennst es Videos in Board 2 oder so


      Bitte Login benutzen, um Kommentare zu schreiben.