34. File Comparison Report

Produced on Wed Jun 18 08:01:38 2008 UTC. This report uses XHTML and CSS2, and is best viewed with a reasonably standards compliant browser such as the latest version of Firefox or Internet Explorer. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

34.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.1\inc\classes BxDolEvents.php Sun May 11 13:17:00 2008 UTC
2 Dolphin-v.6.1.2\inc\classes BxDolEvents.php Mon Jun 16 05:18:35 2008 UTC

34.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 38 4692
Changed 26 134
Inserted 11 16
Removed 0 0

34.3 Comparison options

Whitespace All differences in whitespace within lines are ignored
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

34.4 Active regular expressions

No regular expressions were active.

34.5 Comparison detail

1   <?   1   <?
2     2  
3   //require_ once( BX_D IRECTORY_P ATH_INC .  'prof.inc. php' );   3   //require_ once( BX_D IRECTORY_P ATH_INC .  'prof.inc. php' );
4   //require_ once( BX_D IRECTORY_P ATH_INC .  'sdating.i nc.php' );   4   //require_ once( BX_D IRECTORY_P ATH_INC .  'sdating.i nc.php' );
5     5  
6   require_on ce( BX_DIR ECTORY_PAT H_INC . 'h eader.inc. php' );   6   require_on ce( BX_DIR ECTORY_PAT H_INC . 'h eader.inc. php' );
7   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );   7   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );
8   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );   8   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );
9   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );   9   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );
10     10  
11   require_on ce( BX_DIR ECTORY_PAT H_INC . 't ags.inc.ph p' );   11   require_on ce( BX_DIR ECTORY_PAT H_INC . 't ags.inc.ph p' );
12     12  
13   /*   13   /*
14    * class f or Events   14    * class f or Events
15    */   15    */
16   class BxDo lEvents {   16   class BxDo lEvents {
17       //vari ables   17       //vari ables
18     18  
19       //div  element wi th spacer  image   19       //div  element wi th spacer  image
20       //var  $sRowSpace rDiv;   20       //var  $sRowSpace rDiv;
21     21  
22       //coun t of event s per page   22       //coun t of event s per page
23       var $i EventsPerP age; // co unt of eve nts to sho w per page   23       var $i EventsPerP age; // co unt of eve nts to sho w per page
24     24  
25       //var  $iNewEvPic Width = 20 0;   25       //var  $iNewEvPic Width = 20 0;
26       //var  $iNewEvPic Height = 1 50;   26       //var  $iNewEvPic Height = 1 50;
27     27  
28       //max  sizes of p ictures fo r resizing  during up load   28       //max  sizes of p ictures fo r resizing  during up load
29       var $i IconSize;   29       var $i IconSize;
30       var $i ThumbSize;   30       var $i ThumbSize;
31       var $i ImgSize;   31       var $i ImgSize;
32     32  
33       //admi n mode, ca n All acti ons   33       //admi n mode, ca n All acti ons
34       var $b AdminMode;   34       var $b AdminMode;
35     35  
36       //path  to image  pic_not_av ail.gif   36       //path  to image  pic_not_av ail.gif
37       var $s PicNotAvai l;   37       var $s PicNotAvai l;
38       //path  to spacer  image   38       //path  to spacer  image
39       var $s SpacerPath ;   39       var $s SpacerPath ;
40     40  
41       var $i LastInsert edID = -1;   41       var $i LastInsert edID = -1;
42     42  
43       //use  permalink   43       //use  permalink
44       var $b UseFriendl yLinks;   44       var $b UseFriendl yLinks;
45     45  
46       /**   46       /**
47        * con structor   47        * con structor
48        */   48        */
49       functi on BxDolEv ents($bAdm Mode = FAL SE) {   49       functi on BxDolEv ents($bAdm Mode = FAL SE) {
50           gl obal $site ;   50           gl obal $site ;
51     51  
52           $t his->sSpac erPath = g etTemplate Icon( 'spa cer.gif' ) ;   52           $t his->sSpac erPath = g etTemplate Icon( 'spa cer.gif' ) ;
53           $t his->sPicN otAvail =  'images/ic ons/group_ no_pic.gif ';   53           $t his->sPicN otAvail =  'images/ic ons/group_ no_pic.gif ';
54           $t his->bAdmi nMode = $b AdmMode;   54           $t his->bAdmi nMode = $b AdmMode;
55     55  
56           //  $this->sR owSpacerDi v = <<<EOF   56           //  $this->sR owSpacerDi v = <<<EOF
57   // <table  cellspacin g="0" cell padding="0 " height=" 10" border ="0">   57   // <table  cellspacin g="0" cell padding="0 " height=" 10" border ="0">
58       // <td ><img src= "{$this->s SpacerPath }"></td>   58       // <td ><img src= "{$this->s SpacerPath }"></td>
59   // </table >   59   // </table >
60   // EOF;   60   // EOF;
61           $t his->iEven tsPerPage  = 10;   61           $t his->iEven tsPerPage  = 10;
62     62  
63           $t his->iIcon Size = 45;   63           $t his->iIcon Size = 45;
64           $t his->iThum bSize = 11 0;   64           $t his->iThum bSize = 11 0;
65           $t his->iImgS ize = 340;   65           $t his->iImgS ize = 340;
66     66  
67           $t his->bUseF riendlyLin ks = getPa ram('perma links_even ts') == 'o n' ? true  : false;   67           $t his->bUseF riendlyLin ks = getPa ram('perma links_even ts') == 'o n' ? true  : false;
68       }   68       }
69     69  
70       /**   70       /**
71        * Com pose Array  of posted  data befo re validat ing (post  ad or edit )   71        * Com pose Array  of posted  data befo re validat ing (post  ad or edit )
72        *   72        *
73        * @re turn Array  of posted  variables   73        * @re turn Array  of posted  variables
74        */   74        */
75       functi on FillPos tEventArrB yPostValue s() {   75       functi on FillPos tEventArrB yPostValue s() {
76           $s EventTitle              = proces s_db_input ( $_POST[' event_titl e'] );   76           $s EventTitle              = proces s_db_input ( $_POST[' event_titl e'] );
77           $s EventDesc               = proces s_db_input ( $_POST[' event_desc '] );   77           $s EventDesc               = proces s_db_input ( $_POST[' event_desc '] );
78           $s EventStatu sMessage     = proces s_db_input ( $_POST[' event_stat usmsg'] );   78           $s EventStatu sMessage     = proces s_db_input ( $_POST[' event_stat usmsg'] );
79           $s Tags                    = proces s_db_input ( $_POST[' event_tags '] );   79           $s Tags                    = proces s_db_input ( $_POST[' event_tags '] );
80     80  
81           $s EventCount ry  = proc ess_db_inp ut( $_POST ['event_co untry'] );   81           $s EventCount ry  = proc ess_db_inp ut( $_POST ['event_co untry'] );
82           $s EventCity      = proc ess_db_inp ut( $_POST ['event_ci ty'] );   82           $s EventCity      = proc ess_db_inp ut( $_POST ['event_ci ty'] );
83           $s EventPlace     = proc ess_db_inp ut( $_POST ['event_pl ace'] );   83           $s EventPlace     = proc ess_db_inp ut( $_POST ['event_pl ace'] );
84     84  
85           $s EventStart     = (iss et($_POST[ 'event_sta rt']) && $ _POST['eve nt_start']  != '') ?  strtotime(  $_POST['e vent_start '] ) : -1;   85           $s EventStart     = (iss et($_POST[ 'event_sta rt']) && $ _POST['eve nt_start']  != '') ?  strtotime(  $_POST['e vent_start '] ) : -1;
86           if  ($this->b AdminMode)  {   86           if  ($this->b AdminMode)  {
87                $sEventE nd           = strtot ime( $_POS T['event_e nd'] );   87                $sEventE nd           = strtot ime( $_POS T['event_e nd'] );
88                $sEventS aleStart     = strtot ime( $_POS T['event_s ale_start' ] );   88                $sEventS aleStart     = strtot ime( $_POS T['event_s ale_start' ] );
89                $sEventS aleEnd       = strtot ime( $_POS T['event_s ale_end']  );   89                $sEventS aleEnd       = strtot ime( $_POS T['event_s ale_end']  );
90                $iEventC ountF = (i nt)$_POST[ 'event_cou nt_female' ];   90                $iEventC ountF = (i nt)$_POST[ 'event_cou nt_female' ];
91                $iEventC ountM = (i nt)$_POST[ 'event_cou nt_male'];   91                $iEventC ountM = (i nt)$_POST[ 'event_cou nt_male'];
92           }   92           }
93     93  
94           $a Elements =  array('Ti tle' => $s EventTitle , 'Descrip tion' => $ sEventDesc , 'Status  message' = > $sEventS tatusMessa ge,   94           $a Elements =  array('Ti tle' => $s EventTitle , 'Descrip tion' => $ sEventDesc , 'Status  message' = > $sEventS tatusMessa ge,
95                'City' = > $sEventC ity, 'Coun try' => $s EventCount ry, 'Place ' => $sEve ntPlace, ' Event star t' => $sEv entStart,   95                'City' = > $sEventC ity, 'Coun try' => $s EventCount ry, 'Place ' => $sEve ntPlace, ' Event star t' => $sEv entStart,
96                'Event e nd' => $sE ventEnd, ' Ticket Sal e Start' = > $sEventS aleStart,  'Ticket Sa le End' =>  $sEventSa leEnd,   96                'Event e nd' => $sE ventEnd, ' Ticket Sal e Start' = > $sEventS aleStart,  'Ticket Sa le End' =>  $sEventSa leEnd,
97                'Female  Ticket Cou nt' => $iE ventCountF , 'Male Ti cket Count ' => $iEve ntCountM,    97                'Female  Ticket Cou nt' => $iE ventCountF , 'Male Ti cket Count ' => $iEve ntCountM, 
98                'Tags' = > $sTags);   98                'Tags' = > $sTags);
99     99  
100           re turn $aEle ments;   100           re turn $aEle ments;
101       }   101       }
102     102  
103       /**   103       /**
104        * Gen erate comm on forms a nd include s js   104        * Gen erate comm on forms a nd include s js
105        *   105        *
106        * @re turn HTML  presentati on of data   106        * @re turn HTML  presentati on of data
107        */   107        */
108       functi on PrintCo mmandForms () {   108       functi on PrintCo mmandForms () {
109           $s JSPath = $ site['url' ] . 'inc/' ;   109           $s JSPath = $ site['url' ] . 'inc/' ;
110     110  
111           $s RetHtml =  <<<EOF   111           $s RetHtml =  <<<EOF
112   <script sr c="{$sJSPa th}js/dyna mic_core.j s.php" typ e="text/ja vascript"> </script>   112   <script sr c="{$sJSPa th}js/dyna mic_core.j s.php" typ e="text/ja vascript"> </script>
113   <form acti on="{$_SER VER['PHP_S ELF']}" me thod="post " name="co mmand_edit _event">   113   <form acti on="{$_SER VER['PHP_S ELF']}" me thod="post " name="co mmand_edit _event">
114       <input  type="hid den" name= "action" i d="action"  value="ed it_event"  />   114       <input  type="hid den" name= "action" i d="action"  value="ed it_event"  />
115       <input  type="hid den" name= "EditEvent ID" id="Ed itEventID"  value=""  />   115       <input  type="hid den" name= "EditEvent ID" id="Ed itEventID"  value=""  />
116   </form>   116   </form>
117   <form acti on="{$_SER VER['PHP_S ELF']}" me thod="post " name="co mmand_dele te_event">   117   <form acti on="{$_SER VER['PHP_S ELF']}" me thod="post " name="co mmand_dele te_event">
118       <input  type="hid den" name= "action" i d="action"  value="de lete_event " />   118       <input  type="hid den" name= "action" i d="action"  value="de lete_event " />
119       <input  type="hid den" name= "DeleteEve ntID" id=" DeleteEven tID" value ="" />   119       <input  type="hid den" name= "DeleteEve ntID" id=" DeleteEven tID" value ="" />
120   </form>   120   </form>
121   EOF;   121   EOF;
122           re turn $sRet Html;   122           re turn $sRet Html;
123       }   123       }
124     124  
125       functi on CheckLo gged() {   125       functi on CheckLo gged() {
126           gl obal $logg ed;   126           gl obal $logg ed;
127           if ( !$logged ['member']  && !$logg ed['admin' ] ) {   127           if ( !$logged ['member']  && !$logg ed['admin' ] ) {
128                member_a uth(0);   128                member_a uth(0);
129           }   129           }
130       }   130       }
131     131  
132       functi on DeleteP rofileEven ts($iProfi leID) {   132       functi on DeleteP rofileEven ts($iProfi leID) {
133           if  ($this->b AdminMode= =true) {   133           if  ($this->b AdminMode= =true) {
134                $vDelSQL  = db_res( "SELECT `I D` FROM `S DatingEven ts` WHERE  `Responsib leID` = {$ iProfileID }");   134                $vDelSQL  = db_res( "SELECT `I D` FROM `S DatingEven ts` WHERE  `Responsib leID` = {$ iProfileID }");
135                while( $ aEnent = m ysql_fetch _assoc($vD elSQL) ) {   135                while( $ aEnent = m ysql_fetch _assoc($vD elSQL) ) {
136                    $thi s->PageSDa tingDelete Event($aEn ent['ID']) ;   136                    $thi s->PageSDa tingDelete Event($aEn ent['ID']) ;
137                }   137                }
138           }   138           }
139       }   139       }
140     140  
141       functi on PageSDa tingDelete Event($iDe lEventID =  -1) {   141       functi on PageSDa tingDelete Event($iDe lEventID =  -1) {
142           $t his->Check Logged();   142           $t his->Check Logged();
143           gl obal $dir;   143           gl obal $dir;
144           $s EventID =  ($iDelEven tID>0) ? $ iDelEventI D : proces s_db_input ( (int)$_P OST['Delet eEventID']  );   144           $s EventID =  ($iDelEven tID>0) ? $ iDelEventI D : proces s_db_input ( (int)$_P OST['Delet eEventID']  );
145     145  
146           $a Owner = db _arr("SELE CT `Respon sibleID` F ROM `SDati ngEvents`  WHERE `ID`  = {$sEven tID} LIMIT  1");   146           $a Owner = db _arr("SELE CT `Respon sibleID` F ROM `SDati ngEvents`  WHERE `ID`  = {$sEven tID} LIMIT  1");
147           if  ($aOwner[ 'Responsib leID']==(i nt)$_COOKI E['memberI D'] || $th is->bAdmin Mode) {   147           if  ($aOwner[ 'Responsib leID']==(i nt)$_COOKI E['memberI D'] || $th is->bAdmin Mode) {
148                $vPosts  = db_res(  "DELETE FR OM `SDatin gParticipa nts` WHERE  `IDEvent` ={$sEventI D}" );   148                $vPosts  = db_res(  "DELETE FR OM `SDatin gParticipa nts` WHERE  `IDEvent` ={$sEventI D}" );
149     149  
150                $aPicSQL  = db_arr( "SELECT `P hotoFilena me` FROM ` SDatingEve nts` WHERE  `ID` = {$ sEventID}" );   150                $aPicSQL  = db_arr( "SELECT `P hotoFilena me` FROM ` SDatingEve nts` WHERE  `ID` = {$ sEventID}" );
151                $sMediaF ileName =  $aPicSQL[' PhotoFilen ame'];   151                $sMediaF ileName =  $aPicSQL[' PhotoFilen ame'];
152                if ($sMe diaFileNam e != '') {   152                if ($sMe diaFileNam e != '') {
153                    if ( unlink ( $ dir['sdati ngImage']  . $sMediaF ileName )  == FALSE)  {   153                    if ( unlink ( $ dir['sdati ngImage']  . $sMediaF ileName )  == FALSE)  {
154                         $sRetHtml  .= MsgBox( _t('_FAILE D_TO_DELET E_PIC', $s MediaFileN ame));   154                         $sRetHtml  .= MsgBox( _t('_FAILE D_TO_DELET E_PIC', $s MediaFileN ame));
155                    }   155                    }
156                    if ( unlink ( $ dir['sdati ngImage']  . 'thumb_' .$sMediaFi leName ) = = FALSE) {   156                    if ( unlink ( $ dir['sdati ngImage']  . 'thumb_' .$sMediaFi leName ) = = FALSE) {
157                         $sRetHtml  .= MsgBox( _t('_FAILE D_TO_DELET E_PIC', $s MediaFileN ame));   157                         $sRetHtml  .= MsgBox( _t('_FAILE D_TO_DELET E_PIC', $s MediaFileN ame));
158                    }   158                    }
159                    if ( unlink ( $ dir['sdati ngImage']  . 'icon_'. $sMediaFil eName ) ==  FALSE) {   159                    if ( unlink ( $ dir['sdati ngImage']  . 'icon_'. $sMediaFil eName ) ==  FALSE) {
160                         $sRetHtml  .= MsgBox( _t('_FAILE D_TO_DELET E_PIC', $s MediaFileN ame));   160                         $sRetHtml  .= MsgBox( _t('_FAILE D_TO_DELET E_PIC', $s MediaFileN ame));
161                    }   161                    }
162                }   162                }
163                $sQuery  = "DELETE  FROM `SDat ingEvents`  WHERE `SD atingEvent s`.`ID` =  {$sEventID } LIMIT 1" ;   163                $sQuery  = "DELETE  FROM `SDat ingEvents`  WHERE `SD atingEvent s`.`ID` =  {$sEventID } LIMIT 1" ;
164                db_res(  $sQuery );   164                db_res(  $sQuery );
165                return M sgBox(_t(' _event_del eted'));   165                return M sgBox(_t(' _event_del eted'));
166           }  elseif ($a Owner['Res ponsibleID ']!=(int)$ _COOKIE['m emberID'])  {   166           }  elseif ($a Owner['Res ponsibleID ']!=(int)$ _COOKIE['m emberID'])  {
167                return M sgBox(_t(' _Hacker St ring'));   167                return M sgBox(_t(' _Hacker St ring'));
168           }  else {   168           }  else {
169                return M sgBox(_t(' _event_del ete_failed '));   169                return M sgBox(_t(' _event_del ete_failed '));
170           }   170           }
171       }   171       }
172     172  
173       /**   173       /**
174        * Com pose Array  of errors  during fi lling (val idating)   174        * Com pose Array  of errors  during fi lling (val idating)
175        *   175        *
176        * @pa ram $aElem ents    In put Array  with data   176        * @pa ram $aElem ents    In put Array  with data
177        * @re turn Array  with erro rs   177        * @re turn Array  with erro rs
178        */   178        */
179       functi on CheckEv entErrors(  $aElement s ) {   179       functi on CheckEv entErrors(  $aElement s ) {
180           $a Err = arra y();   180           $a Err = arra y();
181           fo reach( $aE lements as  $sFieldNa me => $sFi eldValue )  {   181           fo reach( $aE lements as  $sFieldNa me => $sFi eldValue )  {
182                switch(  $sFieldNam e ) {   182                switch(  $sFieldNam e ) {
183                    // c ase 'Statu s message' :   183                    // c ase 'Statu s message' :
184                    case  'Title':   184                    case  'Title':
185                    case  'Country' :   185                    case  'Country' :
186                         if( !mb_st rlen($sFie ldValue) )   186                         if( !mb_st rlen($sFie ldValue) )
187                             $aErr[  $sFieldNa me ] = "{$ sFieldName } is requi red";   187                             $aErr[  $sFieldNa me ] = "{$ sFieldName } is requi red";
188                    brea k;   188                    brea k;
189                    case  'Descript ion':   189                    case  'Descript ion':
190                         if( mb_str len($sFiel dValue) <  50 )   190                         if( mb_str len($sFiel dValue) <  50 )
191                             $aErr[  $sFieldNa me ] = "{$ sFieldName } must be  50 symbols  at least" ;   191                             $aErr[  $sFieldNa me ] = "{$ sFieldName } must be  50 symbols  at least" ;
192                    brea k;   192                    brea k;
193                    case  'City':   193                    case  'City':
194                    case  'Place':   194                    case  'Place':
195                         if( !mb_st rlen($sFie ldValue) & & $this->b AdminMode= =TRUE )   195                         if( !mb_st rlen($sFie ldValue) & & $this->b AdminMode= =TRUE )
196                             $aErr[  $sFieldNa me ] = "{$ sFieldName } is requi red";   196                             $aErr[  $sFieldNa me ] = "{$ sFieldName } is requi red";
197                    brea k;   197                    brea k;
198     198  
199                    case  'Event st art':   199                    case  'Event st art':
200                         if( $sFiel dValue > 0  ) {   200                         if( $sFiel dValue > 0  ) {
201                             $sEven tStart = s trtotime($ _REQUEST[' event_star t']);   201                             $sEven tStart = s trtotime($ _REQUEST[' event_star t']);
202                             $sNow  = strtotim e("now");   202                             $sNow  = strtotim e("now");
203                             if ($s EventStart  < $sNow)   203                             if ($s EventStart  < $sNow)
204                                 $a Err[ $sFie ldName ] =  "_event_p ost_wrong_ time";   204                                 $a Err[ $sFie ldName ] =  "_event_p ost_wrong_ time";
205                         } else {   205                         } else {
206                             $aErr[  $sFieldNa me ] = "{$ sFieldName } is requi red";   206                             $aErr[  $sFieldNa me ] = "{$ sFieldName } is requi red";
207                         }   207                         }
208                    brea k;   208                    brea k;
209                    case  'Event en d':   209                    case  'Event en d':
210                    case  'Ticket S ale Start' :   210                    case  'Ticket S ale Start' :
211                    case  'Ticket S ale End':   211                    case  'Ticket S ale End':
212                         if( $sFiel dValue ==  -1 && $thi s->bAdminM ode==TRUE  )   212                         if( $sFiel dValue ==  -1 && $thi s->bAdminM ode==TRUE  )
213                             $aErr[  $sFieldNa me ] = "{$ sFieldName } is requi red";   213                             $aErr[  $sFieldNa me ] = "{$ sFieldName } is requi red";
214                    brea k;   214                    brea k;
215     215  
216                    case  'Female T icket Coun t':   216                    case  'Female T icket Coun t':
217                    case  'Male Tic ket Count' :   217                    case  'Male Tic ket Count' :
218                         if( $sFiel dValue < 1  && $this- >bAdminMod e==TRUE )   218                         if( $sFiel dValue < 1  && $this- >bAdminMod e==TRUE )
219                             $aErr[  $sFieldNa me ] = "{$ sFieldName } must be  positive";   219                             $aErr[  $sFieldNa me ] = "{$ sFieldName } must be  positive";
220                    brea k;   220                    brea k;
221                }   221                }
222           }   222           }
223           re turn $aErr ;   223           re turn $aErr ;
224       }   224       }
225     225  
226       /**   226       /**
227        * fun ction for  New/Edit e vent   227        * fun ction for  New/Edit e vent
228        * @re turn Text  Result   228        * @re turn Text  Result
229        */   229        */
230       functi on SDAddEv ent( $iEve ntID = -1  ) {//for u pdate even t   230       functi on SDAddEv ent( $iEve ntID = -1  ) {//for u pdate even t
231           // print $iEv entID;   231           // print $iEv entID;
232           gl obal $dir;   232           gl obal $dir;
233           gl obal $logg ed;   233           gl obal $logg ed;
234           gl obal $site ;   234           gl obal $site ;
235     235  
236           if ( !$logged ['member']  && !$logg ed['admin' ] ) {   236           if ( !$logged ['member']  && !$logg ed['admin' ] ) {
237                member_a uth(0);   237                member_a uth(0);
238           }   238           }
239     239  
240           //  collect i nformation  about cur rent membe r   240           //  collect i nformation  about cur rent membe r
241           $a Member['ID '] = (int) $_COOKIE[' memberID'] ;   241           $a Member['ID '] = (int) $_COOKIE[' memberID'] ;
242           $a MemberData  = getProf ileInfo( $ aMember['I D'] );   242           $a MemberData  = getProf ileInfo( $ aMember['I D'] );
243     243  
244           //  common   244           //  common
245           $s EventTitle            = process_ db_input(  $_POST['ev ent_title' ] );   245           $s EventTitle            = process_ db_input(  $_POST['ev ent_title' ] );
246           $s EventDesc             = $this->p rocess_htm l_db_input ($_POST['e vent_desc' ]);   246           $s EventDesc             = $this->p rocess_htm l_db_input ($_POST['e vent_desc' ]);
247           $s EventStatu sMessage   = process_ db_input(  $_POST['ev ent_status msg'] );   247           $s EventStatu sMessage   = process_ db_input(  $_POST['ev ent_status msg'] );
248     248  
249           //  event pla ce   249           //  event pla ce
250           $s EventCount ry = proce ss_db_inpu t( $_POST[ 'event_cou ntry'] );   250           $s EventCount ry = proce ss_db_inpu t( $_POST[ 'event_cou ntry'] );
251           $s EventCity     = proce ss_db_inpu t( $_POST[ 'event_cit y'] );   251           $s EventCity     = proce ss_db_inpu t( $_POST[ 'event_cit y'] );
252           $E ventPlace     = proce ss_db_inpu t( $_POST[ 'event_pla ce'] );   252           $E ventPlace     = proce ss_db_inpu t( $_POST[ 'event_pla ce'] );
253           $s Tags    =  process_db _input( $_ POST['even t_tags'] ) ;   253           $s Tags    =  process_db _input( $_ POST['even t_tags'] ) ;
254           $a Tags = exp lodeTags($ sTags);   254           $a Tags = exp lodeTags($ sTags);
255           $s Tags = imp lode(",",  $aTags);   255           $s Tags = imp lode(",",  $aTags);
256     256  
257           $s PictureNam e = $sBase Name;   257           $s PictureNam e = $sBase Name;
258           $a Scan = get imagesize( $_FILES['e vent_photo ']['tmp_na me']);   258           $a Scan = get imagesize( $_FILES['e vent_photo ']['tmp_na me']);
259     259  
260           if  ( in_arra y($aScan[2 ], array(1 ,2,3,6)) & & 0 < strl en( $_FILE S['event_p hoto']['na me']) ) {   260           if  ( in_arra y($aScan[2 ], array(1 ,2,3,6)) & & 0 < strl en( $_FILE S['event_p hoto']['na me']) ) {
261     261  
262                $sCurren tTime = ti me();   262                $sCurren tTime = ti me();
263                if ($iEv entID == - 1) {   263                if ($iEv entID == - 1) {
264                    $sBa seName = ' g_'. $sCur rentTime . '_1';   264                    $sBa seName = ' g_'. $sCur rentTime . '_1';
265                } else {   265                } else {
266                    $sBa seName = d b_value("S ELECT `Pho toFilename ` FROM `SD atingEvent s` WHERE ` ID`={$iEve ntID} LIMI T 1");   266                    $sBa seName = d b_value("S ELECT `Pho toFilename ` FROM `SD atingEvent s` WHERE ` ID`={$iEve ntID} LIMI T 1");
267                    if ( $sBaseName !="") {   267                    if ( $sBaseName !="") {
268                         if (ereg ( "([a-z0-9_ ]+)\.", $s BaseName,  $aRegs)) {   268                         if (ereg ( "([a-z0-9_ ]+)\.", $s BaseName,  $aRegs)) {
269                             $sBase Name = $aR egs[1];   269                             $sBase Name = $aR egs[1];
270                         }   270                         }
271                    } el se {   271                    } el se {
272                         $sBaseName  = ($sBase Name!="")  ? $sBaseNa me : 'g_'.  $sCurrent Time .'_1' ;   272                         $sBaseName  = ($sBase Name!="")  ? $sBaseNa me : 'g_'.  $sCurrent Time .'_1' ;
273                    }   273                    }
274                }   274                }
275     275  
276                $sExt =  moveUpload edImage( $ _FILES, 'e vent_photo ', $dir['t mp'] . $sB aseName, ' ', false ) ;   276                $sExt =  moveUpload edImage( $ _FILES, 'e vent_photo ', $dir['t mp'] . $sB aseName, ' ', false ) ;
277     277  
278                $sBaseNa me .= $sEx t;   278                $sBaseNa me .= $sEx t;
279     279  
280                $sPictur eName = $s BaseName;   280                $sPictur eName = $s BaseName;
281                $sThumbN ame   = 't humb_'.$sB aseName;   281                $sThumbN ame   = 't humb_'.$sB aseName;
282                $sIconNa me    = 'i con_'.$sBa seName;   282                $sIconNa me    = 'i con_'.$sBa seName;
283     283  
284                // resiz e for thum bnail   284                // resiz e for thum bnail
285                $vRes =  imageResiz e( $dir['t mp'] . $sB aseName, $ dir['sdati ngImage']  . $sThumbN ame, $this ->iThumbSi ze, $this- >iThumbSiz e );   285                $vRes =  imageResiz e( $dir['t mp'] . $sB aseName, $ dir['sdati ngImage']  . $sThumbN ame, $this ->iThumbSi ze, $this- >iThumbSiz e );
286                if ( $vR es != IMAG E_ERROR_SU CCESS )   286                if ( $vR es != IMAG E_ERROR_SU CCESS )
287                    retu rn SDATING _ERROR_PHO TO_PROCESS ;   287                    retu rn SDATING _ERROR_PHO TO_PROCESS ;
288                $vRes =  imageResiz e( $dir['t mp'] . $sB aseName, $ dir['sdati ngImage']  . $sPictur eName, $th is->iImgSi ze, $this- >iImgSize  );   288                $vRes =  imageResiz e( $dir['t mp'] . $sB aseName, $ dir['sdati ngImage']  . $sPictur eName, $th is->iImgSi ze, $this- >iImgSize  );
289                if ( $vR es != IMAG E_ERROR_SU CCESS )   289                if ( $vR es != IMAG E_ERROR_SU CCESS )
290                    retu rn SDATING _ERROR_PHO TO_PROCESS ;   290                    retu rn SDATING _ERROR_PHO TO_PROCESS ;
291                $vRes =  imageResiz e( $dir['t mp'] . $sB aseName, $ dir['sdati ngImage']  . $sIconNa me, $this- >iIconSize , $this->i IconSize ) ;   291                $vRes =  imageResiz e( $dir['t mp'] . $sB aseName, $ dir['sdati ngImage']  . $sIconNa me, $this- >iIconSize , $this->i IconSize ) ;
292                if ( $vR es != IMAG E_ERROR_SU CCESS )   292                if ( $vR es != IMAG E_ERROR_SU CCESS )
293                    retu rn SDATING _ERROR_PHO TO_PROCESS ;   293                    retu rn SDATING _ERROR_PHO TO_PROCESS ;
294                unlink(  $dir['tmp' ] . $sBase Name );   294                unlink(  $dir['tmp' ] . $sBase Name );
295                chmod( $ dir['sdati ngImage']  . $sPictur eName, 064 4 );   295                chmod( $ dir['sdati ngImage']  . $sPictur eName, 064 4 );
296                chmod( $ dir['sdati ngImage']  . $sThumbN ame, 0644  );   296                chmod( $ dir['sdati ngImage']  . $sThumbN ame, 0644  );
297                chmod( $ dir['sdati ngImage']  . $sIconNa me, 0644 ) ;   297                chmod( $ dir['sdati ngImage']  . $sIconNa me, 0644 ) ;
298                $sEventP hotoFilena me = proce ss_db_inpu t( $sPictu reName );   298                $sEventP hotoFilena me = proce ss_db_inpu t( $sPictu reName );
299           }  else   299           }  else
300                $sEventP hotoFilena me = '';   300                $sEventP hotoFilena me = '';
301     301  
302           $s PictureSQL  = '';   302           $s PictureSQL  = '';
303           if  ($iEventI D>0 && $sE ventPhotoF ilename!=' ') {   303           if  ($iEventI D>0 && $sE ventPhotoF ilename!=' ') {
304                $sPictur eSQL = "`P hotoFilena me` = '{$s EventPhoto Filename}' ,";   304                $sPictur eSQL = "`P hotoFilena me` = '{$s EventPhoto Filename}' ,";
305           }   305           }
306           //  event dat e   306           //  event dat e
307           $s EventStart  = strtoti me( $_REQU EST['event _start'] ) ;   307           $s EventStart  = strtoti me( $_REQU EST['event _start'] ) ;
308           if  ( $sEvent Start == - 1 )   308           if  ( $sEvent Start == - 1 )
309                return S DATING_ERR OR_WRONG_D ATE_FORMAT ;   309                return S DATING_ERR OR_WRONG_D ATE_FORMAT ;
310     310  
311           if  ($this->b AdminMode)  {   311           if  ($this->b AdminMode)  {
312                $sEventE nd = strto time( $_PO ST['event_ end'] );   312                $sEventE nd = strto time( $_PO ST['event_ end'] );
313                //if ( $ sEventEnd  == -1 )   313                //if ( $ sEventEnd  == -1 )
314                //  retu rn SDATING _ERROR_WRO NG_DATE_FO RMAT;   314                //  retu rn SDATING _ERROR_WRO NG_DATE_FO RMAT;
315                $sEventS aleStart =  strtotime ( $_POST[' event_sale _start'] ) ;   315                $sEventS aleStart =  strtotime ( $_POST[' event_sale _start'] ) ;
316                //if ( $ sEventSale Start == - 1 )   316                //if ( $ sEventSale Start == - 1 )
317                //  retu rn SDATING _ERROR_WRO NG_DATE_FO RMAT;   317                //  retu rn SDATING _ERROR_WRO NG_DATE_FO RMAT;
318                $sEventS aleEnd = s trtotime(  $_POST['ev ent_sale_e nd'] );   318                $sEventS aleEnd = s trtotime(  $_POST['ev ent_sale_e nd'] );
319                //if ( $ sEventSale End == -1  )   319                //if ( $ sEventSale End == -1  )
320                //  retu rn SDATING _ERROR_WRO NG_DATE_FO RMAT;   320                //  retu rn SDATING _ERROR_WRO NG_DATE_FO RMAT;
321                //if ( $ sEventEnd  < $sEventS tart || $s EventSaleE nd < $sEve ntSaleStar t || $sEve ntStart <  $sEventSal eStart )   321                //if ( $ sEventEnd  < $sEventS tart || $s EventSaleE nd < $sEve ntSaleStar t || $sEve ntStart <  $sEventSal eStart )
322                //  retu rn SDATING _ERROR_WRO NG_DATE_FO RMAT;   322                //  retu rn SDATING _ERROR_WRO NG_DATE_FO RMAT;
323                $sEventE ndVal = "F ROM_UNIXTI ME( {$sEve ntEnd} )";   323                $sEventE ndVal = "F ROM_UNIXTI ME( {$sEve ntEnd} )";
324                $sEventS aleStartVa l = "FROM_ UNIXTIME(  {$sEventSa leStart} ) ";   324                $sEventS aleStartVa l = "FROM_ UNIXTIME(  {$sEventSa leStart} ) ";
325                $sEventS aleEndVal  = "FROM_UN IXTIME( {$ sEventSale End} )";   325                $sEventS aleEndVal  = "FROM_UN IXTIME( {$ sEventSale End} )";
326           }  else {   326           }  else {
327                $sEventE ndVal = 'N OW()';   327                $sEventE ndVal = 'N OW()';
328                $sEventS aleStartVa l = 'NOW() ';   328                $sEventS aleStartVa l = 'NOW() ';
329                $sEventS aleEndVal  = 'NOW()';   329                $sEventS aleEndVal  = 'NOW()';
330           }   330           }
331     331  
332           //  event res ponsible   332           //  event res ponsible
333           $s EventRespI d    = ($t his->bAdmi nMode) ? 0  : process _db_input(  $aMemberD ata['ID'],  0, 1 );   333           $s EventRespI d    = ($t his->bAdmi nMode) ? 0  : process _db_input(  $aMemberD ata['ID'],  0, 1 );
334           $s EventRespN ame  = ($t his->bAdmi nMode) ? _ t('Admin')  : process _db_input(  $aMemberD ata['NickN ame'], 0,  1 );   334           $s EventRespN ame  = ($t his->bAdmi nMode) ? _ t('Admin')  : process _db_input(  $aMemberD ata['NickN ame'], 0,  1 );
335           $s EventRespE mail = ($t his->bAdmi nMode) ? $ site['emai l'] : proc ess_db_inp ut( $aMemb erData['Em ail'], 0,  1 );   335           $s EventRespE mail = ($t his->bAdmi nMode) ? $ site['emai l'] : proc ess_db_inp ut( $aMemb erData['Em ail'], 0,  1 );
336           $s EventRespP hone = ($t his->bAdmi nMode) ? ' 666' : pro cess_db_in put( $aMem berData['P hone'], 0,  1 );   336           $s EventRespP hone = ($t his->bAdmi nMode) ? ' 666' : pro cess_db_in put( $aMem berData['P hone'], 0,  1 );
337     337  
338           $i EventAgeLo werFilter  = (int)get Param( 'se arch_start _age' );   338           $i EventAgeLo werFilter  = (int)get Param( 'se arch_start _age' );
339           $i EventAgeUp perFilter  = (int)get Param( 'se arch_end_a ge' );   339           $i EventAgeUp perFilter  = (int)get Param( 'se arch_end_a ge' );
340     340  
341           $s EventMembe rshipFilte r = "\'all \'";   341           $s EventMembe rshipFilte r = "\'all \'";
342     342  
343           $i EventCount F = (int)$ _POST['eve nt_count_f emale'];   343           $i EventCount F = (int)$ _POST['eve nt_count_f emale'];
344           $i EventCount M = (int)$ _POST['eve nt_count_m ale'];   344           $i EventCount M = (int)$ _POST['eve nt_count_m ale'];
345     345  
346           $d EventPrice F = '0.00' ;   346           $d EventPrice F = '0.00' ;
347           $d EventPrice M = '0.00' ;   347           $d EventPrice M = '0.00' ;
348           $d EventPrice C = '0.00' ;   348           $d EventPrice C = '0.00' ;
349     349  
350           //  choose op tions   350           //  choose op tions
351           $i EventChoos ePeriod =  5;   351           $i EventChoos ePeriod =  5;
352     352  
353           //  allow to  view parti cipants   353           //  allow to  view parti cipants
354           $i EventAllow View = '1' ;   354           $i EventAllow View = '1' ;
355     355  
356           if  ($iEventI D==-1) {   356           if  ($iEventI D==-1) {
357                $sNewUri  = uriGene rate($sEve ntTitle, ' SDatingEve nts', 'Ent ryUri', 10 0);   357                $sNewUri  = uriGene rate($sEve ntTitle, ' SDatingEve nts', 'Ent ryUri', 10 0);
358                //Commen ted elemen ts   358                //Commen ted elemen ts
359                /*`Event End` = FRO M_UNIXTIME ( {$sEvent End} ),*/   359                /*`Event End` = FRO M_UNIXTIME ( {$sEvent End} ),*/
360                /*`Ticke tSaleStart ` = FROM_U NIXTIME( { $sEventSal eStart} ), */   360                /*`Ticke tSaleStart ` = FROM_U NIXTIME( { $sEventSal eStart} ), */
361                /*`Ticke tSaleEnd`  = FROM_UNI XTIME( {$s EventSaleE nd} ),*/   361                /*`Ticke tSaleEnd`  = FROM_UNI XTIME( {$s EventSaleE nd} ),*/
362                   362                
363                $vRes =  db_res( "I NSERT INTO  `SDatingE vents` SET   363                $vRes =  db_res( "I NSERT INTO  `SDatingE vents` SET
364                             `Title ` = '{$sEv entTitle}' ,   364                             `Title ` = '{$sEv entTitle}' ,
365                             `Entry Uri` = '{$ sNewUri}',   365                             `Entry Uri` = '{$ sNewUri}',
366                             `Descr iption` =  '{$sEventD esc}',   366                             `Descr iption` =  '{$sEventD esc}',
367                             `Statu s` = 'Acti ve',   367                             `Statu s` = 'Acti ve',
368                             `Statu sMessage`  = '{$sEven tStatusMes sage}',   368                             `Statu sMessage`  = '{$sEven tStatusMes sage}',
369                             `Count ry` = '{$s EventCount ry}',   369                             `Count ry` = '{$s EventCount ry}',
370                             `City`  = '{$sEve ntCity}',   370                             `City`  = '{$sEve ntCity}',
371                             `Place ` = '{$Eve ntPlace}',   371                             `Place ` = '{$Eve ntPlace}',
372                             `Photo Filename`  = '{$sEven tPhotoFile name}',   372                             `Photo Filename`  = '{$sEven tPhotoFile name}',
373                             `Event Start` = F ROM_UNIXTI ME( {$sEve ntStart} ) ,   373                             `Event Start` = F ROM_UNIXTI ME( {$sEve ntStart} ) ,
374                             `Event End` = {$s EventEndVa l},   374                             `Event End` = {$s EventEndVa l},
375                             `Ticke tSaleStart ` = {$sEve ntSaleStar tVal},   375                             `Ticke tSaleStart ` = {$sEve ntSaleStar tVal},
376                             `Ticke tSaleEnd`  = {$sEvent SaleEndVal },   376                             `Ticke tSaleEnd`  = {$sEvent SaleEndVal },
377                             `Respo nsibleID`  = '{$sEven tRespId}',   377                             `Respo nsibleID`  = '{$sEven tRespId}',
378                             `Respo nsibleName ` = '{$sEv entRespNam e}',   378                             `Respo nsibleName ` = '{$sEv entRespNam e}',
379                             `Respo nsibleEmai l` = '{$sE ventRespEm ail}',   379                             `Respo nsibleEmai l` = '{$sE ventRespEm ail}',
380                             `Respo nsiblePhon e` = '{$sE ventRespPh one}',   380                             `Respo nsiblePhon e` = '{$sE ventRespPh one}',
381                             `Event SexFilter`  = 'female ,male',   381                             `Event SexFilter`  = 'female ,male',
382                             `Event AgeLowerFi lter` = {$ iEventAgeL owerFilter },   382                             `Event AgeLowerFi lter` = {$ iEventAgeL owerFilter },
383                             `Event AgeUpperFi lter` = {$ iEventAgeU pperFilter },   383                             `Event AgeUpperFi lter` = {$ iEventAgeU pperFilter },
384                             `Event Membership Filter` =  '{$sEventM embershipF ilter}',   384                             `Event Membership Filter` =  '{$sEventM embershipF ilter}',
385                             `Ticke tCountFema le` = {$iE ventCountF },   385                             `Ticke tCountFema le` = {$iE ventCountF },
386                             `Ticke tCountMale ` = {$iEve ntCountM},   386                             `Ticke tCountMale ` = {$iEve ntCountM},
387                             `Ticke tPriceFema le` = {$dE ventPriceF },   387                             `Ticke tPriceFema le` = {$dE ventPriceF },
388                             `Ticke tPriceMale ` = {$dEve ntPriceM},   388                             `Ticke tPriceMale ` = {$dEve ntPriceM},
389                             `Choos ePeriod` =  {$iEventC hoosePerio d},   389                             `Choos ePeriod` =  {$iEventC hoosePerio d},
390                             `Allow ViewPartic ipants` =  {$iEventAl lowView},   390                             `Allow ViewPartic ipants` =  {$iEventAl lowView},
391                             `Tags`  = '{$sTag s}'   391                             `Tags`  = '{$sTag s}'
392                             " );   392                             " );
393                $iLastID  = mysql_i nsert_id() ;   393                $iLastID  = mysql_i nsert_id() ;
394                if ($iLa stID>0) {   394                if ($iLa stID>0) {
395                    $thi s->iLastIn sertedID =  $iLastID;   395                    $thi s->iLastIn sertedID =  $iLastID;
396                    repa rseObjTags ( 'event',  $iLastID  );   396                    repa rseObjTags ( 'event',  $iLastID  );
397                }   397                }
398           }  else {   398           }  else {
399                //$sNewU ri = uriGe nerate($sE ventTitle,  'SDatingE vents', 'E ntryUri',  100);   399                //$sNewU ri = uriGe nerate($sE ventTitle,  'SDatingE vents', 'E ntryUri',  100);
400                //Commen ted elemen ts   400                //Commen ted elemen ts
401                /*`Event End` = FRO M_UNIXTIME ( {$sEvent End} ),*/   401                /*`Event End` = FRO M_UNIXTIME ( {$sEvent End} ),*/
402                /*`Ticke tSaleStart ` = FROM_U NIXTIME( { $sEventSal eStart} ), */   402                /*`Ticke tSaleStart ` = FROM_U NIXTIME( { $sEventSal eStart} ), */
403                /*`Ticke tSaleEnd`  = FROM_UNI XTIME( {$s EventSaleE nd} ),*/   403                /*`Ticke tSaleEnd`  = FROM_UNI XTIME( {$s EventSaleE nd} ),*/
404     404  
405                $vRes =  db_res( "U PDATE `SDa tingEvents ` SET   405                $vRes =  db_res( "U PDATE `SDa tingEvents ` SET
406                             `Title ` = '{$sEv entTitle}' ,   406                             `Title ` = '{$sEv entTitle}' ,
407                             `Descr iption` =  '{$sEventD esc}',   407                             `Descr iption` =  '{$sEventD esc}',
408                             `Statu s` = 'Acti ve',   408                             `Statu s` = 'Acti ve',
409                             `Statu sMessage`  = '{$sEven tStatusMes sage}',   409                             `Statu sMessage`  = '{$sEven tStatusMes sage}',
410                             `Count ry` = '{$s EventCount ry}',   410                             `Count ry` = '{$s EventCount ry}',
411                             `City`  = '{$sEve ntCity}',   411                             `City`  = '{$sEve ntCity}',
412                             `Place ` = '{$Eve ntPlace}',   412                             `Place ` = '{$Eve ntPlace}',
413                             {$sPic tureSQL}   413                             {$sPic tureSQL}
414                             `Event Start` = F ROM_UNIXTI ME( {$sEve ntStart} ) ,   414                             `Event Start` = F ROM_UNIXTI ME( {$sEve ntStart} ) ,
415                             `Event End` = {$s EventEndVa l},   415                             `Event End` = {$s EventEndVa l},
416                             `Ticke tSaleStart ` = {$sEve ntSaleStar tVal},   416                             `Ticke tSaleStart ` = {$sEve ntSaleStar tVal},
417                             `Ticke tSaleEnd`  = {$sEvent SaleEndVal },   417                             `Ticke tSaleEnd`  = {$sEvent SaleEndVal },
418                             `Respo nsibleID`  = '{$sEven tRespId}',   418                             `Respo nsibleID`  = '{$sEven tRespId}',
419                             `Respo nsibleName ` = '{$sEv entRespNam e}',   419                             `Respo nsibleName ` = '{$sEv entRespNam e}',
420                             `Respo nsibleEmai l` = '{$sE ventRespEm ail}',   420                             `Respo nsibleEmai l` = '{$sE ventRespEm ail}',
421                             `Respo nsiblePhon e` = '{$sE ventRespPh one}',   421                             `Respo nsiblePhon e` = '{$sE ventRespPh one}',
422                             `Event SexFilter`  = 'female ,male',   422                             `Event SexFilter`  = 'female ,male',
423                             `Event AgeLowerFi lter` = {$ iEventAgeL owerFilter },   423                             `Event AgeLowerFi lter` = {$ iEventAgeL owerFilter },
424                             `Event AgeUpperFi lter` = {$ iEventAgeU pperFilter },   424                             `Event AgeUpperFi lter` = {$ iEventAgeU pperFilter },
425                             `Event Membership Filter` =  '{$sEventM embershipF ilter}',   425                             `Event Membership Filter` =  '{$sEventM embershipF ilter}',
426                             `Ticke tCountFema le` = {$iE ventCountF },   426                             `Ticke tCountFema le` = {$iE ventCountF },
427                             `Ticke tCountMale ` = {$iEve ntCountM},   427                             `Ticke tCountMale ` = {$iEve ntCountM},
428                             `Ticke tPriceFema le` = {$dE ventPriceF },   428                             `Ticke tPriceFema le` = {$dE ventPriceF },
429                             `Ticke tPriceMale ` = {$dEve ntPriceM},   429                             `Ticke tPriceMale ` = {$dEve ntPriceM},
430                             `Choos ePeriod` =  {$iEventC hoosePerio d},   430                             `Choos ePeriod` =  {$iEventC hoosePerio d},
431                             `Allow ViewPartic ipants` =  {$iEventAl lowView},   431                             `Allow ViewPartic ipants` =  {$iEventAl lowView},
432                             `Tags`  = '{$sTag s}'   432                             `Tags`  = '{$sTag s}'
433                             WHERE  `ID` = {$i EventID}   433                             WHERE  `ID` = {$i EventID}
434                             " );   434                             " );
435                reparseO bjTags( 'e vent', $iE ventID );   435                reparseO bjTags( 'e vent', $iE ventID );
436           }   436           }
437           re turn SDATI NG_ERROR_S UCCESS;   437           re turn SDATI NG_ERROR_S UCCESS;
438       }   438       }
439     439  
440       /**   440       /**
441        * pag e show eve nt list fu nction   441        * pag e show eve nt list fu nction
442        * @re turn HTML  presentati on of data   442        * @re turn HTML  presentati on of data
443        */   443        */
444       functi on PageSDa tingShowEv ents() {   444       functi on PageSDa tingShowEv ents() {
445           gl obal $site ;   445           gl obal $site ;
446           gl obal $dir;   446           gl obal $dir;
447           gl obal $aPre Values;   447           gl obal $aPre Values;
448           gl obal $oTem plConfig;   448           gl obal $oTem plConfig;
449           // global $da te_format;   449           // global $da te_format;
450           gl obal $tmpl ;   450           gl obal $tmpl ;
451     451  
452           $s EditC = _t ('_Edit');   452           $s EditC = _t ('_Edit');
453           $s DeleteC =  _t('_Delet e');   453           $s DeleteC =  _t('_Delet e');
454           $s SureC = _t ("_Are you  sure");   454           $s SureC = _t ("_Are you  sure");
455           $s TagsC = _t ('_Tags');   455           $s TagsC = _t ('_Tags');
456     456  
457           //  collect i nformation  about cur rent membe r   457           //  collect i nformation  about cur rent membe r
458           $a Member['ID '] = (int) $_COOKIE[' memberID'] ;   458           $a Member['ID '] = (int) $_COOKIE[' memberID'] ;
459           $a MemberData  = getProf ileInfo( $ aMember['I D'] );   459           $a MemberData  = getProf ileInfo( $ aMember['I D'] );
460           $s MemberSex  = $aMember Data['Sex' ];   460           $s MemberSex  = $aMember Data['Sex' ];
461           $a Membership  = getMemb erMembersh ipInfo( $a Member['ID '] );   461           $a Membership  = getMemb erMembersh ipInfo( $a Member['ID '] );
462           $b ShowFrom =  (int)$_RE QUEST['fro m'];   462           $b ShowFrom =  (int)$_RE QUEST['fro m'];
463     463  
464           // $sDateWher eCheck = ( $this->bAd minMode) ?  "AND NOW( ) < DATE_A DD(`SDatin gEvents`.` EventEnd`,  INTERVAL  `SDatingEv ents`.`Cho osePeriod`  DAY)" : ' ';   464           // $sDateWher eCheck = ( $this->bAd minMode) ?  "AND NOW( ) < DATE_A DD(`SDatin gEvents`.` EventEnd`,  INTERVAL  `SDatingEv ents`.`Cho osePeriod`  DAY)" : ' ';
465           $s DateWhereC heck = ''; //'A' comm ented like  bug   465           $s DateWhereC heck = ''; //'A' comm ented like  bug
466           $s CommonSele ctSQL = "D ISTINCT `S DatingEven ts`.`ID`,  `Title`, ` EntryUri`,  `Descript ion`, `Sta tusMessage `, `Countr y`, `City` , `Place`,  `PhotoFil ename`, `T ags`, ";   466           $s CommonSele ctSQL = "D ISTINCT `S DatingEven ts`.`ID`,  `Title`, ` EntryUri`,  `Descript ion`, `Sta tusMessage `, `Countr y`, `City` , `Place`,  `PhotoFil ename`, `T ags`, ";
467            $sCommonSe lectSQL    .=   "`EventSta rt`,  
";
  467            $sCommonSe lectSQL    .=   "`EventSta rt`,   UNIX_TIMES TAMP(`Even tStart`)   AS   'EventStar t_UTS',   ";
468           $s CommonSele ctSQL  .=  "(UNIX_TIM ESTAMP() -  UNIX_TIME STAMP(`Eve ntStart`))  AS `sec`,  `Responsi bleID`, ";   468           $s CommonSele ctSQL  .=  "(UNIX_TIM ESTAMP() -  UNIX_TIME STAMP(`Eve ntStart`))  AS `sec`,  `Responsi bleID`, ";
469           $s CommonSele ctSQL  .=  "(NOW() >  `EventEnd`  AND NOW()  < DATE_AD D(`EventEn d`, INTERV AL `Choose Period` DA Y)) AS `Ch ooseActive `, ";   469           $s CommonSele ctSQL  .=  "(NOW() >  `EventEnd`  AND NOW()  < DATE_AD D(`EventEn d`, INTERV AL `Choose Period` DA Y)) AS `Ch ooseActive `, ";
470           $s CommonSele ctSQL  .=  "`AllowVie wParticipa nts`, (`SD atingParti cipants`.` ID` IS NOT  NULL) AS  `IsPartici pant` ";   470           $s CommonSele ctSQL  .=  "`AllowVie wParticipa nts`, (`SD atingParti cipants`.` ID` IS NOT  NULL) AS  `IsPartici pant` ";
471           $s LeftJoinAd donSQL = " LEFT JOIN  `SDatingPa rticipants ` ON `SDat ingPartici pants`.`ID Event` = ` SDatingEve nts`.`ID`  AND `SDati ngParticip ants`.`IDM ember` = { $aMember[' ID']}";   471           $s LeftJoinAd donSQL = " LEFT JOIN  `SDatingPa rticipants ` ON `SDat ingPartici pants`.`ID Event` = ` SDatingEve nts`.`ID`  AND `SDati ngParticip ants`.`IDM ember` = { $aMember[' ID']}";
472           $s StatusActi veSQL = "` SDatingEve nts`.`Stat us` = 'Act ive'";   472           $s StatusActi veSQL = "` SDatingEve nts`.`Stat us` = 'Act ive'";
473           $s OrderBySQL  = "ORDER  BY `SDatin gEvents`.` EventStart ` DESC";   473           $s OrderBySQL  = "ORDER  BY `SDatin gEvents`.` EventStart ` DESC";
474     474  
475           //  build SQL  query for  event lis ting   475           //  build SQL  query for  event lis ting
476           $s ShowQuery  = '';   476           $s ShowQuery  = '';
477           sw itch ( $_R EQUEST['sh ow_events' ] ) {   477           sw itch ( $_R EQUEST['sh ow_events' ] ) {
478                case 'co untry':   478                case 'co untry':
479                    // q ueries for  showing ' by country '   479                    // q ueries for  showing ' by country '
480                    $sSh owQuery =  "   480                    $sSh owQuery =  "
481                         SELECT   481                         SELECT
482                             {$sCom monSelectS QL }   482                             {$sCom monSelectS QL }
483                         FROM `SDat ingEvents`   483                         FROM `SDat ingEvents`
484                         {$sLeftJoi nAddonSQL}   484                         {$sLeftJoi nAddonSQL}
485                         WHERE   485                         WHERE
486                             {$sSta tusActiveS QL}   486                             {$sSta tusActiveS QL}
487                             {$sDat eWhereChec k}   487                             {$sDat eWhereChec k}
488                             AND `S DatingEven ts`.`Count ry` = '".  process_db _input($_R EQUEST['sh ow_events_ country'])  ."'   488                             AND `S DatingEven ts`.`Count ry` = '".  process_db _input($_R EQUEST['sh ow_events_ country'])  ."'
489                         {$sOrderBy SQL} {$sLi mitSQL}   489                         {$sOrderBy SQL} {$sLi mitSQL}
490                    ";   490                    ";
491                    $sCo untSQL = "   491                    $sCo untSQL = "
492                         SELECT COU NT(*) FROM  `SDatingE vents`   492                         SELECT COU NT(*) FROM  `SDatingE vents`
493                         WHERE   493                         WHERE
494                             {$sSta tusActiveS QL}   494                             {$sSta tusActiveS QL}
495                             {$sDat eWhereChec k}   495                             {$sDat eWhereChec k}
496                             AND `C ountry` =  '". proces s_db_input ($_REQUEST ['show_eve nts_countr y']) ."'   496                             AND `C ountry` =  '". proces s_db_input ($_REQUEST ['show_eve nts_countr y']) ."'
497                    ";   497                    ";
498                    brea k;   498                    brea k;
499                case 'my ':   499                case 'my ':
500                    // q ueries for  showing m y events   500                    // q ueries for  showing m y events
501                    $sSh owQuery =  "   501                    $sSh owQuery =  "
502                         SELECT   502                         SELECT
503                             {$sCom monSelectS QL }   503                             {$sCom monSelectS QL }
504                         FROM `SDat ingEvents`   504                         FROM `SDat ingEvents`
505                         {$sLeftJoi nAddonSQL}   505                         {$sLeftJoi nAddonSQL}
506                         WHERE   506                         WHERE
507                             `Respo nsibleID`  = {$aMembe r['ID']}   507                             `Respo nsibleID`  = {$aMembe r['ID']}
508                         {$sOrderBy SQL} {$sLi mitSQL}   508                         {$sOrderBy SQL} {$sLi mitSQL}
509                    ";   509                    ";
510                    $sCo untSQL = "   510                    $sCo untSQL = "
511                         SELECT COU NT(*) FROM  `SDatingE vents`   511                         SELECT COU NT(*) FROM  `SDatingE vents`
512                    ";   512                    ";
513                    brea k;   513                    brea k;
514                case 'al l':   514                case 'al l':
515                default:   515                default:
516                    // q ueries for  showing a ll availab le events   516                    // q ueries for  showing a ll availab le events
517                    $sSh owQuery =  "   517                    $sSh owQuery =  "
518                         SELECT   518                         SELECT
519                             {$sCom monSelectS QL }   519                             {$sCom monSelectS QL }
520                         FROM `SDat ingEvents`   520                         FROM `SDat ingEvents`
521                         {$sLeftJoi nAddonSQL}   521                         {$sLeftJoi nAddonSQL}
522                         WHERE   522                         WHERE
523                             {$sSta tusActiveS QL}   523                             {$sSta tusActiveS QL}
524                             {$sDat eWhereChec k}   524                             {$sDat eWhereChec k}
525                         {$sOrderBy SQL} {$sLi mitSQL}   525                         {$sOrderBy SQL} {$sLi mitSQL}
526                    ";   526                    ";
527                    $sCo untSQL = "   527                    $sCo untSQL = "
528                         SELECT COU NT(*) FROM  `SDatingE vents`   528                         SELECT COU NT(*) FROM  `SDatingE vents`
529                         WHERE   529                         WHERE
530                             {$sSta tusActiveS QL}   530                             {$sSta tusActiveS QL}
531                             {$sDat eWhereChec k}   531                             {$sDat eWhereChec k}
532                         ";   532                         ";
533           }   533           }
534     534  
535     535  
536           // ////////// ////////// //////   536           // ////////// ////////// //////
537           $i TotalNum =  db_value(  $sCountSQ L );   537           $i TotalNum =  db_value(  $sCountSQ L );
538           if ( !$iTotal Num ) {   538           if ( !$iTotal Num ) {
539                return M sgBox(_t(  '_Sorry, n othing fou nd' ));   539                return M sgBox(_t(  '_Sorry, n othing fou nd' ));
540           }   540           }
541     541  
542           $i PerPage =  (int)$_GET ['per_page '];   542           $i PerPage =  (int)$_GET ['per_page '];
543           if ( !$iPerPa ge )   543           if ( !$iPerPa ge )
544                $iPerPag e = 10;   544                $iPerPag e = 10;
545     545  
546           $i TotalPages  = ceil( $ iTotalNum  / $iPerPag e );   546           $i TotalPages  = ceil( $ iTotalNum  / $iPerPag e );
547     547  
548           $i CurPage =  (int)$_GET ['page'];   548           $i CurPage =  (int)$_GET ['page'];
549     549  
550           if ( $iCurPag e > $iTota lPages )   550           if ( $iCurPag e > $iTota lPages )
551                $iCurPag e = $iTota lPages;   551                $iCurPag e = $iTota lPages;
552     552  
553           if ( $iCurPag e < 1 )   553           if ( $iCurPag e < 1 )
554                $iCurPag e = 1;   554                $iCurPag e = 1;
555     555  
556           $s LimitFrom  = ( $iCurP age - 1 )  * $iPerPag e;   556           $s LimitFrom  = ( $iCurP age - 1 )  * $iPerPag e;
557           $s qlLimit =  "LIMIT {$s LimitFrom} , {$iPerPa ge}";   557           $s qlLimit =  "LIMIT {$s LimitFrom} , {$iPerPa ge}";
558     558  
559           $s ShowQuery  .= $sqlLim it;   559           $s ShowQuery  .= $sqlLim it;
560     560  
561           //  process d atabase qu eries   561           //  process d atabase qu eries
562           $v ShowRes =  db_res( $s ShowQuery  );   562           $v ShowRes =  db_res( $s ShowQuery  );
563           // ////////// ////////// //////   563           // ////////// ////////// //////
564     564  
565           $i ShowNum =  mysql_num_ rows( $vSh owRes );   565           $i ShowNum =  mysql_num_ rows( $vSh owRes );
566     566  
567           if  ( $iShowN um == 0 )  {   567           if  ( $iShowN um == 0 )  {
568                // show  if no even ts availab le   568                // show  if no even ts availab le
569                $sRetHtm l .= Desig nBoxConten t( _t('_Sp eedDating  events'),  '<center>' . _t('_No  events ava ilable') . '</center> ', $oTempl Config ->  PageSDatin gShowEvent s_db_num ) ;   569                $sRetHtm l .= Desig nBoxConten t( _t('_Sp eedDating  events'),  '<center>' . _t('_No  events ava ilable') . '</center> ', $oTempl Config ->  PageSDatin gShowEvent s_db_num ) ;
570           }   570           }
571           el se {   571           el se {
572                $sSpacer Name = $th is -> sSpa cerPath;   572                $sSpacer Name = $th is -> sSpa cerPath;
573     573  
574                // print  list of e vents   574                // print  list of e vents
575                while (  $aResSQL =  mysql_fet ch_assoc($ vShowRes)  ) {   575                while (  $aResSQL =  mysql_fet ch_assoc($ vShowRes)  ) {
576     576  
577                    $sIm gEL = ( st rlen(trim( $aResSQL[' PhotoFilen ame'])) &&  file_exis ts($dir['s datingImag e'] . $aRe sSQL['Phot oFilename' ]) )   577                    $sIm gEL = ( st rlen(trim( $aResSQL[' PhotoFilen ame'])) &&  file_exis ts($dir['s datingImag e'] . $aRe sSQL['Phot oFilename' ]) )
578                         ? "<img cl ass=\"phot o1\" style =\"width:{ $this->iTh umbSize}px ;height:{$ this->iThu mbSize}px; background -image:url ({$site['s datingImag e']}thumb_ {$aResSQL[ 'PhotoFile name']});\ " src=\"{$ sSpacerNam e}\" alt=\ "{$aResSQL ['Title']} \" />"   578                         ? "<img cl ass=\"phot o1\" style =\"width:{ $this->iTh umbSize}px ;height:{$ this->iThu mbSize}px; background -image:url ({$site['s datingImag e']}thumb_ {$aResSQL[ 'PhotoFile name']});\ " src=\"{$ sSpacerNam e}\" alt=\ "{$aResSQL ['Title']} \" />"
579                         : "<img cl ass=\"phot o1\" style =\"width:{ $this->iTh umbSize}px ;height:{$ this->iThu mbSize}px; background -image:url ({$site['u rl']}templ ates/tmpl_ {$tmpl}/{$ this->sPic NotAvail}) ;\" src=\" {$sSpacerN ame}\" />" ;   579                         : "<img cl ass=\"phot o1\" style =\"width:{ $this->iTh umbSize}px ;height:{$ this->iThu mbSize}px; background -image:url ({$site['u rl']}templ ates/tmpl_ {$tmpl}/{$ this->sPic NotAvail}) ;\" src=\" {$sSpacerN ame}\" />" ;
580     580  
581                    $sSh owInfoC =  _t('_Show  info');   581                    $sSh owInfoC =  _t('_Show  info');
582                    $sPa rticipants C = _t('_P articipant s');   582                    $sPa rticipants C = _t('_P articipant s');
583                    $sSt atusMessag eC = _t('_ Status mes sage');   583                    $sSt atusMessag eC = _t('_ Status mes sage');
584                    $sDa teC = _t(' _Date');   584                    $sDa teC = _t(' _Date');
585                    $sPl aceC = _t( '_Place');   585                    $sPl aceC = _t( '_Place');
586                    $sDe scriptionC  = _t('_De scription' );   586                    $sDe scriptionC  = _t('_De scription' );
587                    $sTi tleC = _t( '_Title');   587                    $sTi tleC = _t( '_Title');
588                    $sAc tionsC = _ t('_Action s');   588                    $sAc tionsC = _ t('_Action s');
589                    $sLi stOfPartic ipantsC =  _t('_List' ).' '._t(' _of').' '. _t('_Parti cipants');   589                    $sLi stOfPartic ipantsC =  _t('_List' ).' '._t(' _of').' '. _t('_Parti cipants');
590                    $sPo stedByC =  _t('_Poste d by');   590                    $sPo stedByC =  _t('_Poste d by');
    591                    if ( $aResSQL[' Responsibl eID'] == 0 ) {
    592                         $sPostedBy Href = _t( '_Admin');
    593                    } el se {
591                    $aPo stedBy = $ this->GetP rofileData ($aResSQL[ 'Responsib leID']);   594                         $aPostedBy  = $this-> GetProfile Data($aRes SQL['Respo nsibleID'] );
592                    //$s PostedBy =  $aPostedB y['NickNam e'];   595                         //$sPosted By = $aPos tedBy['Nic kName'];
593                    $sPo stedByHref  = getProf ileLink($a ResSQL['Re sponsibleI D']);   596                         $sPostedBy Href = get ProfileLin k($aResSQL ['Responsi bleID']);
594                    $sPo stedByHref  = '<a hre f="'.$sPos tedByHref. '">'.$aPos tedBy['Nic kName'].'< /a>';   597                         $sPostedBy Href = '<a  href="'.$ sPostedByH ref.'">'.$ aPostedBy[ 'NickName' ].'</a>';
    598                    }
595     599  
596                    $sGe nUrlP = $t his->genUr l($aResSQL ['ID'], $a ResSQL['En tryUri'],  'part');   600                    $sGe nUrlP = $t his->genUr l($aResSQL ['ID'], $a ResSQL['En tryUri'],  'part');
597                    $sVi ewParticip antsVal =  <<<EOF   601                    $sVi ewParticip antsVal =  <<<EOF
598   <a href="{ $sGenUrlP} ">   602   <a href="{ $sGenUrlP} ">
599       {$sLis tOfPartici pantsC}   603       {$sLis tOfPartici pantsC}
600   </a>   604   </a>
601   EOF;   605   EOF;
602                    $sVi ewParticip ants = ($a ResSQL['Al lowViewPar ticipants' ] == '1')  ? $sViewPa rticipants Val : '';   606                    $sVi ewParticip ants = ($a ResSQL['Al lowViewPar ticipants' ] == '1')  ? $sViewPa rticipants Val : '';
603     607  
604                    $sSt atusMessag e = proces s_line_out put($aResS QL['Status Message']) ;   608                    $sSt atusMessag e = proces s_line_out put($aResS QL['Status Message']) ;
605                    $dat e_format_p hp = getPa ram('php_d ate_format ');   609                    $dat e_format_p hp = getPa ram('php_d ate_format ');
606                    
$sDateTime   =   date(   $date_form at_php,   strtotime(   $aResSQL[' EventStart ']   )   );
  610                     // $sDateTime   =   date(   $date_form at_php,   strtotime(   $aResSQL[' EventStart ']   )   );
    611                    $sDa teTime = L ocaledData Time($aRes SQL['Event Start_UTS' ]);
607                    $sEv entsStart  = $sDateTi me." ("._f ormat_when ($aResSQL[ 'sec']).") ";   612                    $sEv entsStart  = $sDateTi me." ("._f ormat_when ($aResSQL[ 'sec']).") ";
608                    $sCo untry = ($ aResSQL['C ountry']!= '') ? _t($ aPreValues ['Country' ][$aResSQL ['Country' ]]['LKey'] ) : '';   613                    $sCo untry = ($ aResSQL['C ountry']!= '') ? _t($ aPreValues ['Country' ][$aResSQL ['Country' ]]['LKey'] ) : '';
609                    $sCi ty = ($aRe sSQL['City ']!='') ?  ', '.proce ss_line_ou tput($aRes SQL['City' ]) : '';   614                    $sCi ty = ($aRe sSQL['City ']!='') ?  ', '.proce ss_line_ou tput($aRes SQL['City' ]) : '';
610                    $sPl ace = ($aR esSQL['Pla ce']!='')  ? ', '.pro cess_line_ output($aR esSQL['Pla ce']) : '' ;   615                    $sPl ace = ($aR esSQL['Pla ce']!='')  ? ', '.pro cess_line_ output($aR esSQL['Pla ce']) : '' ;
611                    $sDe scription  = $aResSQL ['Descript ion'];   616                    $sDe scription  = $aResSQL ['Descript ion'];
612     617  
613                    $sTa gsCommas =  $aResSQL[ 'Tags'];   618                    $sTa gsCommas =  $aResSQL[ 'Tags'];
614                    $aTa gs = split (',', $sTa gsCommas);   619                    $aTa gs = split (',', $sTa gsCommas);
615                    $sTa gsHrefs =  '';   620                    $sTa gsHrefs =  '';
616                    fore ach( $aTag s as $sTag Key ) {   621                    fore ach( $aTag s as $sTag Key ) {
617                         $sTagHrefG en = $this ->genUrl(0 , $sTagKey , 'search' );   622                         $sTagHrefG en = $this ->genUrl(0 , $sTagKey , 'search' );
618                         $sTagsHref s .= <<<EO F   623                         $sTagsHref s .= <<<EO F
619   <a href="{ $sTagHrefG en}" >{$sT agKey}</a> &nbsp;   624   <a href="{ $sTagHrefG en}" >{$sT agKey}</a> &nbsp;
620   EOF;   625   EOF;
621                    }   626                    }
622                    $sTa gs = <<<EO F   627                    $sTa gs = <<<EO F
623   <div class ="cls_res_ info_p">   628   <div class ="cls_res_ info_p">
624       <!--<s pan style= "vertical- align:midd le;">   629       <!--<s pan style= "vertical- align:midd le;">
625           <i mg src="{$ site['icon s']}tag_sm all.png" c lass="marg _icon" alt ="" />   630           <i mg src="{$ site['icon s']}tag_sm all.png" c lass="marg _icon" alt ="" />
626       </span >-->{$sTag sC}:&nbsp; {$sTagsHre fs}   631       </span >-->{$sTag sC}:&nbsp; {$sTagsHre fs}
627   </div>   632   </div>
628   EOF;   633   EOF;
629     634  
630                    $sAc tions = '' ;   635                    $sAc tions = '' ;
631                    if ( $aResSQL[' Responsibl eID']==(in t)$_COOKIE ['memberID '] && $aRe sSQL['Resp onsibleID' ] > 0) {   636                    if ( $aResSQL[' Responsibl eID']==(in t)$_COOKIE ['memberID '] && $aRe sSQL['Resp onsibleID' ] > 0) {
632                         $sActions  = <<<EOF   637                         $sActions  = <<<EOF
633   <div class ="cls_res_ info_p">   638   <div class ="cls_res_ info_p">
634       <a hre f="{$_SERV ER['PHP_SE LF']}" onc lick="Upda teField('E ditEventID ','{$aResS QL['ID']}' );document .forms.com mand_edit_ event.subm it();retur n false;"  style="tex t-transfor m:none;">{ $sEditC}</ a>&nbsp;   639       <a hre f="{$_SERV ER['PHP_SE LF']}" onc lick="Upda teField('E ditEventID ','{$aResS QL['ID']}' );document .forms.com mand_edit_ event.subm it();retur n false;"  style="tex t-transfor m:none;">{ $sEditC}</ a>&nbsp;
635       <a hre f="{$_SERV ER['PHP_SE LF']}" onc lick="if ( confirm('{ $sSureC}') ) {UpdateF ield('Dele teEventID' ,'{$aResSQ L['ID']}') ;document. forms.comm and_delete _event.sub mit(); } r eturn fals e;" style= "text-tran sform:none ;">{$sDele teC}</a>   640       <a hre f="{$_SERV ER['PHP_SE LF']}" onc lick="if ( confirm('{ $sSureC}') ) {UpdateF ield('Dele teEventID' ,'{$aResSQ L['ID']}') ;document. forms.comm and_delete _event.sub mit(); } r eturn fals e;" style= "text-tran sform:none ;">{$sDele teC}</a>
636   </div>   641   </div>
637   EOF;   642   EOF;
638                    }   643                    }
639     644  
640                    $sGe nUrl = $th is->genUrl ($aResSQL[ 'ID'], $aR esSQL['Ent ryUri']);   645                    $sGe nUrl = $th is->genUrl ($aResSQL[ 'ID'], $aR esSQL['Ent ryUri']);
641                    $sIm gEl = $thi s->GetEven tPicture($ aResSQL['I D'], $aRes SQL['Photo Filename'] );   646                    $sIm gEl = $thi s->GetEven tPicture($ aResSQL['I D'], $aRes SQL['Photo Filename'] );
642                    $sMa inContent  = <<<EOF   647                    $sMa inContent  = <<<EOF
643   <div class ="cls_resu lt_row">   648   <div class ="cls_resu lt_row">
644       <div c lass="clea r_both"></ div>   649       <div c lass="clea r_both"></ div>
645       {$sImg El}   650       {$sImg El}
646       <div c lass="cls_ res_info_n owidth" {$ sDataStyle Width}>   651       <div c lass="cls_ res_info_n owidth" {$ sDataStyle Width}>
647           <d iv class=" cls_res_in fo_p">   652           <d iv class=" cls_res_in fo_p">
648                <a class ="actions"  href="{$s GenUrl}">{ $aResSQL[' Title']}</ a>   653                <a class ="actions"  href="{$s GenUrl}">{ $aResSQL[' Title']}</ a>
649           </ div>   654           </ div>
650           {$ sTags}   655           {$ sTags}
651           <! -- <div cl ass="cls_r es_info_p" >   656           <! -- <div cl ass="cls_r es_info_p" >
652                {$sStatu sMessageC} : <div cla ss="clr3"> {$sStatusM essage}</d iv>   657                {$sStatu sMessageC} : <div cla ss="clr3"> {$sStatusM essage}</d iv>
653           </ div> -->   658           </ div> -->
654           <d iv class=" cls_res_in fo_p">   659           <d iv class=" cls_res_in fo_p">
655                {$sDateC }: <div cl ass="clr3" >{$sEvents Start}</di v>   660                {$sDateC }: <div cl ass="clr3" >{$sEvents Start}</di v>
656           </ div>   661           </ div>
657           <d iv class=" cls_res_in fo_p">   662           <d iv class=" cls_res_in fo_p">
658                {$sPoste dByC}: <di v class="c lr3">{$sPo stedByHref }</div>   663                {$sPoste dByC}: <di v class="c lr3">{$sPo stedByHref }</div>
659           </ div>   664           </ div>
660           <d iv class=" cls_res_in fo_p">   665           <d iv class=" cls_res_in fo_p">
661                {$sPlace C}: <div c lass="clr3 ">{$sCount ry}{$sCity }{$sPlace} </div>   666                {$sPlace C}: <div c lass="clr3 ">{$sCount ry}{$sCity }{$sPlace} </div>
662           </ div>   667           </ div>
663           <d iv class=" cls_res_in fo_p">   668           <d iv class=" cls_res_in fo_p">
664                {$sDescr iptionC}:  <div class ="clr3">{$ sDescripti on}</div>   669                {$sDescr iptionC}:  <div class ="clr3">{$ sDescripti on}</div>
665           </ div>   670           </ div>
666           <d iv class=" cls_res_in fo_p">   671           <d iv class=" cls_res_in fo_p">
667                {$sViewP articipant s}   672                {$sViewP articipant s}
668           </ div>   673           </ div>
669           {$ sActions}   674           {$ sActions}
670       </div>   675       </div>
671       <div c lass="clea r_both"></ div>   676       <div c lass="clea r_both"></ div>
672   </div>   677   </div>
673   EOF;   678   EOF;
674     679  
675                    $sRe tHtml .= $ sMainConte nt;   680                    $sRe tHtml .= $ sMainConte nt;
676                }   681                }
677     682  
678                $iVar =  2;   683                $iVar =  2;
679                //////// ////////// /////////   684                //////// ////////// /////////
680                if ($thi s->bUseFri endlyLinks ==false ||  $_GET['sh ow_events' ]!='all')  { //old va riant   685                if ($thi s->bUseFri endlyLinks ==false ||  $_GET['sh ow_events' ]!='all')  { //old va riant
681                    if(  $iTotalPag es > 1)   686                    if(  $iTotalPag es > 1)
682                    {   687                    {
683                         $sRequest  = $_SERVER ['PHP_SELF '] . '?';   688                         $sRequest  = $_SERVER ['PHP_SELF '] . '?';
684                         $aFields =  array('sh ow_events' ,'action') ;   689                         $aFields =  array('sh ow_events' ,'action') ;
685                           690                        
686                         foreach( $ aFields as  $field )   691                         foreach( $ aFields as  $field )
687                             if( is set( $_GET [$field] )  )   692                             if( is set( $_GET [$field] )  )
688                                 $s Request .=  "&amp;{$f ield}=" .  htmlentiti es( proces s_pass_dat a( $_GET[$ field] ) ) ;   693                                 $s Request .=  "&amp;{$f ield}=" .  htmlentiti es( proces s_pass_dat a( $_GET[$ field] ) ) ;
689                           694                        
690                         $paginatio n = '<div  style="tex t-align: c enter; pos ition: rel ative;">'. _t("_Resul ts per pag e").':   695                         $paginatio n = '<div  style="tex t-align: c enter; pos ition: rel ative;">'. _t("_Resul ts per pag e").':
691                                 <s elect name ="per_page " onchange ="window.l ocation=\' ' . $sRequ est . '&am p;per_page =\' + this .value;">   696                                 <s elect name ="per_page " onchange ="window.l ocation=\' ' . $sRequ est . '&am p;per_page =\' + this .value;">
692                                      <option  value="10" ' . ( $iPe rPage == 1 0 ? ' sele cted="sele cted"' : ' ' ) . '>10 </option>   697                                      <option  value="10" ' . ( $iPe rPage == 1 0 ? ' sele cted="sele cted"' : ' ' ) . '>10 </option>
693                                      <option  value="20" ' . ( $iPe rPage == 2 0 ? ' sele cted="sele cted"' : ' ' ) . '>20 </option>   698                                      <option  value="20" ' . ( $iPe rPage == 2 0 ? ' sele cted="sele cted"' : ' ' ) . '>20 </option>
694                                      <option  value="50" ' . ( $iPe rPage == 5 0 ? ' sele cted="sele cted"' : ' ' ) . '>50 </option>   699                                      <option  value="50" ' . ( $iPe rPage == 5 0 ? ' sele cted="sele cted"' : ' ' ) . '>50 </option>
695                                      <option  value="100 "' . ( $iP erPage ==  100 ? ' se lected="se lected"' :  '' ) . '> 100</optio n>   700                                      <option  value="100 "' . ( $iP erPage ==  100 ? ' se lected="se lected"' :  '' ) . '> 100</optio n>
696                                 </ select></d iv>' .   701                                 </ select></d iv>' .
697                             genPag ination( $ iTotalPage s, $iCurPa ge, ( $sRe quest . '& amp;page={ page}&amp; per_page=' .$iPerPage  ) );   702                             genPag ination( $ iTotalPage s, $iCurPa ge, ( $sRe quest . '& amp;page={ page}&amp; per_page=' .$iPerPage  ) );
698                    }   703                    }
699                    else   704                    else
700                         $paginatio n = '';   705                         $paginatio n = '';
701                }   706                }
702                else if  ($this->bU seFriendly Links && $ _GET['show _events']= ='all') {  //new vati ant   707                else if  ($this->bU seFriendly Links && $ _GET['show _events']= ='all') {  //new vati ant
703                    if(  $iTotalPag es > 1) {   708                    if(  $iTotalPag es > 1) {
704                         //$sFriend lyAction =  'show_eve nts=all&ac tion=show' ;   709                         //$sFriend lyAction =  'show_eve nts=all&ac tion=show' ;
705     710  
706                         $sRequest   =  
'events/al l/';
  711                         $sRequest   =   $site['url ']   .   'events/al l/';
707                         /*$aFields  = array(' show_event s','action ');   712                         /*$aFields  = array(' show_event s','action ');
708     713  
709                         foreach( $ aFields as  $field )   714                         foreach( $ aFields as  $field )
710                             if( is set( $_GET [$field] )  )   715                             if( is set( $_GET [$field] )  )
711                                 $s FriendlyAc tion .= "{ $field}="  . htmlenti ties( proc ess_pass_d ata( $_GET [$field] )  ) . '&amp ;';*/   716                                 $s FriendlyAc tion .= "{ $field}="  . htmlenti ties( proc ess_pass_d ata( $_GET [$field] )  ) . '&amp ;';*/
712                           717  
713                         $paginatio n = '<div  style="tex t-align: c enter; pos ition: rel ative;">'. _t("_Resul ts per pag e").':   718                         $paginatio n = '<div  style="tex t-align: c enter; pos ition: rel ative;">'. _t("_Resul ts per pag e").':
714                                 <s elect name ="per_page " onchange ="window.l ocation=\' ' . $sRequ est . '\'  + this.val ue + \'/1\ ';">   719                                 <s elect name ="per_page " onchange ="window.l ocation=\' ' . $sRequ est . '\'  + this.val ue + \'/1\ ';">
715                                      <option  value="10" ' . ( $iPe rPage == 1 0 ? ' sele cted="sele cted"' : ' ' ) . '>10 </option>   720                                      <option  value="10" ' . ( $iPe rPage == 1 0 ? ' sele cted="sele cted"' : ' ' ) . '>10 </option>
716                                      <option  value="20" ' . ( $iPe rPage == 2 0 ? ' sele cted="sele cted"' : ' ' ) . '>20 </option>   721                                      <option  value="20" ' . ( $iPe rPage == 2 0 ? ' sele cted="sele cted"' : ' ' ) . '>20 </option>
717                                      <option  value="50" ' . ( $iPe rPage == 5 0 ? ' sele cted="sele cted"' : ' ' ) . '>50 </option>   722                                      <option  value="50" ' . ( $iPe rPage == 5 0 ? ' sele cted="sele cted"' : ' ' ) . '>50 </option>
718                                      <option  value="100 "' . ( $iP erPage ==  100 ? ' se lected="se lected"' :  '' ) . '> 100</optio n>   723                                      <option  value="100 "' . ( $iP erPage ==  100 ? ' se lected="se lected"' :  '' ) . '> 100</optio n>
719                                 </ select></d iv>' .   724                                 </ select></d iv>' .
720                             genPag ination( $ iTotalPage s, $iCurPa ge, ( $sRe quest.$iPe rPage . '/ {page}' )  );   725                             genPag ination( $ iTotalPage s, $iCurPa ge, ( $sRe quest.$iPe rPage . '/ {page}' )  );
721                    } el se $pagina tion = '';   726                    } el se $pagina tion = '';
722                }   727                }
723                //////// ////////// /////////   728                //////// ////////// /////////
724           }   729           }
725     730  
726           $s RetHtml =  $this->Dec orateAsTab le(_t('_Al l Events') , $sRetHtm l.$paginat ion);   731           $s RetHtml =  $this->Dec orateAsTab le(_t('_Al l Events') , $sRetHtm l.$paginat ion);
727           re turn $sRet Html;   732           re turn $sRet Html;
728       }   733       }
729     734  
730       /**   735       /**
731        * Com pose resul t into Wra pper class   736        * Com pose resul t into Wra pper class
732        *   737        *
733        * @pa ram $sCapt ion captio n of Box   738        * @pa ram $sCapt ion captio n of Box
734        * @pa ram $sValu e   inner  text of bo x   739        * @pa ram $sValu e   inner  text of bo x
735        * @re turn HTML  presentati on of data   740        * @re turn HTML  presentati on of data
736        */   741        */
737       functi on Decorat eAsTable($ sCaption,  $sValue) {   742       functi on Decorat eAsTable($ sCaption,  $sValue) {
738           $s ValueF = < <<EOF   743           $s ValueF = < <<EOF
739   <div class ="cls_resu lt_wrapper ">   744   <div class ="cls_resu lt_wrapper ">
740       {$sVal ue}   745       {$sVal ue}
741   </div>   746   </div>
742   EOF;   747   EOF;
743           $s DecTbl = D esignBoxCo ntent ( _t ($sCaption ), $sValue F, 1 );   748           $s DecTbl = D esignBoxCo ntent ( _t ($sCaption ), $sValue F, 1 );
744           re turn $sDec Tbl;   749           re turn $sDec Tbl;
745       }   750       }
746     751  
747       /**   752       /**
748        * pag e show inf ormation a bout speci fied event   753        * pag e show inf ormation a bout speci fied event
749        * @re turn HTML  presentati on of data   754        * @re turn HTML  presentati on of data
750        */   755        */
751       functi on PageSDa tingShowIn fo() {   756       functi on PageSDa tingShowIn fo() {
752           gl obal $site ;   757           gl obal $site ;
753           gl obal $tmpl ;   758           gl obal $tmpl ;
754           gl obal $dir;   759           gl obal $dir;
755           gl obal $aPre Values;   760           gl obal $aPre Values;
756           gl obal $doll ;   761           gl obal $doll ;
757           gl obal $oTem plConfig;   762           gl obal $oTem plConfig;
758            // global   $date_form at;   763           
global   $date_form at;
759           gl obal $logg ed;   764           gl obal $logg ed;
760     765  
761           //  collect i nformation  about cur rent membe r   766           //  collect i nformation  about cur rent membe r
762           if ( $logged[ 'member']  ) {   767           if ( $logged[ 'member']  ) {
763                $aMember ['ID'] = ( int)$_COOK IE['member ID'];   768                $aMember ['ID'] = ( int)$_COOK IE['member ID'];
764                $aMember Data = get ProfileInf o( $aMembe r['ID'] );   769                $aMember Data = get ProfileInf o( $aMembe r['ID'] );
765           }  else   770           }  else
766                $aMember ['ID'] = 0 ;   771                $aMember ['ID'] = 0 ;
767     772  
768           $s NoPhotoC =  _t('_No p hoto');   773           $s NoPhotoC =  _t('_No p hoto');
769           $s ChangeC =  _t('_Chang e');   774           $s ChangeC =  _t('_Chang e');
770           $s CanBuyTick etC = _t(' _You can b uy the tic ket');   775           $s CanBuyTick etC = _t(' _You can b uy the tic ket');
771           $s BuyTicketC  = _t('_Bu y ticket') ;   776           $s BuyTicketC  = _t('_Bu y ticket') ;
772           $s CountryC =  _t('_Coun try');   777           $s CountryC =  _t('_Coun try');
773           $s CityC = _t ('_City');   778           $s CityC = _t ('_City');
774           $s PlaceC = _ t('_Place' );   779           $s PlaceC = _ t('_Place' );
775           $s EventStart C = _t('_E vent start ');   780           $s EventStart C = _t('_E vent start ');
776           $s DateC = _t ('_Date');   781           $s DateC = _t ('_Date');
777           $s EventEndC  = _t('_Eve nt end');   782           $s EventEndC  = _t('_Eve nt end');
778           $s TicketSale StartC = _ t('_Ticket  sale star t');   783           $s TicketSale StartC = _ t('_Ticket  sale star t');
779           $s TicketSale EndC = _t( '_Ticket s ale end');   784           $s TicketSale EndC = _t( '_Ticket s ale end');
780           $s Responsibl ePersonC =  _t('_Resp onsible pe rson');   785           $s Responsibl ePersonC =  _t('_Resp onsible pe rson');
781           $s PostedByC  = _t('_Pos ted by');   786           $s PostedByC  = _t('_Pos ted by');
782           $s TicketsLef tC = _t('_ Tickets le ft');   787           $s TicketsLef tC = _t('_ Tickets le ft');
783           $s TicketPric eC = _t('_ Ticket pri ce');   788           $s TicketPric eC = _t('_ Ticket pri ce');
784           $s Descriptio nC = _t('_ Descriptio n');   789           $s Descriptio nC = _t('_ Descriptio n');
785           $s SaleStatus C = _t('_S ale status ');   790           $s SaleStatus C = _t('_S ale status ');
786           $s EventC = _ t('_Event' );   791           $s EventC = _ t('_Event' );
787           $s EditC = _t ('_Edit');   792           $s EditC = _t ('_Edit');
788           $s DeleteC =  _t('_Delet e');   793           $s DeleteC =  _t('_Delet e');
789           $s SureC = _t ("_Are you  sure");   794           $s SureC = _t ("_Are you  sure");
790           $s PictureC =  _t('_Pict ure');   795           $s PictureC =  _t('_Pict ure');
791           $s StatusC =  _t('_Statu s');   796           $s StatusC =  _t('_Statu s');
792           $s PhoneC = _ t('_Phone' );   797           $s PhoneC = _ t('_Phone' );
793           $s EmailC = _ t('_E-mail ');   798           $s EmailC = _ t('_E-mail ');
794           $s ActionsC =  _t('_Acti ons');   799           $s ActionsC =  _t('_Acti ons');
795           $s JoinC = _t ('_Join');   800           $s JoinC = _t ('_Join');
796           $s Unsubscrib eC = _t('_ Unsubscrib e');   801           $s Unsubscrib eC = _t('_ Unsubscrib e');
797           $s Participan tsC = _t(' _Participa nts');   802           $s Participan tsC = _t(' _Participa nts');
798           $s ListOfPart icipantsC  = _t('_Lis t').' '._t ('_of').'  '._t('_Par ticipants' );   803           $s ListOfPart icipantsC  = _t('_Lis t').' '._t ('_of').'  '._t('_Par ticipants' );
799           $s TagsC = _t ('_Tags');   804           $s TagsC = _t ('_Tags');
800           $s YOC = _t(' _y/o');   805           $s YOC = _t(' _y/o');
801     806  
802           /* $iEventID  = (int)$_R EQUEST['ev ent_id'];* /   807           /* $iEventID  = (int)$_R EQUEST['ev ent_id'];* /
803           $i EventID =  ($this->bU seFriendly Links) ? ( int)db_val ue("SELECT  `ID` FROM  `SDatingE vents` WHE RE `EntryU ri`='" . $ this->proc ess_html_d b_input($_ REQUEST['e ventUri'])  . "' LIMI T 1") : (i nt)$_REQUE ST['event_ id'];   808           $i EventID =  ($this->bU seFriendly Links) ? ( int)db_val ue("SELECT  `ID` FROM  `SDatingE vents` WHE RE `EntryU ri`='" . $ this->proc ess_html_d b_input($_ REQUEST['e ventUri'])  . "' LIMI T 1") : (i nt)$_REQUE ST['event_ id'];
804     809  
805           if  ($this->i LastInsert edID > 0)  {   810           if  ($this->i LastInsert edID > 0)  {
806                $iEventI D = $this- >iLastInse rtedID;   811                $iEventI D = $this- >iLastInse rtedID;
807                $this->i LastInsert edID = -1;   812                $this->i LastInsert edID = -1;
808           }   813           }
809     814  
810           $s Query =  "   815           $s Query =  "
811                SELECT   816                SELECT
812                    `SDa tingEvents `.`ID` AS  `EventIDN` ,   817                    `SDa tingEvents `.`ID` AS  `EventIDN` ,
813                    `Tit le`,   818                    `Tit le`,
814                    `Ent ryUri`,   819                    `Ent ryUri`,
815                    `Des cription`,   820                    `Des cription`,
816                    `Pho toFilename `,   821                    `Pho toFilename `,
817                    `Sta tusMessage `,   822                    `Sta tusMessage `,
818                    `Cou ntry`,   823                    `Cou ntry`,
819                    `Cit y`,   824                    `Cit y`,
820                    `Pla ce`,   825                    `Pla ce`,
821                    `Tag s`,   826                    `Tag s`,
822                    `Eve ntStart`,   827                    `Eve ntStart`,
    828                    UNIX _TIMESTAMP (`EventSta rt`) AS 'E ventStart_ UTS',
823                    DATE _FORMAT(`E ventEnd`,  '{$date_fo rmat}' ) A S EventEnd ,   829                    DATE _FORMAT(`E ventEnd`,  '{$date_fo rmat}' ) A S EventEnd ,
824                    (NOW () > `Even tStart`) A S `EventBe gan`,   830                    (NOW () > `Even tStart`) A S `EventBe gan`,
825                    (NOW () < `Even tEnd`) AS  `EventNotF inished`,   831                    (NOW () < `Even tEnd`) AS  `EventNotF inished`,
826                     DATE_FORMA T(`TicketS aleStart`,   '{$date_fo rmat}'   )   AS  
TicketSale Start
,
  832                     DATE_FORMA T(`TicketS aleStart`,   '{$date_fo rmat}'   )   AS   ' TicketSale Start ' ,
827                     DATE_FORMA T(`TicketS aleEnd`,   '{$date_fo rmat}'   )   AS  
TicketSale End
,
  833                     DATE_FORMA T(`TicketS aleEnd`,   '{$date_fo rmat}'   )   AS   ' TicketSale End ' ,
828                    (NOW () > `Tick etSaleStar t`) AS `Sa leBegan`,   834                    (NOW () > `Tick etSaleStar t`) AS `Sa leBegan`,
829                    (NOW () < `Tick etSaleEnd` ) AS `Sale NotFinishe d`,   835                    (NOW () < `Tick etSaleEnd` ) AS `Sale NotFinishe d`,
830                    (UNI X_TIMESTAM P() - UNIX _TIMESTAMP (`EventSta rt`)) AS ` sec`,   836                    (UNI X_TIMESTAM P() - UNIX _TIMESTAMP (`EventSta rt`)) AS ` sec`,
831                    `Res ponsibleID `,   837                    `Res ponsibleID `,
832                    `Res ponsibleNa me`,   838                    `Res ponsibleNa me`,
833                    `Res ponsibleEm ail`,   839                    `Res ponsibleEm ail`,
834                    `Res ponsiblePh one`,   840                    `Res ponsiblePh one`,
835                    `Tic ketPriceFe male`,   841                    `Tic ketPriceFe male`,
836                    `Tic ketPriceMa le`,   842                    `Tic ketPriceMa le`,
837                    `Tic ketCountFe male`,   843                    `Tic ketCountFe male`,
838                    `Tic ketCountMa le`,   844                    `Tic ketCountMa le`,
839                    (NOW () > `Even tEnd` AND  NOW() < DA TE_ADD(`Ev entEnd`, I NTERVAL `C hoosePerio d` DAY)) A S `ChooseA ctive`,   845                    (NOW () > `Even tEnd` AND  NOW() < DA TE_ADD(`Ev entEnd`, I NTERVAL `C hoosePerio d` DAY)) A S `ChooseA ctive`,
840                    (`SD atingParti cipants`.` ID` IS NOT  NULL) AS  `IsPartici pant`   846                    (`SD atingParti cipants`.` ID` IS NOT  NULL) AS  `IsPartici pant`
841                FROM `SD atingEvent s`   847                FROM `SD atingEvent s`
842                LEFT JOI N `SDating Participan ts` ON   848                LEFT JOI N `SDating Participan ts` ON
843                    `SDa tingPartic ipants`.`I DEvent` =  `SDatingEv ents`.`ID`   849                    `SDa tingPartic ipants`.`I DEvent` =  `SDatingEv ents`.`ID`
844                    AND  `SDatingPa rticipants `.`IDMembe r` = {$aMe mber['ID'] }   850                    AND  `SDatingPa rticipants `.`IDMembe r` = {$aMe mber['ID'] }
845                WHERE   851                WHERE
846                    `SDa tingEvents `.`ID` = { $iEventID}   852                    `SDa tingEvents `.`ID` = { $iEventID}
847                    AND  `SDatingEv ents`.`Sta tus` = 'Ac tive'   853                    AND  `SDatingEv ents`.`Sta tus` = 'Ac tive'
848                ";   854                ";
849     855  
850           $a EventData  = db_arr(  $sQuery );   856           $a EventData  = db_arr(  $sQuery );
851           if  ( !is_arr ay($aEvent Data) || c ount($aEve ntData) ==  0 )   857           if  ( !is_arr ay($aEvent Data) || c ount($aEve ntData) ==  0 )
852                return D esignBoxCo ntent( '',  '<center> '. _t('_Ev ent is una vailable')  .'</cente r>', $oTem plConfig - > PageSDat ingShowInf o_db_num ) ;   858                return D esignBoxCo ntent( '',  '<center> '. _t('_Ev ent is una vailable')  .'</cente r>', $oTem plConfig - > PageSDat ingShowInf o_db_num ) ;
853     859  
854           $s Query = "   860           $s Query = "
855                SELECT C OUNT(*)   861                SELECT C OUNT(*)
856                FROM `SD atingParti cipants`   862                FROM `SD atingParti cipants`
857                LEFT JOI N `Profile s` ON   863                LEFT JOI N `Profile s` ON
858                    `SDa tingPartic ipants`.`I DMember` =  `Profiles `.`ID`   864                    `SDa tingPartic ipants`.`I DMember` =  `Profiles `.`ID`
859                WHERE   865                WHERE
860                    `SDa tingPartic ipants`.`I DEvent` =  {$iEventID }   866                    `SDa tingPartic ipants`.`I DEvent` =  {$iEventID }
861                    AND  `Profiles` .`Sex` = ' {$sMemberS ex}'   867                    AND  `Profiles` .`Sex` = ' {$sMemberS ex}'
862                ";   868                ";
863              869           
864           $a PartNum =  db_arr( $s Query );   870           $a PartNum =  db_arr( $s Query );
865           $i PartNum =  (int)$aPar tNum[0];   871           $i PartNum =  (int)$aPar tNum[0];
866           $i TicketsLef t = ( $aMe mberData[' Sex'] == ' male' ? $a EventData[ 'TicketCou ntMale'] -  $iPartNum  : $aEvent Data['Tick etCountFem ale'] - $i PartNum );   872           $i TicketsLef t = ( $aMe mberData[' Sex'] == ' male' ? $a EventData[ 'TicketCou ntMale'] -  $iPartNum  : $aEvent Data['Tick etCountFem ale'] - $i PartNum );
867           $i TicketPric e = (float )( $aMembe rData['Sex '] == 'mal e' ? $aEve ntData['Ti cketPriceM ale'] : $a EventData[ 'TicketPri ceFemale']  );   873           $i TicketPric e = (float )( $aMembe rData['Sex '] == 'mal e' ? $aEve ntData['Ti cketPriceM ale'] : $a EventData[ 'TicketPri ceFemale']  );
868     874  
869           //  change pa rticipant  UID   875           //  change pa rticipant  UID
870           $s ErrorMessa ge = '';   876           $s ErrorMessa ge = '';
871           if  ( isset($ _POST['cha nge_uid'])  && $_POST ['change_u id'] == 'o n' ) {   877           if  ( isset($ _POST['cha nge_uid'])  && $_POST ['change_u id'] == 'o n' ) {
872                // check  if this U ID doesn't  exist for  this even t   878                // check  if this U ID doesn't  exist for  this even t
873                $sNewUid  = process _db_input( $_POST['pa rticipant_ uid']);   879                $sNewUid  = process _db_input( $_POST['pa rticipant_ uid']);
874                $aExistU id = db_ar r( "SELECT  `ID` FROM  `SDatingP articipant s`   880                $aExistU id = db_ar r( "SELECT  `ID` FROM  `SDatingP articipant s`
875                                          WHER E `IDEvent ` = {$iEve ntID}   881                                          WHER E `IDEvent ` = {$iEve ntID}
876                                          AND  `IDMember`  <> {$aMem ber['ID']}   882                                          AND  `IDMember`  <> {$aMem ber['ID']}
877                                          AND  LOWER(`Par ticipantUI D`) = LOWE R('$sNewUi d')" );   883                                          AND  LOWER(`Par ticipantUI D`) = LOWE R('$sNewUi d')" );
878                if ( !$a ExistUid[' ID'] ) {   884                if ( !$a ExistUid[' ID'] ) {
879                    $vRe s = db_res ( "UPDATE  `SDatingPa rticipants `   885                    $vRe s = db_res ( "UPDATE  `SDatingPa rticipants `
880                                          SET  `Participa ntUID` = ' $sNewUid'   886                                          SET  `Participa ntUID` = ' $sNewUid'
881                                          WHER E `IDEvent ` = $iEven tID   887                                          WHER E `IDEvent ` = $iEven tID
882                                          AND  `IDMember`  = {$aMemb er['ID']}"  );   888                                          AND  `IDMember`  = {$aMemb er['ID']}"  );
883                    if (  !$vRes )   889                    if (  !$vRes )
884                         $sErrorMes sage = _t( '_Cant cha nge partic ipant UID' );   890                         $sErrorMes sage = _t( '_Cant cha nge partic ipant UID' );
885                } else {   891                } else {
886                    $sEr rorMessage  = _t('_UI D already  exists');   892                    $sEr rorMessage  = _t('_UI D already  exists');
887                }   893                }
888           }   894           }
889     895  
890           //  if ticket  is free t hen buy it  here with out any ch eckouts   896           //  if ticket  is free t hen buy it  here with out any ch eckouts
891           if  ( isset($ _POST['pur chase_tick et']) && $ _POST['pur chase_tick et'] == 'o n' && !$aE ventData[' IsParticip ant'] and  $logged['m ember'] )  {   897           if  ( isset($ _POST['pur chase_tick et']) && $ _POST['pur chase_tick et'] == 'o n' && !$aE ventData[' IsParticip ant'] and  $logged['m ember'] )  {
892                if ( $aE ventData[' SaleBegan' ] && $aEve ntData['Sa leNotFinis hed'] && $ iTicketsLe ft > 0 &&  $iTicketPr ice <= 0.0  ) {   898                if ( $aE ventData[' SaleBegan' ] && $aEve ntData['Sa leNotFinis hed'] && $ iTicketsLe ft > 0 &&  $iTicketPr ice <= 0.0  ) {
893                    // i nsert into  participa nts table   899                    // i nsert into  participa nts table
894                    $iPa rticipantU ID = $aMem berData['N ickName']  . $iEventI D . rand(1 00, 999);   900                    $iPa rticipantU ID = $aMem berData['N ickName']  . $iEventI D . rand(1 00, 999);
895                    $vRe s = db_res ( "INSERT  INTO `SDat ingPartici pants` SET  `IDEvent`  = {$iEven tID}, `IDM ember` = { $aMember[' ID']}, `Pa rticipantU ID` = '{$i Participan tUID}'", 0  );   901                    $vRe s = db_res ( "INSERT  INTO `SDat ingPartici pants` SET  `IDEvent`  = {$iEven tID}, `IDM ember` = { $aMember[' ID']}, `Pa rticipantU ID` = '{$i Participan tUID}'", 0  );
896                    if (  !$vRes )  {   902                    if (  !$vRes )  {
897                         $sErrorMes sage = _t( 'Error: Pa rticipant  subscripti on error') ;   903                         $sErrorMes sage = _t( 'Error: Pa rticipant  subscripti on error') ;
898                    } el se {   904                    } el se {
899                         $sSubject  = getParam ( 't_SDati ngCongratu lation_sub ject' );   905                         $sSubject  = getParam ( 't_SDati ngCongratu lation_sub ject' );
900                         $sMessage  = getParam ( 't_SDati ngCongratu lation' );   906                         $sMessage  = getParam ( 't_SDati ngCongratu lation' );
901     907  
902                         $aPlus = a rray();   908                         $aPlus = a rray();
903                         $aPlus['Na meSDating' ] = $aEven tData['Tit le'];   909                         $aPlus['Na meSDating' ] = $aEven tData['Tit le'];
904                         $aPlus['Pl aceSDating '] = $aEve ntData['Pl ace'];   910                         $aPlus['Pl aceSDating '] = $aEve ntData['Pl ace'];
905                         $aPlus['Wh enStarSDat ing'] = $a EventData[ 'EventStar t'];   911                         $aPlus['Wh enStarSDat ing'] = $a EventData[ 'EventStar t'];
906                         $aPlus['Pe rsonalUID' ] = $iPart icipantUID ;   912                         $aPlus['Pe rsonalUID' ] = $iPart icipantUID ;
907                         $sGenUrl =  $this->ge nUrl($iEve ntID, $aEv entData['E ntryUri']) ;   913                         $sGenUrl =  $this->ge nUrl($iEve ntID, $aEv entData['E ntryUri']) ;
908                         $aPlus['Li nkSDatingE vent'] = $ sGenUrl;   914                         $aPlus['Li nkSDatingE vent'] = $ sGenUrl;
909     915  
910                         $vMailRes  = sendMail ( $aMember Data['Emai l'], $sSub ject, $sMe ssage, $aM ember['ID' ], $aPlus  );   916                         $vMailRes  = sendMail ( $aMember Data['Emai l'], $sSub ject, $sMe ssage, $aM ember['ID' ], $aPlus  );
911     917  
912                         if ( !$vMa ilRes )   918                         if ( !$vMa ilRes )
913                             $_POST ['result']  = 3;   919                             $_POST ['result']  = 3;
914                         else   920                         else
915                             $_POST ['result']  = 1;   921                             $_POST ['result']  = 1;
916                    }   922                    }
917                } else {   923                } else {
918                    $_PO ST['result '] = -1;   924                    $_PO ST['result '] = -1;
919                }   925                }
920           }   926           }
921           el seif ( iss et($_POST[ 'join_even t']) && $_ POST['join _event'] = = 'on' &&  $logged['m ember'] )  {   927           el seif ( iss et($_POST[ 'join_even t']) && $_ POST['join _event'] = = 'on' &&  $logged['m ember'] )  {
922                // inser t into par ticipants  table   928                // inser t into par ticipants  table
923                $iPartic ipantUID =  $aMemberD ata['NickN ame'] . $i EventID .  rand(100,  999);   929                $iPartic ipantUID =  $aMemberD ata['NickN ame'] . $i EventID .  rand(100,  999);
924                $vRes =  db_res( "I NSERT INTO  `SDatingP articipant s` SET `ID Event` = { $iEventID} , `IDMembe r` = {$aMe mber['ID'] }, `Partic ipantUID`  = '{$iPart icipantUID }'", 0 );   930                $vRes =  db_res( "I NSERT INTO  `SDatingP articipant s` SET `ID Event` = { $iEventID} , `IDMembe r` = {$aMe mber['ID'] }, `Partic ipantUID`  = '{$iPart icipantUID }'", 0 );
925                if ( !$v Res ) {   931                if ( !$v Res ) {
926                    $sEr rorMessage  = _t('Err or: Partic ipant subs cription e rror');   932                    $sEr rorMessage  = _t('Err or: Partic ipant subs cription e rror');
927                    $sRe tHtml .= ' <script ty pe="text/j avascript" >alert("'. _t( '_Sorr y, you\'re  already j oined' ).' ");</scrip t>';   933                    $sRe tHtml .= ' <script ty pe="text/j avascript" >alert("'. _t( '_Sorr y, you\'re  already j oined' ).' ");</scrip t>';
928                } else {   934                } else {
929                    $sSu bject = ge tParam( 't _SDatingCo ngratulati on_subject ' );   935                    $sSu bject = ge tParam( 't _SDatingCo ngratulati on_subject ' );
930                    $sMe ssage = ge tParam( 't _SDatingCo ngratulati on' );   936                    $sMe ssage = ge tParam( 't _SDatingCo ngratulati on' );
931     937  
932                    $aPl us = array ();   938                    $aPl us = array ();
933                    $aPl us['NameSD ating'] =  $aEventDat a['Title'] ;   939                    $aPl us['NameSD ating'] =  $aEventDat a['Title'] ;
934                    $aPl us['PlaceS Dating'] =  $aEventDa ta['Place' ];   940                    $aPl us['PlaceS Dating'] =  $aEventDa ta['Place' ];
935                    $aPl us['WhenSt arSDating' ] = $aEven tData['Eve ntStart'];   941                    $aPl us['WhenSt arSDating' ] = $aEven tData['Eve ntStart'];
936                    $aPl us['Person alUID'] =  $iParticip antUID;   942                    $aPl us['Person alUID'] =  $iParticip antUID;
937                    $sGe nUrl = $th is->genUrl ($iEventID , $aEventD ata['Entry Uri']);   943                    $sGe nUrl = $th is->genUrl ($iEventID , $aEventD ata['Entry Uri']);
938                    $aPl us['LinkSD atingEvent '] = $sGen Url;   944                    $aPl us['LinkSD atingEvent '] = $sGen Url;
939     945  
940                    $vMa ilRes = se ndMail( $a MemberData ['Email'],  $sSubject , $sMessag e, $aMembe r['ID'], $ aPlus );   946                    $vMa ilRes = se ndMail( $a MemberData ['Email'],  $sSubject , $sMessag e, $aMembe r['ID'], $ aPlus );
941     947  
942                    $sRe tHtml .= ' <script ty pe="text/j avascript" >alert("'. _t('_You h ave succes sfully joi ned this E vent').'") ;</script> ';   948                    $sRe tHtml .= ' <script ty pe="text/j avascript" >alert("'. _t('_You h ave succes sfully joi ned this E vent').'") ;</script> ';
943     949  
944                    if (  !$vMailRe s )   950                    if (  !$vMailRe s )
945                         $_POST['re sult'] = 3 ;   951                         $_POST['re sult'] = 3 ;
946                    else   952                    else
947                         $_POST['re sult'] = 1 ;   953                         $_POST['re sult'] = 1 ;
948                }   954                }
949           }  elseif ( i sset($_POS T['unsubsc ribe_event ']) && $_P OST['unsub scribe_eve nt'] == 'o n' && $log ged['membe r'] ) {   955           }  elseif ( i sset($_POS T['unsubsc ribe_event ']) && $_P OST['unsub scribe_eve nt'] == 'o n' && $log ged['membe r'] ) {
950                // remov e from par ticipants  table   956                // remov e from par ticipants  table
951                $vRes =  db_res("DE LETE FROM  `SDatingPa rticipants ` WHERE `I DEvent` =  {$iEventID } AND `IDM ember` = { $aMember[' ID']} LIMI T 1");   957                $vRes =  db_res("DE LETE FROM  `SDatingPa rticipants ` WHERE `I DEvent` =  {$iEventID } AND `IDM ember` = { $aMember[' ID']} LIMI T 1");
952                if (mysq l_affected _rows() ==  0) {   958                if (mysq l_affected _rows() ==  0) {
953                    $sEr rorMessage  = _t('Err or: Partic ipant unsu bscription  error');   959                    $sEr rorMessage  = _t('Err or: Partic ipant unsu bscription  error');
954                    $sRe tHtml .= ' <script ty pe="text/j avascript" >alert("'. _t( '_Erro r Occured'  ).'");</s cript>';   960                    $sRe tHtml .= ' <script ty pe="text/j avascript" >alert("'. _t( '_Erro r Occured'  ).'");</s cript>';
955                } else {   961                } else {
956                    $sRe tHtml .= ' <script ty pe="text/j avascript" >alert("'. _t('_You h ave succes sfully uns ubscribe f rom Event' ).'");</sc ript>';   962                    $sRe tHtml .= ' <script ty pe="text/j avascript" >alert("'. _t('_You h ave succes sfully uns ubscribe f rom Event' ).'");</sc ript>';
957                }   963                }
958           }  elseif ( i sset($_POS T['join_ev ent']) &&  $_POST['jo in_event']  == 'on' & & $logged[ 'member']= =false ) {   964           }  elseif ( i sset($_POS T['join_ev ent']) &&  $_POST['jo in_event']  == 'on' & & $logged[ 'member']= =false ) {
959                $this->C heckLogged ();   965                $this->C heckLogged ();
960           }   966           }
961     967  
962           $a MemberPart  = db_arr(  "SELECT ` ID`, `Part icipantUID ` FROM `SD atingParti cipants`   968           $a MemberPart  = db_arr(  "SELECT ` ID`, `Part icipantUID ` FROM `SD atingParti cipants`
963                                               WHERE `IDE vent` = $i EventID   969                                               WHERE `IDE vent` = $i EventID
964                                               AND `IDMem ber` = {$a Member['ID ']}" );   970                                               AND `IDMem ber` = {$a Member['ID ']}" );
965     971  
966           $s ErrElems =  '';   972           $s ErrElems =  '';
967           if  ( isset($ _POST['res ult']) ) {   973           if  ( isset($ _POST['res ult']) ) {
968                $sResult  = '';   974                $sResult  = '';
969                switch (  $_POST['r esult'] )  {   975                switch (  $_POST['r esult'] )  {
970                    case  '-1':   $ sResult =  _t('_RESUL T-1'); bre ak;   976                    case  '-1':   $ sResult =  _t('_RESUL T-1'); bre ak;
971                    case  '0':    $ sResult =  _t('_RESUL T0'); brea k;   977                    case  '0':    $ sResult =  _t('_RESUL T0'); brea k;
972                    case  '1':    $ sResult =  _t('_RESUL T1_THANK',  $aEventDa ta['Title' ] , $aEven tData['Eve ntStart']) ; break;   978                    case  '1':    $ sResult =  _t('_RESUL T1_THANK',  $aEventDa ta['Title' ] , $aEven tData['Eve ntStart']) ; break;
973                    case  '3':    $ sResult =  _t('_RESUL T_SDATING_ MAIL_NOT_S ENT'); bre ak;   979                    case  '3':    $ sResult =  _t('_RESUL T_SDATING_ MAIL_NOT_S ENT'); bre ak;
974                    case  '1000': $ sResult =  _t('_RESUL T1000'); b reak;   980                    case  '1000': $ sResult =  _t('_RESUL T1000'); b reak;
975                }   981                }
976                $sErrEle ms .= '<di v class="e rr">'.$sRe sult.'</di v>';   982                $sErrEle ms .= '<di v class="e rr">'.$sRe sult.'</di v>';
977           }   983           }
978     984  
979           $s PicElement  = '';   985           $s PicElement  = '';
980           $s SpacerName  = $this - > sSpacerP ath;   986           $s SpacerName  = $this - > sSpacerP ath;
981           if  ( strlen( trim($aEve ntData['Ph otoFilenam e'])) && f ile_exists ($dir['sda tingImage' ] . $aEven tData['Pho toFilename ']) ) {   987           if  ( strlen( trim($aEve ntData['Ph otoFilenam e'])) && f ile_exists ($dir['sda tingImage' ] . $aEven tData['Pho toFilename ']) ) {
982                $sPicNam e = $site[ 'sdatingIm age'].$aEv entData['P hotoFilena me'];   988                $sPicNam e = $site[ 'sdatingIm age'].$aEv entData['P hotoFilena me'];
983                $sPicEle ment .= "< img class= \"photo\"  alt=\"\" s tyle=\"wid th:{$this  -> iImgSiz e}px;heigh t:{$this - > iImgSize }px;backgr ound-image :url({$sPi cName});\"  src=\"{$s SpacerName }\" border =\"0\" />" ;   989                $sPicEle ment .= "< img class= \"photo\"  alt=\"\" s tyle=\"wid th:{$this  -> iImgSiz e}px;heigh t:{$this - > iImgSize }px;backgr ound-image :url({$sPi cName});\"  src=\"{$s SpacerName }\" border =\"0\" />" ;
984                $sPicEle ment1 .= '   990                $sPicEle ment1 .= '
985                    <img  src="'.$s ite['sdati ngImage']. $aEventDat a['PhotoFi lename'].' " border=" 0" alt="'. _t('_SDati ng photo a lt', $aEve ntData['Ti tle']).'"  />';   991                    <img  src="'.$s ite['sdati ngImage']. $aEventDat a['PhotoFi lename'].' " border=" 0" alt="'. _t('_SDati ng photo a lt', $aEve ntData['Ti tle']).'"  />';
986           }  else {   992           }  else {
987                $sPicNaN ame = "{$s ite['url'] }templates /tmpl_{$tm pl}/{$this  -> sPicNo tAvail}";   993                $sPicNaN ame = "{$s ite['url'] }templates /tmpl_{$tm pl}/{$this  -> sPicNo tAvail}";
988                $sPicEle ment .= "< img class= \"photo\"  alt=\"\" s tyle=\"wid th:{$this  -> iImgSiz e}px;heigh t:{$this - > iImgSize }px;backgr ound-image :url({$sPi cNaName}); \" src=\"{ $sSpacerNa me}\" bord er=\"0\" / >";   994                $sPicEle ment .= "< img class= \"photo\"  alt=\"\" s tyle=\"wid th:{$this  -> iImgSiz e}px;heigh t:{$this - > iImgSize }px;backgr ound-image :url({$sPi cNaName}); \" src=\"{ $sSpacerNa me}\" bord er=\"0\" / >";
989                $sPicEle ment1 .= '   995                $sPicEle ment1 .= '
990                    <div  align="ce nter" clas s="text" s tyle="widt h: 200px;  height: 15 0px; verti cal-align:  middle; l ine-height : 150px; b order: 1px  solid sil ver;">'.$s NoPhotoC.' </div>';   996                    <div  align="ce nter" clas s="text" s tyle="widt h: 200px;  height: 15 0px; verti cal-align:  middle; l ine-height : 150px; b order: 1px  solid sil ver;">'.$s NoPhotoC.' </div>';
991           }   997           }
992     998  
993           /* $sInnerDat a = '';   999           /* $sInnerDat a = '';
994           if  ( $aMembe rPart['ID' ] ) {   1000           if  ( $aMembe rPart['ID' ] ) {
995                if ( $aE ventData[' EventBegan '] && $aEv entData['E ventNotFin ished'] )  {   1001                if ( $aE ventData[' EventBegan '] && $aEv entData['E ventNotFin ished'] )  {
996                    $sIn nerData .=  _t('_Even t started' );   1002                    $sIn nerData .=  _t('_Even t started' );
997                }   1003                }
998                elseif (  $aEventDa ta['Choose Active'] )  {   1004                elseif (  $aEventDa ta['Choose Active'] )  {
999                    $sIn nerData .=  _t('_Even t finished ') .". <a  href=\"{$_ SERVER['PH P_SELF']}? action=sel ect_match& amp;event_ id={$iEven tID}\">".  _t('_Choos e particip ants you l iked') ."< /a>";   1005                    $sIn nerData .=  _t('_Even t finished ') .". <a  href=\"{$_ SERVER['PH P_SELF']}? action=sel ect_match& amp;event_ id={$iEven tID}\">".  _t('_Choos e particip ants you l iked') ."< /a>";
1000                } else {   1006                } else {
1001                    if (  strlen($s ErrorMessa ge) )   1007                    if (  strlen($s ErrorMessa ge) )
1002                         $sInnerDat a .= "<div  align=\"c enter\" cl ass=\"err\ " style=\" width: 100 %;\">{$sEr rorMessage }</div>\n" ;   1008                         $sInnerDat a .= "<div  align=\"c enter\" cl ass=\"err\ " style=\" width: 100 %;\">{$sEr rorMessage }</div>\n" ;
1003                         $sInnerDat a .= _t('_ You are pa rticipant  of event') .'<br />';   1009                         $sInnerDat a .= _t('_ You are pa rticipant  of event') .'<br />';
1004                         $sParticip antUID = h tmlspecial chars($aMe mberPart[' Participan tUID']);   1010                         $sParticip antUID = h tmlspecial chars($aMe mberPart[' Participan tUID']);
1005                         $sInnerDat a .= <<<EO F   1011                         $sInnerDat a .= <<<EO F
1006   <center>   1012   <center>
1007       <form  id="change UIDForm" a ction="{$_ SERVER['PH P_SELF']}? action=sho w_info&eve nt_id={$iE ventID}" m ethod="pos t" style=" margin: 2p x;">   1013       <form  id="change UIDForm" a ction="{$_ SERVER['PH P_SELF']}? action=sho w_info&eve nt_id={$iE ventID}" m ethod="pos t" style=" margin: 2p x;">
1008           <i nput type= "hidden" n ame="chang e_uid" val ue="on" />   1014           <i nput type= "hidden" n ame="chang e_uid" val ue="on" />
1009           <i nput type= "text" cla ss="no" na me="partic ipant_uid"  value="{$ sParticipa ntUID}" si ze="20" ma xlength="3 0" style=" vertical-a lign: midd le;" />&nb sp;   1015           <i nput type= "text" cla ss="no" na me="partic ipant_uid"  value="{$ sParticipa ntUID}" si ze="20" ma xlength="3 0" style=" vertical-a lign: midd le;" />&nb sp;
1010           <i nput type= "submit" c lass="no"  value="{$s ChangeC}"  style="wid th: 80px;  vertical-a lign: midd le" />   1016           <i nput type= "submit" c lass="no"  value="{$s ChangeC}"  style="wid th: 80px;  vertical-a lign: midd le" />
1011       </form >   1017       </form >
1012   </center>   1018   </center>
1013   EOF;   1019   EOF;
1014                }   1020                }
1015           }   1021           }
1016           el seif ( $aE ventData[' SaleBegan' ] and $aEv entData['S aleNotFini shed'] and  $logged[' member'] )  {   1022           el seif ( $aE ventData[' SaleBegan' ] and $aEv entData['S aleNotFini shed'] and  $logged[' member'] )  {
1017                if ( $iT icketsLeft  > 0 ) {   1023                if ( $iT icketsLeft  > 0 ) {
1018                    if (  $iTicketP rice > 0.0  ) {   1024                    if (  $iTicketP rice > 0.0  ) {
1019                         $sInnerDat a .= <<<EO F   1025                         $sInnerDat a .= <<<EO F
1020   {$sCanBuyT icketC}<br  />   1026   {$sCanBuyT icketC}<br  />
1021   <center>   1027   <center>
1022       <form  id="buyTic ketForm" a ction="{$s ite['url'] }checkout. php" metho d="post" s tyle="marg in: 2px;">   1028       <form  id="buyTic ketForm" a ction="{$s ite['url'] }checkout. php" metho d="post" s tyle="marg in: 2px;">
1023           <i nput type= "hidden" n ame="actio n" value=" collect" / >   1029           <i nput type= "hidden" n ame="actio n" value=" collect" / >
1024           <i nput type= "hidden" n ame="check out_action " value="s peeddating " />   1030           <i nput type= "hidden" n ame="check out_action " value="s peeddating " />
1025           <i nput type= "hidden" n ame="data"  value="{$ iEventID}"  />   1031           <i nput type= "hidden" n ame="data"  value="{$ iEventID}"  />
1026           <i nput type= "hidden" n ame="amoun t" value=" {$iTicketP rice}" />   1032           <i nput type= "hidden" n ame="amoun t" value=" {$iTicketP rice}" />
1027           <i nput type= "submit" c lass="no"  value="{$s BuyTicketC }" style=" width: 100 px; vertic al-align:  middle;" / >   1033           <i nput type= "submit" c lass="no"  value="{$s BuyTicketC }" style=" width: 100 px; vertic al-align:  middle;" / >
1028       </form >   1034       </form >
1029   </center>   1035   </center>
1030   EOF;   1036   EOF;
1031                    }   1037                    }
1032                    else  {   1038                    else  {
1033                         $sInnerDat a .= <<<EO F   1039                         $sInnerDat a .= <<<EO F
1034   {$sCanBuyT icketC}<br  />   1040   {$sCanBuyT icketC}<br  />
1035   <center>   1041   <center>
1036       <form  id="buyTic ketForm" a ction="{$_ SERVER['PH P_SELF']}? action=sho w_info&eve nt_id={$iE ventID}" m ethod="pos t" style=" margin: 2p x;">   1042       <form  id="buyTic ketForm" a ction="{$_ SERVER['PH P_SELF']}? action=sho w_info&eve nt_id={$iE ventID}" m ethod="pos t" style=" margin: 2p x;">
1037           <i nput type= "hidden" n ame="purch ase_ticket " value="o n" />   1043           <i nput type= "hidden" n ame="purch ase_ticket " value="o n" />
1038           <i nput type= "submit" c lass="no"  value="{$s BuyTicketC }" style=" width: 100 px; vertic al-align:  middle;" / >   1044           <i nput type= "submit" c lass="no"  value="{$s BuyTicketC }" style=" width: 100 px; vertic al-align:  middle;" / >
1039       </form >   1045       </form >
1040   </center>   1046   </center>
1041   EOF;   1047   EOF;
1042                    }   1048                    }
1043                } else {   1049                } else {
1044                    $sIn nerData .=   _t('_No  tickets le ft');   1050                    $sIn nerData .=   _t('_No  tickets le ft');
1045                }   1051                }
1046           }  elseif ( $ aEventData ['SaleBega n'] ) {   1052           }  elseif ( $ aEventData ['SaleBega n'] ) {
1047                $sInnerD ata .=  _t ('_Sale fi nished');   1053                $sInnerD ata .=  _t ('_Sale fi nished');
1048           }  else {   1054           }  else {
1049                $sInnerD ata .=  _t ('_Sale no t started  yet');   1055                $sInnerD ata .=  _t ('_Sale no t started  yet');
1050           }* /   1056           }* /
1051     1057  
1052           $s StatusMess age = proc ess_line_o utput($aEv entData['S tatusMessa ge']);   1058           $s StatusMess age = proc ess_line_o utput($aEv entData['S tatusMessa ge']);
1053           $s CountryPic  = _t($aPr eValues['C ountry'][$ aEventData ['Country' ]]['LKey'] );   1059           $s CountryPic  = _t($aPr eValues['C ountry'][$ aEventData ['Country' ]]['LKey'] );
1054           $s City = pro cess_line_ output($aE ventData[' City']);   1060           $s City = pro cess_line_ output($aE ventData[' City']);
1055           $s Place = pr ocess_line _output($a EventData[ 'Place']);   1061           $s Place = pr ocess_line _output($a EventData[ 'Place']);
1056           $s Responsibl ePerson =  process_li ne_output( $aEventDat a['Respons ibleName'] );   1062           $s Responsibl ePerson =  process_li ne_output( $aEventDat a['Respons ibleName'] );
    1063           if  ($aEventD ata['Respo nsibleID']  == 0) {
    1064                $sPosted ByHref = _ t('_Admin' );
    1065           }  else {
1057           $a PostedBy =  $this->Ge tProfileDa ta($aEvent Data['Resp onsibleID' ]);   1066                $aPosted By = $this ->GetProfi leData($aE ventData[' Responsibl eID']);
1058           // $sPostedBy  = $aPoste dBy['NickN ame'];   1067                //$sPost edBy = $aP ostedBy['N ickName'];
1059           $s PostedByHr ef = getPr ofileLink( $aEventDat a['Respons ibleID']);   1068                $sPosted ByHref = g etProfileL ink($aEven tData['Res ponsibleID ']);
1060           $s PostedByHr ef = '<a h ref="'.$sP ostedByHre f.'">'.$aP ostedBy['N ickName']. '</a>';   1069                $sPosted ByHref = ' <a href="' .$sPostedB yHref.'">' .$aPostedB y['NickNam e'].'</a>' ;
    1070           }
1061           $s Phone = pr ocess_line _output($a EventData[ 'Responsib lePhone']) ;   1071           $s Phone = pr ocess_line _output($a EventData[ 'Responsib lePhone']) ;
1062           $s Email = pr ocess_line _output($a EventData[ 'Responsib leEmail']) ;   1072           $s Email = pr ocess_line _output($a EventData[ 'Responsib leEmail']) ;
1063           $s TicketPric e = ($iTic ketPrice >  0.0) ? $d oll . $iTi cketPrice  : _t('_fre e');   1073           $s TicketPric e = ($iTic ketPrice >  0.0) ? $d oll . $iTi cketPrice  : _t('_fre e');
1064           $s Descriptio n = /*proc ess_text_w ithlinks_o utput*/ $a EventData[ 'Descripti on'];   1074           $s Descriptio n = /*proc ess_text_w ithlinks_o utput*/ $a EventData[ 'Descripti on'];
1065           $s Title = pr ocess_line _output($a EventData[ 'Title']);   1075           $s Title = pr ocess_line _output($a EventData[ 'Title']);
1066     1076  
1067           $s TagsVals =  '';   1077           $s TagsVals =  '';
1068           $s TagsCommas  = $aEvent Data['Tags '];   1078           $s TagsCommas  = $aEvent Data['Tags '];
1069           $a Tags = spl it(',', $s TagsCommas );   1079           $a Tags = spl it(',', $s TagsCommas );
1070           fo reach( $aT ags as $sT agKey ) {   1080           fo reach( $aT ags as $sT agKey ) {
    1081                if ($sTa gKey != '' ) {
1071                if( isse t($aTagsPo st[$sTagKe y] ) )   1082                    if(  isset($aTa gsPost[$sT agKey] ) )
1072                    $aTa gsPost[$sT agKey]++;   1083                         $aTagsPost [$sTagKey] ++;
1073                else   1084                    else
1074                    $aTa gsPost[$sT agKey] = 1 ;   1085                         $aTagsPost [$sTagKey]  = 1;
1075           }   1086                }
    1087           }
1076     1088  
    1089           if  (count($a TagsPost))  {
1077           fo reach( $aT agsPost as  $varKey = > $varValu e ) {   1090                foreach(  $aTagsPos t as $varK ey => $var Value ) {
1078                $sTagHre fGen = $th is->genUrl (0, $varKe y, 'search ');   1091                    $sTa gHrefGen =  $this->ge nUrl(0, $v arKey, 'se arch');
1079                $sTagsVa ls .= <<<E OF   1092                    $sTa gsVals .=  <<<EOF
1080   <span styl e="vertica l-align:mi ddle;"><im g src="{$s ite['icons ']}tag.png " class="m arg_icon"  alt="" />< /span>   1093   <span styl e="vertica l-align:mi ddle;"><im g src="{$s ite['icons ']}tag.png " class="m arg_icon"  alt="" />< /span>
1081   <a class=" actions" h ref="{$sTa gHrefGen}"  style="te xt-transfo rm:capital ize;" >{$v arKey}</a> &nbsp;({$v arValue})   1094   <a class=" actions" h ref="{$sTa gHrefGen}"  style="te xt-transfo rm:capital ize;" >{$v arKey}</a> &nbsp;({$v arValue})
1082   <br />   1095   <br />
1083   EOF;   1096   EOF;
1084           }   1097                }
    1098           }
1085     1099  
1086           $s Actions =  '';   1100           $s Actions =  '';
1087           if  ($aEventD ata['Respo nsibleID'] ==(int)$_C OOKIE['mem berID']) {   1101           if  ($aEventD ata['Respo nsibleID'] ==(int)$_C OOKIE['mem berID']) {
1088                $sAction s = <<<EOF   1102                $sAction s = <<<EOF
1089   <div class ="padds">   1103   <div class ="padds">
1090       <img s rc="{$site ['icons']} categ_edit .png" alt= "{$sEditC} " title="{ $sEditC}"  class="mar g_icon" />   1104       <img s rc="{$site ['icons']} categ_edit .png" alt= "{$sEditC} " title="{ $sEditC}"  class="mar g_icon" />
1091       <a cla ss="action s" href="{ $_SERVER[' PHP_SELF'] }" onclick ="UpdateFi eld('EditE ventID','{ $aEventDat a['EventID N']}');doc ument.form s.command_ edit_event .submit(); return fal se;" style ="text-tra nsform:non e;">{$sEdi tC}</a>&nb sp;   1105       <a cla ss="action s" href="{ $_SERVER[' PHP_SELF'] }" onclick ="UpdateFi eld('EditE ventID','{ $aEventDat a['EventID N']}');doc ument.form s.command_ edit_event .submit(); return fal se;" style ="text-tra nsform:non e;">{$sEdi tC}</a>&nb sp;
1092   </div>   1106   </div>
1093   <div class ="padds">   1107   <div class ="padds">
1094       <img s rc="{$site ['icons']} action_blo ck.gif" al t="{$sEdit C}" title= "{$sEditC} " class="m arg_icon"  />   1108       <img s rc="{$site ['icons']} action_blo ck.gif" al t="{$sEdit C}" title= "{$sEditC} " class="m arg_icon"  />
1095       <a cla ss="action s" href="{ $_SERVER[' PHP_SELF'] }" onclick ="if (conf irm('{$sSu reC}')) {U pdateField ('DeleteEv entID','{$ aEventData ['EventIDN ']}');docu ment.forms .command_d elete_even t.submit() ; } return  false;" s tyle="text -transform :none;">{$ sDeleteC}< /a>   1109       <a cla ss="action s" href="{ $_SERVER[' PHP_SELF'] }" onclick ="if (conf irm('{$sSu reC}')) {U pdateField ('DeleteEv entID','{$ aEventData ['EventIDN ']}');docu ment.forms .command_d elete_even t.submit() ; } return  false;" s tyle="text -transform :none;">{$ sDeleteC}< /a>
1096   </div>   1110   </div>
1097   EOF;   1111   EOF;
1098           }   1112           }
1099           $s UsersActio ns = '';   1113           $s UsersActio ns = '';
1100           $s PartProfSQ L = "SELEC T * FROM ` SDatingPar ticipants`  WHERE `ID Event`={$i EventID} A ND `IDMemb er`={$aMem ber['ID']} ";   1114           $s PartProfSQ L = "SELEC T * FROM ` SDatingPar ticipants`  WHERE `ID Event`={$i EventID} A ND `IDMemb er`={$aMem ber['ID']} ";
1101           $a PartProfSQ L = db_arr ($sPartPro fSQL);   1115           $a PartProfSQ L = db_arr ($sPartPro fSQL);
1102           if  (mysql_af fected_row s() == 0)  { //no mat ches   1116           if  (mysql_af fected_row s() == 0)  { //no mat ches
1103                $sUsersA ctions = < <<EOF   1117                $sUsersA ctions = < <<EOF
1104   <div class ="padds">   1118   <div class ="padds">
1105       <img s rc="{$site ['icons']} _membershi p.jpg" alt ="{$sJoinC }" title=" {$sJoinC}"  class="ma rg_icon" / >   1119       <img s rc="{$site ['icons']} _membershi p.jpg" alt ="{$sJoinC }" title=" {$sJoinC}"  class="ma rg_icon" / >
1106       <a cla ss="action s" href="{ $_SERVER[' PHP_SELF'] }" onclick ="document .forms.Joi nEventForm .submit();  return fa lse;" >   1120       <a cla ss="action s" href="{ $_SERVER[' PHP_SELF'] }" onclick ="document .forms.Joi nEventForm .submit();  return fa lse;" >
1107           {$ sJoinC}   1121           {$ sJoinC}
1108       </a>   1122       </a>
1109   </div>   1123   </div>
1110   EOF;   1124   EOF;
1111           }  else {   1125           }  else {
1112                $sUsersA ctions = < <<EOF   1126                $sUsersA ctions = < <<EOF
1113   <div class ="padds">   1127   <div class ="padds">
1114       <img s rc="{$site ['icons']} action_blo ck.gif" al t="{$sUnsu bscribeC}"  title="{$ sUnsubscri beC}" clas s="marg_ic on" />   1128       <img s rc="{$site ['icons']} action_blo ck.gif" al t="{$sUnsu bscribeC}"  title="{$ sUnsubscri beC}" clas s="marg_ic on" />
1115       <a cla ss="action s" href="{ $_SERVER[' PHP_SELF'] }" onclick ="document .forms.Uns ubscribeEv entForm.su bmit(); re turn false ;" >   1129       <a cla ss="action s" href="{ $_SERVER[' PHP_SELF'] }" onclick ="document .forms.Uns ubscribeEv entForm.su bmit(); re turn false ;" >
1116           {$ sUnsubscri beC}   1130           {$ sUnsubscri beC}
1117       </a>   1131       </a>
1118   </div>   1132   </div>
1119   EOF;   1133   EOF;
1120           }   1134           }
1121     1135  
1122           $v PartProfil esRes = db _res( "   1136           $v PartProfil esRes = db _res( "
1123                SELECT ` Profiles`. *, `SDatin gParticipa nts`.`Part icipantUID ` AS `UID`  FROM `SDa tingPartic ipants`   1137                SELECT ` Profiles`. *, `SDatin gParticipa nts`.`Part icipantUID ` AS `UID`  FROM `SDa tingPartic ipants`
1124                INNER JO IN `Profil es` ON `SD atingParti cipants`.` IDMember`  = `Profile s`.`ID`   1138                INNER JO IN `Profil es` ON `SD atingParti cipants`.` IDMember`  = `Profile s`.`ID`
1125                WHERE `S DatingPart icipants`. `IDEvent`  = {$iEvent ID}   1139                WHERE `S DatingPart icipants`. `IDEvent`  = {$iEvent ID}
1126                ORDER BY  RAND() LI MIT 2" );   1140                ORDER BY  RAND() LI MIT 2" );
1127           $s Participan ts = '';   1141           $s Participan ts = '';
1128           wh ile ( $aPa rtProfiles  = mysql_f etch_assoc ($vPartPro filesRes)  ) {   1142           wh ile ( $aPa rtProfiles  = mysql_f etch_assoc ($vPartPro filesRes)  ) {
1129                $iUserIs Online = g et_user_on line_statu s($aPartPr ofiles[ID] );   1143                $iUserIs Online = g et_user_on line_statu s($aPartPr ofiles[ID] );
1130                $sCont =  get_membe r_thumbnai l($aPartPr ofiles['ID '], 'none'  ) . '<br  /><center> ' . getPro fileOnline Status( $i UserIsOnli ne ) . '</ center>';   1144                $sCont =  get_membe r_thumbnai l($aPartPr ofiles['ID '], 'none'  ) . '<br  /><center> ' . getPro fileOnline Status( $i UserIsOnli ne ) . '</ center>';
1131                $sThumb  = get_memb er_thumbna il($aPartP rofiles['I D'], 'none ' );   1145                $sThumb  = get_memb er_thumbna il($aPartP rofiles['I D'], 'none ' );
1132                $sProfLi nk = getPr ofileLink( $aPartProf iles['ID'] );   1146                $sProfLi nk = getPr ofileLink( $aPartProf iles['ID'] );
1133                $sAge =  age( $aPar tProfiles[ 'DateOfBir th'] ). $s YOC;   1147                $sAge =  age( $aPar tProfiles[ 'DateOfBir th'] ). $s YOC;
1134                $sPartic ipants .=  <<<EOF   1148                $sPartic ipants .=  <<<EOF
1135   <div style ="float:le ft;text-al ign:center ;margin-ri ght:10px;p osition:re lative;">   1149   <div style ="float:le ft;text-al ign:center ;margin-ri ght:10px;p osition:re lative;">
1136       {$sThu mb}   1150       {$sThu mb}
1137       <div c lass="brow se_nick" s tyle="widt h:{$this-> iThumbSize }px;">   1151       <div c lass="brow se_nick" s tyle="widt h:{$this-> iThumbSize }px;">
1138           <a  href="{$s ProfLink}" >{$aPartPr ofiles['Ni ckName']}< /a>: {$sAg e}   1152           <a  href="{$s ProfLink}" >{$aPartPr ofiles['Ni ckName']}< /a>: {$sAg e}
1139       </div>   1153       </div>
1140   </div>   1154   </div>
1141   EOF;   1155   EOF;
1142           }   1156           }
1143     1157  
1144           $s AdminTicke tsPart = ' ';$sAdminT icketsPart 2='';   1158           $s AdminTicke tsPart = ' ';$sAdminT icketsPart 2='';
1145           $s StatusSect  = '';   1159           $s StatusSect  = '';
1146           if  ($aEventD ata['Respo nsibleID'] ==0) {   1160           if  ($aEventD ata['Respo nsibleID'] ==0) {
1147                $sAdminT icketsPart  = <<<EOF   1161                $sAdminT icketsPart  = <<<EOF
1148   <div class ="cls_res_ info">   1162   <div class ="cls_res_ info">
1149       {$sEve ntEndC}: < div class= "clr3">{$a EventData[ 'EventEnd' ]}</div>   1163       {$sEve ntEndC}: < div class= "clr3">{$a EventData[ 'EventEnd' ]}</div>
1150   </div>   1164   </div>
1151   <div class ="cls_res_ info">   1165   <div class ="cls_res_ info">
1152       {$sTic ketSaleSta rtC}: <div  class="cl r3">{$aEve ntData['Ti cketSaleSt art']}</di v>   1166       {$sTic ketSaleSta rtC}: <div  class="cl r3">{$aEve ntData['Ti cketSaleSt art']}</di v>
1153   </div>   1167   </div>
1154   <div class ="cls_res_ info">   1168   <div class ="cls_res_ info">
1155       {$sTic ketSaleEnd C}: <div c lass="clr3 ">{$aEvent Data['Tick etSaleEnd' ]}</div>   1169       {$sTic ketSaleEnd C}: <div c lass="clr3 ">{$aEvent Data['Tick etSaleEnd' ]}</div>
1156   </div>   1170   </div>
1157   EOF;   1171   EOF;
1158                $sAdminT icketsPart 2 = <<<EOF   1172                $sAdminT icketsPart 2 = <<<EOF
1159   <div class ="cls_res_ info">   1173   <div class ="cls_res_ info">
1160       {$sTic ketsLeftC} : <div cla ss="clr3"> {$iTickets Left}</div >   1174       {$sTic ketsLeftC} : <div cla ss="clr3"> {$iTickets Left}</div >
1161   </div>   1175   </div>
1162   <div class ="cls_res_ info">   1176   <div class ="cls_res_ info">
1163       {$sTic ketPriceC} : <div cla ss="clr3"> {$sTicketP rice}</div >   1177       {$sTic ketPriceC} : <div cla ss="clr3"> {$sTicketP rice}</div >
1164   </div>   1178   </div>
1165   <tr class= "panel">   1179   <tr class= "panel">
1166       <td co lspan="2"  align="cen ter" class ="profile_ header"><b >{$sSaleSt atusC}</b> </td>   1180       <td co lspan="2"  align="cen ter" class ="profile_ header"><b >{$sSaleSt atusC}</b> </td>
1167   </tr>   1181   </tr>
1168   <!-- <tr>   1182   <!-- <tr>
1169       <td co lspan="2"  align="lef t" class=" profile_td _2">   1183       <td co lspan="2"  align="lef t" class=" profile_td _2">
1170           {$ sInnerData }   1184           {$ sInnerData }
1171       </td>   1185       </td>
1172   </tr> -->   1186   </tr> -->
1173   EOF;   1187   EOF;
1174     1188  
1175                 $sStatusSe ct  
=   <<<EOF
  1189                 $sStatusSe ct FDB   =   <<<EOF
    1190   <div class ="cls_res_ info">
    1191       <div c lass="clr3 ">{$sStatu sMessage}< /div>
    1192   </div>
    1193   <div class ="clear_bo th"></div>
    1194   EOF;
    1195  
    1196                $sStatus Sect = Des ignBoxCont ent($sStat usC, $sSta tusSectFDB , 1);
    1197                /*$sStat usSect = < <<EOF
1176   <div class ="disignBo xFirst">   1198   <div class ="disignBo xFirst">
1177       <div c lass="boxF irstHeader ">   1199       <div c lass="boxF irstHeader ">
1178           {$ sStatusC}   1200           {$ sStatusC}
1179       </div>   1201       </div>
1180       <div c lass="boxC ontent">   1202       <div c lass="boxC ontent">
1181           <d iv class=" cls_res_in fo">   1203           <d iv class=" cls_res_in fo">
1182                <div cla ss="clr3"> {$sStatusM essage}</d iv>   1204                <div cla ss="clr3"> {$sStatusM essage}</d iv>
1183           </ div>   1205           </ div>
1184           <d iv class=" clear_both "></div>   1206           <d iv class=" clear_both "></div>
1185       </div>   1207       </div>
1186   </div>   1208   </div>
1187   EOF;
  1209   EOF; */
1188           }   1210           }
1189     1211  
1190            $sImageSec t  
=   <<<EOF
  1212            $sImageSec t FDB   =   <<<EOF
    1213   <div class ="photoBlo ck">
    1214       {$sPic Element}
    1215   </div>
    1216   <div class ="clear_bo th"></div>
    1217   EOF;
    1218           $s ImageSect  = DesignBo xContent($ sEventC.'  '.$sPictur eC, $sImag eSectFDB,  1);
    1219           /* $sImageSec t = <<<EOF
1191   <div class ="disignBo xFirst">   1220   <div class ="disignBo xFirst">
1192       <div c lass="boxF irstHeader ">   1221       <div c lass="boxF irstHeader ">
1193           {$ sEventC} { $sPictureC }   1222           {$ sEventC} { $sPictureC }
1194       </div>   1223       </div>
1195       <div c lass="boxC ontent">   1224       <div c lass="boxC ontent">
1196           <d iv class=" photoBlock ">   1225           <d iv class=" photoBlock ">
1197                {$sPicEl ement}   1226                {$sPicEl ement}
1198           </ div>   1227           </ div>
1199           <d iv class=" clear_both "></div>   1228           <d iv class=" clear_both "></div>
1200       </div>   1229       </div>
1201   </div>   1230   </div>
1202   EOF;
  1231   EOF; */
1203     1232  
1204            $sActionsS ect  
=   <<<EOF
  1233            $sActionsS ect FDB   =   <<<EOF
    1234   {$sUsersAc tions}
    1235   {$sActions }
    1236   <div class ="clear_bo th"></div>
    1237   EOF;
    1238           $s ActionsSec t = Design BoxContent ($sActions C, $sActio nsSectFDB,  1);
    1239           /* $sActionsS ect = <<<E OF
1205   <div class ="disignBo xFirst">   1240   <div class ="disignBo xFirst">
1206       <div c lass="boxF irstHeader ">   1241       <div c lass="boxF irstHeader ">
1207           {$ sActionsC}   1242           {$ sActionsC}
1208       </div>   1243       </div>
1209       <div c lass="boxC ontent">   1244       <div c lass="boxC ontent">
1210           {$ sUsersActi ons}   1245           {$ sUsersActi ons}
1211           {$ sActions}   1246           {$ sActions}
1212           <d iv class=" clear_both "></div>   1247           <d iv class=" clear_both "></div>
1213       </div>   1248       </div>
1214   </div>   1249   </div>
1215   EOF;
  1250   EOF; */
1216     1251  
1217           $s EventsStar t = _forma t_when($aE ventData[' sec']);   1252           $s EventsStar t = _forma t_when($aE ventData[' sec']);
1218           $d ate_format _php = get Param('php _date_form at');   1253           $d ate_format _php = get Param('php _date_form at');
1219           
$sDateTime   =   date(   $date_form at_php,   strtotime(   $aEventDat a['EventSt art']   )   );
  1254            // $sDateTime   =   date(   $date_form at_php,   strtotime(   $aEventDat a['EventSt art']   )   );
    1255           $s DateTime =  LocaledDa taTime($aE ventData[' EventStart _UTS']);
1220     1256  
1221            $sSubjectS ect  
=   <<<EOF
  1257            $sSubjectS ect FDB   =   <<<EOF
    1258   <div class ="cls_res_ info">
    1259       {$sCou ntryC}: <d iv class=" clr3">{$sC ountryPic} </div>
    1260   </div>
    1261   <div class ="cls_res_ info">
    1262       {$sCit yC}: <div  class="clr 3">{$sCity }</div>
    1263   </div>
    1264   <div class ="cls_res_ info">
    1265       {$sPla ceC}: <div  class="cl r3">{$sPla ce}</div>
    1266   </div>
    1267   <div class ="cls_res_ info">
    1268       {$sDat eC}: <div  class="clr 3">{$sDate Time} ({$s EventsStar t})</div>
    1269   </div>
    1270   {$sAdminTi cketsPart}
    1271   <div class ="cls_res_ info">
    1272       {$sPos tedByC}: < div class= "clr3">{$s PostedByHr ef}</div>
    1273   </div>
    1274   {$sAdminTi cketsPart2 }
    1275   <div class ="clear_bo th"></div>
    1276   EOF;
    1277           $s SubjectSec t = Design BoxContent ($sTitle,  $sSubjectS ectFDB, 1) ;
    1278           /* $sSubjectS ect = <<<E OF
1222   <div class ="disignBo xFirst">   1279   <div class ="disignBo xFirst">
1223       <div c lass="boxF irstHeader ">   1280       <div c lass="boxF irstHeader ">
1224           {$ sTitle}   1281           {$ sTitle}
1225       </div>   1282       </div>
1226       <div c lass="boxC ontent">   1283       <div c lass="boxC ontent">
1227           <d iv class=" cls_res_in fo">   1284           <d iv class=" cls_res_in fo">
1228                {$sCount ryC}: <div  class="cl r3">{$sCou ntryPic}</ div>   1285                {$sCount ryC}: <div  class="cl r3">{$sCou ntryPic}</ div>
1229           </ div>   1286           </ div>
1230           <d iv class=" cls_res_in fo">   1287           <d iv class=" cls_res_in fo">
1231                {$sCityC }: <div cl ass="clr3" >{$sCity}< /div>   1288                {$sCityC }: <div cl ass="clr3" >{$sCity}< /div>
1232           </ div>   1289           </ div>
1233           <d iv class=" cls_res_in fo">   1290           <d iv class=" cls_res_in fo">
1234                {$sPlace C}: <div c lass="clr3 ">{$sPlace }</div>   1291                {$sPlace C}: <div c lass="clr3 ">{$sPlace }</div>
1235           </ div>   1292           </ div>
1236           <d iv class=" cls_res_in fo">   1293           <d iv class=" cls_res_in fo">
1237                {$sDateC }: <div cl ass="clr3" >{$sDateTi me} ({$sEv entsStart} )</div>   1294                {$sDateC }: <div cl ass="clr3" >{$sDateTi me} ({$sEv entsStart} )</div>
1238           </ div>   1295           </ div>
1239           {$ sAdminTick etsPart}   1296           {$ sAdminTick etsPart}
1240           <d iv class=" cls_res_in fo">   1297           <d iv class=" cls_res_in fo">
1241                {$sPoste dByC}: <di v class="c lr3">{$sPo stedByHref }</div>   1298                {$sPoste dByC}: <di v class="c lr3">{$sPo stedByHref }</div>
1242           </ div>   1299           </ div>
1243           {$ sAdminTick etsPart2}   1300           {$ sAdminTick etsPart2}
1244           <d iv class=" clear_both "></div>   1301           <d iv class=" clear_both "></div>
1245       </div>   1302       </div>
1246   </div>   1303   </div>
1247   EOF;
  1304   EOF; */
1248     1305  
1249            $sDescript ionSect  
=   <<<EOF
  1306            $sDescript ionSect FDB   =   <<<EOF
    1307   <div class ="cls_res_ info">
    1308       <div c lass="clr3 ">{$sDescr iption}</d iv>
    1309   </div>
    1310   <div class ="clear_bo th"></div>
    1311   EOF;
    1312           $s Descriptio nSect = De signBoxCon tent($sDes criptionC,  $sDescrip tionSectFD B, 1);
    1313           /* $sDescript ionSect =  <<<EOF
1250   <div class ="disignBo xFirst">   1314   <div class ="disignBo xFirst">
1251       <div c lass="boxF irstHeader ">   1315       <div c lass="boxF irstHeader ">
1252           {$ sDescripti onC}   1316           {$ sDescripti onC}
1253       </div>   1317       </div>
1254       <div c lass="boxC ontent">   1318       <div c lass="boxC ontent">
1255           <d iv class=" cls_res_in fo">   1319           <d iv class=" cls_res_in fo">
1256                <div cla ss="clr3"> {$sDescrip tion}</div >   1320                <div cla ss="clr3"> {$sDescrip tion}</div >
1257           </ div>   1321           </ div>
1258           <d iv class=" clear_both "></div>   1322           <d iv class=" clear_both "></div>
1259       </div>   1323       </div>
1260   </div>   1324   </div>
1261   EOF;
  1325   EOF; */
1262     1326  
1263           $s GenUrlP =  $this->gen Url($iEven tID, $aEve ntData['En tryUri'],  'part');   1327           $s GenUrlP =  $this->gen Url($iEven tID, $aEve ntData['En tryUri'],  'part');
1264     1328  
1265            $sParticip antsSect  
=   <<<EOF
  1329            $sParticip antsSect FDB   =   <<<EOF
    1330   {$sPartici pants}
    1331   <div class ="clear_bo th"></div>
    1332   <div class ="padds" s tyle="heig ht:23px;ve rtical-ali gn:middle; ">
    1333       <span  style="ver tical-alig n: middle; ">
    1334           <i mg src="{$ site['icon s']}grs.gi f" alt=""  title="" c lass="marg _icon" />
    1335       </span >
    1336       <span>
    1337           <a  class="ac tions" hre f="{$sGenU rlP}">
    1338                {$sListO fParticipa ntsC}
    1339           </ a>
    1340       </span >
    1341   </div>
    1342   EOF;
    1343           $s Participan tsSect = D esignBoxCo ntent($sPa rticipants C, $sParti cipantsSec tFDB, 1);
    1344           /* $sParticip antsSect =  <<<EOF
1266   <div class ="disignBo xFirst">   1345   <div class ="disignBo xFirst">
1267       <div c lass="boxF irstHeader ">   1346       <div c lass="boxF irstHeader ">
1268           {$ sParticipa ntsC}   1347           {$ sParticipa ntsC}
1269       </div>   1348       </div>
1270       <div c lass="boxC ontent">   1349       <div c lass="boxC ontent">
1271           {$ sParticipa nts}   1350           {$ sParticipa nts}
1272           <d iv class=" clear_both "></div>   1351           <d iv class=" clear_both "></div>
1273           <d iv class=" padds" sty le="height :23px;vert ical-align :middle;">   1352           <d iv class=" padds" sty le="height :23px;vert ical-align :middle;">
1274                <span st yle="verti cal-align:  middle;">   1353                <span st yle="verti cal-align:  middle;">
1275                    <img  src="{$si te['icons' ]}grs.gif"  alt="" ti tle="" cla ss="marg_i con" />   1354                    <img  src="{$si te['icons' ]}grs.gif"  alt="" ti tle="" cla ss="marg_i con" />
1276                </span>   1355                </span>
1277                <span>   1356                <span>
1278                    <a c lass="acti ons" href= "{$sGenUrl P}">   1357                    <a c lass="acti ons" href= "{$sGenUrl P}">
1279                         {$sListOfP articipant sC}   1358                         {$sListOfP articipant sC}
1280                    </a>   1359                    </a>
1281                </span>   1360                </span>
1282           </ div>   1361           </ div>
1283       </div>   1362       </div>
1284   </div>   1363   </div>
1285   EOF;
  1364   EOF; */
1286     1365  
1287            $sTagsSect  
=   <<<EOF
  1366            $sTagsSect FDB   =   <<<EOF
    1367   {$sTagsVal s}
    1368   <div class ="clear_bo th"></div>
    1369   EOF;
    1370           $s TagsSect =  ($sTagsVa ls=='') ?  '' : Desig nBoxConten t("<div cl ass=\"cls_ res_thumb\ ">{$sTagsC }</div>",  $sTagsSect FDB, 1);
    1371           /* $sTagsSect  = <<<EOF
1288   <div class ="disignBo xFirst">   1372   <div class ="disignBo xFirst">
1289       <div c lass="boxF irstHeader ">   1373       <div c lass="boxF irstHeader ">
1290           <d iv class=" cls_res_th umb">   1374           <d iv class=" cls_res_th umb">
1291                {$sTagsC }   1375                {$sTagsC }
1292           </ div>   1376           </ div>
1293       </div>   1377       </div>
1294       <div c lass="boxC ontent">   1378       <div c lass="boxC ontent">
1295           {$ sTagsVals}   1379           {$ sTagsVals}
1296           <d iv class=" clear_both "></div>   1380           <d iv class=" clear_both "></div>
1297       </div>   1381       </div>
1298   </div>   1382   </div>
1299   EOF;
  1383   EOF; */
1300     1384  
1301           $s GenUrlJ =  $this->gen Url($iEven tID, $aEve ntData['En tryUri']);   1385           $s GenUrlJ =  $this->gen Url($iEven tID, $aEve ntData['En tryUri']);
1302     1386  
1303           $s RetHtml .=  <<<EOF   1387           $s RetHtml .=  <<<EOF
1304   <form id=" JoinEventF orm" actio n="{$sGenU rlJ}" meth od="post">   1388   <form id=" JoinEventF orm" actio n="{$sGenU rlJ}" meth od="post">
1305       <input  type="hid den" name= "join_even t" value=" on" />   1389       <input  type="hid den" name= "join_even t" value=" on" />
1306   </form>   1390   </form>
1307   <form id=" Unsubscrib eEventForm " action=" {$sGenUrlJ }" method= "post">   1391   <form id=" Unsubscrib eEventForm " action=" {$sGenUrlJ }" method= "post">
1308       <input  type="hid den" name= "unsubscri be_event"  value="on"  />   1392       <input  type="hid den" name= "unsubscri be_event"  value="on"  />
1309   </form>   1393   </form>
1310   <!--{$sBre adCrumbs}- ->   1394   <!--{$sBre adCrumbs}- ->
1311   {$sErrElem s}   1395   {$sErrElem s}
1312   <div>   1396   <div>
1313       <div c lass="clea r_both"></ div>   1397       <div c lass="clea r_both"></ div>
1314       <div c lass="cls_ info_left" >   1398       <div c lass="cls_ info_left" >
1315           {$ sImageSect }   1399           {$ sImageSect }
1316           {$ sActionsSe ct}   1400           {$ sActionsSe ct}
1317       </div>   1401       </div>
1318       <div c lass="cls_ info">   1402       <div c lass="cls_ info">
1319           {$ sSubjectSe ct}   1403           {$ sSubjectSe ct}
1320           {$ sDescripti onSect}   1404           {$ sDescripti onSect}
1321           {$ sStatusSec t}   1405           {$ sStatusSec t}
1322           {$ sParticipa ntsSect}   1406           {$ sParticipa ntsSect}
1323           {$ sTagsSect}   1407           {$ sTagsSect}
1324       </div>   1408       </div>
1325       <div c lass="clea r_both"></ div>   1409       <div c lass="clea r_both"></ div>
1326   </div>   1410   </div>
1327   <div class ="clear_bo th"></div>   1411   <div class ="clear_bo th"></div>
1328   EOF;   1412   EOF;
1329     1413  
1330           re turn $sRet Html;   1414           re turn $sRet Html;
1331       }   1415       }
1332     1416  
1333       /**   1417       /**
1334        * pag e show par ticipants  function   1418        * pag e show par ticipants  function
1335        * @re turn HTML  presentati on of data   1419        * @re turn HTML  presentati on of data
1336        */   1420        */
1337       functi on PageSDa tingShowPa rticipants () {   1421       functi on PageSDa tingShowPa rticipants () {
1338           gl obal $site ;   1422           gl obal $site ;
1339           gl obal $oTem plConfig;   1423           gl obal $oTem plConfig;
1340     1424  
1341           $s YOC = _t(' _y/o');   1425           $s YOC = _t(' _y/o');
1342     1426  
1343           $s RetHtml =  '';   1427           $s RetHtml =  '';
1344           $s EventParti cipantsC =  _t('_Even t particip ants');   1428           $s EventParti cipantsC =  _t('_Even t particip ants');
1345           $s ListOfPart icipantsC  = _t('_Lis t').' '._t ('_of').'  '._t('_Par ticipants' );   1429           $s ListOfPart icipantsC  = _t('_Lis t').' '._t ('_of').'  '._t('_Par ticipants' );
1346     1430  
1347           //  collect i nformation  about cur rent membe r   1431           //  collect i nformation  about cur rent membe r
1348           if ( $logged[ 'member']  ) {   1432           if ( $logged[ 'member']  ) {
1349                $aMember ['ID'] = ( int)$_COOK IE['member ID'];   1433                $aMember ['ID'] = ( int)$_COOK IE['member ID'];
1350                $aMember Data = get ProfileInf o( $aMembe r['ID'] );   1434                $aMember Data = get ProfileInf o( $aMembe r['ID'] );
1351           }  else   1435           }  else
1352                $aMember ['ID'] = 0 ;   1436                $aMember ['ID'] = 0 ;
1353     1437  
1354           $a Membership  = getMemb erMembersh ipInfo( $a Member['ID '] );   1438           $a Membership  = getMemb erMembersh ipInfo( $a Member['ID '] );
1355     1439  
1356           /* $iEventID  = (int)$_R EQUEST['ev ent_id'];* /   1440           /* $iEventID  = (int)$_R EQUEST['ev ent_id'];* /
1357           $i EventID =  ($this->bU seFriendly Links) ? ( int)db_val ue("SELECT  `ID` FROM  `SDatingE vents` WHE RE `EntryU ri`='" . $ this->proc ess_html_d b_input($_ REQUEST['e ventUri'])  . "' LIMI T 1") : (i nt)$_REQUE ST['event_ id'];   1441           $i EventID =  ($this->bU seFriendly Links) ? ( int)db_val ue("SELECT  `ID` FROM  `SDatingE vents` WHE RE `EntryU ri`='" . $ this->proc ess_html_d b_input($_ REQUEST['e ventUri'])  . "' LIMI T 1") : (i nt)$_REQUE ST['event_ id'];
1358     1442  
1359           $s Query = "   1443           $s Query = "
1360                SELECT ` ID`, `Titl e`,   1444                SELECT ` ID`, `Titl e`,
1361                    (NOW () > `Even tEnd` AND  NOW() < DA TE_ADD(`Ev entEnd`, I NTERVAL `C hoosePerio d` DAY)) A S `ChooseA ctive`   1445                    (NOW () > `Even tEnd` AND  NOW() < DA TE_ADD(`Ev entEnd`, I NTERVAL `C hoosePerio d` DAY)) A S `ChooseA ctive`
1362                FROM `SD atingEvent s`   1446                FROM `SD atingEvent s`
1363                WHERE   1447                WHERE
1364                    `ID`  = {$iEven tID} AND ` Status` =  'Active' A ND `AllowV iewPartici pants` = 1 ";   1448                    `ID`  = {$iEven tID} AND ` Status` =  'Active' A ND `AllowV iewPartici pants` = 1 ";
1365           $a EventData  = db_arr(  $sQuery );   1449           $a EventData  = db_arr(  $sQuery );
1366           if  ( !$aEven tData['ID' ] )   1450           if  ( !$aEven tData['ID' ] )
1367                return D esignBoxCo ntent( '',  '<center> '. _t('_Ev ent is una vailable')  .'</cente r>', $oTem plConfig - > PageSDat ingShowPar ticipants_ db_num );   1451                return D esignBoxCo ntent( '',  '<center> '. _t('_Ev ent is una vailable')  .'</cente r>', $oTem plConfig - > PageSDat ingShowPar ticipants_ db_num );
1368     1452  
1369           $s RetHtml .=  '<div cla ss="text"> '.process_ line_outpu t($aEventD ata['Title ']).'</div >';   1453           $s RetHtml .=  '<div cla ss="text"> '.process_ line_outpu t($aEventD ata['Title ']).'</div >';
1370     1454  
1371           //  list of p articipant s   1455           //  list of p articipant s
1372           $a SelfPart =  db_arr( " SELECT `ID ` FROM `SD atingParti cipants`   1456           $a SelfPart =  db_arr( " SELECT `ID ` FROM `SD atingParti cipants`
1373                                          WHER E `IDEvent ` = $iEven tID   1457                                          WHER E `IDEvent ` = $iEven tID
1374                                          AND  `IDMember`  = {$aMemb er['ID']}"  );   1458                                          AND  `IDMember`  = {$aMemb er['ID']}"  );
1375           $i PartPage =  (isset($_ REQUEST['p art_page'] )) ? (int) $_REQUEST[ 'part_page '] : 1;   1459           $i PartPage =  (isset($_ REQUEST['p art_page'] )) ? (int) $_REQUEST[ 'part_page '] : 1;
1376           $i PartPPerPa ge = (isse t($_REQUES T['part_p_ per_page'] )) ? (int) $_REQUEST[ 'part_p_pe r_page'] :  30;   1460           $i PartPPerPa ge = (isse t($_REQUES T['part_p_ per_page'] )) ? (int) $_REQUEST[ 'part_p_pe r_page'] :  30;
1377           $i LimitFirst  = (int)($ iPartPage  - 1) * $iP artPPerPag e;   1461           $i LimitFirst  = (int)($ iPartPage  - 1) * $iP artPPerPag e;
1378           $v PartProfil esRes = db _res( "SEL ECT `Profi les`.*, `S DatingPart icipants`. `Participa ntUID` AS  `UID`   1462           $v PartProfil esRes = db _res( "SEL ECT `Profi les`.*, `S DatingPart icipants`. `Participa ntUID` AS  `UID`
1379                                               FROM `SDat ingPartici pants`   1463                                               FROM `SDat ingPartici pants`
1380                                               INNER JOIN  `Profiles ` ON `SDat ingPartici pants`.`ID Member` =  `Profiles` .`ID`   1464                                               INNER JOIN  `Profiles ` ON `SDat ingPartici pants`.`ID Member` =  `Profiles` .`ID`
1381                                               WHERE `SDa tingPartic ipants`.`I DEvent` =  $iEventID   1465                                               WHERE `SDa tingPartic ipants`.`I DEvent` =  $iEventID
1382                                               ORDER BY ` Profiles`. `NickName`   1466                                               ORDER BY ` Profiles`. `NickName`
1383                                               LIMIT $iLi mitFirst,  $iPartPPer Page" );   1467                                               LIMIT $iLi mitFirst,  $iPartPPer Page" );
1384           $a Total = db _arr( "SEL ECT COUNT( *) FROM `S DatingPart icipants`   1468           $a Total = db _arr( "SEL ECT COUNT( *) FROM `S DatingPart icipants`
1385                                          WHER E `SDating Participan ts`.`IDEve nt` = $iEv entID" );   1469                                          WHER E `SDating Participan ts`.`IDEve nt` = $iEv entID" );
1386     1470  
1387           $i PartProfil esTotal =  (int)$aTot al[0];   1471           $i PartProfil esTotal =  (int)$aTot al[0];
1388           $i PagesNum =  ceil( $iP artProfile sTotal / $ iPartPPerP age );   1472           $i PagesNum =  ceil( $iP artProfile sTotal / $ iPartPPerP age );
1389           $s GenUrlP =  $this->gen Url($iEven tID, '', ' part', tru e);   1473           $s GenUrlP =  $this->gen Url($iEven tID, '', ' part', tru e);
1390           $s PartGetUrl  = $sGenUr lP . (isse t($_REQUES T['part_p_ per_page'] ) ? '&amp; part_p_per _page='. ( int)$_REQU EST['part_ p_per_page '] : '');   1474           $s PartGetUrl  = $sGenUr lP . (isse t($_REQUES T['part_p_ per_page'] ) ? '&amp; part_p_per _page='. ( int)$_REQU EST['part_ p_per_page '] : '');
1391     1475  
1392           if  ( $iPartP rofilesTot al == 0 )  {   1476           if  ( $iPartP rofilesTot al == 0 )  {
1393                $sRetHtm l .= _t('_ There are  no partici pants for  this event ');   1477                $sRetHtm l .= _t('_ There are  no partici pants for  this event ');
1394           }  else {   1478           }  else {
1395                if ( $iP agesNum >  1 ) {   1479                if ( $iP agesNum >  1 ) {
1396                    $sRe tHtml .= ' <div class ="text">'. _t('_Pages ').':&nbsp ;';   1480                    $sRe tHtml .= ' <div class ="text">'. _t('_Pages ').':&nbsp ;';
1397     1481  
1398                    for  ( $i = 1;  $i <= $iPa gesNum; $i ++ ) {   1482                    for  ( $i = 1;  $i <= $iPa gesNum; $i ++ ) {
1399                         if ( $i ==  $iPartPag e )   1483                         if ( $i ==  $iPartPag e )
1400                             $sRetH tml .= "[{ $i}]&nbsp; ";   1484                             $sRetH tml .= "[{ $i}]&nbsp; ";
1401                         else   1485                         else
1402                             $sRetH tml .= "<a  href=\"{$ sPartGetUr l}&amp;par t_page={$i }\">{$i}</ a>&nbsp;";   1486                             $sRetH tml .= "<a  href=\"{$ sPartGetUr l}&amp;par t_page={$i }\">{$i}</ a>&nbsp;";
1403                    }   1487                    }
1404                    $sRe tHtml .= ' </div><br  />';   1488                    $sRe tHtml .= ' </div><br  />';
1405                }   1489                }
1406     1490  
1407                $sProfil esTrs = '' ;   1491                $sProfil esTrs = '' ;
1408                while (  $part_prof iles_arr =  mysql_fet ch_assoc($ vPartProfi lesRes) )  {   1492                while (  $part_prof iles_arr =  mysql_fet ch_assoc($ vPartProfi lesRes) )  {
1409                    $iUs erIsOnline  = get_use r_online_s tatus($par t_profiles _arr[ID]);   1493                    $iUs erIsOnline  = get_use r_online_s tatus($par t_profiles _arr[ID]);
1410                    $sCo nt = get_m ember_thum bnail($par t_profiles _arr['ID'] , 'none' )  . '<br /> <center>'  . getProfi leOnlineSt atus( $iUs erIsOnline  ) . '</ce nter>';   1494                    $sCo nt = get_m ember_thum bnail($par t_profiles _arr['ID'] , 'none' )  . '<br /> <center>'  . getProfi leOnlineSt atus( $iUs erIsOnline  ) . '</ce nter>';
1411                    //$s ProfilesTr s .= Desig nBoxConten tBorder( p rocess_lin e_output(  strmaxtext len( $part _profiles_ arr['NickN ame'], 11  ) ) . ': '  . age( $p art_profil es_arr['Da teOfBirth' ] ) . ' '  . _t('_y/o '), $sCont  );   1495                    //$s ProfilesTr s .= Desig nBoxConten tBorder( p rocess_lin e_output(  strmaxtext len( $part _profiles_ arr['NickN ame'], 11  ) ) . ': '  . age( $p art_profil es_arr['Da teOfBirth' ] ) . ' '  . _t('_y/o '), $sCont  );
1412                    $sTh umb = get_ member_thu mbnail($pa rt_profile s_arr['ID' ], 'none'  );   1496                    $sTh umb = get_ member_thu mbnail($pa rt_profile s_arr['ID' ], 'none'  );
1413                    $sPr ofLink = g etProfileL ink($part_ profiles_a rr['ID']);   1497                    $sPr ofLink = g etProfileL ink($part_ profiles_a rr['ID']);
1414                    $sAg e = age( $ part_profi les_arr['D ateOfBirth '] ). $sYO C;   1498                    $sAg e = age( $ part_profi les_arr['D ateOfBirth '] ). $sYO C;
1415                    $sPr ofilesTrs  .= <<<EOF   1499                    $sPr ofilesTrs  .= <<<EOF
1416   <div style ="float:le ft;text-al ign:center ;margin-ri ght:10px;p osition:re lative;">   1500   <div style ="float:le ft;text-al ign:center ;margin-ri ght:10px;p osition:re lative;">
1417       {$sThu mb}   1501       {$sThu mb}
1418       <div c lass="brow se_nick" s tyle="widt h:{$this-> iThumbSize }px;">   1502       <div c lass="brow se_nick" s tyle="widt h:{$this-> iThumbSize }px;">
1419           <a  href="{$s ProfLink}" >{$part_pr ofiles_arr ['NickName ']}</a>: { $sAge}   1503           <a  href="{$s ProfLink}" >{$part_pr ofiles_arr ['NickName ']}</a>: { $sAge}
1420       </div>   1504       </div>
1421   </div>   1505   </div>
1422   EOF;   1506   EOF;
1423                }   1507                }
1424     1508  
1425                $sNickna meC = _t(' _Nickname' );   1509                $sNickna meC = _t(' _Nickname' );
1426                $sDateOf BirthC = _ t('_DateOf Birth');   1510                $sDateOf BirthC = _ t('_DateOf Birth');
1427                $sSexC =  _t('_Sex' );   1511                $sSexC =  _t('_Sex' );
1428                $sEventU IDC = _t(' _Event UID ');   1512                $sEventU IDC = _t(' _Event UID ');
1429     1513  
1430                $sChoose Parts = '' ;   1514                $sChoose Parts = '' ;
1431                // show  'choose pa rticipants ' link onl y during c hoose peri od and if  member is  participan t of this  event   1515                // show  'choose pa rticipants ' link onl y during c hoose peri od and if  member is  participan t of this  event
1432                // if (  $this->bAd minMode==F ALSE || ($ aEventData ['ChooseAc tive'] &&  $aSelfPart ['ID'] ))  {   1516                // if (  $this->bAd minMode==F ALSE || ($ aEventData ['ChooseAc tive'] &&  $aSelfPart ['ID'] ))  {
1433                    // $ sChoosePar ts = '<div  class="te xt" align= "center">< a href="'. $_SERVER[' PHP_SELF'] .'?action= select_mat ch&amp;eve nt_id='.$i EventID.'" >'._t('_Ch oose parti cipants yo u liked'). '</a></div ><br />';   1517                    // $ sChoosePar ts = '<div  class="te xt" align= "center">< a href="'. $_SERVER[' PHP_SELF'] .'?action= select_mat ch&amp;eve nt_id='.$i EventID.'" >'._t('_Ch oose parti cipants yo u liked'). '</a></div ><br />';
1434                // }   1518                // }
1435     1519  
1436                $sPagesH ref = '';   1520                $sPagesH ref = '';
1437                if ( $iP agesNum >  1 ) {   1521                if ( $iP agesNum >  1 ) {
1438                    $sPa gesHref .=  '<div cla ss="text"> '._t('_Pag es').':&nb sp;';   1522                    $sPa gesHref .=  '<div cla ss="text"> '._t('_Pag es').':&nb sp;';
1439                    for  ( $i = 1;  $i <= $iPa gesNum; $i ++ ) {   1523                    for  ( $i = 1;  $i <= $iPa gesNum; $i ++ ) {
1440                         if ( $i ==  $iPartPag e )   1524                         if ( $i ==  $iPartPag e )
1441                             $sPage sHref .= " [{$i}]&nbs p;";   1525                             $sPage sHref .= " [{$i}]&nbs p;";
1442                         else   1526                         else
1443                             $sPage sHref .= " <a href=\" {$sPartGet Url}&amp;p art_page={ $i}\">{$i} </a>&nbsp; ";   1527                             $sPage sHref .= " <a href=\" {$sPartGet Url}&amp;p art_page={ $i}\">{$i} </a>&nbsp; ";
1444                    }   1528                    }
1445                    $sPa gesHref .=  '</div><b r />';   1529                    $sPa gesHref .=  '</div><b r />';
1446                }   1530                }
1447     1531  
1448                $sRetHtm l .= $sPro filesTrs .  $sPagesHr ef;   1532                $sRetHtm l .= $sPro filesTrs .  $sPagesHr ef;
1449           }   1533           }
1450           $s RetHtml .=  '<div cla ss="clear_ both"></di v>';   1534           $s RetHtml .=  '<div cla ss="clear_ both"></di v>';
1451     1535  
1452           re turn Desig nBoxConten t( $sListO fParticipa ntsC, $sRe tHtml, $oT emplConfig  -> PageSD atingShowP articipant s_db_num ) ;   1536           re turn Desig nBoxConten t( $sListO fParticipa ntsC, $sRe tHtml, $oT emplConfig  -> PageSD atingShowP articipant s_db_num ) ;
1453       }   1537       }
1454     1538  
1455       /**   1539       /**
1456        * pag e show fil er form fu nction   1540        * pag e show fil er form fu nction
1457        * @re turn HTML  presentati on of data   1541        * @re turn HTML  presentati on of data
1458        */   1542        */
1459       functi on PageSDa tingShowFo rm() {   1543       functi on PageSDa tingShowFo rm() {
1460           gl obal $aPre Values;   1544           gl obal $aPre Values;
1461           gl obal $oTem plConfig;   1545           gl obal $oTem plConfig;
1462           gl obal $enab le_event_c reating;   1546           gl obal $enab le_event_c reating;
1463           gl obal $logg ed;   1547           gl obal $logg ed;
1464     1548  
1465           $s ShowCalend arC = _t(' _Show cale ndar');   1549           $s ShowCalend arC = _t(' _Show cale ndar');
1466           $s AddNewEven tC = _t('_ Add new ev ent');   1550           $s AddNewEven tC = _t('_ Add new ev ent');
1467           $s ShowAllEve ntsC = _t( '_Show all  events');   1551           $s ShowAllEve ntsC = _t( '_Show all  events');
1468           $s ShowEvents ByCountryC  = _t('_Sh ow events  by country ');   1552           $s ShowEvents ByCountryC  = _t('_Sh ow events  by country ');
1469           $s ShowC = _t ('_Show');   1553           $s ShowC = _t ('_Show');
1470     1554  
1471           //  collect i nformation  about cur rent membe r   1555           //  collect i nformation  about cur rent membe r
1472           if ( $logged[ 'member']  ) {   1556           if ( $logged[ 'member']  ) {
1473                $aMember ['ID'] = ( int)$_COOK IE['member ID'];   1557                $aMember ['ID'] = ( int)$_COOK IE['member ID'];
1474                $aMember Data = get ProfileInf o( $aMembe r['ID'] );   1558                $aMember Data = get ProfileInf o( $aMembe r['ID'] );
1475           }   1559           }
1476              1560           
1477           $a Show = arr ay();   1561           $a Show = arr ay();
1478           $s CountryDis abled = 'd isabled="d isabled"';   1562           $s CountryDis abled = 'd isabled="d isabled"';
1479     1563  
1480           if  ( $_REQUE ST['show_e vents'] ==  'country'  ) {   1564           if  ( $_REQUE ST['show_e vents'] ==  'country'  ) {
1481                $aShow[' country']  = process_ pass_data( $_REQUEST[ 'show_even ts_country ']);   1565                $aShow[' country']  = process_ pass_data( $_REQUEST[ 'show_even ts_country ']);
1482                $sCountr yDisabled  = '';   1566                $sCountr yDisabled  = '';
1483           }   1567           }
1484     1568  
1485           $s BlockForCa lendarAndE ventDiv =  '';   1569           $s BlockForCa lendarAndE ventDiv =  '';
1486           if ( $oTemplC onfig -> c ustomize[' events'][' showTopBut tons'] ) {   1570           if ( $oTemplC onfig -> c ustomize[' events'][' showTopBut tons'] ) {
1487                $sBlockF orCalendar AndEventDi v .= <<<EO F   1571                $sBlockF orCalendar AndEventDi v .= <<<EO F
1488   <div align ="center"  class="blo ckForCalen darAndEven t">   1572   <div align ="center"  class="blo ckForCalen darAndEven t">
1489       <a hre f="{$_SERV ER['PHP_SE LF']}?acti on=calenda r">{$sShow CalendarC} </a>   1573       <a hre f="{$_SERV ER['PHP_SE LF']}?acti on=calenda r">{$sShow CalendarC} </a>
1490   EOF;   1574   EOF;
1491                if( $ena ble_event_ creating a nd $logged ['member']  ) {   1575                if( $ena ble_event_ creating a nd $logged ['member']  ) {
1492                    $sBl ockForCale ndarAndEve ntDiv .= " | <a href= \"{$_SERVE R['PHP_SEL F']}?actio n=new\">{$ sAddNewEve ntC}</a>";   1576                    $sBl ockForCale ndarAndEve ntDiv .= " | <a href= \"{$_SERVE R['PHP_SEL F']}?actio n=new\">{$ sAddNewEve ntC}</a>";
1493                }   1577                }
1494                $sBlockF orCalendar AndEventDi v .= '</di v>';   1578                $sBlockF orCalendar AndEventDi v .= '</di v>';
1495           }   1579           }
1496     1580  
1497           $s ShowEvents Chk = ($_R EQUEST['sh ow_events' ] == 'all' ) ? 'check ed="checke d"' : '';   1581           $s ShowEvents Chk = ($_R EQUEST['sh ow_events' ] == 'all' ) ? 'check ed="checke d"' : '';
1498           $s CountryChk  = ($_REQU EST['show_ events'] = = 'country ') ? 'chec ked="check ed"' : '';   1582           $s CountryChk  = ($_REQU EST['show_ events'] = = 'country ') ? 'chec ked="check ed"' : '';
1499     1583  
1500           $s CountryOpt ions = '';   1584           $s CountryOpt ions = '';
1501           $s SelCountry  = isset($ aShow['cou ntry']) ?  $aShow['co untry'] :  $aMemberDa ta['Countr y'];   1585           $s SelCountry  = isset($ aShow['cou ntry']) ?  $aShow['co untry'] :  $aMemberDa ta['Countr y'];
1502           fo reach ( $a PreValues[ 'Country']  as $key = > $value )  {   1586           fo reach ( $a PreValues[ 'Country']  as $key = > $value )  {
1503                $sCountr ySelected  = ( $sSelC ountry ==  $key ) ? ' selected=" selected"'  : '';   1587                $sCountr ySelected  = ( $sSelC ountry ==  $key ) ? ' selected=" selected"'  : '';
1504                $sCountr yOptions . = "<option  value=\"{ $key}\" ".  $sCountry Selected . " >". _t($ value['LKe y']) ."</o ption>";   1588                $sCountr yOptions . = "<option  value=\"{ $key}\" ".  $sCountry Selected . " >". _t($ value['LKe y']) ."</o ption>";
1505           }   1589           }
1506     1590  
1507       $sRetH tml = <<<E OF   1591       $sRetH tml = <<<E OF
1508   <center>   1592   <center>
1509       <scrip t language ="JavaScri pt" type=" text/javas cript">   1593       <scrip t language ="JavaScri pt" type=" text/javas cript">
1510       <!--   1594       <!--
1511           fu nction upd ateShowCon trols()   1595           fu nction upd ateShowCon trols()
1512           {   1596           {
1513                document .getElemen tById('sho w_events_s elect_id') .disabled  = !(docume nt.getElem entById('s how_events _country_i d').checke d);   1597                document .getElemen tById('sho w_events_s elect_id') .disabled  = !(docume nt.getElem entById('s how_events _country_i d').checke d);
1514           }   1598           }
1515       -->   1599       -->
1516       </scri pt>   1600       </scri pt>
1517       {$sBlo ckForCalen darAndEven tDiv}   1601       {$sBlo ckForCalen darAndEven tDiv}
1518       <form  id="showEv entsForm"  action="{$ _SERVER['P HP_SELF']} " method=" get">   1602       <form  id="showEv entsForm"  action="{$ _SERVER['P HP_SELF']} " method=" get">
1519           <t able cellp adding="4"  cellspaci ng="0" bor der="0" cl ass="text"  width="60 0">   1603           <t able cellp adding="4"  cellspaci ng="0" bor der="0" cl ass="text"  width="60 0">
1520                <tr>   1604                <tr>
1521                    <td  align="lef t" colspan ="2" class ="text">   1605                    <td  align="lef t" colspan ="2" class ="text">
1522                         <input typ e="radio"  name="show _events" i d="show_ev ents_all_i d" value=" all" style ="vertical -align: mi ddle;" onC lick="java script: up dateShowCo ntrols();"  {$sShowEv entsChk} / >   1606                         <input typ e="radio"  name="show _events" i d="show_ev ents_all_i d" value=" all" style ="vertical -align: mi ddle;" onC lick="java script: up dateShowCo ntrols();"  {$sShowEv entsChk} / >
1523                         &nbsp;<lab el for="sh ow_events_ all_id">{$ sShowAllEv entsC}</la bel>   1607                         &nbsp;<lab el for="sh ow_events_ all_id">{$ sShowAllEv entsC}</la bel>
1524                    </td >   1608                    </td >
1525                </tr>   1609                </tr>
1526                <tr>   1610                <tr>
1527                    <td  align="lef t" width=" 300" class ="text">   1611                    <td  align="lef t" width=" 300" class ="text">
1528                         <input typ e="radio"  name="show _events" i d="show_ev ents_count ry_id" val ue="countr y" style=" vertical-a lign: midd le;" onCli ck="javasc ript: upda teShowCont rols();"   {$sCountry Chk} />   1612                         <input typ e="radio"  name="show _events" i d="show_ev ents_count ry_id" val ue="countr y" style=" vertical-a lign: midd le;" onCli ck="javasc ript: upda teShowCont rols();"   {$sCountry Chk} />
1529                         &nbsp;<lab el for="sh ow_events_ country_id ">{$sShowE ventsByCou ntryC}</la bel>   1613                         &nbsp;<lab el for="sh ow_events_ country_id ">{$sShowE ventsByCou ntryC}</la bel>
1530                    </td >   1614                    </td >
1531                    <td  align="lef t" class=" text">   1615                    <td  align="lef t" class=" text">
1532                         <select cl ass="no" n ame="show_ events_cou ntry" id=" show_event s_select_i d" {$sCoun tryDisable d} >{$sCou ntryOption s}</select >   1616                         <select cl ass="no" n ame="show_ events_cou ntry" id=" show_event s_select_i d" {$sCoun tryDisable d} >{$sCou ntryOption s}</select >
1533                    </td >   1617                    </td >
1534                </tr>   1618                </tr>
1535           </ table>   1619           </ table>
1536           <b r />   1620           <b r />
1537           <i nput type= "submit" c lass="no"  value="{$s ShowC}" />   1621           <i nput type= "submit" c lass="no"  value="{$s ShowC}" />
1538           <i nput type= "hidden" n ame="actio n" value=" show" />   1622           <i nput type= "hidden" n ame="actio n" value=" show" />
1539           <i nput type= "hidden" n ame="from"  value="0"  />   1623           <i nput type= "hidden" n ame="from"  value="0"  />
1540       </form >   1624       </form >
1541   </center>   1625   </center>
1542   EOF;   1626   EOF;
1543     1627  
1544           re turn Desig nBoxConten t( _t('_Se lect event s to show' ), $sRetHt ml, $oTemp lConfig ->  PageSDati ngShowForm _db_num );   1628           re turn Desig nBoxConten t( _t('_Se lect event s to show' ), $sRetHt ml, $oTemp lConfig ->  PageSDati ngShowForm _db_num );
1545       }   1629       }
1546     1630  
1547       /**   1631       /**
1548        * pag e show fil er form fu nction   1632        * pag e show fil er form fu nction
1549        * @re turn HTML  presentati on of data   1633        * @re turn HTML  presentati on of data
1550        */   1634        */
1551       functi on PageSDa tingCalend ar() {   1635       functi on PageSDa tingCalend ar() {
1552           gl obal $dir;   1636           gl obal $dir;
1553           gl obal $site ;   1637           gl obal $site ;
1554           gl obal $sdat ingThumbWi dth;   1638           gl obal $sdat ingThumbWi dth;
1555           gl obal $sdat ingThumbHe ight;   1639           gl obal $sdat ingThumbHe ight;
1556           gl obal $aPre Values;   1640           gl obal $aPre Values;
1557           gl obal $oTem plConfig;   1641           gl obal $oTem plConfig;
1558     1642  
1559           $i PicSize =  $this->iIc onSize + 1 5;   1643           $i PicSize =  $this->iIc onSize + 1 5;
1560     1644  
1561           //  collect i nformation  about cur rent membe r   1645           //  collect i nformation  about cur rent membe r
1562           $a Member['ID '] = (int) $_COOKIE[' memberID'] ;   1646           $a Member['ID '] = (int) $_COOKIE[' memberID'] ;
1563           $a MemberData  = getProf ileInfo( $ aMember['I D'] );   1647           $a MemberData  = getProf ileInfo( $ aMember['I D'] );
1564           $s MemberSex  = $aMember Data['Sex' ];   1648           $s MemberSex  = $aMember Data['Sex' ];
1565           $a Membership  = getMemb erMembersh ipInfo( $a Member['ID '] );   1649           $a Membership  = getMemb erMembersh ipInfo( $a Member['ID '] );
1566     1650  
1567           //  now year,  month and  day   1651           //  now year,  month and  day
1568           li st($iNowYe ar, $iNowM onth, $iNo wDay) = ex plode( '-' , date('Y- m-d') );   1652           li st($iNowYe ar, $iNowM onth, $iNo wDay) = ex plode( '-' , date('Y- m-d') );
1569           //  current y ear, month , month na me, day, d ays in mon th   1653           //  current y ear, month , month na me, day, d ays in mon th
1570           if  ( isset($ _REQUEST[' month']) )  {   1654           if  ( isset($ _REQUEST[' month']) )  {
1571                list($iC urMonth, $ iCurYear)  = explode(  '-', $_RE QUEST['mon th'] );   1655                list($iC urMonth, $ iCurYear)  = explode(  '-', $_RE QUEST['mon th'] );
1572                $iCurMon th = (int) $iCurMonth ;   1656                $iCurMon th = (int) $iCurMonth ;
1573                $iCurYea r = (int)$ iCurYear;   1657                $iCurYea r = (int)$ iCurYear;
1574           }   1658           }
1575           el se {   1659           el se {
1576                list($iC urMonth, $ iCurYear)  = explode(  '-', date ('n-Y') );   1660                list($iC urMonth, $ iCurYear)  = explode(  '-', date ('n-Y') );
1577           }   1661           }
1578           li st($sCurMo nthName, $ iCurDaysIn Month) = e xplode( '- ', date('F -t', mktim e( 0, 0, 0 , $iCurMon th, $iNowD ay, $iCurY ear )) );   1662           li st($sCurMo nthName, $ iCurDaysIn Month) = e xplode( '- ', date('F -t', mktim e( 0, 0, 0 , $iCurMon th, $iNowD ay, $iCurY ear )) );
1579           //  previous  month year , month   1663           //  previous  month year , month
1580           $i PrevYear =  $iCurYear ;   1664           $i PrevYear =  $iCurYear ;
1581           $i PrevMonth  = $iCurMon th - 1;   1665           $i PrevMonth  = $iCurMon th - 1;
1582           if  ( $iPrevM onth <= 0  ) {   1666           if  ( $iPrevM onth <= 0  ) {
1583                $iPrevMo nth = 12;   1667                $iPrevMo nth = 12;
1584                $iPrevYe ar--;   1668                $iPrevYe ar--;
1585           }   1669           }
1586           //  next mont h year, mo nth   1670           //  next mont h year, mo nth
1587           $i NextYear =  $iCurYear ;   1671           $i NextYear =  $iCurYear ;
1588           $i NextMonth  = $iCurMon th + 1;   1672           $i NextMonth  = $iCurMon th + 1;
1589           if  ( $iNextM onth > 12  ) {   1673           if  ( $iNextM onth > 12  ) {
1590                $iNextMo nth = 1;   1674                $iNextMo nth = 1;
1591                $iNextYe ar++;   1675                $iNextYe ar++;
1592           }   1676           }
1593           //  days in p revious mo nth   1677           //  days in p revious mo nth
1594           $i PrevDaysIn Month = (i nt)date( ' t', mktime ( 0, 0, 0,  $iPrevMon th, $iNowD ay, $iPrev Year ) );   1678           $i PrevDaysIn Month = (i nt)date( ' t', mktime ( 0, 0, 0,  $iPrevMon th, $iNowD ay, $iPrev Year ) );
1595           //  days-of-w eek of fir st day in  current mo nth   1679           //  days-of-w eek of fir st day in  current mo nth
1596           $i FirstDayDo w = (int)d ate( 'w',  mktime( 0,  0, 0, $iC urMonth, 1 , $iCurYea r ) );   1680           $i FirstDayDo w = (int)d ate( 'w',  mktime( 0,  0, 0, $iC urMonth, 1 , $iCurYea r ) );
1597           //  from whic h day of p revious mo nth calend ar starts   1681           //  from whic h day of p revious mo nth calend ar starts
1598           $i PrevShowFr om = $iPre vDaysInMon th - $iFir stDayDow +  1;   1682           $i PrevShowFr om = $iPre vDaysInMon th - $iFir stDayDow +  1;
1599     1683  
1600           //  select ev ents array   1684           //  select ev ents array
1601           $a CalendarEv ents = arr ay();   1685           $a CalendarEv ents = arr ay();
1602           $s CountryFil ter = 'all ';   1686           $s CountryFil ter = 'all ';
1603           $s RCalendarC ountry = i sset($_REQ UEST['cale ndar_count ry']) ? $_ REQUEST['c alendar_co untry'] :  $aMemberDa ta['Countr y'];   1687           $s RCalendarC ountry = i sset($_REQ UEST['cale ndar_count ry']) ? $_ REQUEST['c alendar_co untry'] :  $aMemberDa ta['Countr y'];
1604           $s RCalendarC ountry = ( $sRCalenda rCountry== '') ? 'all ' : $sRCal endarCount ry ;   1688           $s RCalendarC ountry = ( $sRCalenda rCountry== '') ? 'all ' : $sRCal endarCount ry ;
1605           if  ( $sRCale ndarCountr y == 'all'  ) {   1689           if  ( $sRCale ndarCountr y == 'all'  ) {
1606                $sCountr yFilter =  '';   1690                $sCountr yFilter =  '';
1607           }   1691           }
1608           el se {   1692           el se {
1609                $sCountr yFilter =  'AND `Coun try` = \'' . process_ db_input($ sRCalendar Country) .  '\'';   1693                $sCountr yFilter =  'AND `Coun try` = \'' . process_ db_input($ sRCalendar Country) .  '\'';
1610           }   1694           }
1611     1695  
1612           // old WHERE  data`s   1696           // old WHERE  data`s
1613           /*   1697           /*
1614           AN D FIND_IN_ SET('{$sMe mberSex}',  `EventSex Filter`)   1698           AN D FIND_IN_ SET('{$sMe mberSex}',  `EventSex Filter`)
1615           AN D ( TO_DAY S('{$aMemb erData['Da teOfBirth' ]}')   1699           AN D ( TO_DAY S('{$aMemb erData['Da teOfBirth' ]}')
1616           BE TWEEN TO_D AYS(DATE_S UB(NOW(),  INTERVAL ` EventAgeUp perFilter`  YEAR))   1700           BE TWEEN TO_D AYS(DATE_S UB(NOW(),  INTERVAL ` EventAgeUp perFilter`  YEAR))
1617           AN D TO_DAYS( DATE_SUB(N OW(), INTE RVAL `Even tAgeLowerF ilter` YEA R)) )   1701           AN D TO_DAYS( DATE_SUB(N OW(), INTE RVAL `Even tAgeLowerF ilter` YEA R)) )
1618           AN D ( INSTR( `EventMemb ershipFilt er`, '\'al l\'') OR I NSTR(`Even tMembershi pFilter`,  '\'{$aMemb ership['ID ']}\'') )   1702           AN D ( INSTR( `EventMemb ershipFilt er`, '\'al l\'') OR I NSTR(`Even tMembershi pFilter`,  '\'{$aMemb ership['ID ']}\'') )
1619           */   1703           */
1620           $s Request =  "SELECT `I D`, `Title `, `PhotoF ilename`,  DAYOFMONTH (`EventSta rt`) AS `E ventDay`,  MONTH(`Eve ntStart`)  AS `EventM onth` FROM  `SDatingE vents`   1704           $s Request =  "SELECT `I D`, `Title `, `PhotoF ilename`,  DAYOFMONTH (`EventSta rt`) AS `E ventDay`,  MONTH(`Eve ntStart`)  AS `EventM onth` FROM  `SDatingE vents`
1621                                 WH ERE ( MONT H(`EventSt art`) = {$ iCurMonth}  AND YEAR( `EventStar t`) = {$iC urYear} OR   1705                                 WH ERE ( MONT H(`EventSt art`) = {$ iCurMonth}  AND YEAR( `EventStar t`) = {$iC urYear} OR
1622                                          MONT H( DATE_AD D(`EventSt art`, INTE RVAL 1 MON TH) ) = {$ iCurMonth}  AND YEAR(  DATE_ADD( `EventStar t`, INTERV AL 1 MONTH ) ) = {$iC urYear} OR   1706                                          MONT H( DATE_AD D(`EventSt art`, INTE RVAL 1 MON TH) ) = {$ iCurMonth}  AND YEAR(  DATE_ADD( `EventStar t`, INTERV AL 1 MONTH ) ) = {$iC urYear} OR
1623                                          MONT H( DATE_SU B(`EventSt art`, INTE RVAL 1 MON TH) ) = {$ iCurMonth}  AND YEAR(  DATE_SUB( `EventStar t`, INTERV AL 1 MONTH ) ) = {$iC urYear} )   1707                                          MONT H( DATE_SU B(`EventSt art`, INTE RVAL 1 MON TH) ) = {$ iCurMonth}  AND YEAR(  DATE_SUB( `EventStar t`, INTERV AL 1 MONTH ) ) = {$iC urYear} )
1624                                 {$ sCountryFi lter}   1708                                 {$ sCountryFi lter}
1625                                 AN D `Status`  = 'Active '   1709                                 AN D `Status`  = 'Active '
1626                                 ";   1710                                 ";
1627     1711  
1628           $v EventsRes  = db_res(  $sRequest  );   1712           $v EventsRes  = db_res(  $sRequest  );
1629           wh ile ( $aEv entData =  mysql_fetc h_assoc($v EventsRes)  ) {   1713           wh ile ( $aEv entData =  mysql_fetc h_assoc($v EventsRes)  ) {
1630                $aCalend arEvents[" {$aEventDa ta['EventD ay']}-{$aE ventData[' EventMonth ']}"][$aEv entData['I D']]['Titl e'] = $aEv entData['T itle'];   1714                $aCalend arEvents[" {$aEventDa ta['EventD ay']}-{$aE ventData[' EventMonth ']}"][$aEv entData['I D']]['Titl e'] = $aEv entData['T itle'];
1631                $aCalend arEvents[" {$aEventDa ta['EventD ay']}-{$aE ventData[' EventMonth ']}"][$aEv entData['I D']]['Phot oFilename' ] = $aEven tData['Pho toFilename '];   1715                $aCalend arEvents[" {$aEventDa ta['EventD ay']}-{$aE ventData[' EventMonth ']}"][$aEv entData['I D']]['Phot oFilename' ] = $aEven tData['Pho toFilename '];
1632           }   1716           }
1633     1717  
1634           //  make cale ndar grid   1718           //  make cale ndar grid
1635           $b PreviousMo nth = ($iF irstDayDow  > 0 ? tru e : false) ;   1719           $b PreviousMo nth = ($iF irstDayDow  > 0 ? tru e : false) ;
1636           $b NextMonth  = false;   1720           $b NextMonth  = false;
1637           $i CurrentDay  = ($bPrev iousMonth)  ? $iPrevS howFrom :  1;   1721           $i CurrentDay  = ($bPrev iousMonth)  ? $iPrevS howFrom :  1;
1638     1722  
1639           fo r ($i = 0;  $i < 6; $ i++) {   1723           fo r ($i = 0;  $i < 6; $ i++) {
1640                for ($j  = 0; $j <  7; $j++) {   1724                for ($j  = 0; $j <  7; $j++) {
1641                    $aCa lendarGrid [$i][$j][' day'] = $i CurrentDay ;   1725                    $aCa lendarGrid [$i][$j][' day'] = $i CurrentDay ;
1642                    $aCa lendarGrid [$i][$j][' month'] =  ($bPreviou sMonth ? $ iPrevMonth  : ($bNext Month ? $i NextMonth  : $iCurMon th));   1726                    $aCa lendarGrid [$i][$j][' month'] =  ($bPreviou sMonth ? $ iPrevMonth  : ($bNext Month ? $i NextMonth  : $iCurMon th));
1643                    $aCa lendarGrid [$i][$j][' current']  = (!$bPrev iousMonth  && !$bNext Month);   1727                    $aCa lendarGrid [$i][$j][' current']  = (!$bPrev iousMonth  && !$bNext Month);
1644                    $aCa lendarGrid [$i][$j][' today'] =  ($iNowYear  == $iCurY ear && $iN owMonth ==  $iCurMont h && $iNow Day == $iC urrentDay  && !$bPrev iousMonth  && !$bNext Month);   1728                    $aCa lendarGrid [$i][$j][' today'] =  ($iNowYear  == $iCurY ear && $iN owMonth ==  $iCurMont h && $iNow Day == $iC urrentDay  && !$bPrev iousMonth  && !$bNext Month);
1645                    // m ake day in crement   1729                    // m ake day in crement
1646                    $iCu rrentDay++ ;   1730                    $iCu rrentDay++ ;
1647                    if (  $bPreviou sMonth &&  $iCurrentD ay > $iPre vDaysInMon th ) {   1731                    if (  $bPreviou sMonth &&  $iCurrentD ay > $iPre vDaysInMon th ) {
1648                         $bPrevious Month = fa lse;   1732                         $bPrevious Month = fa lse;
1649                         $iCurrentD ay = 1;   1733                         $iCurrentD ay = 1;
1650                    }   1734                    }
1651                    if (  !$bPrevio usMonth &&  !$bNextMo nth && $iC urrentDay  > $iCurDay sInMonth )  {   1735                    if (  !$bPrevio usMonth &&  !$bNextMo nth && $iC urrentDay  > $iCurDay sInMonth )  {
1652                         $bNextMont h = true;   1736                         $bNextMont h = true;
1653                         $iCurrentD ay = 1;   1737                         $iCurrentD ay = 1;
1654                    }   1738                    }
1655                }   1739                }
1656           }   1740           }
1657     1741  
1658           $s ShowEvents ByCountryC  = _t('_Sh ow events  by country ');   1742           $s ShowEvents ByCountryC  = _t('_Sh ow events  by country ');
1659           $s AllC = _t( '_All');   1743           $s AllC = _t( '_All');
1660           $s PrevC = _t ('_Prev');   1744           $s PrevC = _t ('_Prev');
1661           $s NextC = _t ('_Next');   1745           $s NextC = _t ('_Next');
1662           $s SundaySC =  _t('_Sund ay_short') ;   1746           $s SundaySC =  _t('_Sund ay_short') ;
1663           $s MondaySC =  _t('_Mond ay_short') ;   1747           $s MondaySC =  _t('_Mond ay_short') ;
1664           $s TuesdaySC  = _t('_Tue sday_short ');   1748           $s TuesdaySC  = _t('_Tue sday_short ');
1665           $s WednesdayS C = _t('_W ednesday_s hort');   1749           $s WednesdayS C = _t('_W ednesday_s hort');
1666           $s ThursdaySC  = _t('_Th ursday_sho rt');   1750           $s ThursdaySC  = _t('_Th ursday_sho rt');
1667           $s FridaySC =  _t('_Frid ay_short') ;   1751           $s FridaySC =  _t('_Frid ay_short') ;
1668           $s SaturdaySC  = _t('_Sa turday_sho rt');   1752           $s SaturdaySC  = _t('_Sa turday_sho rt');
1669           $s NoPhotoC =  _t('_No p hoto');   1753           $s NoPhotoC =  _t('_No p hoto');
1670           $s CalendarC  = _t('_Cal endar');   1754           $s CalendarC  = _t('_Cal endar');
1671     1755  
1672           $s CalendarOp tions = '' ;   1756           $s CalendarOp tions = '' ;
1673           $s CalSel = (  $sRCalend arCountry  == 'all' )  ? 'select ed="select ed"' : '';   1757           $s CalSel = (  $sRCalend arCountry  == 'all' )  ? 'select ed="select ed"' : '';
1674           $s CalendarOp tions .= ' <option va lue="all"  '. $sCalSe l ." >{$sA llC}</opti on>";   1758           $s CalendarOp tions .= ' <option va lue="all"  '. $sCalSe l ." >{$sA llC}</opti on>";
1675           fo reach ( $a PreValues[ 'Country']  as $key = > $value )  {   1759           fo reach ( $a PreValues[ 'Country']  as $key = > $value )  {
1676                $sCalKey Sel = ( $s RCalendarC ountry ==  "{$key}" )  ? 'select ed="select ed"' : '';   1760                $sCalKey Sel = ( $s RCalendarC ountry ==  "{$key}" )  ? 'select ed="select ed"' : '';
1677                $sCuontr yVal = _t( $value['LK ey']);   1761                $sCuontr yVal = _t( $value['LK ey']);
1678                $sCalend arOptions  .= "<optio n value=\" {$key}\" { $sCalKeySe l} >{$sCuo ntryVal}</ option>";   1762                $sCalend arOptions  .= "<optio n value=\" {$key}\" { $sCalKeySe l} >{$sCuo ntryVal}</ option>";
1679           }   1763           }
1680     1764  
1681           $s CalendarCo untry = (i sset($_REQ UEST['cale ndar_count ry'])) ? ' &amp;calen dar_countr y='. proce ss_pass_da ta($_REQUE ST['calend ar_country ']) : '';   1765           $s CalendarCo untry = (i sset($_REQ UEST['cale ndar_count ry'])) ? ' &amp;calen dar_countr y='. proce ss_pass_da ta($_REQUE ST['calend ar_country ']) : '';
1682           $s CalendarPr evHref = $ _SERVER['P HP_SELF']. "?action=c alendar&am p;month={$ iPrevMonth }-{$iPrevY ear}".$sCa lendarCoun try;   1766           $s CalendarPr evHref = $ _SERVER['P HP_SELF']. "?action=c alendar&am p;month={$ iPrevMonth }-{$iPrevY ear}".$sCa lendarCoun try;
1683           $s CurMonYear  = _t('_'. $sCurMonth Name) .',  '. $iCurYe ar;   1767           $s CurMonYear  = _t('_'. $sCurMonth Name) .',  '. $iCurYe ar;
1684           $s CalendarNe xtHref = $ _SERVER['P HP_SELF']. "?action=c alendar&am p;month={$ iNextMonth }-{$iNextY ear}".$sCa lendarCoun try;   1768           $s CalendarNe xtHref = $ _SERVER['P HP_SELF']. "?action=c alendar&am p;month={$ iNextMonth }-{$iNextY ear}".$sCa lendarCoun try;
1685     1769  
1686           $s CalTableTr s = '';   1770           $s CalTableTr s = '';
1687           fo r ($i = 0;  $i < 6; $ i++) {   1771           fo r ($i = 0;  $i < 6; $ i++) {
1688                $sCalTab leTrs .= ' <tr>';   1772                $sCalTab leTrs .= ' <tr>';
1689                for ($j  = 0; $j <  7; $j++) {   1773                for ($j  = 0; $j <  7; $j++) {
1690                    if (  $aCalenda rGrid[$i][ $j]['today '] )   1774                    if (  $aCalenda rGrid[$i][ $j]['today '] )
1691                         $sCellClas s = 'calen dar_today' ;   1775                         $sCellClas s = 'calen dar_today' ;
1692                    else if ( $aCal endarGrid[ $i][$j]['c urrent'] )   1776                    else if ( $aCal endarGrid[ $i][$j]['c urrent'] )
1693                         $sCellClas s = 'calen dar_curren t';   1777                         $sCellClas s = 'calen dar_curren t';
1694                    else   1778                    else
1695                         $sCellClas s = 'calen dar_non_cu rrent';   1779                         $sCellClas s = 'calen dar_non_cu rrent';
1696     1780  
1697                    $sCa lTableTrs  .= <<<EOF   1781                    $sCa lTableTrs  .= <<<EOF
1698   <td style= "width:100 px;height: 100px;" cl ass="{$sCe llClass}"> {$aCalenda rGrid[$i][ $j]['day'] }   1782   <td style= "width:100 px;height: 100px;" cl ass="{$sCe llClass}"> {$aCalenda rGrid[$i][ $j]['day'] }
1699   EOF;   1783   EOF;
1700     1784  
1701                    $vDa yMonthValu e = $aCale ndarGrid[$ i][$j]['da y'] .'-'.   $aCalenda rGrid[$i][ $j]['month '];   1785                    $vDa yMonthValu e = $aCale ndarGrid[$ i][$j]['da y'] .'-'.   $aCalenda rGrid[$i][ $j]['month '];
1702                    if (  isset($aC alendarEve nts[$vDayM onthValue] ) && is_ar ray($aCale ndarEvents [$vDayMont hValue]) )  {   1786                    if (  isset($aC alendarEve nts[$vDayM onthValue] ) && is_ar ray($aCale ndarEvents [$vDayMont hValue]) )  {
1703                         foreach (  $aCalendar Events[$vD ayMonthVal ue] as $ev entID => $ eventArr )  {   1787                         foreach (  $aCalendar Events[$vD ayMonthVal ue] as $ev entID => $ eventArr )  {
1704                             $sEven tThumbname  = getThum bNameByPic tureName($ eventArr[' PhotoFilen ame'], tru e);   1788                             $sEven tThumbname  = getThum bNameByPic tureName($ eventArr[' PhotoFilen ame'], tru e);
1705                             $sGenU rl = $this ->genUrl($ eventID, ' ', 'entry' , true);   1789                             $sGenU rl = $this ->genUrl($ eventID, ' ', 'entry' , true);
1706     1790  
1707                             if ( s trlen(trim ($sEventTh umbname))  && file_ex ists($dir[ 'sdatingIm age'] . $s EventThumb name) ) {   1791                             if ( s trlen(trim ($sEventTh umbname))  && file_ex ists($dir[ 'sdatingIm age'] . $s EventThumb name) ) {
1708                                 $s CalTableTr s .= <<<EO F   1792                                 $s CalTableTr s .= <<<EO F
1709   <div>   1793   <div>
1710   <a href="{ $sGenUrl}" >   1794   <a href="{ $sGenUrl}" >
1711       <img s rc="{$site ['sdatingI mage']}ico n_{$eventA rr['PhotoF ilename']} " border=" 0" alt="{$ eventArr[' Title']}"  title="{$e ventArr['T itle']}" s tyle="marg in: 2px;"  />   1795       <img s rc="{$site ['sdatingI mage']}ico n_{$eventA rr['PhotoF ilename']} " border=" 0" alt="{$ eventArr[' Title']}"  title="{$e ventArr['T itle']}" s tyle="marg in: 2px;"  />
1712   </a>   1796   </a>
1713   </div>   1797   </div>
1714   EOF;   1798   EOF;
1715                             } else  {   1799                             } else  {
1716                                 gl obal $tmpl ;   1800                                 gl obal $tmpl ;
1717                                 $s SpacerName  = $this - > sSpacerP ath;   1801                                 $s SpacerName  = $this - > sSpacerP ath;
1718                                 $s Naname = $ site['url' ].'templat es/tmpl_'. $tmpl.'/'. $this -> s PicNotAvai l;   1802                                 $s Naname = $ site['url' ].'templat es/tmpl_'. $tmpl.'/'. $this -> s PicNotAvai l;
1719                                 $s CalTableTr s .= <<<EO F   1803                                 $s CalTableTr s .= <<<EO F
1720   <!-- <div  align="cen ter" class ="small" t itle="{$ev entArr['Ti tle']}" st yle="width : {$sdatin gThumbWidt h}px; heig ht: {$sdat ingThumbHe ight}px; v ertical-al ign: middl e; line-he ight: {$sd atingThumb Height}px;  border: 1 px solid s ilver; bac kground-co lor: #FFFF FF; font-w eight: nor mal; margi n: 2px; fo nt-size: 8 0%; cursor : pointer; "> -->   1804   <!-- <div  align="cen ter" class ="small" t itle="{$ev entArr['Ti tle']}" st yle="width : {$sdatin gThumbWidt h}px; heig ht: {$sdat ingThumbHe ight}px; v ertical-al ign: middl e; line-he ight: {$sd atingThumb Height}px;  border: 1 px solid s ilver; bac kground-co lor: #FFFF FF; font-w eight: nor mal; margi n: 2px; fo nt-size: 8 0%; cursor : pointer; "> -->
1721   <div>   1805   <div>
1722       <a hre f="{$sGenU rl}">   1806       <a hre f="{$sGenU rl}">
1723           <i mg src="{$ sSpacerNam e}" style= "width:64p x;height:6 4px; backg round-imag e: url({$s Naname});"  class="ph oto1" alt= "" />   1807           <i mg src="{$ sSpacerNam e}" style= "width:64p x;height:6 4px; backg round-imag e: url({$s Naname});"  class="ph oto1" alt= "" />
1724           <! --<nobr>{$ sNoPhotoC} </nobr>-->   1808           <! --<nobr>{$ sNoPhotoC} </nobr>-->
1725       </a>   1809       </a>
1726   </div>   1810   </div>
1727   EOF;   1811   EOF;
1728                             }   1812                             }
1729                         }   1813                         }
1730                    }   1814                    }
1731     1815  
1732                    $sCa lTableTrs  .= '</td>' ;   1816                    $sCa lTableTrs  .= '</td>' ;
1733                }   1817                }
1734                $sCalTab leTrs .= ' </tr>';   1818                $sCalTab leTrs .= ' </tr>';
1735           }   1819           }
1736     1820  
1737           $s RetHtml =  <<<EOF   1821           $s RetHtml =  <<<EOF
1738   <br />   1822   <br />
1739   <div align ="center"  style="mar gin-bottom : 10px;">   1823   <div align ="center"  style="mar gin-bottom : 10px;">
1740       <form  id="calend arCountryF orm" actio n="{$_SERV ER['PHP_SE LF']}" met hod="get"  style="mar gin: 0px;" >   1824       <form  id="calend arCountryF orm" actio n="{$_SERV ER['PHP_SE LF']}" met hod="get"  style="mar gin: 0px;" >
1741           <i nput type= "hidden" n ame="actio n" value=" calendar"  />   1825           <i nput type= "hidden" n ame="actio n" value=" calendar"  />
1742           <i nput type= "hidden" n ame="month " value="{ $iCurMonth }-{$iCurYe ar}" />   1826           <i nput type= "hidden" n ame="month " value="{ $iCurMonth }-{$iCurYe ar}" />
1743           {$ sShowEvent sByCountry C}&nbsp;   1827           {$ sShowEvent sByCountry C}&nbsp;
1744           <s elect clas s="no" nam e="calenda r_country"  onchange= "javascrip t: documen t.forms['c alendarCou ntryForm'] .submit(); " style="v ertical-al ign: middl e;">{$sCal endarOptio ns}</selec t>   1828           <s elect clas s="no" nam e="calenda r_country"  onchange= "javascrip t: documen t.forms['c alendarCou ntryForm'] .submit(); " style="v ertical-al ign: middl e;">{$sCal endarOptio ns}</selec t>
1745       </form >   1829       </form >
1746     1830  
1747       <table  cellpaddi ng="1" cel lspacing=" 1" border= "0" width= "100%" cla ss="text"  style="tex t-align:ce nter;margi n-top:10px ;">   1831       <table  cellpaddi ng="1" cel lspacing=" 1" border= "0" width= "100%" cla ss="text"  style="tex t-align:ce nter;margi n-top:10px ;">
1748           <t r>   1832           <t r>
1749                <td clas s="calenda r_current"  style="pa dding: 3px ;">   1833                <td clas s="calenda r_current"  style="pa dding: 3px ;">
1750                    <a h ref="{$sCa lendarPrev Href}">{$s PrevC}</a>   1834                    <a h ref="{$sCa lendarPrev Href}">{$s PrevC}</a>
1751                </td>   1835                </td>
1752                <td cols pan="5" cl ass="calen dar_curren t">{$sCurM onYear}</t d>   1836                <td cols pan="5" cl ass="calen dar_curren t">{$sCurM onYear}</t d>
1753                <td clas s="calenda r_current"  style="pa dding: 3px ;">   1837                <td clas s="calenda r_current"  style="pa dding: 3px ;">
1754                    <a h ref="{$sCa lendarNext Href}">{$s NextC}</a>   1838                    <a h ref="{$sCa lendarNext Href}">{$s NextC}</a>
1755                </td>   1839                </td>
1756           </ tr>   1840           </ tr>
1757           <t r>   1841           <t r>
1758                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sSun daySC}</td >   1842                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sSun daySC}</td >
1759                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sMon daySC}</td >   1843                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sMon daySC}</td >
1760                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sTue sdaySC}</t d>   1844                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sTue sdaySC}</t d>
1761                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sWed nesdaySC}< /td>   1845                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sWed nesdaySC}< /td>
1762                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sThu rsdaySC}</ td>   1846                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sThu rsdaySC}</ td>
1763                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sFri daySC}</td >   1847                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sFri daySC}</td >
1764                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sSat urdaySC}</ td>   1848                <td styl e="width:{ $iPicSize} px;" class ="calendar _non_curre nt">{$sSat urdaySC}</ td>
1765           </ tr>   1849           </ tr>
1766       {$sCal TableTrs}   1850       {$sCal TableTrs}
1767       </tabl e>   1851       </tabl e>
1768   </div>   1852   </div>
1769   <br />   1853   <br />
1770   EOF;   1854   EOF;
1771     1855  
1772           re turn Desig nBoxConten t( $sCalen darC, $sRe tHtml, $oT emplConfig  -> PageSD atingCalen dar_db_num  );   1856           re turn Desig nBoxConten t( $sCalen darC, $sRe tHtml, $oT emplConfig  -> PageSD atingCalen dar_db_num  );
1773   }   1857   }
1774     1858  
1775       functi on Generat eZapatecCo de($sEl1,  $sEl2) {   1859       functi on Generat eZapatecCo de($sEl1,  $sEl2) {
1776           $i CurYear =  date("Y");   1860           $i CurYear =  date("Y");
1777           $i CurMonth =  date("m") ;   1861           $i CurMonth =  date("m") ;
1778           $i CurDay = d ate("d");   1862           $i CurDay = d ate("d");
1779           $s Res = <<<E OF   1863           $s Res = <<<E OF
1780   Zapatec.Ca lendar.set up({   1864   Zapatec.Ca lendar.set up({
1781       firstD ay           : 1,   1865       firstD ay           : 1,
1782       weekNu mbers        : true,   1866       weekNu mbers        : true,
1783       showOt hers         : true,   1867       showOt hers         : true,
1784       showsT ime          : true,   1868       showsT ime          : true,
1785       timeFo rmat         : "24",   1869       timeFo rmat         : "24",
1786       step                : 2,   1870       step                : 2,
1787       range               : [{$iCu rYear}.{$i CurMonth},  2099.12],   1871       range               : [{$iCu rYear}.{$i CurMonth},  2099.12],
1788       electr ic           : false,   1872       electr ic           : false,
1789       single Click        : true,   1873       single Click        : true,
1790       inputF ield         : "{$sEl 1}",   1874       inputF ield         : "{$sEl 1}",
1791       button              : "{$sEl 2}",   1875       button              : "{$sEl 2}",
1792       ifForm at           : "%Y-%m -%d %H:%M: %S",   1876       ifForm at           : "%Y-%m -%d %H:%M: %S",
1793       daForm at           : "%Y/%m /%d",   1877       daForm at           : "%Y/%m /%d",
1794       align               : "Br"   1878       align               : "Br"
1795   });   1879   });
1796   EOF;   1880   EOF;
1797           re turn $sRes ;   1881           re turn $sRes ;
1798       }   1882       }
1799     1883  
1800       /**   1884       /**
1801        * pag e show add  new event  form func tion   1885        * pag e show add  new event  form func tion
1802        * @re turn HTML  presentati on of data   1886        * @re turn HTML  presentati on of data
1803        */   1887        */
1804       functi on PageSDa tingNewEve ntForm($iE ventID=0,  $arrErr =  NULL) {   1888       functi on PageSDa tingNewEve ntForm($iE ventID=0,  $arrErr =  NULL) {
1805           $t his->Check Logged();   1889           $t his->Check Logged();
1806           gl obal $site ;   1890           gl obal $site ;
1807           gl obal $aPre Values;   1891           gl obal $aPre Values;
1808           gl obal $new_ result_tex t;   1892           gl obal $new_ result_tex t;
1809           gl obal $oTem plConfig;   1893           gl obal $oTem plConfig;
1810           gl obal $date _format;   1894           gl obal $date _format;
1811           gl obal $logg ed;   1895           gl obal $logg ed;
1812     1896  
1813           //  collect i nformation  about cur rent membe r   1897           //  collect i nformation  about cur rent membe r
1814           $a Member['ID '] = (int) $_COOKIE[' memberID'] ;   1898           $a Member['ID '] = (int) $_COOKIE[' memberID'] ;
1815           $a MemberData  = getProf ileInfo( $ aMember['I D'] );   1899           $a MemberData  = getProf ileInfo( $ aMember['I D'] );
1816           $s MemberCoun try = ($th is->bAdmin Mode) ? ge tParam( 'd efault_cou ntry' ) :  $aMemberDa ta['Countr y'];   1900           $s MemberCoun try = ($th is->bAdmin Mode) ? ge tParam( 'd efault_cou ntry' ) :  $aMemberDa ta['Countr y'];
1817           $s PleaseFill AllFieldsC  = _t('_Pl ease fill  up all fie lds');   1901           $s PleaseFill AllFieldsC  = _t('_Pl ease fill  up all fie lds');
1818           $s TitleC = _ t('_Title' );   1902           $s TitleC = _ t('_Title' );
1819           $s Descriptio nC = _t('_ Descriptio n');   1903           $s Descriptio nC = _t('_ Descriptio n');
1820           $s StatusMess ageC = _t( '_Status m essage');   1904           $s StatusMess ageC = _t( '_Status m essage');
1821           $s CountryC =  _t('_Coun try');   1905           $s CountryC =  _t('_Coun try');
1822           $s CityC = _t ('_City');   1906           $s CityC = _t ('_City');
1823           $s PlaceC = _ t('_Place' );   1907           $s PlaceC = _ t('_Place' );
1824           $s VenuePhoto C = _t('_V enue photo ');   1908           $s VenuePhoto C = _t('_V enue photo ');
1825           $s EventStart C = _t('_E vent start ');   1909           $s EventStart C = _t('_E vent start ');
1826           $s EventEndC  = _t('_Eve nt end');   1910           $s EventEndC  = _t('_Eve nt end');
1827           $s TicketSale StartC = _ t('_Ticket  sale star t');   1911           $s TicketSale StartC = _ t('_Ticket  sale star t');
1828           $s TicketSale EndC = _t( '_Ticket s ale end');   1912           $s TicketSale EndC = _t( '_Ticket s ale end');
1829           $s FemaleTick etCountC =  _t('_Fema le ticket  count');   1913           $s FemaleTick etCountC =  _t('_Fema le ticket  count');
1830           $s MaleTicket CountC = _ t('_Male t icket coun t');   1914           $s MaleTicket CountC = _ t('_Male t icket coun t');
1831           // $sSaveChan gesC = _t( '_Save Cha nges');   1915           // $sSaveChan gesC = _t( '_Save Cha nges');
1832           $s PostEventC  = _t('_Po st Event') ;   1916           $s PostEventC  = _t('_Po st Event') ;
1833           $s AddNewEven tC = _t('_ Add new ev ent');   1917           $s AddNewEven tC = _t('_ Add new ev ent');
1834           $s TagsC = _t ('_Tags');   1918           $s TagsC = _t ('_Tags');
1835           $s CommitC =  _t('_Apply  Changes') ;   1919           $s CommitC =  _t('_Apply  Changes') ;
    1920           $s ChooseC =  _t('_Choos e');
    1921           $s ClearC = _ t('_Clear' );
1836     1922  
1837           $s EventURL =  $_SERVER[ 'PHP_SELF' ];   1923           $s EventURL =  $_SERVER[ 'PHP_SELF' ];
1838     1924  
1839           if  ($iEventI D>0) {   1925           if  ($iEventI D>0) {
1840                $sEventS QL = "SELE CT * FROM  `SDatingEv ents` WHER E `ID` = { $iEventID}  LIMIT 1";   1926                $sEventS QL = "SELE CT * FROM  `SDatingEv ents` WHER E `ID` = { $iEventID}  LIMIT 1";
1841                $aEvent  = db_arr(  $sEventSQL  );   1927                $aEvent  = db_arr(  $sEventSQL  );
1842                $sEventT itle = $aE vent['Titl e'];   1928                $sEventT itle = $aE vent['Titl e'];
1843                $sEventT ags = $aEv ent['Tags' ];   1929                $sEventT ags = $aEv ent['Tags' ];
1844                   1930                
1845                $sEventD esc = $aEv ent['Descr iption'];   1931                $sEventD esc = $aEv ent['Descr iption'];
1846                $sEventS tatusMsg =  $aEvent[' StatusMess age'];   1932                $sEventS tatusMsg =  $aEvent[' StatusMess age'];
1847                $sSelect edCountry  = $aEvent[ 'Country'] ;   1933                $sSelect edCountry  = $aEvent[ 'Country'] ;
1848                $sSitySr c = $site[ 'flags'].s trtolower( $sSelected Country);   1934                $sSitySr c = $site[ 'flags'].s trtolower( $sSelected Country);
1849                $sEventC ity = $aEv ent['City' ];   1935                $sEventC ity = $aEv ent['City' ];
1850                $sEventP lace = $aE vent['Plac e'];   1936                $sEventP lace = $aE vent['Plac e'];
1851                $sEventE nd = $aEve nt['Ticket SaleEnd'];   1937                $sEventE nd = $aEve nt['Ticket SaleEnd'];
1852                $sEventS tart = $aE vent['Even tStart'];   1938                $sEventS tart = $aE vent['Even tStart'];
1853                $sFemale TicketCoun t = $aEven t['TicketC ountFemale '];   1939                $sFemale TicketCoun t = $aEven t['TicketC ountFemale '];
1854                $sMaleTi cketCount  = $aEvent[ 'TicketCou ntMale'];   1940                $sMaleTi cketCount  = $aEvent[ 'TicketCou ntMale'];
1855                //$sEven tTags = $a Event['Tag s'];   1941                //$sEven tTags = $a Event['Tag s'];
1856     1942  
1857     1943  
1858                //$sPost Picture =  $aEvent['P ostPhoto'] ;   1944                //$sPost Picture =  $aEvent['P ostPhoto'] ;
1859                //if ($s PostImage  != '')    1945                //if ($s PostImage  != '') 
1860                //  $sPo stPictureT ag = '<img  src="'.$s ite['blogI mage'].'bi g_'.$sPost Image.'" s tyle="posi tion:stati c;" />';   1946                //  $sPo stPictureT ag = '<img  src="'.$s ite['blogI mage'].'bi g_'.$sPost Image.'" s tyle="posi tion:stati c;" />';
1861                $sEdited IdElement  = '<input  type="hidd en" name=" EditedEven tID" id="E ditedEvent ID" value= "'.$iEvent ID.'" />';   1947                $sEdited IdElement  = '<input  type="hidd en" name=" EditedEven tID" id="E ditedEvent ID" value= "'.$iEvent ID.'" />';
1862     1948  
1863                $sPostEv entC = $sC ommitC;   1949                $sPostEv entC = $sC ommitC;
1864                $sPostAc tion = 'ev ent_update d';   1950                $sPostAc tion = 'ev ent_update d';
1865                $sAddNew EventC = _ t('_Edit e vent');   1951                $sAddNew EventC = _ t('_Edit e vent');
1866                $sANEven tAction =  "event_sav e";   1952                $sANEven tAction =  "event_sav e";
1867                //$sJSIn s = "Updat eField('Ed itEventID' ,'{$iEvent ID}');";   1953                //$sJSIn s = "Updat eField('Ed itEventID' ,'{$iEvent ID}');";
1868                //$sEdit IdStr = '< input type ="hidden"  name="Edit edEventID"  value="'. $iEventID. '">';   1954                //$sEdit IdStr = '< input type ="hidden"  name="Edit edEventID"  value="'. $iEventID. '">';
1869                $sEventU RL = $this ->genUrl($ iEventID,  $aEvent['E ntryUri']) ;   1955                $sEventU RL = $this ->genUrl($ iEventID,  $aEvent['E ntryUri']) ;
1870                //$sEven tURL = "?a ction=show _info&amp; event_id={ $iEventID} ";   1956                //$sEven tURL = "?a ction=show _info&amp; event_id={ $iEventID} ";
1871           }  else {   1957           }  else {
1872                $sEventT itle = iss et($_POST[ 'event_tit le']) ? ht mlspecialc hars( proc ess_pass_d ata($_POST ['event_ti tle']) ) :  '';   1958                $sEventT itle = iss et($_POST[ 'event_tit le']) ? ht mlspecialc hars( proc ess_pass_d ata($_POST ['event_ti tle']) ) :  '';
1873                $sEventT ags = isse t($_POST[' event_tags ']) ? html specialcha rs( proces s_pass_dat a($_POST[' event_tags ']) ) : '' ;   1959                $sEventT ags = isse t($_POST[' event_tags ']) ? html specialcha rs( proces s_pass_dat a($_POST[' event_tags ']) ) : '' ;
1874                $sEventD esc = isse t($_POST[' event_desc ']) ? html specialcha rs( proces s_pass_dat a($_POST[' event_desc ']) ) : '' ;   1960                $sEventD esc = isse t($_POST[' event_desc ']) ? html specialcha rs( proces s_pass_dat a($_POST[' event_desc ']) ) : '' ;
1875                $sEventS tatusMsg =  isset($_P OST['event _statusmsg ']) ? html specialcha rs( proces s_pass_dat a($_POST[' event_stat usmsg']) )  : '';   1961                $sEventS tatusMsg =  isset($_P OST['event _statusmsg ']) ? html specialcha rs( proces s_pass_dat a($_POST[' event_stat usmsg']) )  : '';
1876                $sSelect edCountry  = isset($_ POST['even t_country' ]) ? $_POS T['event_c ountry'] :  $sMemberC ountry;   1962                $sSelect edCountry  = isset($_ POST['even t_country' ]) ? $_POS T['event_c ountry'] :  $sMemberC ountry;
1877                $sSitySr c = $site[ 'flags'].s trtolower( $sSelected Country);   1963                $sSitySr c = $site[ 'flags'].s trtolower( $sSelected Country);
1878                $sEventC ity = isse t($_POST[' event_city ']) ? html specialcha rs( proces s_pass_dat a($_POST[' event_city ']) ) : '' ;   1964                $sEventC ity = isse t($_POST[' event_city ']) ? html specialcha rs( proces s_pass_dat a($_POST[' event_city ']) ) : '' ;
1879                $sEventP lace = iss et($_POST[ 'event_pla ce']) ? ht mlspecialc hars( proc ess_pass_d ata($_POST ['event_pl ace']) ) :  '';   1965                $sEventP lace = iss et($_POST[ 'event_pla ce']) ? ht mlspecialc hars( proc ess_pass_d ata($_POST ['event_pl ace']) ) :  '';
1880                $sEventE nd = isset ($_POST['e vent_end'] ) ? htmlsp ecialchars ( process_ pass_data( $_POST['ev ent_end'])  ) : strft ime( str_r eplace('%i ','%M', $d ate_format ) );   1966                $sEventE nd = isset ($_POST['e vent_end'] ) ? htmlsp ecialchars ( process_ pass_data( $_POST['ev ent_end'])  ) : strft ime( str_r eplace('%i ','%M', $d ate_format ) );
1881                $sFemale TicketCoun t = isset( $_POST['ev ent_count_ female'])  ? htmlspec ialchars(  process_pa ss_data($_ POST['even t_count_fe male']) )  : '';   1967                $sFemale TicketCoun t = isset( $_POST['ev ent_count_ female'])  ? htmlspec ialchars(  process_pa ss_data($_ POST['even t_count_fe male']) )  : '';
1882                $sMaleTi cketCount  = isset($_ POST['even t_count_ma le']) ? ht mlspecialc hars( proc ess_pass_d ata($_POST ['event_co unt_male'] ) ) : '';   1968                $sMaleTi cketCount  = isset($_ POST['even t_count_ma le']) ? ht mlspecialc hars( proc ess_pass_d ata($_POST ['event_co unt_male'] ) ) : '';
1883                $sPostAc tion = 'ev ent_save';   1969                $sPostAc tion = 'ev ent_save';
1884                $sANEven tAction =  "new";   1970                $sANEven tAction =  "new";
1885           }   1971           }
1886     1972  
1887           $s CountriesO ptions = ' ';   1973           $s CountriesO ptions = ' ';
1888              1974           
1889           fo reach ( $a PreValues[ 'Country']  as $key = > $value )  {   1975           fo reach ( $a PreValues[ 'Country']  as $key = > $value )  {
1890                $sSC = ( $sSelected Country ==  $key) ? ' selected=" selected"'  : '';   1976                $sSC = ( $sSelected Country ==  $key) ? ' selected=" selected"'  : '';
1891                $sVal =  _t($value[ 'LKey']);   1977                $sVal =  _t($value[ 'LKey']);
1892                $sCountr iesOptions  .= "<opti on value=\ "{$key}\"  {$sSC}>{$s Val}</opti on>";   1978                $sCountr iesOptions  .= "<opti on value=\ "{$key}\"  {$sSC}>{$s Val}</opti on>";
1893           }   1979           }
1894     1980  
1895           $s NewResText  = ( strle n($new_res ult_text)  ) ? '<div  class="err " style="m argin: 10p x;"><div>' .$new_resu lt_text.'< /div></div >' : '';   1981           $s NewResText  = ( strle n($new_res ult_text)  ) ? '<div  class="err " style="m argin: 10p x;"><div>' .$new_resu lt_text.'< /div></div >' : '';
1896     1982  
1897           $s JSCode = < <<EOF   1983           $s JSCode = < <<EOF
1898   <script ty pe="text/j avascript" >   1984   <script ty pe="text/j avascript" >
1899   <!--   1985   <!--
1900       functi on AutoSel ectFlag()  {   1986       functi on AutoSel ectFlag()  {
1901           va r vElem =  document.g etElementB yId('event _country_i d');   1987           va r vElem =  document.g etElementB yId('event _country_i d');
1902           ch angeFlag(v Elem.value );   1988           ch angeFlag(v Elem.value );
1903       }   1989       }
1904     1990  
1905       functi on changeF lag(flagIS O)   1991       functi on changeF lag(flagIS O)
1906       {   1992       {
1907           fl agImage =  document.g etElementB yId('flagI mageId');   1993           fl agImage =  document.g etElementB yId('flagI mageId');
1908           fl agImage.sr c = '{$sit e['flags'] }' + flagI SO.toLower Case() + ' .gif';   1994           fl agImage.sr c = '{$sit e['flags'] }' + flagI SO.toLower Case() + ' .gif';
1909       }   1995       }
1910   //-->   1996   //-->
1911   </script>   1997   </script>
1912   EOF;   1998   EOF;
1913     1999  
1914           $s ZapatecCal endar = '' ;   2000           $s ZapatecCal endar = '' ;
1915           // if ( $_REQ UEST['acti on'] == 'n ew' ) {   2001           // if ( $_REQ UEST['acti on'] == 'n ew' ) {
1916                $sAdminC alendars =  '';   2002                $sAdminC alendars =  '';
1917                if ($thi s->bAdminM ode) {   2003                if ($thi s->bAdminM ode) {
1918                    $sAd minCalenda rs = $this ->Generate ZapatecCod e('event_e nd_id','en d_choose_i d') .   2004                    $sAd minCalenda rs = $this ->Generate ZapatecCod e('event_e nd_id','en d_choose_i d') .
1919                         $this->Gen erateZapat ecCode('ev ent_sale_s tart_id',' sale_start _choose_id ') .   2005                         $this->Gen erateZapat ecCode('ev ent_sale_s tart_id',' sale_start _choose_id ') .
1920                         $this->Gen erateZapat ecCode('ev ent_sale_e nd_id','sa le_end_cho ose_id');   2006                         $this->Gen erateZapat ecCode('ev ent_sale_e nd_id','sa le_end_cho ose_id');
1921                }   2007                }
1922                $sZapate cCalendar  = $this->G enerateZap atecCode(' event_star t_id','sta rt_choose_ id') . $sA dminCalend ars;   2008                $sZapate cCalendar  = $this->G enerateZap atecCode(' event_star t_id','sta rt_choose_ id') . $sA dminCalend ars;
1923           // }   2009           // }
1924     2010  
1925           // //php vali dating fie lds   2011           // //php vali dating fie lds
1926           $s Tstyle = ( $arrErr['T itle'] ? ' block' : ' none');   2012           $s Tstyle = ( $arrErr['T itle'] ? ' block' : ' none');
1927           $s Dstyle = ( $arrErr['D escription '] ? 'bloc k' : 'none ');   2013           $s Dstyle = ( $arrErr['D escription '] ? 'bloc k' : 'none ');
1928           $s SMstyle =  ($arrErr[' Status mes sage'] ? ' block' : ' none');   2014           $s SMstyle =  ($arrErr[' Status mes sage'] ? ' block' : ' none');
1929           $s Cstyle = ( $arrErr['C ity'] ? 'b lock' : 'n one');   2015           $s Cstyle = ( $arrErr['C ity'] ? 'b lock' : 'n one');
1930           $s Pstyle = ( $arrErr['P lace'] ? ' block' : ' none');   2016           $s Pstyle = ( $arrErr['P lace'] ? ' block' : ' none');
1931           $s ESstyle =  ($arrErr[' Event star t'] ? 'blo ck' : 'non e');   2017           $s ESstyle =  ($arrErr[' Event star t'] ? 'blo ck' : 'non e');
1932           $s EEstyle =  ($arrErr[' Event end' ] ? 'block ' : 'none' );   2018           $s EEstyle =  ($arrErr[' Event end' ] ? 'block ' : 'none' );
1933           $s TSSstyle =  ($arrErr[ 'Ticket Sa le Start']  ? 'block'  : 'none') ;   2019           $s TSSstyle =  ($arrErr[ 'Ticket Sa le Start']  ? 'block'  : 'none') ;
1934           $s TSEstyle =  ($arrErr[ 'Ticket Sa le End'] ?  'block' :  'none');   2020           $s TSEstyle =  ($arrErr[ 'Ticket Sa le End'] ?  'block' :  'none');
1935           $s FTCstyle =  ($arrErr[ 'Female Ti cket Count '] ? 'bloc k' : 'none ');   2021           $s FTCstyle =  ($arrErr[ 'Female Ti cket Count '] ? 'bloc k' : 'none ');
1936           $s MTCstyle =  ($arrErr[ 'Male Tick et Count']  ? 'block'  : 'none') ;   2022           $s MTCstyle =  ($arrErr[ 'Male Tick et Count']  ? 'block'  : 'none') ;
1937           // error mess ages   2023           // error mess ages
1938           $s Tmsg = ($a rrErr['Tit le'] ? _t(  '_'.$arrE rr['Title' ] ) : '' ) ;   2024           $s Tmsg = ($a rrErr['Tit le'] ? _t(  '_'.$arrE rr['Title' ] ) : '' ) ;
1939           $s Dmsg = ($a rrErr['Des cription']  ? _t( '_' .$arrErr[' Descriptio n'] ) : ''  );   2025           $s Dmsg = ($a rrErr['Des cription']  ? _t( '_' .$arrErr[' Descriptio n'] ) : ''  );
1940           $s SMmsg = ($ arrErr['St atus messa ge'] ? _t(  '_'.$arrE rr['Status  message']  ) : '' );   2026           $s SMmsg = ($ arrErr['St atus messa ge'] ? _t(  '_'.$arrE rr['Status  message']  ) : '' );
1941           $s Cmsg = ($a rrErr['Cit y'] ? _t(  '_'.$arrEr r['City']  ) : '' );   2027           $s Cmsg = ($a rrErr['Cit y'] ? _t(  '_'.$arrEr r['City']  ) : '' );
1942           $s Pmsg = ($a rrErr['Pla ce'] ? _t(  '_'.$arrE rr['Place' ] ) : '' ) ;   2028           $s Pmsg = ($a rrErr['Pla ce'] ? _t(  '_'.$arrE rr['Place' ] ) : '' ) ;
1943           $s ESmsg = ($ arrErr['Ev ent start' ] ? _t( '_ '.$arrErr[ 'Event sta rt'] ) : ' ' );   2029           $s ESmsg = ($ arrErr['Ev ent start' ] ? _t( '_ '.$arrErr[ 'Event sta rt'] ) : ' ' );
1944           $s EEmsg = ($ arrErr['Ev ent end']  ? _t( '_'. $arrErr['E vent end']  ) : '' );   2030           $s EEmsg = ($ arrErr['Ev ent end']  ? _t( '_'. $arrErr['E vent end']  ) : '' );
1945           $s TSSmsg = ( $arrErr['T icket Sale  Start'] ?  _t( '_'.$ arrErr['Ti cket Sale  Start'] )  : '' );   2031           $s TSSmsg = ( $arrErr['T icket Sale  Start'] ?  _t( '_'.$ arrErr['Ti cket Sale  Start'] )  : '' );
1946           $s TSEmsg = ( $arrErr['T icket Sale  End'] ? _ t( '_'.$ar rErr['Tick et Sale En d'] ) : ''  );   2032           $s TSEmsg = ( $arrErr['T icket Sale  End'] ? _ t( '_'.$ar rErr['Tick et Sale En d'] ) : ''  );
1947           $s FTCmsg = ( $arrErr['F emale Tick et Count']  ? _t( '_' .$arrErr[' Female Tic ket Count' ] ) : '' ) ;   2033           $s FTCmsg = ( $arrErr['F emale Tick et Count']  ? _t( '_' .$arrErr[' Female Tic ket Count' ] ) : '' ) ;
1948           $s MTCmsg = ( $arrErr['M ale Ticket  Count'] ?  _t( '_'.$ arrErr['Ma le Ticket  Count'] )  : '' );   2034           $s MTCmsg = ( $arrErr['M ale Ticket  Count'] ?  _t( '_'.$ arrErr['Ma le Ticket  Count'] )  : '' );
1949     2035  
1950     2036  
1951           $s AdminSales Part='';   2037           $s AdminSales Part='';
1952           $s StatusMess ='';   2038           $s StatusMess ='';
1953           if  ($this->b AdminMode)  {   2039           if  ($this->b AdminMode)  {
1954                $sStatus Mess = <<< EOF   2040                $sStatus Mess = <<< EOF
1955   <tr class= "vc">   2041   <tr class= "vc">
1956       <td cl ass="form_ label">{$s StatusMess ageC}:</td >   2042       <td cl ass="form_ label">{$s StatusMess ageC}:</td >
1957       <td cl ass="form_ value">   2043       <td cl ass="form_ value">
1958           <d iv class=" edit_error " style="d isplay:{$s SMstyle}">   2044           <d iv class=" edit_error " style="d isplay:{$s SMstyle}">
1959                {$sSMmsg }   2045                {$sSMmsg }
1960           </ div>   2046           </ div>
1961           <i nput class ="form_inp ut" type=" text" name ="event_st atusmsg" i d="event_s tatusmsg_i d" value=" {$sEventSt atusMsg}"  />   2047           <i nput class ="form_inp ut" type=" text" name ="event_st atusmsg" i d="event_s tatusmsg_i d" value=" {$sEventSt atusMsg}"  />
1962       </td>   2048       </td>
1963   </tr>   2049   </tr>
1964   EOF;   2050   EOF;
1965     2051  
1966                $sAdminS alesPart =  <<<EOF   2052                $sAdminS alesPart =  <<<EOF
1967   <tr class= "vc">   2053   <tr class= "vc">
1968       <td cl ass="form_ label">{$s EventEndC} :</td>   2054       <td cl ass="form_ label">{$s EventEndC} :</td>
1969       <td cl ass="form_ value">   2055       <td cl ass="form_ value">
1970           <! -- <input  type="text " class="n o" name="e vent_end"  id="event_ end_id" si ze="20" va lue="{$sEv entEnd}" / >-->   2056           <! -- <input  type="text " class="n o" name="e vent_end"  id="event_ end_id" si ze="20" va lue="{$sEv entEnd}" / >-->
1971           <d iv class=" edit_error " style="d isplay:{$s EEstyle}">   2057           <d iv class=" edit_error " style="d isplay:{$s EEstyle}">
1972                {$sEEmsg }   2058                {$sEEmsg }
1973           </ div>   2059           </ div>
1974           <i nput type= "text" cla ss="form_i nput_date"  name="eve nt_end" id ="event_en d_id" valu e="" />   2060           <i nput type= "text" cla ss="form_i nput_date"  name="eve nt_end" id ="event_en d_id" valu e="" />
1975            <input   type="butt on"   id="end_ch oose_id"   value="
Choose
"   />
  2061            <input   type="butt on"   id="end_ch oose_id"   value=" {$s Choose C} "   />
1976            <input   type="butt on"   id="end_cl ear_id"   onClick="d ocument.ge tElementBy Id('event_ end_id').v alue   =   '';   "   value="
Clear
"   />
  2062            <input   type="butt on"   id="end_cl ear_id"   onClick="d ocument.ge tElementBy Id('event_ end_id').v alue   =   '';   "   value=" {$s Clear C} "   />
1977       </td>   2063       </td>
1978   </tr>   2064   </tr>
1979   <tr class= "vc">   2065   <tr class= "vc">
1980       <td cl ass="form_ label">{$s TicketSale StartC}:</ td>   2066       <td cl ass="form_ label">{$s TicketSale StartC}:</ td>
1981       <td cl ass="form_ value">   2067       <td cl ass="form_ value">
1982           <d iv class=" edit_error " style="d isplay:{$s TSSstyle}" >   2068           <d iv class=" edit_error " style="d isplay:{$s TSSstyle}" >
1983                {$sTSSms g}   2069                {$sTSSms g}
1984           </ div>   2070           </ div>
1985           <i nput type= "text" cla ss="form_i nput_date"  name="eve nt_sale_st art" id="e vent_sale_ start_id"  value="" / >   2071           <i nput type= "text" cla ss="form_i nput_date"  name="eve nt_sale_st art" id="e vent_sale_ start_id"  value="" / >
1986            <input   type="butt on"   id="sale_s tart_choos e_id"   value="
Choose
"   />
  2072            <input   type="butt on"   id="sale_s tart_choos e_id"   value=" {$s Choose C} "   />
1987            <input   type="butt on"   id="sale_s tart_clear _id"   onClick="d ocument.ge tElementBy Id('event_ sale_start _id').valu e   =   '';   "   value="
Clear
"   />
  2073            <input   type="butt on"   id="sale_s tart_clear _id"   onClick="d ocument.ge tElementBy Id('event_ sale_start _id').valu e   =   '';   "   value=" {$s Clear C} "   />
1988       </td>   2074       </td>
1989   </tr>   2075   </tr>
1990   <tr class= "vc">   2076   <tr class= "vc">
1991       <td cl ass="form_ label">{$s TicketSale EndC}:</td >   2077       <td cl ass="form_ label">{$s TicketSale EndC}:</td >
1992       <td cl ass="form_ value">   2078       <td cl ass="form_ value">
1993           <d iv class=" edit_error " style="d isplay:{$s TSEstyle}" >   2079           <d iv class=" edit_error " style="d isplay:{$s TSEstyle}" >
1994                {$sTSEms g}   2080                {$sTSEms g}
1995           </ div>   2081           </ div>
1996           <i nput type= "text" cla ss="form_i nput_date"  name="eve nt_sale_en d" id="eve nt_sale_en d_id" valu e="" />   2082           <i nput type= "text" cla ss="form_i nput_date"  name="eve nt_sale_en d" id="eve nt_sale_en d_id" valu e="" />
1997            <input   type="butt on"   id="sale_e nd_choose_ id"   value="
Choose
"   />
  2083            <input   type="butt on"   id="sale_e nd_choose_ id"   value=" {$s Choose C} "   />
1998            <input   type="butt on"   id="sale_e nd_clear_i d"   onClick="d ocument.ge tElementBy Id('event_ sale_end_i d').value   =   '';   "   value="
Clear
"   />
  2084            <input   type="butt on"   id="sale_e nd_clear_i d"   onClick="d ocument.ge tElementBy Id('event_ sale_end_i d').value   =   '';   "   value=" {$s Clear C} "   />
1999       </td>   2085       </td>
2000   </tr>   2086   </tr>
2001   <tr class= "vc">   2087   <tr class= "vc">
2002       <td cl ass="form_ label">{$s FemaleTick etCountC}: </td>   2088       <td cl ass="form_ label">{$s FemaleTick etCountC}: </td>
2003       <td cl ass="form_ value">   2089       <td cl ass="form_ value">
2004           <d iv class=" edit_error " style="d isplay:{$s FTCstyle}" >   2090           <d iv class=" edit_error " style="d isplay:{$s FTCstyle}" >
2005                {$sFTCms g}   2091                {$sFTCms g}
2006           </ div>   2092           </ div>
2007           <i nput type= "text" cla ss="form_i nput_count " name="ev ent_count_ female" id ="event_co unt_female _id" value ="{$sFemal eTicketCou nt}" />   2093           <i nput type= "text" cla ss="form_i nput_count " name="ev ent_count_ female" id ="event_co unt_female _id" value ="{$sFemal eTicketCou nt}" />
2008       </td>   2094       </td>
2009   </tr>   2095   </tr>
2010   <tr class= "vc">   2096   <tr class= "vc">
2011       <td cl ass="form_ label">{$s MaleTicket CountC}:</ td>   2097       <td cl ass="form_ label">{$s MaleTicket CountC}:</ td>
2012       <td cl ass="form_ value">   2098       <td cl ass="form_ value">
2013           <d iv class=" edit_error " style="d isplay:{$s MTCstyle}" >   2099           <d iv class=" edit_error " style="d isplay:{$s MTCstyle}" >
2014                {$sMTCms g}   2100                {$sMTCms g}
2015           </ div>   2101           </ div>
2016           <i nput type= "text" cla ss="form_i nput_count " name="ev ent_count_ male" id=" event_coun t_male_id"  value="{$ sMaleTicke tCount}" / >   2102           <i nput type= "text" cla ss="form_i nput_count " name="ev ent_count_ male" id=" event_coun t_male_id"  value="{$ sMaleTicke tCount}" / >
2017       </td>   2103       </td>
2018   </tr>   2104   </tr>
2019   EOF;   2105   EOF;
2020           }   2106           }
2021     2107  
2022           $s RetHtml =  <<<EOF   2108           $s RetHtml =  <<<EOF
2023   {$sJSCode}   2109   {$sJSCode}
2024   {$sNewResT ext}   2110   {$sNewResT ext}
2025   <form id=" newEventFo rm" action ="{$sEvent URL}" meth od="post"  enctype="m ultipart/f orm-data">   2111   <form id=" newEventFo rm" action ="{$sEvent URL}" meth od="post"  enctype="m ultipart/f orm-data">
2026   <table cla ss="addEve ntForm">   2112   <table cla ss="addEve ntForm">
2027       <tr cl ass="vc">   2113       <tr cl ass="vc">
2028           <t d class="f orm_label" >{$sTitleC }:</td>   2114           <t d class="f orm_label" >{$sTitleC }:</td>
2029           <t d class="f orm_value" >   2115           <t d class="f orm_value" >
2030                <div cla ss="edit_e rror" styl e="display :{$sTstyle }">   2116                <div cla ss="edit_e rror" styl e="display :{$sTstyle }">
2031                    {$sT msg}   2117                    {$sT msg}
2032                </div>   2118                </div>
2033                <input c lass="form _input" ty pe="text"  name="even t_title" i d="event_t itle_id" v alue="{$sE ventTitle} " />   2119                <input c lass="form _input" ty pe="text"  name="even t_title" i d="event_t itle_id" v alue="{$sE ventTitle} " />
2034           </ td>   2120           </ td>
2035       </tr>   2121       </tr>
2036       <tr cl ass="vc">   2122       <tr cl ass="vc">
2037           <t d class="f orm_label" >{$sTagsC} :</td>   2123           <t d class="f orm_label" >{$sTagsC} :</td>
2038           <t d class="f orm_value" >   2124           <t d class="f orm_value" >
2039                <input c lass="form _input" ty pe="text"  name="even t_tags" va lue="{$sEv entTags}"  />   2125                <input c lass="form _input" ty pe="text"  name="even t_tags" va lue="{$sEv entTags}"  />
2040           </ td>   2126           </ td>
2041       </tr>   2127       </tr>
2042       <tr cl ass="vc">   2128       <tr cl ass="vc">
2043           <t d class="f orm_label" >{$sDescri ptionC}:</ td>   2129           <t d class="f orm_label" >{$sDescri ptionC}:</ td>
2044           <t d class="f orm_value" >   2130           <t d class="f orm_value" >
2045                <div cla ss="edit_e rror" styl e="display :{$sDstyle }">   2131                <div cla ss="edit_e rror" styl e="display :{$sDstyle }">
2046                    {$sD msg}   2132                    {$sD msg}
2047                </div>   2133                </div>
2048                <textare a class="c lassfiedsT extArea" n ame="event _desc" id= "event_des c_id" styl e="width:7 00px;heigh t:400px;"> {$sEventDe sc}</texta rea>   2134                <textare a class="c lassfiedsT extArea" n ame="event _desc" id= "event_des c_id" styl e="width:7 00px;heigh t:400px;"> {$sEventDe sc}</texta rea>
2049           </ td>   2135           </ td>
2050       </tr>   2136       </tr>
2051       {$sSta tusMess}   2137       {$sSta tusMess}
2052       <tr cl ass="vc">   2138       <tr cl ass="vc">
2053           <t d class="f orm_label" >{$sCountr yC}:</td>   2139           <t d class="f orm_label" >{$sCountr yC}:</td>
2054           <t d class="f orm_value" >   2140           <t d class="f orm_value" >
2055                <select  class="for m_select"  name="even t_country"  id="event _country_i d" onchang e="javascr ipt: chang eFlag(this .value);">   2141                <select  class="for m_select"  name="even t_country"  id="event _country_i d" onchang e="javascr ipt: chang eFlag(this .value);">
2056                    {$sC ountriesOp tions}   2142                    {$sC ountriesOp tions}
2057                </select >   2143                </select >
2058                <img id= "flagImage Id" src="{ $sSitySrc} .gif" alt= "flag" />   2144                <img id= "flagImage Id" src="{ $sSitySrc} .gif" alt= "flag" />
2059           </ td>   2145           </ td>
2060       </tr>   2146       </tr>
2061       <tr cl ass="vc">   2147       <tr cl ass="vc">
2062           <t d class="f orm_label" >{$sCityC} :</td>   2148           <t d class="f orm_label" >{$sCityC} :</td>
2063           <t d align="l eft">   2149           <t d align="l eft">
2064                <div cla ss="edit_e rror" styl e="display :{$sCstyle }">   2150                <div cla ss="edit_e rror" styl e="display :{$sCstyle }">
2065                    {$sC msg}   2151                    {$sC msg}
2066                </div>   2152                </div>
2067                <input t ype="text"  class="fo rm_input"  name="even t_city" id ="event_ci ty_id" val ue="{$sEve ntCity}" / >   2153                <input t ype="text"  class="fo rm_input"  name="even t_city" id ="event_ci ty_id" val ue="{$sEve ntCity}" / >
2068           </ td>   2154           </ td>
2069       </tr>   2155       </tr>
2070       <tr cl ass="vc">   2156       <tr cl ass="vc">
2071           <t d class="f orm_label" >{$sPlaceC }:</td>   2157           <t d class="f orm_label" >{$sPlaceC }:</td>
2072           <t d class="f orm_value" >   2158           <t d class="f orm_value" >
2073                <div cla ss="edit_e rror" styl e="display :{$sPstyle }">   2159                <div cla ss="edit_e rror" styl e="display :{$sPstyle }">
2074                    {$sP msg}   2160                    {$sP msg}
2075                </div>   2161                </div>
2076                <input t ype="text"  class="fo rm_input"  name="even t_place" i d="event_p lace_id" v alue="{$sE ventPlace} " />   2162                <input t ype="text"  class="fo rm_input"  name="even t_place" i d="event_p lace_id" v alue="{$sE ventPlace} " />
2077           </ td>   2163           </ td>
2078       </tr>   2164       </tr>
2079       <tr cl ass="vc">   2165       <tr cl ass="vc">
2080           <t d class="f orm_label" >{$sVenueP hotoC}:</t d>   2166           <t d class="f orm_label" >{$sVenueP hotoC}:</t d>
2081           <t d class="f orm_value" >   2167           <t d class="f orm_value" >
2082                <input t ype="file"  class="fo rm_file" n ame="event _photo" id ="event_ph oto_id" />   2168                <input t ype="file"  class="fo rm_file" n ame="event _photo" id ="event_ph oto_id" />
2083           </ td>   2169           </ td>
2084       </tr>   2170       </tr>
2085       <tr cl ass="vc">   2171       <tr cl ass="vc">
2086           <t d class="f orm_label" >{$sEventS tartC}:</t d>   2172           <t d class="f orm_label" >{$sEventS tartC}:</t d>
2087           <t d class="f orm_value" >   2173           <t d class="f orm_value" >
2088                <div cla ss="edit_e rror" styl e="display :{$sESstyl e}">   2174                <div cla ss="edit_e rror" styl e="display :{$sESstyl e}">
2089                    {$sE Smsg}   2175                    {$sE Smsg}
2090                </div>   2176                </div>
2091                <input t ype="text"  class="fo rm_input_d ate" name= "event_sta rt" id="ev ent_start_ id" value= "{$sEventS tart}" rea donly="rea donly" />   2177                <input t ype="text"  class="fo rm_input_d ate" name= "event_sta rt" id="ev ent_start_ id" value= "{$sEventS tart}" rea donly="rea donly" />
2092                 <input   type="butt on"   id="start_ choose_id"   value="
Choose
"   />
  2178                 <input   type="butt on"   id="start_ choose_id"   value=" {$s Choose C} "   />
2093                 <input   type="butt on"   id="start_ clear_id"   onClick="d ocument.ge tElementBy Id('event_ start_id') .value   =   '';   "   value="
Clear
"   />
  2179                 <input   type="butt on"   id="start_ clear_id"   onClick="d ocument.ge tElementBy Id('event_ start_id') .value   =   '';   "   value=" {$s Clear C} "   />
2094           </ td>   2180           </ td>
2095       </tr>   2181       </tr>
2096       {$sAdm inSalesPar t}   2182       {$sAdm inSalesPar t}
2097       <tr cl ass="vc">   2183       <tr cl ass="vc">
2098           <t d class="f orm_colspa n" colspan ="2">   2184           <t d class="f orm_colspa n" colspan ="2">
2099                <input t ype="hidde n" name="a ction" val ue="{$sANE ventAction }" />   2185                <input t ype="hidde n" name="a ction" val ue="{$sANE ventAction }" />
2100                {$sEdite dIdElement }   2186                {$sEdite dIdElement }
2101                <input t ype="submi t" class=" form_submi t" name="{ $sPostActi on}" value ="{$sPostE ventC}"   2187                <input t ype="submi t" class=" form_submi t" name="{ $sPostActi on}" value ="{$sPostE ventC}"
2102                  style= "vertical- align: mid dle;margin -top:10px; " />   2188                  style= "vertical- align: mid dle;margin -top:10px; " />
2103           </ td>   2189           </ td>
2104       </tr>   2190       </tr>
2105   </table>   2191   </table>
2106   </form>   2192   </form>
2107   <!-- Loadi ng Calenda r JavaScri pt files - ->   2193   <!-- Loadi ng Calenda r JavaScri pt files - ->
2108       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_src/ utils.js"> </script>   2194       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_src/ utils.js"> </script>
2109       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_src/ calendar.j s"></scrip t>   2195       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_src/ calendar.j s"></scrip t>
2110       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_src/ calendar-s etup.js">< /script>   2196       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_src/ calendar-s etup.js">< /script>
2111     2197  
2112   <!-- Loadi ng languag e definiti on file -- >   2198   <!-- Loadi ng languag e definiti on file -- >
2113       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_lang /calendar- en.js"></s cript>   2199       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_lang /calendar- en.js"></s cript>
2114     2200  
2115   <script ty pe="text/j avascript" >   2201   <script ty pe="text/j avascript" >
2116   //<![CDATA [   2202   //<![CDATA [
2117       {$sZap atecCalend ar}   2203       {$sZap atecCalend ar}
2118   //]]>   2204   //]]>
2119   onload=Aut oSelectFla g();   2205   onload=Aut oSelectFla g();
2120   </script>   2206   </script>
2121   EOF;   2207   EOF;
2122     2208  
2123           re turn Desig nBoxConten t( $sAddNe wEventC, $ sRetHtml,  $oTemplCon fig -> Pag eSDatingNe wEvent_db_ num );   2209           re turn Desig nBoxConten t( $sAddNe wEventC, $ sRetHtml,  $oTemplCon fig -> Pag eSDatingNe wEvent_db_ num );
2124       }   2210       }
2125     2211  
2126       functi on ShowSea rchResult( ) {   2212       functi on ShowSea rchResult( ) {
2127           $s RetHtml =  '';   2213           $s RetHtml =  '';
2128           $s SearchedTa g = proces s_db_input ( $_REQUES T['tagKey' ] );   2214           $s SearchedTa g = proces s_db_input ( $_REQUES T['tagKey' ] );
2129           // $iMemberID  = $_REQUE ST['ownerI D'];   2215           // $iMemberID  = $_REQUE ST['ownerI D'];
2130           gl obal $site ;   2216           gl obal $site ;
2131           gl obal $aPre Values;   2217           gl obal $aPre Values;
2132           gl obal $tmpl ;   2218           gl obal $tmpl ;
2133           gl obal $dir;   2219           gl obal $dir;
2134     2220  
2135           $d ate_format _php = get Param('php _date_form at');   2221           $d ate_format _php = get Param('php _date_form at');
2136           $s TagsC = _t ('_Tags');   2222           $s TagsC = _t ('_Tags');
2137           $s TagC = _t( '_Tag');   2223           $s TagC = _t( '_Tag');
2138           $s ShowInfoC  = _t('_Sho w info');   2224           $s ShowInfoC  = _t('_Sho w info');
2139           $s Participan tsC = _t(' _Participa nts');   2225           $s Participan tsC = _t(' _Participa nts');
2140           $s StatusMess ageC = _t( '_Status m essage');   2226           $s StatusMess ageC = _t( '_Status m essage');
2141           $s DateC = _t ('_Date');   2227           $s DateC = _t ('_Date');
2142           $s PlaceC = _ t('_Place' );   2228           $s PlaceC = _ t('_Place' );
2143           $s Descriptio nC = _t('_ Descriptio n');   2229           $s Descriptio nC = _t('_ Descriptio n');
2144           $s TitleC = _ t('_Title' );   2230           $s TitleC = _ t('_Title' );
2145           $s ActionsC =  _t('_Acti ons');   2231           $s ActionsC =  _t('_Acti ons');
2146           $s ListOfPart icipantsC  = _t('_Lis t').' '._t ('_of').'  '._t('_Par ticipants' );   2232           $s ListOfPart icipantsC  = _t('_Lis t').' '._t ('_of').'  '._t('_Par ticipants' );
2147     2233  
2148           $s SpacerName  = $this - > sSpacerP ath;   2234           $s SpacerName  = $this - > sSpacerP ath;
2149     2235  
2150           // $sCategory Addon = ($ iCategoryI D>0) ? "AN D `BlogPos ts`.`Categ oryID` = { $iCategory ID}" : '';   2236           // $sCategory Addon = ($ iCategoryI D>0) ? "AN D `BlogPos ts`.`Categ oryID` = { $iCategory ID}" : '';
2151           $s BlogPosts  = '';   2237           $s BlogPosts  = '';
2152           $s EventSQL =  "SELECT *  FROM `SDa tingEvents `";   2238           $s EventSQL =  "SELECT *  FROM `SDa tingEvents `";
2153           $v BlogPosts  = db_res(  $sEventSQL  );   2239           $v BlogPosts  = db_res(  $sEventSQL  );
2154           wh ile ( $aRe sSQL = mys ql_fetch_a ssoc($vBlo gPosts) )  {   2240           wh ile ( $aRe sSQL = mys ql_fetch_a ssoc($vBlo gPosts) )  {
2155                $sDateTi me = date(  $date_for mat_php, s trtotime(  $aResSQL[' EventStart '] ) );   2241                $sDateTi me = date(  $date_for mat_php, s trtotime(  $aResSQL[' EventStart '] ) );
2156     2242  
2157                $sCountr y = ($aRes SQL['Count ry']!='')  ? _t($aPre Values['Co untry'][$a ResSQL['Co untry']][' LKey']) :  '';   2243                $sCountr y = ($aRes SQL['Count ry']!='')  ? _t($aPre Values['Co untry'][$a ResSQL['Co untry']][' LKey']) :  '';
2158                $sCity =  ($aResSQL ['City']!= '') ? ', ' .process_l ine_output ($aResSQL[ 'City']) :  '';   2244                $sCity =  ($aResSQL ['City']!= '') ? ', ' .process_l ine_output ($aResSQL[ 'City']) :  '';
2159                $sPlace  = ($aResSQ L['Place'] !='') ? ',  '.process _line_outp ut($aResSQ L['Place'] ) : '';   2245                $sPlace  = ($aResSQ L['Place'] !='') ? ',  '.process _line_outp ut($aResSQ L['Place'] ) : '';
2160                $sDescri ption = /* process_te xt_withlin ks_output* /($aResSQL ['Descript ion']);   2246                $sDescri ption = /* process_te xt_withlin ks_output* /($aResSQL ['Descript ion']);
2161     2247  
2162                $sImgEL  = ( strlen (trim($aRe sSQL['Phot oFilename' ])) && fil e_exists($ dir['sdati ngImage']  . $aResSQL ['PhotoFil ename']) )   2248                $sImgEL  = ( strlen (trim($aRe sSQL['Phot oFilename' ])) && fil e_exists($ dir['sdati ngImage']  . $aResSQL ['PhotoFil ename']) )
2163                    ? "< img class= \"photo1\"  alt=\"\"  style=\"wi dth:{$this ->iThumbSi ze}px;heig ht:{$this- >iThumbSiz e}px;backg round-imag e:url({$si te['sdatin gImage']}t humb_{$aRe sSQL['Phot oFilename' ]});\" src =\"{$sSpac erName}\"  />"   2249                    ? "< img class= \"photo1\"  alt=\"\"  style=\"wi dth:{$this ->iThumbSi ze}px;heig ht:{$this- >iThumbSiz e}px;backg round-imag e:url({$si te['sdatin gImage']}t humb_{$aRe sSQL['Phot oFilename' ]});\" src =\"{$sSpac erName}\"  />"
2164                    : "< img class= \"photo1\"  alt=\"\"  style=\"wi dth:{$this ->iThumbSi ze}px;heig ht:{$this- >iThumbSiz e}px;backg round-imag e:url({$si te['url']} templates/ tmpl_{$tmp l}/{$this- >sPicNotAv ail});\" s rc=\"{$sSp acerName}\ " />";   2250                    : "< img class= \"photo1\"  alt=\"\"  style=\"wi dth:{$this ->iThumbSi ze}px;heig ht:{$this- >iThumbSiz e}px;backg round-imag e:url({$si te['url']} templates/ tmpl_{$tmp l}/{$this- >sPicNotAv ail});\" s rc=\"{$sSp acerName}\ " />";
2165     2251  
2166                $sTagsCo mmas = $aR esSQL['Tag s'];   2252                $sTagsCo mmas = $aR esSQL['Tag s'];
2167                $aTags =  split(',' , $sTagsCo mmas);   2253                $aTags =  split(',' , $sTagsCo mmas);
2168     2254  
2169                $sTagsHr efs = '';   2255                $sTagsHr efs = '';
2170                foreach(  $aTags as  $sTagKey  ) {   2256                foreach(  $aTags as  $sTagKey  ) {
2171                    $sTa gHrefGen =  $this->ge nUrl(0, $s TagKey, 's earch');   2257                    $sTa gHrefGen =  $this->ge nUrl(0, $s TagKey, 's earch');
2172                    $sTa gsHrefs .=  <<<EOF   2258                    $sTa gsHrefs .=  <<<EOF
2173   <a href="{ $sTagHrefG en}" >{$sT agKey}</a> &nbsp;   2259   <a href="{ $sTagHrefG en}" >{$sT agKey}</a> &nbsp;
2174   EOF;   2260   EOF;
2175                }   2261                }
2176     2262  
2177                $sGenUrl  = $this-> genUrl($aR esSQL['ID' ], $aResSQ L['EntryUr i']);   2263                $sGenUrl  = $this-> genUrl($aR esSQL['ID' ], $aResSQ L['EntryUr i']);
2178     2264  
2179                if (in_a rray($sSea rchedTag,$ aTags)) {   2265                if (in_a rray($sSea rchedTag,$ aTags)) {
2180                    $sBl ogPosts .=  <<<EOF   2266                    $sBl ogPosts .=  <<<EOF
2181   <div class ="cls_resu lt_row">   2267   <div class ="cls_resu lt_row">
2182       <div c lass="thum bnail_bloc k" style=" float:left ;">   2268       <div c lass="thum bnail_bloc k" style=" float:left ;">
2183           <a  href="{$s GenUrl}">   2269           <a  href="{$s GenUrl}">
2184                {$sImgEL }   2270                {$sImgEL }
2185           </ a>   2271           </ a>
2186       </div>   2272       </div>
2187       <div c lass="cls_ res_info_n owidth" {$ sDataStyle Width}>   2273       <div c lass="cls_ res_info_n owidth" {$ sDataStyle Width}>
2188           <d iv class=" cls_res_in fo_p">   2274           <d iv class=" cls_res_in fo_p">
2189                <a class ="actions"  href="{$s GenUrl}">{ $aResSQL[' Title']}</ a>   2275                <a class ="actions"  href="{$s GenUrl}">{ $aResSQL[' Title']}</ a>
2190           </ div>   2276           </ div>
2191           <d iv class=" cls_res_in fo_p">   2277           <d iv class=" cls_res_in fo_p">
2192                <!-- <sp an style=" vertical-a lign:middl e;">   2278                <!-- <sp an style=" vertical-a lign:middl e;">
2193                    <img  src="{$si te['icons' ]}tag_smal l.png" cla ss="marg_i con" alt=" " />   2279                    <img  src="{$si te['icons' ]}tag_smal l.png" cla ss="marg_i con" alt=" " />
2194                </span>- ->{$sTagsC }:&nbsp;{$ sTagsHrefs }   2280                </span>- ->{$sTagsC }:&nbsp;{$ sTagsHrefs }
2195           </ div>   2281           </ div>
2196           <! -- <div cl ass="cls_r es_info_p" >   2282           <! -- <div cl ass="cls_r es_info_p" >
2197                {$sStatu sMessageC} : <div cla ss="clr3"> {$sStatusM essage}</d iv>   2283                {$sStatu sMessageC} : <div cla ss="clr3"> {$sStatusM essage}</d iv>
2198           </ div> -->   2284           </ div> -->
2199           <d iv class=" cls_res_in fo_p">   2285           <d iv class=" cls_res_in fo_p">
2200                {$sDateC }: <div cl ass="clr3" >{$sDateTi me}</div>   2286                {$sDateC }: <div cl ass="clr3" >{$sDateTi me}</div>
2201           </ div>   2287           </ div>
2202           <d iv class=" cls_res_in fo_p">   2288           <d iv class=" cls_res_in fo_p">
2203                {$sPlace C}: <div c lass="clr3 ">{$sCount ry}{$sCity }{$sPlace} </div>   2289                {$sPlace C}: <div c lass="clr3 ">{$sCount ry}{$sCity }{$sPlace} </div>
2204           </ div>   2290           </ div>
2205           <d iv class=" cls_res_in fo_p">   2291           <d iv class=" cls_res_in fo_p">
2206                {$sDescr iptionC}:  <div class ="clr3">{$ sDescripti on}</div>   2292                {$sDescr iptionC}:  <div class ="clr3">{$ sDescripti on}</div>
2207           </ div>   2293           </ div>
2208           <d iv class=" cls_res_in fo_p">   2294           <d iv class=" cls_res_in fo_p">
2209                {$sViewP articipant s}   2295                {$sViewP articipant s}
2210           </ div>   2296           </ div>
2211       </div>   2297       </div>
2212       <div c lass="clea r_both"></ div>   2298       <div c lass="clea r_both"></ div>
2213   </div>   2299   </div>
2214   EOF;   2300   EOF;
2215                }   2301                }
2216           }   2302           }
2217     2303  
2218           $s BlogPosts  = ($sBlogP osts == '' ) ? MsgBox (_t( '_Sor ry, nothin g found' ) ) : $sBlog Posts;   2304           $s BlogPosts  = ($sBlogP osts == '' ) ? MsgBox (_t( '_Sor ry, nothin g found' ) ) : $sBlog Posts;
2219           re turn $this ->Decorate AsTable($s TagC.' - ' .$sSearche dTag, $sBl ogPosts);   2305           re turn $this ->Decorate AsTable($s TagC.' - ' .$sSearche dTag, $sBl ogPosts);
2220       }   2306       }
2221     2307  
2222       /**   2308       /**
2223        * SQL  Get all P rofiles da ta by Prof ile Id   2309        * SQL  Get all P rofiles da ta by Prof ile Id
2224        *   2310        *
2225         * @p aram $iPro fileId   2311         * @p aram $iPro fileId
2226        * @re turn SQL d ata   2312        * @re turn SQL d ata
2227        */   2313        */
2228       functi on GetProf ileData($i ProfileId)  {   2314       functi on GetProf ileData($i ProfileId)  {
2229           re turn getPr ofileInfo(  $iProfile Id );   2315           re turn getPr ofileInfo(  $iProfile Id );
2230       }   2316       }
2231     2317  
2232       functi on GetEven tPicture($ iEventID,  $sEventPic Name='DOLP HIN') {   2318       functi on GetEven tPicture($ iEventID,  $sEventPic Name='DOLP HIN') {
2233           gl obal $dir;   2319           gl obal $dir;
2234           gl obal $site ;   2320           gl obal $site ;
2235           gl obal $tmpl ;   2321           gl obal $tmpl ;
2236           $s SpacerName  = $this - > sSpacerP ath;   2322           $s SpacerName  = $this - > sSpacerP ath;
2237           if  ($sEventP icName=='D OLPHIN') {   2323           if  ($sEventP icName=='D OLPHIN') {
2238                $sReques t = "SELEC T `PhotoFi lename`,`T itle` FROM  `SDatingE vents` WHE RE `ID` =  {$iEventID } LIMIT 1" ;   2324                $sReques t = "SELEC T `PhotoFi lename`,`T itle` FROM  `SDatingE vents` WHE RE `ID` =  {$iEventID } LIMIT 1" ;
2239                $aResPic  = db_arr( $sRequest) ;   2325                $aResPic  = db_arr( $sRequest) ;
2240                $sEventP icName = $ aResPic['P hotoFilena me'];   2326                $sEventP icName = $ aResPic['P hotoFilena me'];
2241                $this->i ThumbSize  = 45;   2327                $this->i ThumbSize  = 45;
2242                $sAlt =  $aResPic[' Title'];   2328                $sAlt =  $aResPic[' Title'];
2243                $sTypePi c = "icon_ ";   2329                $sTypePi c = "icon_ ";
2244           }  else {   2330           }  else {
2245                $sTypePi c = "thumb _";   2331                $sTypePi c = "thumb _";
2246                $sAlt =  $sEventPic Name;   2332                $sAlt =  $sEventPic Name;
2247           }   2333           }
2248     2334  
2249           $s GenUrl = $ this->genU rl($iEvent ID, '', 'e ntry', tru e);   2335           $s GenUrl = $ this->genU rl($iEvent ID, '', 'e ntry', tru e);
2250     2336  
2251           $s EventPicNa me = ( str len(trim($ sEventPicN ame)) && f ile_exists ($dir['sda tingImage' ] . $sEven tPicName)  )   2337           $s EventPicNa me = ( str len(trim($ sEventPicN ame)) && f ile_exists ($dir['sda tingImage' ] . $sEven tPicName)  )
2252                    ? "< img class= \"photo1\"  style=\"w idth:{$thi s->iThumbS ize}px;hei ght:{$this ->iThumbSi ze}px;back ground-ima ge:url({$s ite['sdati ngImage']} {$sTypePic }{$sEventP icName});\ " src=\"{$ sSpacerNam e}\" alt=\ "{$sAlt}\"  />"   2338                    ? "< img class= \"photo1\"  style=\"w idth:{$thi s->iThumbS ize}px;hei ght:{$this ->iThumbSi ze}px;back ground-ima ge:url({$s ite['sdati ngImage']} {$sTypePic }{$sEventP icName});\ " src=\"{$ sSpacerNam e}\" alt=\ "{$sAlt}\"  />"
2253                    : "< img class= \"photo1\"  style=\"w idth:{$thi s->iThumbS ize}px;hei ght:{$this ->iThumbSi ze}px;back ground-ima ge:url({$s ite['url'] }templates /tmpl_{$tm pl}/{$this ->sPicNotA vail});\"  src=\"{$sS pacerName} \" alt=\"{ $sAlt}\" / >";   2339                    : "< img class= \"photo1\"  style=\"w idth:{$thi s->iThumbS ize}px;hei ght:{$this ->iThumbSi ze}px;back ground-ima ge:url({$s ite['url'] }templates /tmpl_{$tm pl}/{$this ->sPicNotA vail});\"  src=\"{$sS pacerName} \" alt=\"{ $sAlt}\" / >";
2254           $s EventPic =  <<<EOF   2340           $s EventPic =  <<<EOF
2255   <div  clas s="thumbna il_block"  style="flo at:left;">   2341   <div  clas s="thumbna il_block"  style="flo at:left;">
2256       <a hre f="{$sGenU rl}">   2342       <a hre f="{$sGenU rl}">
2257           {$ sEventPicN ame}   2343           {$ sEventPicN ame}
2258       </a>   2344       </a>
2259   </div>   2345   </div>
2260   EOF;   2346   EOF;
2261           re turn $sEve ntPic;   2347           re turn $sEve ntPic;
2262       }   2348       }
2263     2349  
2264       functi on genUrl( $iEntryId,  $sEntryUr i, $sType= 'entry', $ bForce = f alse) { // sType - en try / part /search   2350       functi on genUrl( $iEntryId,  $sEntryUr i, $sType= 'entry', $ bForce = f alse) { // sType - en try / part /search
2265           gl obal $site ;   2351           gl obal $site ;
2266     2352  
2267           if  ($bForce)  {   2353           if  ($bForce)  {
2268                $sEntryU ri = db_va lue("SELEC T `EntryUr i` FROM `S DatingEven ts` WHERE  `ID`='{$iE ntryId}' L IMIT 1");   2354                $sEntryU ri = db_va lue("SELEC T `EntryUr i` FROM `S DatingEven ts` WHERE  `ID`='{$iE ntryId}' L IMIT 1");
2269           }   2355           }
2270     2356  
2271           $s MainUrl =  $site['url '];   2357           $s MainUrl =  $site['url '];
2272     2358  
2273           if  ($this->b UseFriendl yLinks) {   2359           if  ($this->b UseFriendl yLinks) {
2274                $sUrl =  $sMainUrl. "events/{$ sType}/{$s EntryUri}" ;   2360                $sUrl =  $sMainUrl. "events/{$ sType}/{$s EntryUri}" ;
2275           }  else {   2361           }  else {
2276                $sUrl =  '';   2362                $sUrl =  '';
2277                switch ( $sType) {   2363                switch ( $sType) {
2278                    case  'entry':   2364                    case  'entry':
2279                         $sUrl = "{ $sMainUrl} events.php ?action=sh ow_info&am p;event_id ={$iEntryI d}";   2365                         $sUrl = "{ $sMainUrl} events.php ?action=sh ow_info&am p;event_id ={$iEntryI d}";
2280                         break;   2366                         break;
2281                    case  'part':   2367                    case  'part':
2282                         $sUrl = "{ $sMainUrl} events.php ?action=sh ow_part&am p;event_id ={$iEntryI d}";   2368                         $sUrl = "{ $sMainUrl} events.php ?action=sh ow_part&am p;event_id ={$iEntryI d}";
2283                         break;   2369                         break;
2284                    case  'search':   2370                    case  'search':
2285                         $sUrl = "{ $sMainUrl} events.php ?action=se arch_by_ta g&amp;tagK ey={$sEntr yUri}";   2371                         $sUrl = "{ $sMainUrl} events.php ?action=se arch_by_ta g&amp;tagK ey={$sEntr yUri}";
2286                         break;   2372                         break;
2287                }   2373                }
2288           }   2374           }
2289           re turn $sUrl ;   2375           re turn $sUrl ;
2290       }   2376       }
2291     2377  
2292       functi on GenAnyB lockConten t($sOrder= 'last', $i ProfileID= 0, $sLimit ="LIMIT 5"  ) {   2378       functi on GenAnyB lockConten t($sOrder= 'last', $i ProfileID= 0, $sLimit ="LIMIT 5"  ) {
2293           gl obal $site ;   2379           gl obal $site ;
2294           gl obal $shor t_date_for mat;   2380           gl obal $shor t_date_for mat;
2295     2381  
2296           $p hp_date_fo rmat = get Param( 'ph p_date_for mat' );   2382           $p hp_date_fo rmat = get Param( 'ph p_date_for mat' );
2297           $i BlogLimitC hars = (in t)getParam ("max_blog _preview") ;   2383           $i BlogLimitC hars = (in t)getParam ("max_blog _preview") ;
2298           $s ClockIcon  = getTempl ateIcon( ' clock.gif'  );   2384           $s ClockIcon  = getTempl ateIcon( ' clock.gif'  );
2299     2385  
2300           $s OrderS = ' ';   2386           $s OrderS = ' ';
2301           sw itch ($sOr der) {   2387           sw itch ($sOr der) {
2302                case 'la st':   2388                case 'la st':
2303                    $sOr derS = "OR DER BY `Ev entStart`  DESC";   2389                    $sOr derS = "OR DER BY `Ev entStart`  DESC";
2304                    brea k;   2390                    brea k;
2305                case 'la test':   2391                case 'la test':
2306                    $sOr derS = "OR DER BY `Ev entStart`  DESC";   2392                    $sOr derS = "OR DER BY `Ev entStart`  DESC";
2307                    brea k;   2393                    brea k;
2308                case 'ra nd':   2394                case 'ra nd':
2309                    $sOr derS = "OR DER BY RAN D()";   2395                    $sOr derS = "OR DER BY RAN D()";
2310                    brea k;   2396                    brea k;
2311                case 'fi rst':   2397                case 'fi rst':
2312                    $sOr derS = "OR DER BY `Ev entStart`  ASC";   2398                    $sOr derS = "OR DER BY `Ev entStart`  ASC";
2313                    brea k;   2399                    brea k;
2314           }   2400           }
2315           $s ProfileS =  ($iProfil eID>0) ? " (`SDatingE vents`.`Re sponsibleI D` = '{$iP rofileID}'  OR `SDati ngParticip ants`.`IDM ember` = ' {$iProfile ID}')" : ' 1';   2401           $s ProfileS =  ($iProfil eID>0) ? " (`SDatingE vents`.`Re sponsibleI D` = '{$iP rofileID}'  OR `SDati ngParticip ants`.`IDM ember` = ' {$iProfile ID}')" : ' 1';
2316     2402  
2317           $s Query = "   2403           $s Query = "
2318                SELECT D ISTINCT `S DatingEven ts`. * , ` Profiles`. `NickName`  ,   2404                SELECT D ISTINCT `S DatingEven ts`. * , ` Profiles`. `NickName`  ,
2319                UNIX_TIM ESTAMP( `S DatingEven ts`.`Event Start` ) A S `DateTim e_f`    2405                UNIX_TIM ESTAMP( `S DatingEven ts`.`Event Start` ) A S `DateTim e_f` 
2320                FROM `SD atingEvent s`    2406                FROM `SD atingEvent s` 
2321                INNER JO IN `Profil es` ON `Pr ofiles`.`I D` = `SDat ingEvents` .`Responsi bleID`    2407                INNER JO IN `Profil es` ON `Pr ofiles`.`I D` = `SDat ingEvents` .`Responsi bleID` 
2322                LEFT JOI N `SDating Participan ts` ON `SD atingParti cipants`.` IDEvent` =  `SDatingE vents`.`ID   2408                LEFT JOI N `SDating Participan ts` ON `SD atingParti cipants`.` IDEvent` =  `SDatingE vents`.`ID
2323                WHERE {$ sProfileS}   2409                WHERE {$ sProfileS}
2324                AND `SDa tingEvents `.`Status`  = 'Active '   2410                AND `SDa tingEvents `.`Status`  = 'Active '
2325                {$sOrder S}   2411                {$sOrder S}
2326                {$sLimit }   2412                {$sLimit }
2327           ";   2413           ";
2328     2414  
2329           $r Blogs = db _res( $sQu ery );   2415           $r Blogs = db _res( $sQu ery );
2330     2416  
2331           if ( !mysql_n um_rows( $ rBlogs ) )   2417           if ( !mysql_n um_rows( $ rBlogs ) )
2332                return ' ';   2418                return M sgBox(_t(' _Sorry, no thing foun d'));
2333     2419  
2334           $s Blocks = ' ';   2420           $s Blocks = ' ';
2335           wh ile( $aBlo g = mysql_ fetch_asso c( $rBlogs  ) ) {   2421           wh ile( $aBlo g = mysql_ fetch_asso c( $rBlogs  ) ) {
2336                $sPic =  $this->Get EventPictu re($aBlog[ 'ID']);   2422                $sPic =  $this->Get EventPictu re($aBlog[ 'ID']);
2337     2423  
2338                $sGenUrl  = $this-> genUrl($aB log['ID'],  $aBlog['E ntryUri']) ;   2424                $sGenUrl  = $this-> genUrl($aB log['ID'],  $aBlog['E ntryUri']) ;
2339     2425  
2340                $sLinkMo re = '';   2426                $sLinkMo re = '';
2341                if( strl en( $aBlog ['Descript ion']) > $ iBlogLimit Chars )    2427                if( strl en( $aBlog ['Descript ion']) > $ iBlogLimit Chars ) 
2342                    $sLi nkMore = " ... <a hre f=\"{$sGen Url}\">"._ t('_Read m ore')."</a >";   2428                    $sLi nkMore = " ... <a hre f=\"{$sGen Url}\">"._ t('_Read m ore')."</a >";
2343     2429  
2344                $sBlogSn ippet = mb _substr( s trip_tags(  $aBlog['D escription '] ), 0, $ iBlogLimit Chars ) .  $sLinkMore ;   2430                $sBlogSn ippet = mb _substr( s trip_tags(  $aBlog['D escription '] ), 0, $ iBlogLimit Chars ) .  $sLinkMore ;
2345                
$sDataTime Formatted   =   date(   $php_date_ format,   $aBlog['Da teTime_f']   );
  2431                 // $sDataTime Formatted   =   date(   $php_date_ format,   $aBlog['Da teTime_f']   );
    2432                $sDataTi meFormatte d = Locale dDataTime( $aBlog['Da teTime_f'] );
2346                $sBlocks  .= <<<EOF   2433                $sBlocks  .= <<<EOF
2347   <div class ="blog_blo ck">   2434   <div class ="blog_blo ck">
2348       <div c lass="icon _block">   2435       <div c lass="icon _block">
2349           {$ sPic}   2436           {$ sPic}
2350       </div>   2437       </div>
2351       <div c lass="blog _wrapper_n ">   2438       <div c lass="blog _wrapper_n ">
2352           <d iv class=" blog_subje ct_n">   2439           <d iv class=" blog_subje ct_n">
2353                <a href= "{$sGenUrl }" class=" bottom_tex t">   2440                <a href= "{$sGenUrl }" class=" bottom_tex t">
2354                    {$aB log['Title ']}   2441                    {$aB log['Title ']}
2355                </a>   2442                </a>
2356           </ div>   2443           </ div>
2357           <d iv class=" blogInfo">   2444           <d iv class=" blogInfo">
2358                <span><i mg src="{$ sClockIcon }" alt=""  />{$sDataT imeFormatt ed} </span >   2445                <span><i mg src="{$ sClockIcon }" alt=""  />{$sDataT imeFormatt ed} </span >
2359           </ div>   2446           </ div>
2360           <d iv class=" blogSnippe t">   2447           <d iv class=" blogSnippe t">
2361                {$sBlogS nippet}   2448                {$sBlogS nippet}
2362           </ div>   2449           </ div>
2363       </div>   2450       </div>
2364   </div>   2451   </div>
2365   <div class ="clear_bo th"></div>   2452   <div class ="clear_bo th"></div>
2366   EOF;   2453   EOF;
2367           }   2454           }
2368     2455  
    2456           if  ($sBlocks  == '') $s Blocks = M sgBox(_t(' _Sorry, no thing foun d'));
2369           re turn $sBlo cks;   2457           re turn $sBlo cks;
2370       }   2458       }
2371     2459  
2372       functi on process _html_db_i nput( $sTe xt ) {   2460       functi on process _html_db_i nput( $sTe xt ) {
2373           re turn addsl ashes( cle ar_xss( tr im( proces s_pass_dat a( $sText  ))));   2461           re turn addsl ashes( cle ar_xss( tr im( proces s_pass_dat a( $sText  ))));
2374       }   2462       }
2375   }   2463   }
2376     2464  
2377   ?>   2465   ?>