Thread Rating:
  • 15 Vote(s) - 4.13 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[For 1.8] OUGC Awards
#91
This user has been denied support. This user has been denied support.
Sure, I'll aid you if I find any fix for quick reply. I guess I'm okay with running one query in PMs.
Reply
#92
This user has been denied support. This user has been denied support.
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.
Reply
#93
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:
		// 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.
Reply
#94
This user has been denied support. This user has been denied support.
Was testing this plugin out,it doesn't show on postbit.
Reply
#95
Make sure the required variable is in your postbit template. ({$pos['ougc_awards']} IIRC)
Reply
#96
This user has been denied support. This user has been denied support.
(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.
Reply
#97
This user has been denied support. This user has been denied support.
Thanks for this Smile Been looking for a good alternative to the paid plugin
Reply
#98
(Nothing personal)

Do you think this is more stable than MyAwards?
I like this ones' features more, buy myawards is basically 100% stable.

Reply
#99
I'm not sure what to answer, really. I have never used MyAwards and don't know if it is frequently updated.
Reply
It's not frequently updated, there's nothing wrong with it.

Like, do you plan on finding more bugs and errors?

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)