PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/upload/includes/report_hack/report_user.php

http://torrentpier2.googlecode.com/
PHP | 45 lines | 30 code | 6 blank | 9 comment | 1 complexity | cce87f01d52366505297c44f4cec5090 MD5 | raw file
 1<?php
 2
 3class report_user extends report_module
 4{
 5	var $mode = 'reportuser';
 6	var $duplicates = true;
 7
 8	//
 9	// Constructor
10	//
11	function report_user($id, $data, $lang)
12	{
13		$this->id = $id;
14		$this->data = $data;
15		$this->lang = $lang;
16	}
17
18	//
19	// Returns url to a report subject
20	//
21	function subject_url($id, $non_html_amp = false)
22	{
23		$sep = ($non_html_amp) ? '&' : '&amp;';
24		return 'profile.php?mode=viewprofile'. $sep. POST_USERS_URL .'=' . (int) $id;
25	}
26
27	//
28	// Returns report subject title
29	//
30	function subject_obtain($report_subject)
31	{
32		$sql = 'SELECT username
33			FROM ' . BB_USERS . '
34			WHERE user_id = ' . (int) $report_subject;
35		if (!$result = DB()->sql_query($sql))
36		{
37			message_die(GENERAL_ERROR, 'Could not obtain report subject', '', __LINE__, __FILE__, $sql);
38		}
39
40		$row = DB()->sql_fetchrow($result);
41		DB()->sql_freeresult($result);
42
43		return ($row) ? $row['username'] : false;
44	}
45}