Prosze o pomoc w wykonaniu
zapytanie do zaznaczenia ostatniego postu w ktorym sie znajdujemy
zapytanie do zaznaczenia ostatniego postu w ktorym sie znajdujemy
$tid = (int)$mybb->input['tid'];
$thread = get_thread($tid);
$fid = $thread['fid'];
$query = $db->query("
SELECT pid
FROM ".TABLE_PREFIX."posts
WHERE tid='.{$tid}.'
ORDER BY dateline
DESC LIMIT 1");
$pid = $db->fetch_array($query);
SELECT * FROM '.TABLE_PREFIX.'posts WHERE tid ='.{$tid}.' ORDER BY pid DESC LIMIT 1
<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$plugins->add_hook('class_moderation_open_threads', 'test');
function test_info()
{
return array(
"name" => "test",
"description" => "test.",
"website" => "",
"author" => "ja",
"authorsite" => "",
"version" => "1.0",
"compatibility" => "16*"
);
}
function test_activate()
{
}
function test_deactivate()
{
}
function test_run($tid)
{
global $db, $mybb, $moderation;
$tid = (int)$mybb->input['tid'];
$thread = get_thread($tid);
$fid = $thread['fid'];
$query = $db->query("
SELECT pid
FROM ".TABLE_PREFIX."posts
WHERE tid='.{$tid}.'
ORDER BY dateline
DESC LIMIT 1");
$pid = $db->fetch_array($query);
if (empty($moderation))
{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;
}
$moderation->delete_post($pid);
}
?>
2 gości