| 1 | <? |
|---|
| 2 | |
|---|
| 3 | /*************************************************************************** |
|---|
| 4 | * Dolphin Smart Community Builder |
|---|
| 5 | * ----------------- |
|---|
| 6 | * begin : Mon Mar 23 2006 |
|---|
| 7 | * copyright : (C) 2006 BoonEx Group |
|---|
| 8 | * website : http://www.boonex.com/ |
|---|
| 9 | * This file is part of Dolphin - Smart Community Builder |
|---|
| 10 | * |
|---|
| 11 | * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. |
|---|
| 12 | * http://creativecommons.org/licenses/by/3.0/ |
|---|
| 13 | * |
|---|
| 14 | * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|---|
| 15 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|---|
| 16 | * See the Creative Commons Attribution 3.0 License for more details. |
|---|
| 17 | * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, |
|---|
| 18 | * see license.txt file; if not, write to marketing@boonex.com |
|---|
| 19 | ***************************************************************************/ |
|---|
| 20 | |
|---|
| 21 | require_once( 'inc/header.inc.php' ); |
|---|
| 22 | require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); |
|---|
| 23 | require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' ); |
|---|
| 24 | require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); |
|---|
| 25 | |
|---|
| 26 | // --------------- page variables |
|---|
| 27 | |
|---|
| 28 | $_page['name_index'] = 30; |
|---|
| 29 | $_page['css_name'] = 'mem_polls.css'; |
|---|
| 30 | |
|---|
| 31 | $logged['member'] = member_auth( 0, false ); |
|---|
| 32 | |
|---|
| 33 | $_page['header'] = _t( "_Members Polls H" ); |
|---|
| 34 | $_page['header_text'] = _t( "_Members Polls H1" ); |
|---|
| 35 | |
|---|
| 36 | // this is dynamic page - send headers to do not cache this page |
|---|
| 37 | send_headers_page_changed(); |
|---|
| 38 | |
|---|
| 39 | // --------------- page components |
|---|
| 40 | |
|---|
| 41 | $_ni = $_page['name_index']; |
|---|
| 42 | $_page_cont[$_ni]['page_main_code'] = PageCompPageMainCode(); |
|---|
| 43 | |
|---|
| 44 | // --------------- [END] page components |
|---|
| 45 | |
|---|
| 46 | PageCode(); |
|---|
| 47 | |
|---|
| 48 | // --------------- page components functions |
|---|
| 49 | |
|---|
| 50 | /** |
|---|
| 51 | * page code function |
|---|
| 52 | */ |
|---|
| 53 | function PageCompPageMainCode() |
|---|
| 54 | { |
|---|
| 55 | global $site; |
|---|
| 56 | global $aPreValues; |
|---|
| 57 | |
|---|
| 58 | $query = " |
|---|
| 59 | SELECT |
|---|
| 60 | `id_poll`, |
|---|
| 61 | `id_profile`, |
|---|
| 62 | `poll_question`, |
|---|
| 63 | `Profiles`.* |
|---|
| 64 | FROM `ProfilesPolls` |
|---|
| 65 | LEFT JOIN `Profiles` ON |
|---|
| 66 | `id_profile` = `Profiles`.`ID` |
|---|
| 67 | WHERE |
|---|
| 68 | `poll_status` = 'active' |
|---|
| 69 | AND `poll_approval` |
|---|
| 70 | ORDER BY `id_poll` DESC |
|---|
| 71 | "; |
|---|
| 72 | //$query = "SELECT `ID`, `Question` FROM `polls_q` WHERE `Active` = 'on' ORDER BY `Question`"; |
|---|
| 73 | |
|---|
| 74 | $res = db_res($query); |
|---|
| 75 | |
|---|
| 76 | if ( $res and mysql_num_rows($res) ) |
|---|
| 77 | { |
|---|
| 78 | $ret = '<div class="clear_both"></div>'; |
|---|
| 79 | |
|---|
| 80 | while ( $arr = mysql_fetch_array($res) ) |
|---|
| 81 | { |
|---|
| 82 | $age_str = _t("_y/o", age( $arr['DateOfBirth'] )); |
|---|
| 83 | $y_o_sex = $age_str . ' ' . _t("_".$arr['Sex']); |
|---|
| 84 | |
|---|
| 85 | $poll_coutry = _t($aPreValues['Country'][$arr['Country']]['LKey']); |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | $ret .= '<div class="pollBody">'; |
|---|
| 89 | $ret .= '<div class="clear_both"></div>'; |
|---|
| 90 | |
|---|
| 91 | $ret .= '<div class="pollInfo">'; |
|---|
| 92 | $ret .= get_member_icon( $arr['id_profile'], 'left' ); |
|---|
| 93 | $ret .= '<div class="pollInfo_nickname">'; |
|---|
| 94 | $ret .= _t( '_Submitted by', $arr['NickName'] ); |
|---|
| 95 | $ret .= '</div>'; |
|---|
| 96 | $ret .= '<div class="pollInfo_info">'; |
|---|
| 97 | $ret .= $y_o_sex . '<br />' . $poll_coutry; |
|---|
| 98 | $ret .= '</div>'; |
|---|
| 99 | $ret .= '</div>'; |
|---|
| 100 | |
|---|
| 101 | $ret .= '<div class="clear_both"></div>'; |
|---|
| 102 | $ret .= ShowPoll( $arr['id_poll'] ); |
|---|
| 103 | $ret .= '<div class="clear_both"></div>'; |
|---|
| 104 | |
|---|
| 105 | $ret .= '</div>'; |
|---|
| 106 | |
|---|
| 107 | } |
|---|
| 108 | $ret .= '<div class="clear_both"></div>'; |
|---|
| 109 | } |
|---|
| 110 | else |
|---|
| 111 | { |
|---|
| 112 | $ret = "<div align=center>". _t("_No polls available") ."</div>\n"; |
|---|
| 113 | } |
|---|
| 114 | |
|---|
| 115 | return $ret; |
|---|
| 116 | } |
|---|
| 117 | |
|---|
| 118 | ?> |
|---|