2014-11-06, 02:56 PM
Hi, I was on MyBB 1.6.x plugin information in the post, which has been issued a warning.
However, in the MyBB 1.8.x does not work to me, you can look at what I'm doing wrong?
Sorry, translate.
However, in the MyBB 1.8.x does not work to me, you can look at what I'm doing wrong?
function postwarnings_collect(&$post)
{
global $postID;
if(!count($postID))
{
$postID = array();
}
array_push($postID, $post['pid']);
}
function postwarnings_main(&$page)
{
global $db, $postID, $page;
if(count($postID))
{
$query = $db->query("SELECT A.`pid`, A.`tid`, A.`title`, B.`title` AS `title2`, A.`points` FROM `". TABLE_PREFIX ."warnings` AS A JOIN `". TABLE_PREFIX ."warningtypes` AS B WHERE A.`pid` IN (". implode(", ", $postID) .") AND A.`tid` = B.`tid`;");
while($row = $db->fetch_array($query))
{
if(!empty($row['title2']))
{
$reason = $row['title2'];
}
else
{
$reason = $row['title'];
}
$page = str_replace("<div class=\"post_body scaleimages\" id=\"pid_" . $row['pid']. "\">", "<div class=\"post_body scaleimages\" id=\"pid_" . $row['pid']. "\"><div class=\"post_warned\" style=\"border: 2px dotted red; background: #330000; font-weight: bold; color: red; padding: 2px;\"><br />* Autor postu otrzymał ostrzeżenie. Powód: " . $reason . " (+" . $row['points'] . " " .(($row['points'] == 1)?("punkt"):((($row['points'] % 10 > 1)&&($row['points'] % 10 < 5)&&!(($row['points'] % 100 >= 10)&&($row['points'] % 100 <= 21)))?("punkty"):("punktów"))) . ").<br /><br /></div><br />", $page);
}
}
}
Regards.Sorry, translate.