fix forum BBCode problems

This commit is contained in:
unknown
2012-06-14 08:11:13 +03:00
parent 235577d180
commit b30b8b29a4
5 changed files with 20 additions and 6 deletions
+2 -1
View File
@@ -38,7 +38,7 @@ foreach($posts as $pos) {
<a href="javascript:void(0);" bbType="d" bbTag="u" ><div title="underlined" alt="underlined" class="bbButton bbUnderscore"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="alliance" ><div title="Alliance" alt="Alliance" class="bbButton bbAlliance"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="Player" ><div title="Player" alt="Player" class="bbButton bbPlayer"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="x|y" ><div title="Coordinates" alt="Coordinates" class="bbButton bbCoordinate"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="coor" ><div title="Coordinates" alt="Coordinates" class="bbButton bbCoordinate"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="report" ><div title="Report" alt="Report" class="bbButton bbReport"></div></a>
<a href="javascript:void(0);" bbWin="resources" id="text_resourceButton"><div title="Resources" alt="Resources" class="bbButton bbResource"></div></a>
<a href="javascript:void(0);" bbWin="smilies" id="text_smilieButton"><div title="Smilies" alt="Smilies" class="bbButton bbSmilie"></div></a>
@@ -70,6 +70,7 @@ foreach($posts as $pos) {
</tbody></table>
<p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
<span style="color: #DD0000"><b>Warning:</b> you can't use the values <b>[message]</b> or <b>[/message]</b> in your post because it can cause problem with bbcode system.</span>
<?php }else{
header("Location: banned.php");
}
+2 -1
View File
@@ -33,7 +33,7 @@ if($session->access!=BANNED){
<a href="javascript:void(0);" bbType="d" bbTag="u" ><div title="underlined" alt="underlined" class="bbButton bbUnderscore"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="alliance" ><div title="Alliance" alt="Alliance" class="bbButton bbAlliance"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="Player" ><div title="Player" alt="Player" class="bbButton bbPlayer"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="x|y" ><div title="Coordinates" alt="Coordinates" class="bbButton bbCoordinate"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="coor" ><div title="Coordinates" alt="Coordinates" class="bbButton bbCoordinate"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="report" ><div title="Report" alt="Report" class="bbButton bbReport"></div></a>
<a href="javascript:void(0);" bbWin="resources" id="text_resourceButton"><div title="Resources" alt="Resources" class="bbButton bbResource"></div></a>
@@ -122,6 +122,7 @@ if($session->access!=BANNED){
<p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
<span style="color: #DD0000"><b>Warning:</b> you can't use the values <b>[message]</b> or <b>[/message]</b> in your post because it can cause problem with bbcode system.</span>
<?php }else{
header("Location: banned.php");
}
+2 -1
View File
@@ -37,7 +37,7 @@ foreach($topics as $arr) {
<a href="javascript:void(0);" bbType="d" bbTag="u" ><div title="underlined" alt="underlined" class="bbButton bbUnderscore"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="alliance" ><div title="Alliance" alt="Alliance" class="bbButton bbAlliance"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="Player" ><div title="Player" alt="Player" class="bbButton bbPlayer"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="x|y" ><div title="Coordinates" alt="Coordinates" class="bbButton bbCoordinate"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="coor" ><div title="Coordinates" alt="Coordinates" class="bbButton bbCoordinate"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="report" ><div title="Report" alt="Report" class="bbButton bbReport"></div></a>
<a href="javascript:void(0);" bbWin="resources" id="text_resourceButton"><div title="Resources" alt="Resources" class="bbButton bbResource"></div></a>
<a href="javascript:void(0);" bbWin="smilies" id="text_smilieButton"><div title="Smilies" alt="Smilies" class="bbButton bbSmilie"></div></a>
@@ -69,6 +69,7 @@ foreach($topics as $arr) {
</tbody></table>
<p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
<span style="color: #DD0000"><b>Warning:</b> you can't use the values <b>[message]</b> or <b>[/message]</b> in your post because it can cause problem with bbcode system.</span>
<?php }else{
header("Location: banned.php");
}
+2 -1
View File
@@ -34,7 +34,7 @@ foreach($topics as $top) {
<a href="javascript:void(0);" bbType="d" bbTag="u" ><div title="underlined" alt="underlined" class="bbButton bbUnderscore"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="alliance" ><div title="Alliance" alt="Alliance" class="bbButton bbAlliance"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="Player" ><div title="Player" alt="Player" class="bbButton bbPlayer"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="x|y" ><div title="Coordinates" alt="Coordinates" class="bbButton bbCoordinate"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="coor" ><div title="Coordinates" alt="Coordinates" class="bbButton bbCoordinate"></div></a>
<a href="javascript:void(0);" bbType="d" bbTag="report" ><div title="Report" alt="Report" class="bbButton bbReport"></div></a>
<a href="javascript:void(0);" bbWin="resources" id="text_resourceButton"><div title="Resources" alt="Resources" class="bbButton bbResource"></div></a>
<a href="javascript:void(0);" bbWin="smilies" id="text_smilieButton"><div title="Smilies" alt="Smilies" class="bbButton bbSmilie"></div></a>
@@ -65,6 +65,7 @@ foreach($topics as $top) {
</tbody></table>
<p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
<span style="color: #DD0000"><b>Warning:</b> you can't use the values <b>[message]</b> or <b>[/message]</b> in your post because it can cause problem with bbcode system.</span>
<?php }else{
header("Location: banned.php");
}
+12 -2
View File
@@ -52,7 +52,10 @@ if(isset($_POST['newtopic'])){
}else{
$ends = '';
}
if(!preg_match('/\[message\]/',$post) && !preg_match('/\[\/message\]/',$post)){
$post = "[message]".$post."[/message]";
$database->CreatTopic($title,$post,$cat,$owner,$alli,$ends);
}
}
if(isset($_POST['newpost'])){
$post = $_POST['text'];
@@ -60,22 +63,29 @@ if(isset($_POST['newpost'])){
$tids = $_POST['tid'];
$owner = $session->uid;
if($post != ""){
if(!preg_match('/\[message\]/',$post) && !preg_match('/\[\/message\]/',$post)){
$post = "[message]".$post."[/message]";
$database->UpdatePostDate($tids);
$database->CreatPost($post,$tids,$owner);
}
}
}
if(isset($_POST['editans'])){
$post = $_POST['text'];
$topic_id = $_POST['tid'];
if(!preg_match('/\[message\]/',$post) && !preg_match('/\[\/message\]/',$post)){
$post = "[message]".$post."[/message]";
$database->EditUpdateTopic($topic_id,$post);
}
}
if(isset($_POST['editpost'])){
$post = $_POST['text'];
$post = htmlspecialchars($post);
$posts_id = $_POST['pod'];
if(!preg_match('/\[message\]/',$post) && !preg_match('/\[\/message\]/',$post)){
$post = "[message]".$post."[/message]";
$database->EditUpdatePost($posts_id,$post);
}
}
if(!isset($_GET['admin'])) {
$_GET['admin'] = null;