Not Solved Replacing Attachment Inside Post
#3
Not Solved
global $gid, $mybb, $db, $templates, $attachcache, $lang;
		
		$lang->load("hideattachmentsuntilreply", false, true);
		
		$haurgroups = explode(",",$mybb->settings['hideattachmentsuntilreply_groups']);
		$haurwhite = explode(",",$mybb->settings['hideattachmentsuntilreply_white']);

		if($mybb->settings['hideattachmentsuntilreply_enable'] == 1)
		{
			if(in_array($mybb->user['usergroup'], $haurgroups))
			{
				if(in_array($mybb->user['uid'], $haurwhite))
				{
				}
				else
				{
					if(is_array($attachcache[$post['pid']]) && $mybb->user['uid'] != $post['uid'] && !is_moderator($post['fid']))
					{
						$query = $db->simple_select("posts", "pid", "tid = '".$post['tid']."' AND uid = '".$mybb->user['uid']."'");
						
						if(!$db->num_rows($query) || $mybb->user['uid'] == 0)
						{
							eval("\$post['attachments'] = \"".$templates->get("hideattachmentsuntilreply")."\";");
						}
					}
				}
			}
			else
			{
			}
					
				
		}
	}

Still needs some tidying up.
Reply


Messages In This Thread
Replacing Attachment Inside Post - by BleepyEvans - 2012-02-13, 06:13 PM
RE: Replacing Attachment Inside Post - by BleepyEvans - 2012-02-13, 06:51 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)