From de4b3670d8252fe180f634fe17647226b9a1b2a6 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sat, 30 Oct 2010 16:53:58 +0000 Subject: improved users history - part 2 --- .../Application/Controllers/MeetController.php | 38 ++++++++++++++- h-source/Application/Views/Meet/contributions.php | 7 +++ h-source/Application/Views/Meet/talk.php | 56 ++++++++++++++++++++++ h-source/Application/Views/talk.php | 1 + 4 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 h-source/Application/Views/Meet/talk.php (limited to 'h-source/Application') diff --git a/h-source/Application/Controllers/MeetController.php b/h-source/Application/Controllers/MeetController.php index d2ccc27..314f273 100644 --- a/h-source/Application/Controllers/MeetController.php +++ b/h-source/Application/Controllers/MeetController.php @@ -34,6 +34,7 @@ class MeetController extends BaseController $this->model('HardwareModel'); $this->model('IssuesModel'); $this->model('MessagesModel'); + $this->model('TalkModel'); $argKeys = array( 'page:forceNat' => 1, @@ -107,9 +108,12 @@ class MeetController extends BaseController $messNumb = $this->m['MessagesModel']->select('id_mes,messages.id_issue,messages.creation_date')->where(array('created_by'=>$clean['id_user'],'deleted'=>'no'))->rowNumber(); + $talkNumb = $this->m['TalkModel']->select('talk.title')->where(array('created_by'=>$clean['id_user'],'deleted'=>'no'))->rowNumber(); + $data['hasHardware'] = $hardNumb > 0 ? true : false; $data['hasIssues'] = $issuesNumb > 0 ? true : false; $data['hasMessages'] = $messNumb > 0 ? true : false; + $data['hasTalk'] = $talkNumb > 0 ? true : false; $this->append($data); $this->load('contributions'); @@ -208,7 +212,39 @@ class MeetController extends BaseController $this->load('messages'); $this->right(); } + } + + //messages in the talk page + public function talk($lang = 'en', $user = '') + { + $clean['user'] = ctype_alnum($user) ? sanitizeAll($user) : ''; + $data['title'] = "messages submitted - ".Website::$generalName; + + $this->shift(2); + + if ($this->userExists($clean['user'])) + { + //load the Pages helper + $this->helper('Pages','meet/talk/'.$this->lang.'/'.$clean['user'],'page'); + + $clean['id_user'] = (int)$this->m['UsersModel']->getUserId($clean['user']); + $this->m['TalkModel']->from('talk inner join hardware')->using('id_hard')->select('talk.title,talk.creation_date,talk.id_hard,talk.id_talk,hardware.type')->where(array('created_by'=>$clean['id_user'],'deleted'=>'no'))->orderBy('id_talk desc'); + + $recordNumber = $this->m['TalkModel']->rowNumber(); + $page = $this->viewArgs['page']; + + $this->m['TalkModel']->limit = $this->h['Pages']->getLimit($page,$recordNumber,20); + + $data['table'] = $this->m['TalkModel']->send(); + + $data['meet_username'] = $clean['user']; + + $data['pageList'] = $this->h['Pages']->render($page-3,7); + + $this->append($data); + $this->load('talk'); + $this->right(); + } } - } \ No newline at end of file diff --git a/h-source/Application/Views/Meet/contributions.php b/h-source/Application/Views/Meet/contributions.php index f679c71..99ad4d1 100644 --- a/h-source/Application/Views/Meet/contributions.php +++ b/h-source/Application/Views/Meet/contributions.php @@ -51,6 +51,13 @@ + + +
+ viewStatus;?>">talk messages submitted by +
+ + \ No newline at end of file diff --git a/h-source/Application/Views/Meet/talk.php b/h-source/Application/Views/Meet/talk.php new file mode 100644 index 0000000..7ad80f0 --- /dev/null +++ b/h-source/Application/Views/Meet/talk.php @@ -0,0 +1,56 @@ + + +. +?> + +
+ +
+ ">Home » ">meet » ">contributions » talk messages +
+ +
+ talk messages submitted by +
+ +
+ +
+ +
+ + + baseUrl."/$controller/talk/$lang/$t_id#talk-$t_id_talk'>".$t_title." at ".smartDate($t_date);?> +
+ +
+ +
+ +
+ : +
+ +
\ No newline at end of file diff --git a/h-source/Application/Views/talk.php b/h-source/Application/Views/talk.php index d0872f4..5975c54 100644 --- a/h-source/Application/Views/talk.php +++ b/h-source/Application/Views/talk.php @@ -34,6 +34,7 @@ +
-- cgit v1.2.3