Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (($pos = strpos($content, "[code;id=")) !== false) {
- $i = 0;
- $sc_id = "";
- while (($content{$pos+9+$i}) != "]") {
- $sc_id .= $content{$pos+9+$i};
- $i++;
- }
- $sql = "select code_lang_id, code, lang_symbol from site_codes ";
- $sql .= "left join site_codes_lang on (site_codes.code_lang_id = site_codes_lang.lang_id) ";
- $sql .= "where code_id = '".DBText($sc_id)."'";
- $qry_code = new Query($sql);
- $qry_code->Open();
- if (!$qry_code->EOF) {
- $the_code = $qry_code->GetValue("code");
- $code_lang = $qry_code->GetValue("lang_symbol");
- $replace = DrawCodeBlock($the_code, "code_block_"+$sc_id, $code_lang, 450, true);
- $content = str_ireplace("[code;id=".$sc_id."]",$replace,$content);
- }else{
- $content = str_ireplace("[code;id=".$sc_id."]","",$content);
- }
- $qry_code->Close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement