Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
sulaiman0dawod committed Jan 28, 2023
1 parent 6c20092 commit 9c9460c
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 128 deletions.
21 changes: 16 additions & 5 deletions admincp/cpstyles/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1034,13 +1034,24 @@ color:#63A28F;font-size:7pt;font-weight:bold;text-align:left;
color:#3366CC;
}
/* for 480px or less */
@media screen and (max-width: 480px) {
.row1, .row2{
border-top: 2px dotted #C9C9C9 !important;
@media screen and (max-width: 680px) {
table,td,h1,textarea{
outline:0 !important ;
left:auto !important ;
right:auto !important ;
resize:vertical;
min-height:auto !important
}
textarea, #text{
max-width:40%;
.row1,.row2,.row3,.row4{
padding: 0px;
height: auto;
border: 0px solid;
}

.sceditor-container {
width: 420px; height: 400px;
}

}

/*
Expand Down
3 changes: 2 additions & 1 deletion admincp/cpstyles/templates/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
- {$lang['powered']}
{/if}</title>
<!-- action_find_addons_1 -->
<link rel="stylesheet" href="../{$admincpdir}/cpstyles/<?php echo $PowerBB->_CONF['info_row']['cssprefs'];?>/style.css" type="text/css" />

<link rel="stylesheet" href="{$style_path}" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset={$_CONF['info_row']['charset']}" />
<link rel="stylesheet" href="../look/fonts/font-awesome.min.css" />
<link rel="stylesheet" href="../look/fonts/fonts.css" />
Expand Down
94 changes: 4 additions & 90 deletions admincp/cpstyles/templates/options_all_general.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
</select>
</td>
</tr>
<tr>
<td class="row2">{$lang['members_send_pm']}</td>
<td class="row2">
<input type="text" name="members_send_pm" id="input_members_send_pm" value="{$_CONF['info_row']['members_send_pm']}" size="2" maxlength="2" />
Expand Down Expand Up @@ -153,6 +154,7 @@
<input type="text" name="content_language" id="input_content_language" value="{$_CONF['info_row']['content_language']}" size="3" maxlength="9" />
</td>
</tr>
<tr>
<td class="row2">
{$lang['flood_search']}
</td>
Expand Down Expand Up @@ -1302,41 +1304,7 @@
{$lang['mange_ajax']}
</td>
</tr>
<!--
<tr>
<td class="row1">
تنشيطها في صفحة البحث
</td>
<td class="row1">
<select name="ajax_search" id="select_ajax_search">
{if {$_CONF['info_row']['ajax_search']}}
<option value="1" selected="selected">{$lang['yes']}</option>
<option value="0">{$lang['no']}</option>
{else}
<option value="1">{$lang['yes']}</option>
<option value="0" selected="selected">{$lang['no']}</option>
{/if}
</select>
</td>
</tr>

<td class="row2">
{$lang['activate_ajax_register']}
</td>
<td class="row2">
<input TYPE="hidden" name="ajax_search" id="select_ajax_search" value="0" />
<select name="ajax_register" id="select_ajax_register">
{if {$_CONF['info_row']['ajax_register']}}
<option value="1" selected="selected">{$lang['yes']}</option>
<option value="0">{$lang['no']}</option>
{else}
<option value="1">{$lang['yes']}</option>
<option value="0" selected="selected">{$lang['no']}</option>
{/if}
</select>
</td>
</tr>
-->
<tr>
<td class="row1">
{$lang['ajax_freply']}
Expand All @@ -1353,24 +1321,7 @@
</select>
</td>
</tr>
<!--
<tr>
<td class="row1">
{$lang['ajax_moderator_options']}
</td>
<td class="row1">
<select name="ajax_moderator_options" id="select_ajax_moderator_options">
{if {$_CONF['info_row']['ajax_moderator_options']}}
<option value="1" selected="selected">{$lang['yes']}</option>
<option value="0">{$lang['no']}</option>
{else}
<option value="1">{$lang['yes']}</option>
<option value="0" selected="selected">{$lang['no']}</option>
{/if}
</select>
</td>
</tr>
-->

<tr valign="top" align="center">
<td class="main2" colspan="2">{$lang['board_close']}</td>
</tr>
Expand Down Expand Up @@ -1617,25 +1568,7 @@
{$lang['Settings_ads']}
</td>
</tr>
<!--
<tr>
<td class="row1">
تنشيط ظهور الإعلان التجاري العشوائي
</td>
<td class="row1">
<select name="random_ads" id="select_random_ads">
{if {$_CONF['info_row']['random_ads']}}
<option value="1" selected="selected">{$lang['yes']}</option>
<option value="0">{$lang['no']}</option>
{else}
<option value="1">{$lang['yes']}</option>
<option value="0" selected="selected">{$lang['no']}</option>
{/if}
</select>
</td>
</tr>
<tr>
-->

<td class="row1">
{$lang['show_ads']}
</td>
Expand Down Expand Up @@ -1806,7 +1739,6 @@
</td>
</tr>
<tr>
<tr>
<td class="row1">
{$lang['chat_num_mem_posts']}
</td>
Expand Down Expand Up @@ -1839,24 +1771,6 @@
</td>
</tr>
<tr>
<!--
<tr>
<td class="row1">
{$lang['chat_bar_dir']}
</td>
<td class="row1">
<select name="chat_bar_dir" id="select_chat_bar_dir">
{if {$_CONF['info_row']['chat_bar_dir']} == 'out'}
<option value="out" selected="selected">{$lang['chat_place_out']}</option>
<option value="inside">{$lang['chat_place_inside']}</option>
{else}
<option value="out">{$lang['chat_place_out']}</option>
<option value="inside" selected="selected">{$lang['chat_place_inside']}</option>
{/if}
</select>
</td>
</tr>
!-->
<tr align="center">
<td class="main2" colspan="2">
{$lang['Hide_links_for_visitors']}
Expand Down
5 changes: 5 additions & 0 deletions admincp/modulescp/common.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,12 @@ function _CommonCode()
$PowerBB->template->assign('DISABLE_HOOKS',$PowerBB->DISABLE_HOOKS);
$PowerBB->template->assign('admincpdir_cssprefs',"../".$PowerBB->admincpdir."/cpstyles/".$PowerBB->_CONF['info_row']['cssprefs']);
$PowerBB->template->assign('superadministrators',$PowerBB->superadministrators);
$Gets_file_cssprefs_path = "../".$PowerBB->admincpdir."/cpstyles/".$PowerBB->_CONF['info_row']['cssprefs']."/style.css";

if(file_exists($Gets_file_cssprefs_path))
{ $Gets_file_modification_time = filemtime($Gets_file_cssprefs_path);
$PowerBB->template->assign('style_path',$Gets_file_cssprefs_path."?v=".$Gets_file_modification_time);
}
if (empty($PowerBB->_CONF['rows']['member_row']['avater_path']))
{
$avater_path_admin = "../".$PowerBB->admincpdir."/cpstyles/".$PowerBB->_CONF['info_row']['cssprefs']."/profile-45x45.png";
Expand Down
46 changes: 16 additions & 30 deletions includes/pbboardCodeparse.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function replace($string)
return $matches[1];
}, $string);

$string = str_replace("&quot;", '"', $string);
$string = str_replace("http://www.youtube.com", "https://www.youtube.com", $string);

// jwplayer tag replace
$jwplayer_search= '#\[jwplayer=(.*),(.*),(.*),(.*)\](.*)\[/jwplayer\]#siU';
Expand Down Expand Up @@ -520,8 +520,8 @@ function PowerCode_Youtube($linky, $messages)
$linky = str_replace("&gt;", ">", $linky);
$linky = str_replace(array('"', "'"), array('&quot;', '&#39;'), $linky);
$linky = str_replace(array('/watch?', "v="), array('/v', '/'), $linky);
return "<span id='ytplayer'><object id='ytplayer' width='95%' height='315'><param name='movie' value='$linky'></param><param name='allowFullScreen' value='true'></param><param id='ytplayer' name='allowscriptaccess' value='always'></param><embed id='ytplayer' src='$linky' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' allownetworking='internal' width='95%' height='315'></embed></object></span>";
// return "<iframe id='ytplayer' type='text/html' width='560' height='315' src='$linky' frameborder='0' allowfullscreen></iframe>";
$linky = str_replace("/v/", "/embed/", $linky);
return '<iframe width="560" height="315" src="'.$linky.'" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" frameborder="0" allowfullscreen></iframe>';
}
function PowerCode_BBcode($option, $content, $bbcode_tag)
{
Expand Down Expand Up @@ -598,9 +598,6 @@ function censor_words($text)
$text = str_ireplace("<script", "&lt;script", $text);
$text = str_ireplace("<meta", "&lt;meta", $text);


// regex iframe
$text = str_ireplace("<iframe", '<iframe sandbox="allow-popups allow-same-origin"', $text);
// nofollow links out said
if (isset($PowerBB->_SERVER['HTTPS']) &&
($PowerBB->_SERVER['HTTPS'] == 'on' || $PowerBB->_SERVER['HTTPS'] == 1) ||
Expand Down Expand Up @@ -926,22 +923,6 @@ function feltr_words($text)
$text = str_replace("&amp;#39;","'",$text);
$text = $PowerBB->functions->pbb_stripslashes($text);
$text = str_replace('{39}',"'",$text);
$text = str_ireplace('xss',"**",$text);
$text = str_ireplace('document',"**",$text);
$text = str_ireplace('cookie',"**",$text);
$text = str_ireplace('alert',"**",$text);
$text = str_ireplace('location',"**",$text);
$text = str_ireplace('equiv',"**",$text);
$text = str_ireplace('script',"**",$text);
$text = str_ireplace('equiv',"**",$text);
$text = str_ireplace('refresh',"**",$text);
$text = str_ireplace('meta',"**",$text);
$text = str_ireplace('base',"**",$text);
$text = str_ireplace('iframe',"**",$text);
$text = str_ireplace('style',"",$text);
$text = str_ireplace('method',"**",$text);
$text = str_ireplace('input',"**",$text);
$text = str_ireplace('action',"**",$text);
$censorwords = preg_split('#[ \r\n\t]+#', $PowerBB->_CONF['info_row']['censorwords'], -1, PREG_SPLIT_NO_EMPTY);
$text = str_ireplace($censorwords,'**', $text);
$blankasciistrip ="160 173 u8205 u8204 u8237 u8238";
Expand Down Expand Up @@ -1420,6 +1401,7 @@ function html2bb($string)
'#<li>(.*?)</li>#si' => '[li]\\1[/li]',
'#&nbsp;#si' => ' ',
'#<center>(.*?)</center>#si' => '[center]\\1[/center]',
'#<div style="text-align: center;">(.*?)</div>#si' => '[center]\\1[/center]',
'#<br(.*?)>#si' => chr(13).chr(10),
'#<p>(.*?)</p>#si' => chr(13).chr(10).chr(13).chr(10).'\\1',

Expand All @@ -1431,7 +1413,7 @@ function html2bb($string)
//'#<code>(.*?)</code>#si' => '[code]\\1[/code]',
//'#<iframe style="(.*?)" id="ytplayer" type="text/html" width="534" height="401" src="(.*?)/embed/(.*?)" frameborder="0"/></iframe>#si' => '[youtube]\\3[/youtube]',

'#<span.*? style="(.*?)".*?>(.*?)</span>#si' => '[style=\\1]\\2[/style]',
'#<span.*? style="(.*?)".*?>(.*?)</span>#si' => '\\2',
//'#<a href="mailto:"(.*?)" title="Email (.*?)">(.*?)</a>#si' => '[email]\\1[/email]',
//'#<img src="(.*?) >#si' => '[img]\\1[/img]',
);
Expand All @@ -1451,32 +1433,36 @@ function html2bb($string)
$string = preg_replace('#<p align="(.*?)">(.*?)</p>#i', "[$1] $2 [/$1]", $string);
$string = preg_replace('#<div align="(.*?)">(.*?)</div>#i', "[$1] $2 [/$1]", $string);
$string = preg_replace('#<div>(.*?)</div>#i', "$1 \r\n", $string);


$string = preg_replace('#<span>(.*?)</span>#i', "$1", $string);
$string = preg_replace('#<code>(.*?)</code>#i', "[code]$1[/code]", $string);
$string = str_replace('\\"', '"', $string);
$string = str_replace('</b>', '', $string);
//$string = str_replace('</b>', '', $string);
$string = str_replace('</i>', '[/i]', $string);
$string = str_replace('</u>', '[/u]', $string);
$string = str_replace('</ul>', '[/list]', $string);
$string = str_replace('</ol>', '[/list]', $string);
$string = str_replace('</em>', '[/i]', $string);
$string = str_replace('</strong>', '[/b]', $string);
$string = str_replace('</blockquote>', '[/quote]', $string);
$string = str_replace('</code>', '[/code]', $string);
$string = str_replace('<code>', '[code]', $string);
$string = str_replace('</pre>', '[code]', $string);
// Do simple reg expr replacements
$string = preg_replace('#<b(| .*?)>#', '', $string);
$string = preg_replace('#<span(| .*?)>#', '', $string);
$string = preg_replace('#<i(| .*?)>#', '[i]', $string);
$string = preg_replace('#<u(| .*?)>#', '[u]', $string);
$string = preg_replace('#<ul(| .*?)>#', '[list]', $string);
$string = preg_replace('#<ol(| .*?)>#', '[list=1]', $string);
$string = preg_replace('#<li(| .*?)>#', '[*]', $string);
$string = preg_replace('#<em(| .*?)>#', '[i]', $string);
$string = preg_replace('#<strong(| .*?)>#', '', $string);
$string = preg_replace('#<blockquote(| .*?)>#', '[quote]', $string);
$string = preg_replace('#<strong(| .*?)>#', '[b]', $string);
$string = str_replace('</strong>', '[/b]', $string);

$string = preg_replace('#<blockquote(| .*?)>#i', '[quote]$1', $string);
$string = str_replace('</blockquote>', '[/quote]', $string);

$string = preg_replace('#<pre(| .*?)>#', '[code]', $string);
$string = str_replace('</pre>', '[/code]', $string);

// replace multiple instances of [b] or [i] with single tags
$string = preg_replace('#(\[b\])+#', '[b]', $string);
$string = preg_replace('#(\[i\])+#', '[i]', $string);
Expand Down
13 changes: 11 additions & 2 deletions modules/management.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -1146,8 +1146,11 @@ function __SubjectEdit()


// $GetSubjectInfo['text'] = $PowerBB->Powerparse->censor_words($GetSubjectInfo['text']);

//$GetSubjectInfo['text'] = $PowerBB->Powerparse->replace_htmlentities($GetSubjectInfo['text']);
if(strstr($GetSubjectInfo['text'],"<br />"))
{
$GetSubjectInfo['text'] = $PowerBB->Powerparse->html2bb($GetSubjectInfo['text']);
$PowerBB->_CONF['template']['ReplyInfo']['text'] = $PowerBB->Powerparse->remove_strings($PowerBB->_CONF['template']['ReplyInfo']['text']);
}
//$GetSubjectInfo['text'] = str_replace('<br />', "", $GetSubjectInfo['text']);
$GetSubjectInfo['title'] = $PowerBB->functions->CleanVariable($GetSubjectInfo['title'],'html');
$GetSubjectInfo['title'] = $PowerBB->functions->CleanVariable($GetSubjectInfo['title'],'sql');
Expand Down Expand Up @@ -1388,6 +1391,7 @@ function _SubjectEditStart()
$PowerBB->functions->error($PowerBB->_CONF['template']['_CONF']['lang']['no_text']);
}


$TitlePost = utf8_decode($PowerBB->_POST['title']);
if (isset($TitlePost{$PowerBB->_CONF['info_row']['post_title_max']}))
{
Expand Down Expand Up @@ -1935,7 +1939,12 @@ function __ReplyEdit()

$PowerBB->_CONF['template']['ReplyInfo'] = $PowerBB->core->GetInfo($ReplyArr,'reply');


if(strstr($PowerBB->_CONF['template']['ReplyInfo']['text'],"<br />"))
{
$PowerBB->_CONF['template']['ReplyInfo']['text'] = $PowerBB->Powerparse->html2bb($PowerBB->_CONF['template']['ReplyInfo']['text']);
$PowerBB->_CONF['template']['ReplyInfo']['text'] = $PowerBB->Powerparse->remove_strings($PowerBB->_CONF['template']['ReplyInfo']['text']);
}

$SubjectArr = array();
$SubjectArr['where'] = array('id',$PowerBB->_GET['subject_id']);
Expand Down

0 comments on commit 9c9460c

Please sign in to comment.