2012-10-05, 02:51 PM
I wrote a plugin recently, everything works fine except sending PMs to all.
Notice that I did worked with PM function in past and it did sent PM to multiple users, but this time, I'm fetching user's list directly by querying uids of users from db.
It won't send PM to everybody.
Fetching the value of uid:
Say, currently, this query returns 3 rows of uids, for example, uid 1,2,3 . Then I have certain part of PM function like this:
$touid = array(explode(",", (intval($uids))));
and in toid options, I have $touid, like this:
I tried all possible possibilities I could, defining toid as array() and using $pm['toid'] = $touid when I have $touid value as intval($uids); but it won't work.
As I said, if I was to fetch the PM uids/username directly from plugin settings, it would have worked as I'm already using it for one plugin of mine.
But here, fetching values from db and sending those uids PM directly doesn't seem to work.
Any help is appreciated, am stuck at this.
Thank you.
Notice that I did worked with PM function in past and it did sent PM to multiple users, but this time, I'm fetching user's list directly by querying uids of users from db.
It won't send PM to everybody.
Fetching the value of uid:
while($person = $db->fetch_array($query))
{
$uids = $person['uids'];
}
Say, currently, this query returns 3 rows of uids, for example, uid 1,2,3 . Then I have certain part of PM function like this:
$touid = array(explode(",", (intval($uids))));
and in toid options, I have $touid, like this:
"toid" => $touid,
I tried all possible possibilities I could, defining toid as array() and using $pm['toid'] = $touid when I have $touid value as intval($uids); but it won't work.
As I said, if I was to fetch the PM uids/username directly from plugin settings, it would have worked as I'm already using it for one plugin of mine.
But here, fetching values from db and sending those uids PM directly doesn't seem to work.
Any help is appreciated, am stuck at this.
Thank you.