diff --git a/codepot/etc/codepot.ini.in b/codepot/etc/codepot.ini.in index ba30d727..20e73551 100644 --- a/codepot/etc/codepot.ini.in +++ b/codepot/etc/codepot.ini.in @@ -154,6 +154,11 @@ file_dir = "@DEPOTDIR@/files" ;------------------------------------------------------------------------------ attachment_dir = "@DEPOTDIR@/attachments" +;------------------------------------------------------------------------------ +; directory to store user icons +;------------------------------------------------------------------------------ +usericon_dir = "@DEPOTDIR@/usericons" + ;------------------------------------------------------------------------------ ; log threshold ;------------------------------------------------------------------------------ diff --git a/codepot/src/codepot/controllers/project.php b/codepot/src/codepot/controllers/project.php index 6ea95b13..428a7fdd 100644 --- a/codepot/src/codepot/controllers/project.php +++ b/codepot/src/codepot/controllers/project.php @@ -199,7 +199,7 @@ class Project extends Controller $project->description = $this->input->post('project_description'); $project->commitable = $this->input->post('project_commitable'); $project->public = $this->input->post('project_public'); - $project->members = explode (',', $this->input->post('project_members')); + $project->members = array_unique (preg_split ('/[[:space:],]+/', $this->input->post('project_members'))); // validate the form if ($this->form_validation->run()) diff --git a/codepot/src/codepot/models/projectmodel.php b/codepot/src/codepot/models/projectmodel.php index 7a86e793..dc9f11d2 100644 --- a/codepot/src/codepot/models/projectmodel.php +++ b/codepot/src/codepot/models/projectmodel.php @@ -460,6 +460,35 @@ class ProjectModel extends Model foreach ($files as $file) @unlink (CODEPOT_FILE_DIR . "/{$file->encname}"); } + + function getUserIcons ($users) + { + $this->db->trans_start (); + + $this->db->select ('userid,icon_name'); + $this->db->where_in ('userid', $users); + $this->db->where ('icon_name IS NOT NULL', null); + + $query = $this->db->get ('user_settings'); + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_complete (); + return FALSE; + } + + $out = array(); + $result = $query->result(); + + if (!empty($result)) + { + foreach ($result as $t) $out[$t->userid] = $t->icon_name; + } + + $this->db->trans_complete (); + if ($this->db->trans_status() === FALSE) return FALSE; + + return $out; + } } ?> diff --git a/codepot/src/codepot/views/project_home.php b/codepot/src/codepot/views/project_home.php index edabb702..6c322dc9 100644 --- a/codepot/src/codepot/views/project_home.php +++ b/codepot/src/codepot/views/project_home.php @@ -77,13 +77,34 @@ $this->load->view ( $member_count = count($members); $members = array_unique ($members); $priority = 0; + + $icons = $this->projects->getUserIcons($members); + if ($icons === FALSE) $icons = array(); // can't get the icon array for members. + for ($i = 0; $i < $member_count; $i++) { if (!array_key_exists($i, $members)) continue; $m = $members[$i]; if ($m == '') continue; - print "