1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-17 19:09:45 +01:00

Backward compatibility fixes.

This commit is contained in:
Cameron 2020-05-06 16:15:52 -07:00
parent 8ac7f1fdf1
commit 0f2ab37d47
6 changed files with 63 additions and 4 deletions

View File

@ -210,6 +210,7 @@ if (/*!defined("PREVIEWTHEME") && */! (isset($no_core_css) && $no_core_css !==tr
if(THEME_LEGACY === true || !deftrue('BOOTSTRAP'))
{
$e_js->otherCSS('{e_WEB_CSS}backcompat.css');
$e_js->footerFile('{e_WEB_JS}core/backcompat.js');
}

View File

@ -1605,6 +1605,12 @@ class e_parse extends e_parser
{
$opts['nobreak'] = true;
$text = trim($text);
if(strpos($text,'[center]') === 0) // quick bc fix TODO Find a better solution. [center][/center] containing HTML.
{
$text = str_replace("[center]","<div style='text-align:center'>",$text);
$text = str_replace("[/center]","</div>",$text);
}
}
$fromadmin = $opts['fromadmin'];

View File

@ -1607,9 +1607,9 @@ class news_front
require_once(THEME."news_template.php");
if(empty($ALTERNATECLASS1))
if(!empty($ALTERNATECLASS1))
{
return TRUE;
return true;
}
$newscolumns = (isset($NEWSCOLUMNS) ? $NEWSCOLUMNS : 1);
@ -1618,7 +1618,9 @@ class news_front
$loop = 1;
$param = array();
$param['current_action'] = $action;
foreach($newsAr as $news) {
foreach($newsAr as $news)
{
if(is_array($ALTERNATECLASSES))
{
@ -1630,7 +1632,8 @@ class news_front
$newsdata[$loop] .= $this->ix->render_newsitem($news, 'return', '', '', $param);
}
$loop ++;
if($loop > $newscolumns) {
if($loop > $newscolumns)
{
$loop = 1;
}
}

View File

@ -65,6 +65,39 @@ TMP;
$expected = "<div class='bbcode-center' style='text-align:center'><img src='".e_HTTP."e107_images/generic/blank_avatar.jpg' width='' alt='Blank Avatar' title='Blank Avatar' class='img-rounded rounded bbcode bbcode-img' /></div>";
$this->assertEquals($expected, $actual, "BBcode parsing failed on [img]");
$src = <<<SRC
[center]<script type=&quot;text/javascript&quot;><!--
google_ad_client = &quot;12345678&quot;;
/* vertical */
google_ad_slot = &quot;12345&quot;;
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;>
</script>[/center]
SRC;
$expected = <<<EXPECTED
<div style='text-align:center'><script type="text/javascript"><!--
google_ad_client = "12345678";
/* vertical */
google_ad_slot = "12345";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
EXPECTED;
$actual = $this->tp->toHTML($src,true);
$this->assertEquals($expected,$actual);
/*
$src = "[html]
<pre>&#036;sql = e107::getDb();

View File

@ -65,6 +65,9 @@ table.table { width: 100% }
background-color: #f9f9f9;
}
.s-message a.close { cursor: pointer }
/* Bootstrap classes that hide content for all devices except screen readers (accessibility) */
.sr-only {
position: absolute;

View File

@ -0,0 +1,13 @@
/* Legacy Theme v1.x compat when bootstrap not in use */
// (function ($)
$('.s-message a.close').on('click', function ()
{
$(this).parent('.s-message').hide('slow');
}
);