2012-09-19, 06:01 AM
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
2012-09-20, 07:49 PM
Found anything? Actually I've got my schedule busy and appointments all these weekend.
I've some time tomorrow, I shall utilize and try to find a fix for postbit. I'd let you know if I find a fix.
I've some time tomorrow, I shall utilize and try to find a fix for postbit. I'd let you know if I find a fix.
2012-09-21, 03:06 AM
The problem is that the $pids variable is only avaible at showthread.php. No sure how you are running your queries but for me this seems to work:
The else statement is for:
newreply.php
newthread.php
showthread.php (quick reply only)
editpost.php
Though editpost.php requires a different way to get the post author UID.
// First we need to get our data
if(THIS_SCRIPT == 'private.php')
{
global $db, $pm;
$query = $db->query("
SELECT a.aid, a.name, a.image, pm.uid
FROM ".TABLE_PREFIX."ougc_awards a
JOIN ".TABLE_PREFIX."ougc_awards_users ag ON (ag.aid=a.aid)
JOIN ".TABLE_PREFIX."privatemessages pm ON (pm.uid=ag.uid)
WHERE pm.pmid='{$pm['pmid']}' AND a.visible='1' AND a.type!='1'
ORDER BY ag.date desc
".($max_postbit == -1 ? '' : 'LIMIT '.$max_postbit)."
");
while($data = $db->fetch_array($query))
{
$ougc_awards_cache[$data['uid']][$data['aid']] = $data;
}
$awards = $ougc_awards_cache[$pm['uid']];
}
elseif(THIS_SCRIPT == 'announcements.php')
{
global $db, $aid;
$query = $db->query("
SELECT a.aid, a.name, a.image, ann.uid
FROM ".TABLE_PREFIX."ougc_awards a
JOIN ".TABLE_PREFIX."ougc_awards_users ag ON (ag.aid=a.aid)
JOIN ".TABLE_PREFIX."announcements ann ON (ann.uid=ag.uid)
WHERE ann.aid='{$aid}' AND a.visible='1' AND a.type!='1'
ORDER BY ag.date desc
".($max_postbit == -1 ? '' : 'LIMIT '.$max_postbit)."
");
while($data = $db->fetch_array($query))
{
$ougc_awards_cache[$data['uid']][$data['aid']] = $data;
}
$awards = $ougc_awards_cache[$pm['uid']];
}
elseif(THIS_SCRIPT == 'showthread.php')
{
static $ougc_awards_cache = null;
if(!isset($ougc_awards_cache))
{
global $db, $pids;
$query = $db->query("
SELECT a.aid, a.name, a.image, p.uid
FROM ".TABLE_PREFIX."ougc_awards a
JOIN ".TABLE_PREFIX."ougc_awards_users ag ON (ag.aid=a.aid)
JOIN ".TABLE_PREFIX."posts p ON (p.uid=ag.uid)
WHERE p.{$pids} AND a.visible='1' AND a.type!='1'
ORDER BY ag.date desc
-- ".($max_postbit == -1 ? '' : 'LIMIT '.$max_postbit)
);
while($data = $db->fetch_array($query))
{
$ougc_awards_cache[$data['uid']][$data['aid']] = $data;
}
}
$awards = $ougc_awards_cache[$post['uid']];
}
else
{
global $db, $mybb;
$query = $db->query("
SELECT a.aid, a.name, a.image, ag.uid
FROM ".TABLE_PREFIX."ougc_awards a
JOIN ".TABLE_PREFIX."ougc_awards_users ag ON (ag.aid=a.aid)
WHERE ag.uid='{$mybb->user['uid']}' AND a.visible='1' AND a.type!='1'
ORDER BY ag.date desc
".($max_postbit == -1 ? '' : 'LIMIT '.$max_postbit)
);
while($givedawards = $db->fetch_array($query))
{
$ougc_awards_cache[$givedawards['uid']][$givedawards['aid']] = $givedawards;
}
$awards = $ougc_awards_cache[$mybb->user['uid']];
}
The else statement is for:
newreply.php
newthread.php
showthread.php (quick reply only)
editpost.php
Though editpost.php requires a different way to get the post author UID.
2012-10-07, 05:25 AM
Was testing this plugin out,it doesn't show on postbit.
2012-10-09, 04:40 AM
Make sure the required variable is in your postbit template. ({$pos['ougc_awards']} IIRC)
2012-10-09, 01:28 PM
(2012-10-07, 05:25 AM)Verilog Wrote: [ -> ]Was testing this plugin out,it doesn't show on postbit.Also check if number of awards to be shown on postbit is set to a value higher than zero.
2012-10-15, 03:44 PM
Thanks for this Been looking for a good alternative to the paid plugin
2012-10-17, 10:15 PM
(Nothing personal)
Do you think this is more stable than MyAwards?
I like this ones' features more, buy myawards is basically 100% stable.
Do you think this is more stable than MyAwards?
I like this ones' features more, buy myawards is basically 100% stable.
2012-10-18, 05:45 AM
I'm not sure what to answer, really. I have never used MyAwards and don't know if it is frequently updated.
2012-10-18, 10:35 AM
It's not frequently updated, there's nothing wrong with it.
Like, do you plan on finding more bugs and errors?
Like, do you plan on finding more bugs and errors?