PDA

View Full Version : Custom plugin points inlinemod hook problem


Oskar20x2
09-10-2016, 12:39 PM
I need some help, the plugin works well if you moderate only 1 thread, but when you select 2 or more threads only adds the first.

How captured values array of threads and userid?, this is my code:

hook: inlinemod_approvethread

require_once(DIR . '/includes/points.php');

global $thread;

$post = fetch_postinfo($thread['firstpostid']);

$words = $post['pagetext'];
$words = strip_bbcode($words, true);
$words = preg_split('/\s/', trim($words));
$words = sizeof($words);

$user = $thread['postuserid'];
add_points('PointsThread', $words, $user);


Sorry for my English...

MarkFL
09-10-2016, 12:59 PM
In vB 4.2.x, the array of threads by id that were selected via inline moderation are in the array:

$tlist

To turn them into a comma-delimited list for the purposes of a query, then use the line:

$threadidlist = implode(',', $tlist);

It may be the same in vB 3.x. :)

Oskar20x2
09-10-2016, 01:23 PM
Thanks MarkFL, I'll try. ;)

edit...
some example?