| 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 | |
|---|
| 25 | // --------------- page variables / login |
|---|
| 26 | |
|---|
| 27 | $_page['name_index'] = 30; |
|---|
| 28 | $_page['css_name'] = 'stories.css'; |
|---|
| 29 | |
|---|
| 30 | if ( !( $logged['admin'] = member_auth( 1, false ) ) ) |
|---|
| 31 | if ( !( $logged['member'] = member_auth( 0, false ) ) ) |
|---|
| 32 | if ( !( $logged['aff'] = member_auth( 2, false )) ) |
|---|
| 33 | $logged['moderator'] = member_auth( 3, false ); |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | $_page['header'] = _t( "_STORY_VIEW_H" ); |
|---|
| 37 | $_page['header_text'] = _t( "_STORY_VIEW_H1" ); |
|---|
| 38 | //$_page['header_text'] = ('g4' != $tmpl) ? _t( "_STORY_VIEW_H1" ) : "<img src=\"{$site['images']}feedback.gif\">"; |
|---|
| 39 | // --------------- page components |
|---|
| 40 | |
|---|
| 41 | $_ni = $_page['name_index']; |
|---|
| 42 | $_page_cont[$_ni]['page_main_code'] = PageCompPageMainCode(); |
|---|
| 43 | |
|---|
| 44 | // --------------- [END] page components |
|---|
| 45 | |
|---|
| 46 | // this is dynamic page - send headers to do not cache this page |
|---|
| 47 | send_headers_page_changed(); |
|---|
| 48 | PageCode(); |
|---|
| 49 | |
|---|
| 50 | // --------------- page components functions |
|---|
| 51 | |
|---|
| 52 | /** |
|---|
| 53 | * page code function |
|---|
| 54 | */ |
|---|
| 55 | function PageCompPageMainCode() |
|---|
| 56 | { |
|---|
| 57 | global $site; |
|---|
| 58 | global $short_date_format; |
|---|
| 59 | |
|---|
| 60 | $out = ""; |
|---|
| 61 | |
|---|
| 62 | $query = "SELECT `Stories`.`ID`, `Profiles`.`ID` as `MembID`, DATE_FORMAT(`Stories`.`Date`, '$short_date_format' ) AS 'Date', `Stories`.`Header`, `Stories`.`Text`, `Profiles`.`ID` as `prID`, `Profiles`.`NickName` FROM `Stories` INNER JOIN `Profiles` ON (`Stories`.`Sender` = `Profiles`.`ID`) WHERE `Stories`.`active` = 'on' ORDER BY `Stories`.`Date` DESC"; |
|---|
| 63 | |
|---|
| 64 | $res = db_res($query); |
|---|
| 65 | if ( !$res ) |
|---|
| 66 | return 0; |
|---|
| 67 | |
|---|
| 68 | $out .= " |
|---|
| 69 | <br /> |
|---|
| 70 | <div align=left> <a href=\"".$site['url']."story.php\">"._t("_post my feedback")."</a></div> |
|---|
| 71 | <br /> |
|---|
| 72 | <table width=\"100%\" cellspacing=1 cellpadding=2 class=small width=100%>"; |
|---|
| 73 | $num = mysql_num_rows($res); |
|---|
| 74 | if ( !$num ) |
|---|
| 75 | $out .= " |
|---|
| 76 | <tr> |
|---|
| 77 | <td><center>"._t("_NO_STORIES")."</center></td> |
|---|
| 78 | </tr>"; |
|---|
| 79 | else |
|---|
| 80 | { |
|---|
| 81 | while ( $arr = mysql_fetch_array($res)) |
|---|
| 82 | { |
|---|
| 83 | $story_header = process_line_output( $arr['Header'] ); |
|---|
| 84 | $out .= " |
|---|
| 85 | <tr class=panel> |
|---|
| 86 | <td align=center width=15%>{$arr['Date']}</td> |
|---|
| 87 | <td align=center width=15%><a href=\"".getProfileLink($arr['prID'])."\">{$arr['NickName']}</a></td> |
|---|
| 88 | <td aling=left> <a href='story_view.php?ID={$arr['ID']}'>$story_header</a></td> |
|---|
| 89 | </tr>"; |
|---|
| 90 | |
|---|
| 91 | } |
|---|
| 92 | } |
|---|
| 93 | |
|---|
| 94 | $out .= " |
|---|
| 95 | </table>\n"; |
|---|
| 96 | |
|---|
| 97 | return $out; |
|---|
| 98 | } |
|---|
| 99 | |
|---|
| 100 | ?> |
|---|