HomeHelpTrac

source: tags/6.1/explanation.php @ 10242

Revision 10242, 5.8 KB checked in by Alexander Trofimov, 3 years ago (diff)

dolphin 6.1.5, initial commit

Line 
1<?php
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
21require_once( 'inc/header.inc.php' );
22require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' );
23require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
24
25// --------------- page variables and login
26
27$_page['name_index']    = 44;
28
29if ( !( $logged['admin'] = member_auth( 1, false ) ) )
30    if ( !( $logged['member'] = member_auth( 0, false ) ) )
31        if ( !( $logged['aff'] = member_auth( 2, false )) )
32            $logged['moderator'] = member_auth( 3, false );
33
34
35if ( $_GET['explain'] != 'imadd' )
36{
37    $_page['header'] = _t( "_EXPLANATION_H" ).": "._t("_".$_GET['explain']);
38    $_page['header_text'] = _t( "_EXPLANATION_H" ).": "._t("_".$_GET['explain']);
39}
40else
41{
42    $_page['header'] = _t("_User was added to im");
43    $_page['header_text'] = _t("_User was added to im");
44}
45
46
47
48// --------------- page components
49
50$_ni = $_page['name_index'];
51$_page_cont[$_ni]['body_onload'] = 'javascript: void(0)';
52$_page_cont[$_ni]['page_main_code'] = DesignBoxContent($_page['header_text'], PageMainCode(), $oTemplConfig -> PageExplanation_db_num);
53
54// --------------- [END] page components
55
56PageCode();
57
58// --------------- page components functions
59
60function im_up()
61{
62
63 ob_start();
64?>
65
66 <table align="center" cellspacing=4 cellpadding=4 class=small width=90% border=0>
67 <tr><td>
68
69 Your current membership status doesn't allow You to use this feature.
70 Please <a href="<?=$site[url]?>membership.php" target="_blank">click here</a> to upgrade your membership.
71 </td></tr>
72 </table>
73
74<?php
75
76 $ret = ob_get_contents();
77 ob_end_clean();
78
79 return $ret;
80
81}
82
83function membershipActionsList($membershipID)
84{
85    $resLevelActions = db_res("
86        SELECT  IDAction,
87                Name,
88                AllowedCount,
89                AllowedPeriodLen,
90                AllowedPeriodStart,
91                AllowedPeriodEnd,
92                AdditionalParamName,
93                AdditionalParamValue
94        FROM    MemLevelActions
95                INNER JOIN MemActions
96                ON MemLevelActions.IDAction = MemActions.ID
97        WHERE MemLevelActions.IDLevel = $membershipID
98        ORDER BY MemActions.Name");
99
100          ob_start();
101?>
102<!-- [START] List Membership Actions -->
103
104<style type="text/css">
105table.allowedActionsTable{
106    border-bottom:1px solid;
107    border-right:1px solid;
108}
109table.allowedActionsTable td{
110    padding: 5px;
111    text-align: center;
112    border-top:1px solid;
113    border-left:1px solid;
114}
115</style>
116<table cellpadding="0" cellspacing="0" border="0" style="font-size: 8pt" class="allowedActionsTable" align="center" width="100%">
117<tr>
118        <td colspan="5" align="center"><?= _t("_Allowed actions") ?></td>
119</tr>
120<tr>
121        <td><b><?= _t("_Action") ?></b></td>
122        <td><b><?= _t("_Times allowed") ?></b></td>
123        <td><b><?= _t("_Period (hours)") ?></b></td>
124        <td><b><?= _t("_Allowed Since") ?></b></td>
125        <td><b><?= _t("_Allowed Until") ?></b></td>
126</tr>
127<?
128    if(mysql_num_rows($resLevelActions) <= 0)
129    {
130?>
131<tr>
132        <td colspan="5"><?= _t("_No actions allowed for this membership") ?></td>
133</tr>
134<?
135    }
136    while($membershipAction = mysql_fetch_assoc($resLevelActions))
137    {
138?>
139<tr>
140        <td style="text-align: left;"><b><?= _t("_".$membershipAction['Name']) ?></b></td>
141        <td><?= $membershipAction['AllowedCount'] ? $membershipAction['AllowedCount'] : _t("_no limit") ?></td>
142        <td><?= $membershipAction['AllowedPeriodLen'] ? $membershipAction['AllowedPeriodLen'] : _t("_no limit") ?></td>
143        <td><?= $membershipAction['AllowedPeriodStart'] ? $membershipAction['AllowedPeriodStart'] : _t("_no limit") ?></td>
144        <td><?= $membershipAction['AllowedPeriodEnd'] ? $membershipAction['AllowedPeriodEnd'] : _t("_no limit") ?></td>
145</tr>
146<?
147    }
148?>
149</table>
150
151<?
152    $result = ob_get_contents();
153         ob_end_clean();
154
155    return $result;
156}
157
158/**
159 * Prints HTML Code for explanation
160 */
161function PageMainCode()
162{
163    global $site;
164    global $oTemplConfig;
165
166    $b = "<table width=".($oTemplConfig -> expl_db_w-5)." class=text cellspacing=0 cellpadding=0><td width=5><img src={$site['images']}spacer.gif alt=\"\" width=5></td><td width=".($oTemplConfig -> expl_db_w-15)."><div width=".($oTemplConfig -> expl_db_w-15)." align=justify>";
167    $a = "</div></td><td width=5><img src={$site['images']}spacer.gif  alt=\"\" width=5></td></table>";
168    switch ( $_GET['explain'] )
169    {
170        case 'Unconfirmed': return $b._t("_ATT_UNCONFIRMED_E").$a;
171        case 'Approval': return $b._t("_ATT_APPROVAL_E").$a;
172        case 'Active': return $b._t("_ATT_ACTIVE_E").$a;
173        case 'Rejected': return $b._t("_ATT_REJECTED_E").$a;
174        case 'Suspended': return $b._t("_ATT_SUSPENDED_E", $site['title']).$a;
175        case 'membership': return membershipActionsList((int)$_GET['type']);
176        case 'im_up': return im_up();
177        case 'imadd':
178?>
179    <script type="text/javascript">
180    <!--
181    var amount = 8
182    function pause()
183    {
184        myID = setTimeout( "close_win()", amount*1000 )
185    }
186    function close_win()
187    {
188        window.close()
189    }
190    pause();
191    //-->
192    </script>
193<?php
194            $ID = (int)$_GET['ID'];
195            db_res("INSERT INTO IMessages SET IDFrom = ".(int)$_COOKIE['memberID'].", IDTo = $ID, `When`=NOW(), Msg=''");
196            return $b._t("_User was added to im").$a;
197    }
198    return "";
199}
200
201?>
Note: See TracBrowser for help on using the repository browser.