Example #1
0
function convert_ubb($str, $advanced = 0, $inrss = 0)
{
    global $logstat, $template, $mbcon, $lnc, $config;
    if ($logstat != 1) {
        $str = preg_replace("/\\[hide\\](.+?)\\[\\/hide\\]/is", "<div class=\"quote hidebox\"><div class=\"quote-title\">{$lnc[311]}</div><div class=\"quote-content\">{$lnc[312]}  <a href=\"{$config['blogurl']}/login.php?job=register\">{$lnc[79]}</a> {$lnc[235]} <a href=\"{$config['blogurl']}/login.php\">{$lnc[89]}</a> </div></div>", $str);
    } else {
        $str = str_replace(array('[hide]', '[/hide]'), '', $str);
    }
    $str = str_replace(array('{', '}'), array('&#123;', '&#125;'), $str);
    $str = plugin_walk('ubbanalyse', $str);
    $basicubb_search = array('[hr]', '<br>');
    $basicubb_replace = array('<hr/>', '<br/>');
    $str = str_replace($basicubb_search, $basicubb_replace, $str);
    //[IMG]
    if ($advanced == 1) {
        $str = preg_replace("/\\[url=([^\\[]*)\\]\\[img( align=L| align=M| align=R)?( width=[0-9]+)?( height=[0-9]+)?\\]\\s*(\\S+?)\\s*\\[\\/img\\]\\[\\/url\\]/ise", "makeimgwithurl('\\1', '\\2', '\\3', '\\4', '\\5', {$inrss})", $str);
        $str = preg_replace("/\\[img( align=L| align=M| align=R)?( width=[0-9]+)?( height=[0-9]+)?\\]\\s*(\\S+?)\\s*\\[\\/img\\]/ise", "makeimg('\\1', '\\2', '\\3', '\\4', {$inrss})", $str);
    } else {
        $str = preg_replace("/\\[img( align=L| align=M| align=R)?( width=[0-9]+)?( height=[0-9]+)?\\]\\s*(\\S+?)\\s*\\[\\/img\\]/ise", "makeimginrss('\\4')", $str);
    }
    if ($mbcon['countdownload'] == '1' && $inrss == 0) {
        $str = preg_replace(array("/\\[sfile\\]\\s*\\[attach\\]([0-9]+)\\[\\/attach\\]\\s*\\[\\/sfile\\]/ise", "/\\[file\\]\\s*\\[attach\\]([0-9]+)\\[\\/attach\\]\\s*\\[\\/file\\]/ise"), array("makedownload('\\1', 1, 0, true)", "makedownload('\\1', 0, 0, true)"), $str);
    }
    $str = preg_replace("/\\[attach\\]([0-9]+)\\[\\/attach\\]/is", "attachment.php?fid=\\1", $str);
    $str = preg_replace("/\\[sfile\\]\\s*(\\S+?)\\s*\\[\\/sfile\\]/ise", "makedownload('\\1', 1, {$inrss}, false)", $str);
    $str = preg_replace("/\\[file\\]\\s*(\\S+?)\\s*\\[\\/file\\]/ise", "makedownload('\\1', 0, {$inrss}, false)", $str);
    //Auto add url link
    if ($mbcon['autoaddlink'] == 1) {
        $str = preg_replace("/(?<=[^\\]a-z0-9-=\"'\\/])((https?|ftp|gopher|news|telnet|rtsp|mms|callto|ed2k):\\/\\/|www\\.)([a-z0-9\\/\\-_+=.~!%@?#%&;:\$\\()|]+)/i", "[url]\\1\\3[/url]", $str);
    }
    $regubb_search = array("/\\[size=([^\\[\\<]+?)\\](.+?)\\[\\/size\\]/ie", "/\\[tbl( width=[0-9]+)?(%)?( bgcolor=[^ ]*)?( border=[^ ]*)?\\](.+?)\\[\\/tbl\\]/ise", "/\\s*\\[quote\\][\n\r]*(.+?)[\n\r]*\\[\\/quote\\]\\s*/is", "/\\s*\\[quote=(.+?)\\][\n\r]*(.+?)[\n\r]*\\[\\/quote\\]\\s*/is", "/\\s*\\[code\\][\n\r]*(.+?)[\n\r]*\\[\\/code\\]\\s*/ie", "/\\[url\\]([^\\[]*)\\[\\/url\\]/ie", "/\\[url=www.([^\\[\"']+?)\\](.+?)\\[\\/url\\]/is", "/\\[url=([^\\[]*)\\](.+?)\\[\\/url\\]/is", "/\\[email\\]([^\\[]*)\\[\\/email\\]/is", "/\\[acronym=([^\\[]*)\\](.+?)\\[\\/acronym\\]/is", "/\\[color=([a-zA-Z0-9#]+?)\\](.+?)\\[\\/color\\]/i", "/\\[font=([^\\[\\<:;\\(\\)=&#\\.\\+\\*\\/]+?)\\](.+?)\\[\\/font\\]/i", "/\\[p align=([^\\[\\<]+?)\\](.+?)\\[\\/p\\]/i", "/\\[b\\](.+?)\\[\\/b\\]/i", "/\\[i\\](.+?)\\[\\/i\\]/i", "/\\[u\\](.+?)\\[\\/u\\]/i", "/\\[strike\\](.+?)\\[\\/strike\\]/i", "/\\[sup\\](.+?)\\[\\/sup\\]/i", "/\\[sub\\](.+?)\\[\\/sub\\]/i", "/\\s*\\[php\\][\n\r]*(.+?)[\n\r]*\\[\\/php\\]\\s*/ie");
    $regubb_replace = array("makefontsize('\\1', '\\2')", "maketable('\\5','\\1','\\2','\\3','\\4')", "<div class=\"quote\"><div class=\"quote-title\">{$lnc[265]}</div><div class=\"quote-content\">\\1</div></div>", "<div class=\"quote\"><div class=\"quote-title\">{$lnc[266]} \\1</div><div class=\"quote-content\">\\2</div></div>", "makecode('\\1')", "makeurl('\\1')", "<a href=\"http://www.\\1\" target=\"_blank\">\\2</a>", "<a href=\"\\1\" target=\"_blank\">\\2</a>", "<a href=\"mailto:\\1\">\\1</a>", "<acronym title=\"\\1\">\\2</acronym>", "<span style=\"color: \\1;\">\\2</span>", "<span style=\"font-family: \\1;\">\\2</span>", "<p align=\"\\1\">\\2</p>", "<strong>\\1</strong>", "<em>\\1</em>", "<u>\\1</u>", "<del>\\1</del>", "<sup>\\1</sup>", "<sub>\\1</sub>", "xhtmlHighlightString('\\1')");
    $str = preg_replace($regubb_search, $regubb_replace, $str);
    //Multimedia Objects, dangerous, so visitors shall never be allowed to post such an object directly
    if ($advanced == 1) {
        $str = $inrss == 0 ? preg_replace("/\\[(wmp|swf|real|flv)=([^\\[\\<]+?),([^\\[\\<]+?)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/(wmp|swf|real|flv)\\]/ies", "makemedia('\\1', '\\4', '\\2', '\\3')", $str) : preg_replace("/\\[(wmp|swf|real|flv)=([^\\[\\<]+?),([^\\[\\<]+?)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/(wmp|swf|real|flv)\\]/is", "<br/>{$lnc[267]}<br/>", $str);
        $str = plugin_walk('ubbanalyseadvance', $str);
    }
    return $str;
}
Example #2
0
 $currentuserid = $userdetail['userid'];
 if ($changemytime == 1) {
     acceptrequest('newyear,newmonth,newday,newhour,newmin,newsec');
     $finaltime = gmmktime($newhour, $newmin, $newsec, $newmonth, $newday, $newyear) - $config['timezone'] * 3600;
 } elseif ($job == 'store') {
     $finaltime = $currenttime;
 } elseif ($ajax != 'on') {
     $finaltime = $records['pubtime'];
 } else {
     $finaltime = $currenttime;
 }
 if ($finaltime <= $currenttime && $property == 4) {
     $property = 0;
 }
 //Already should be published
 $content = plugin_walk('storecontent', $content);
 //load plugin
 $blog->query("DELETE FROM `{$db_prefix}blogs` WHERE `blogid`=-1");
 if ($job == 'store') {
     $currentid = $maxrecord['maxblogid'] + 1;
     $query = "INSERT INTO `{$db_prefix}blogs` VALUES ('{$currentid}', '{$title}','{$finaltime}','{$currentuserid}', 0, 0, 0, '{$property}','{$category}','{$tags}','{$sticky}','{$htmlstat}', '{$ubbstat}', '{$emotstat}', '{$content}', '0', '0', '{$sweather}', '0', '{$pinged}', '{$permitgp}', '{$starred}', '{$blogpsw}', '{$frontpage}', '{$entrysummary}', '{$comefrom}', '{$originsrc}', '{$blogalias}')";
 } else {
     $currentid = $itemid;
     if ($tags || $records['tags'] != '' && $ajax != 'on') {
         $oldtags = @explode('>', trim($records['tags'], '>'));
         $oldtags_query = "'" . @implode("', '", $oldtags) . "'";
         if ($oldtags_query != "''") {
             $blog->query("UPDATE `{$db_prefix}tags` SET tagentry=replace(tagentry, ',{$currentid},', ','), tagcounter=tagcounter-1 WHERE tagname in({$oldtags_query})");
         }
         //Remove all records containing this entry
     }
Example #3
0
        if ($plugin_closesidebar == 1) {
            $elements['mainpage'] = str_replace("class=\"content\"", "class=\"content-wide\"", $elements['mainpage']);
        }
        $bodymenu = $t->set('mainpage', array('pagebar' => '', 'iftoppage' => 'none', 'ifbottompage' => 'none', 'ifannouncement' => 'none', 'topannounce' => '', 'mainpart' => $plugin_return, 'previouspageexists' => '', 'nextpageexists' => ''));
    } else {
        include "inc/mod_main.php";
    }
}
//Section: <head>..<body>
$ajax_js = "<script type=\"text/javascript\" src=\"lang/{$langfront}/jslang.js?jsver={$codeversion}\"></script>\n";
$ajax_js .= "<script type=\"text/javascript\" src=\"images/js/ajax.js?jsver={$codeversion}\"></script>\n";
$ajax_js .= "<script type=\"text/javascript\" src=\"images/js/swfobject.js?jsver={$codeversion}\"></script>\n";
$shutajax = $config['closeajax'] == '1' ? 1 : 0;
$ajax_js .= "<script type=\"text/javascript\">\n//<![CDATA[\nvar moreimagepath=\"{$template['moreimages']}\";\nvar shutajax={$shutajax};\nvar absbaseurl='{$config['blogurl']}/';\n//]]>\n</script>";
$ajax_js .= "<link title=\"{$lnc[128]} {$config['blogname']}\" rel=\"search\"  type=\"application/opensearchdescription+xml\"  href=\"inc/opensearch.php\" />\n";
$ajax_js = plugin_walk('firstheader', $ajax_js);
include_once "inc/mod_basic.php";
include_once "data/mods.php";
$extraheader = $mbcon['extraheader'] . "\n" . @implode("\n", $section_prebody);
$headerhtml = $t->set('header', array('blogname' => $config['blogname'], 'blogdesc' => $config['blogdesc'], 'csslocation' => $csslocation, 'pagetitle' => $pagetitle, 'ajax_js' => $ajax_js, "extraheader" => $extraheader, "blogkeywords" => '<!--global:{additionalkeywords}-->' . $config['blogkeywords'], 'baseurl' => $baseurl, 'language' => $langname['languagename'], 'codeversion' => $codeversion));
//Admin notification
//$headerhtml.=$headerhtml_notifyadmin;
//Section: Top
$section_head_components = "<li>" . @implode("</li>\r\n<li>", $section_header) . "</li>";
$headmenu = $t->set('displayheader', array('blogname' => $config['blogname'], 'blogdesc' => $config['blogdesc'], 'section_head_components' => $section_head_components));
//Where am I now?
if (defined('whereAmI')) {
    $currentpagelocation = whereAmI;
} else {
    $nav = $_SERVER["REQUEST_URI"];
    $currentpagelocation = strrchr($nav, '/');