6. Araxis Merge File Comparison Report

Produced by Araxis Merge on Mon May 18 06:28:23 2009 UTC. See www.araxis.com for information about Merge. 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.

6.1 Files compared

# Location File Last Modified
1 D:\Dolphin-v.6.1.5\inc\classes BxDolEvents.php Fri May 1 05:23:57 2009 UTC
2 D:\Dolphin-v.6.1.6\inc\classes BxDolEvents.php Fri May 15 05:15:22 2009 UTC

6.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 4632
Changed 1 2
Inserted 0 0
Removed 0 0

6.3 Comparison options

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

6.4 Active regular expressions

No regular expressions were active.

6.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           // variables   17           // variables
18     18  
19           // count of e vents per  page   19           // count of e vents per  page
20           va r $iEvents PerPage; / / count of  events to  show per  page   20           va r $iEvents PerPage; / / count of  events to  show per  page
21     21  
22           // max sizes  of picture s for resi zing durin g upload   22           // max sizes  of picture s for resi zing durin g upload
23           va r $iIconSi ze;   23           va r $iIconSi ze;
24           va r $iThumbS ize;   24           va r $iThumbS ize;
25           va r $iImgSiz e;   25           va r $iImgSiz e;
26     26  
27           // admin mode , can All  actions   27           // admin mode , can All  actions
28           va r $bAdminM ode;   28           va r $bAdminM ode;
29     29  
30           // path to im age pic_no t_avail.gi f   30           // path to im age pic_no t_avail.gi f
31           va r $sPicNot Avail;   31           va r $sPicNot Avail;
32           // path to sp acer image   32           // path to sp acer image
33           va r $sSpacer Path;   33           va r $sSpacer Path;
34     34  
35           va r $iLastIn sertedID =  -1;   35           va r $iLastIn sertedID =  -1;
36     36  
37           // use permal ink   37           // use permal ink
38           va r $bUseFri endlyLinks ;   38           va r $bUseFri endlyLinks ;
39     39  
40           /* *   40           /* *
41            *  construct or   41            *  construct or
42            * /   42            * /
43           fu nction BxD olEvents($ bAdmMode =  FALSE) {   43           fu nction BxD olEvents($ bAdmMode =  FALSE) {
44                    glob al $site;   44                    glob al $site;
45     45  
46                    $thi s->sSpacer Path = get TemplateIc on( 'space r.gif' );   46                    $thi s->sSpacer Path = get TemplateIc on( 'space r.gif' );
47                    $thi s->sPicNot Avail = 'i mages/icon s/group_no _pic.gif';   47                    $thi s->sPicNot Avail = 'i mages/icon s/group_no _pic.gif';
48                    $thi s->bAdminM ode = $bAd mMode;   48                    $thi s->bAdminM ode = $bAd mMode;
49     49  
50                    $thi s->iEvents PerPage =  10;   50                    $thi s->iEvents PerPage =  10;
51     51  
52                    $thi s->iIconSi ze = 45;   52                    $thi s->iIconSi ze = 45;
53                    $thi s->iThumbS ize = 110;   53                    $thi s->iThumbS ize = 110;
54                    $thi s->iImgSiz e = 340;   54                    $thi s->iImgSiz e = 340;
55     55  
56                    $thi s->bUseFri endlyLinks  = getPara m('permali nks_events ') == 'on'  ? true :  false;   56                    $thi s->bUseFri endlyLinks  = getPara m('permali nks_events ') == 'on'  ? true :  false;
57           }   57           }
58     58  
59           /* *   59           /* *
60            *  Compose A rray of po sted data  before val idating (p ost ad or  edit)   60            *  Compose A rray of po sted data  before val idating (p ost ad or  edit)
61            *   61            *
62            *  @return A rray of po sted varia bles   62            *  @return A rray of po sted varia bles
63            * /   63            * /
64           fu nction Fil lPostEvent ArrByPostV alues() {   64           fu nction Fil lPostEvent ArrByPostV alues() {
65                    $sEv entTitle                      =  process_db _input( $_ POST['even t_title'],  1 );   65                    $sEv entTitle                      =  process_db _input( $_ POST['even t_title'],  1 );
66                    $sEv entDesc                                = $t his->proce ss_html_db _input( $_ POST['even t_desc'] ) ;   66                    $sEv entDesc                                = $t his->proce ss_html_db _input( $_ POST['even t_desc'] ) ;
67                    $sEv entStatusM essage     = process_ db_input(  $_POST['ev ent_status msg'], 1 ) ;   67                    $sEv entStatusM essage     = process_ db_input(  $_POST['ev ent_status msg'], 1 ) ;
68                    $sTa gs                                     = pr ocess_db_i nput( $_PO ST['event_ tags'], 1  );   68                    $sTa gs                                     = pr ocess_db_i nput( $_PO ST['event_ tags'], 1  );
69     69  
70                    $sEv entCountry   = proces s_db_input ( $_POST[' event_coun try'], 1 ) ;   70                    $sEv entCountry   = proces s_db_input ( $_POST[' event_coun try'], 1 ) ;
71                    $sEv entCity               = process_ db_input(  $_POST['ev ent_city'] , 1 );   71                    $sEv entCity               = process_ db_input(  $_POST['ev ent_city'] , 1 );
72                    $sEv entPlace     = proces s_db_input ( $_POST[' event_plac e'], 1 );   72                    $sEv entPlace     = proces s_db_input ( $_POST[' event_plac e'], 1 );
73     73  
74                    $sEv entStart     = (isset ($_POST['e vent_start ']) && $_P OST['event _start'] ! = '') ? st rtotime( $ _POST['eve nt_start']  ) : -1;   74                    $sEv entStart     = (isset ($_POST['e vent_start ']) && $_P OST['event _start'] ! = '') ? st rtotime( $ _POST['eve nt_start']  ) : -1;
75                    if ( $this->bAd minMode) {   75                    if ( $this->bAd minMode) {
76                             $sEven tEnd                        = st rtotime( $ _POST['eve nt_end'] ) ;   76                             $sEven tEnd                        = st rtotime( $ _POST['eve nt_end'] ) ;
77                             $sEven tSaleStart         =  strtotime(  $_POST['e vent_sale_ start'] );   77                             $sEven tSaleStart         =  strtotime(  $_POST['e vent_sale_ start'] );
78                             $sEven tSaleEnd           =  strtotime(  $_POST['e vent_sale_ end'] );   78                             $sEven tSaleEnd           =  strtotime(  $_POST['e vent_sale_ end'] );
79                             $iEven tCountF =  (int)$_POS T['event_c ount_femal e'];   79                             $iEven tCountF =  (int)$_POS T['event_c ount_femal e'];
80                             $iEven tCountM =  (int)$_POS T['event_c ount_male' ];   80                             $iEven tCountM =  (int)$_POS T['event_c ount_male' ];
81                    }   81                    }
82     82  
83                    $aEl ements = a rray('Titl e' => $sEv entTitle,  'Descripti on' => $sE ventDesc,  'Status me ssage' =>  $sEventSta tusMessage ,   83                    $aEl ements = a rray('Titl e' => $sEv entTitle,  'Descripti on' => $sE ventDesc,  'Status me ssage' =>  $sEventSta tusMessage ,
84                             'City'  => $sEven tCity, 'Co untry' =>  $sEventCou ntry, 'Pla ce' => $sE ventPlace,  'Event st art' => $s EventStart ,   84                             'City'  => $sEven tCity, 'Co untry' =>  $sEventCou ntry, 'Pla ce' => $sE ventPlace,  'Event st art' => $s EventStart ,
85                             'Event  end' => $ sEventEnd,  'Ticket S ale Start'  => $sEven tSaleStart , 'Ticket  Sale End'  => $sEvent SaleEnd,   85                             'Event  end' => $ sEventEnd,  'Ticket S ale Start'  => $sEven tSaleStart , 'Ticket  Sale End'  => $sEvent SaleEnd,
86                             'Femal e Ticket C ount' => $ iEventCoun tF, 'Male  Ticket Cou nt' => $iE ventCountM   86                             'Femal e Ticket C ount' => $ iEventCoun tF, 'Male  Ticket Cou nt' => $iE ventCountM
87                             'Tags'  => $sTags );   87                             'Tags'  => $sTags );
88     88  
89                    retu rn $aEleme nts;   89                    retu rn $aEleme nts;
90           }   90           }
91     91  
92           /* *   92           /* *
93            *  Generate  common for ms and inc ludes js   93            *  Generate  common for ms and inc ludes js
94            *   94            *
95            *  @return H TML presen tation of  data   95            *  @return H TML presen tation of  data
96            * /   96            * /
97           fu nction Pri ntCommandF orms() {   97           fu nction Pri ntCommandF orms() {
98                    glob al $site;   98                    glob al $site;
99                    $sJS Path = $si te['url']  . 'inc/';   99                    $sJS Path = $si te['url']  . 'inc/';
100     100  
101                    $sRe tHtml = << <EOF   101                    $sRe tHtml = << <EOF
102   <script sr c="{$sJSPa th}js/dyna mic_core.j s.php" typ e="text/ja vascript"> </script>   102   <script sr c="{$sJSPa th}js/dyna mic_core.j s.php" typ e="text/ja vascript"> </script>
103   <form acti on="{$_SER VER['PHP_S ELF']}" me thod="post " name="co mmand_edit _event">   103   <form acti on="{$_SER VER['PHP_S ELF']}" me thod="post " name="co mmand_edit _event">
104           <i nput type= "hidden" n ame="actio n" id="act ion" value ="edit_eve nt" />   104           <i nput type= "hidden" n ame="actio n" id="act ion" value ="edit_eve nt" />
105           <i nput type= "hidden" n ame="EditE ventID" id ="EditEven tID" value ="" />   105           <i nput type= "hidden" n ame="EditE ventID" id ="EditEven tID" value ="" />
106   </form>   106   </form>
107   <form acti on="{$_SER VER['PHP_S ELF']}" me thod="post " name="co mmand_dele te_event">   107   <form acti on="{$_SER VER['PHP_S ELF']}" me thod="post " name="co mmand_dele te_event">
108           <i nput type= "hidden" n ame="actio n" id="act ion" value ="delete_e vent" />   108           <i nput type= "hidden" n ame="actio n" id="act ion" value ="delete_e vent" />
109           <i nput type= "hidden" n ame="Delet eEventID"  id="Delete EventID" v alue="" />   109           <i nput type= "hidden" n ame="Delet eEventID"  id="Delete EventID" v alue="" />
110   </form>   110   </form>
111   EOF;   111   EOF;
112                    retu rn $sRetHt ml;   112                    retu rn $sRetHt ml;
113           }   113           }
114     114  
115           fu nction Che ckLogged()  {   115           fu nction Che ckLogged()  {
116                    glob al $logged ;   116                    glob al $logged ;
117                    if(  !$logged[' member'] & & !$logged ['admin']  ) {   117                    if(  !$logged[' member'] & & !$logged ['admin']  ) {
118                             member _auth(0);   118                             member _auth(0);
119                    }   119                    }
120           }   120           }
121     121  
122           fu nction Del eteProfile Events($iP rofileID)  {   122           fu nction Del eteProfile Events($iP rofileID)  {
123                    if ( $this->bAd minMode==t rue) {   123                    if ( $this->bAd minMode==t rue) {
124                             $vDelS QL = db_re s("SELECT  `ID` FROM  `SDatingEv ents` WHER E `Respons ibleID` =  '{$iProfil eID}'");   124                             $vDelS QL = db_re s("SELECT  `ID` FROM  `SDatingEv ents` WHER E `Respons ibleID` =  '{$iProfil eID}'");
125                             while(  $aEnent =  mysql_fet ch_assoc($ vDelSQL) )  {   125                             while(  $aEnent =  mysql_fet ch_assoc($ vDelSQL) )  {
126                                      $this->P ageSDating DeleteEven t($aEnent[ 'ID']);   126                                      $this->P ageSDating DeleteEven t($aEnent[ 'ID']);
127                             }   127                             }
128                    }   128                    }
129           }   129           }
130     130  
131           fu nction Pag eSDatingDe leteEvent( $iDelEvent ID = -1) {   131           fu nction Pag eSDatingDe leteEvent( $iDelEvent ID = -1) {
132                    glob al $dir;   132                    glob al $dir;
133     133  
134                    $thi s->CheckLo gged();   134                    $thi s->CheckLo gged();
135     135  
136                    $sEv entID = ($ iDelEventI D>0) ? $iD elEventID  : (int)$_P OST['Delet eEventID'] ;   136                    $sEv entID = ($ iDelEventI D>0) ? $iD elEventID  : (int)$_P OST['Delet eEventID'] ;
137     137  
138                    $aOw ner = db_a rr("SELECT  `Responsi bleID` FRO M `SDating Events` WH ERE `ID` =  '{$sEvent ID}' LIMIT  1");   138                    $aOw ner = db_a rr("SELECT  `Responsi bleID` FRO M `SDating Events` WH ERE `ID` =  '{$sEvent ID}' LIMIT  1");
139                    if ( $aOwner['R esponsible ID']==(int )$_COOKIE[ 'memberID' ] || $this ->bAdminMo de) {   139                    if ( $aOwner['R esponsible ID']==(int )$_COOKIE[ 'memberID' ] || $this ->bAdminMo de) {
140                             $vPost s = db_res ( "DELETE  FROM `SDat ingPartici pants` WHE RE `IDEven t`={$sEven tID}" );   140                             $vPost s = db_res ( "DELETE  FROM `SDat ingPartici pants` WHE RE `IDEven t`={$sEven tID}" );
141     141  
142                             $aPicS QL = db_ar r("SELECT  `PhotoFile name` FROM  `SDatingE vents` WHE RE `ID` =  '{$sEventI D}'");   142                             $aPicS QL = db_ar r("SELECT  `PhotoFile name` FROM  `SDatingE vents` WHE RE `ID` =  '{$sEventI D}'");
143                             $sMedi aFileName  = $aPicSQL ['PhotoFil ename'];   143                             $sMedi aFileName  = $aPicSQL ['PhotoFil ename'];
144                             if ($s MediaFileN ame != '')  {   144                             if ($s MediaFileN ame != '')  {
145                                      if (@unl ink ( $dir ['sdatingI mage'] . $ sMediaFile Name ) ==  FALSE) {   145                                      if (@unl ink ( $dir ['sdatingI mage'] . $ sMediaFile Name ) ==  FALSE) {
146                                               $sRetHtml  .= MsgBox( _t('_FAILE D_TO_DELET E_PIC', $s MediaFileN ame));   146                                               $sRetHtml  .= MsgBox( _t('_FAILE D_TO_DELET E_PIC', $s MediaFileN ame));
147                                      }   147                                      }
148                                      if (@unl ink ( $dir ['sdatingI mage'] . ' thumb_'.$s MediaFileN ame ) == F ALSE) {   148                                      if (@unl ink ( $dir ['sdatingI mage'] . ' thumb_'.$s MediaFileN ame ) == F ALSE) {
149                                               $sRetHtml  .= MsgBox( _t('_FAILE D_TO_DELET E_PIC', $s MediaFileN ame));   149                                               $sRetHtml  .= MsgBox( _t('_FAILE D_TO_DELET E_PIC', $s MediaFileN ame));
150                                      }   150                                      }
151                                      if (@unl ink ( $dir ['sdatingI mage'] . ' icon_'.$sM ediaFileNa me ) == FA LSE) {   151                                      if (@unl ink ( $dir ['sdatingI mage'] . ' icon_'.$sM ediaFileNa me ) == FA LSE) {
152                                               $sRetHtml  .= MsgBox( _t('_FAILE D_TO_DELET E_PIC', $s MediaFileN ame));   152                                               $sRetHtml  .= MsgBox( _t('_FAILE D_TO_DELET E_PIC', $s MediaFileN ame));
153                                      }   153                                      }
154                             }   154                             }
155                             $sQuer y = "DELET E FROM `SD atingEvent s` WHERE ` SDatingEve nts`.`ID`  = '{$sEven tID}' LIMI T 1";   155                             $sQuer y = "DELET E FROM `SD atingEvent s` WHERE ` SDatingEve nts`.`ID`  = '{$sEven tID}' LIMI T 1";
156                             db_res ( $sQuery  );   156                             db_res ( $sQuery  );
157                             return  MsgBox(_t ('_event_d eleted'));   157                             return  MsgBox(_t ('_event_d eleted'));
158                    } el seif ($aOw ner['Respo nsibleID'] !=(int)$_C OOKIE['mem berID']) {   158                    } el seif ($aOw ner['Respo nsibleID'] !=(int)$_C OOKIE['mem berID']) {
159                             return  MsgBox(_t ('_Hacker  String'));   159                             return  MsgBox(_t ('_Hacker  String'));
160                    } el se {   160                    } el se {
161                             return  MsgBox(_t ('_event_d elete_fail ed'));   161                             return  MsgBox(_t ('_event_d elete_fail ed'));
162                    }   162                    }
163           }   163           }
164     164  
165           /* *   165           /* *
166            *  Compose A rray of er rors durin g filling  (validatin g)   166            *  Compose A rray of er rors durin g filling  (validatin g)
167            *   167            *
168            *  @param $a Elements     Input Ar ray with d ata   168            *  @param $a Elements     Input Ar ray with d ata
169            *  @return A rray with  errors   169            *  @return A rray with  errors
170            * /   170            * /
171           fu nction Che ckEventErr ors( $aEle ments ) {   171           fu nction Che ckEventErr ors( $aEle ments ) {
172                    $aEr r = array( );   172                    $aEr r = array( );
173                    fore ach( $aEle ments as $ sFieldName  => $sFiel dValue ) {   173                    fore ach( $aEle ments as $ sFieldName  => $sFiel dValue ) {
174                             switch ( $sFieldN ame ) {   174                             switch ( $sFieldN ame ) {
175                                      // case  'Status me ssage':   175                                      // case  'Status me ssage':
176                                      case 'Ti tle':   176                                      case 'Ti tle':
177                                      case 'Co untry':   177                                      case 'Co untry':
178                                               if( !mb_st rlen($sFie ldValue) )   178                                               if( !mb_st rlen($sFie ldValue) )
179                                                       $a Err[ $sFie ldName ] =  "{$sField Name} is r equired";   179                                                       $a Err[ $sFie ldName ] =  "{$sField Name} is r equired";
180                                      break;   180                                      break;
181                                      case 'De scription' :   181                                      case 'De scription' :
182                                               if( mb_str len($sFiel dValue) <  50 )   182                                               if( mb_str len($sFiel dValue) <  50 )
183                                                       $a Err[ $sFie ldName ] =  "{$sField Name} must  be 50 sym bols at le ast";   183                                                       $a Err[ $sFie ldName ] =  "{$sField Name} must  be 50 sym bols at le ast";
184                                      break;   184                                      break;
185                                      case 'Ci ty':   185                                      case 'Ci ty':
186                                      case 'Pl ace':   186                                      case 'Pl ace':
187                                               if( !mb_st rlen($sFie ldValue) & & $this->b AdminMode= =true )   187                                               if( !mb_st rlen($sFie ldValue) & & $this->b AdminMode= =true )
188                                                       $a Err[ $sFie ldName ] =  "{$sField Name} is r equired";   188                                                       $a Err[ $sFie ldName ] =  "{$sField Name} is r equired";
189                                      break;   189                                      break;
190     190  
191                                      case 'Ev ent start' :   191                                      case 'Ev ent start' :
192                                               if( $sFiel dValue > 0  ) {   192                                               if( $sFiel dValue > 0  ) {
193                                                       $s EventStart  = strtoti me($_REQUE ST['event_ start']);   193                                                       $s EventStart  = strtoti me($_REQUE ST['event_ start']);
194                                                       $s Now = strt otime("now ");   194                                                       $s Now = strt otime("now ");
195                                                       if  ($sEventS tart < $sN ow)   195                                                       if  ($sEventS tart < $sN ow)
196                                                                $aEr r[ $sField Name ] = " _event_pos t_wrong_ti me";   196                                                                $aEr r[ $sField Name ] = " _event_pos t_wrong_ti me";
197                                               } else {   197                                               } else {
198                                                       $a Err[ $sFie ldName ] =  "{$sField Name} is r equired";   198                                                       $a Err[ $sFie ldName ] =  "{$sField Name} is r equired";
199                                               }   199                                               }
200                                      break;   200                                      break;
201                                      case 'Ev ent end':   201                                      case 'Ev ent end':
202                                      case 'Ti cket Sale  Start':   202                                      case 'Ti cket Sale  Start':
203                                      case 'Ti cket Sale  End':   203                                      case 'Ti cket Sale  End':
204                                               if( $sFiel dValue ==  -1 && $thi s->bAdminM ode==true  )   204                                               if( $sFiel dValue ==  -1 && $thi s->bAdminM ode==true  )
205                                                       $a Err[ $sFie ldName ] =  "{$sField Name} is r equired";   205                                                       $a Err[ $sFie ldName ] =  "{$sField Name} is r equired";
206                                      break;   206                                      break;
207     207  
208                                      case 'Fe male Ticke t Count':   208                                      case 'Fe male Ticke t Count':
209                                      case 'Ma le Ticket  Count':   209                                      case 'Ma le Ticket  Count':
210                                               if( $sFiel dValue < 1  && $this- >bAdminMod e==true )   210                                               if( $sFiel dValue < 1  && $this- >bAdminMod e==true )
211                                                       $a Err[ $sFie ldName ] =  "{$sField Name} must  be positi ve";   211                                                       $a Err[ $sFie ldName ] =  "{$sField Name} must  be positi ve";
212                                      break;   212                                      break;
213                             }   213                             }
214                    }   214                    }
215                    retu rn $aErr;   215                    retu rn $aErr;
216           }   216           }
217     217  
218           /* *   218           /* *
219            *  function  for New/Ed it event   219            *  function  for New/Ed it event
220            *  @return T ext Result   220            *  @return T ext Result
221            * /   221            * /
222           fu nction SDA ddEvent( $ iEventID =  -1 ) {//f or update  event   222           fu nction SDA ddEvent( $ iEventID =  -1 ) {//f or update  event
223                    glob al $dir;   223                    glob al $dir;
224                    glob al $logged ;   224                    glob al $logged ;
225                    glob al $site;   225                    glob al $site;
226     226  
227                    if(  !$logged[' member'] & & !$logged ['admin']  ) {   227                    if(  !$logged[' member'] & & !$logged ['admin']  ) {
228                             member _auth(0);   228                             member _auth(0);
229                    }   229                    }
230     230  
231                    // c ollect inf ormation a bout curre nt member   231                    // c ollect inf ormation a bout curre nt member
232                    $aMe mber['ID']  = (int)$_ COOKIE['me mberID'];   232                    $aMe mber['ID']  = (int)$_ COOKIE['me mberID'];
233                    $aMe mberData =  getProfil eInfo( $aM ember['ID' ] );   233                    $aMe mberData =  getProfil eInfo( $aM ember['ID' ] );
234     234  
235                    // c ommon   235                    // c ommon
236                    $sEv entTitle           =  process_db _input( $_ POST['even t_title'],  1 );   236                    $sEv entTitle           =  process_db _input( $_ POST['even t_title'],  1 );
237                    $sEv entDesc            =  $this->pro cess_html_ db_input($ _POST['eve nt_desc']) ;   237                    $sEv entDesc            =  $this->pro cess_html_ db_input($ _POST['eve nt_desc']) ;
238                    $sEv entStatusM essage  =  process_db _input( $_ POST['even t_statusms g'], 1 );   238                    $sEv entStatusM essage  =  process_db _input( $_ POST['even t_statusms g'], 1 );
239     239  
240                    // e vent place   240                    // e vent place
241                    $sEv entCountry  = process _db_input(  $_POST['e vent_count ry'], 1 );   241                    $sEv entCountry  = process _db_input(  $_POST['e vent_count ry'], 1 );
242                    $sEv entCity     = process _db_input(  $_POST['e vent_city' ], 1 );   242                    $sEv entCity     = process _db_input(  $_POST['e vent_city' ], 1 );
243                    $Eve ntPlace     = process _db_input(  $_POST['e vent_place '], 1 );   243                    $Eve ntPlace     = process _db_input(  $_POST['e vent_place '], 1 );
244                    $sTa gs    = pr ocess_db_i nput( $_PO ST['event_ tags'], 1  );   244                    $sTa gs    = pr ocess_db_i nput( $_PO ST['event_ tags'], 1  );
245                    $aTa gs = explo deTags($sT ags);   245                    $aTa gs = explo deTags($sT ags);
246                    $sTa gs = implo de(",", $a Tags);   246                    $sTa gs = implo de(",", $a Tags);
247     247  
248                    $sEv entPhotoFi lename = ' ';   248                    $sEv entPhotoFi lename = ' ';
249     249  
250                    if ( $_FILES['e vent_photo ']) {   250                    if ( $_FILES['e vent_photo ']) {
251                             $sPict ureName =  $sBaseName ;   251                             $sPict ureName =  $sBaseName ;
252                             $aScan  = getimag esize($_FI LES['event _photo'][' tmp_name'] );   252                             $aScan  = getimag esize($_FI LES['event _photo'][' tmp_name'] );
253     253  
254                             if ( i n_array($a Scan[2], a rray(1,2,3 ,6)) && 0  < strlen(  $_FILES['e vent_photo ']['name'] ) ) {   254                             if ( i n_array($a Scan[2], a rray(1,2,3 ,6)) && 0  < strlen(  $_FILES['e vent_photo ']['name'] ) ) {
255     255  
256                                      $sCurren tTime = ti me();   256                                      $sCurren tTime = ti me();
257                                      if ($iEv entID == - 1) {   257                                      if ($iEv entID == - 1) {
258                                               $sBaseName  = 'g_'. $ sCurrentTi me .'_1';   258                                               $sBaseName  = 'g_'. $ sCurrentTi me .'_1';
259                                      } else {   259                                      } else {
260                                               $sBaseName  = db_valu e("SELECT  `PhotoFile name` FROM  `SDatingE vents` WHE RE `ID`='{ $iEventID} ' LIMIT 1" );   260                                               $sBaseName  = db_valu e("SELECT  `PhotoFile name` FROM  `SDatingE vents` WHE RE `ID`='{ $iEventID} ' LIMIT 1" );
261                                               if ($sBase Name!="")  {   261                                               if ($sBase Name!="")  {
262                                                       if  (ereg ("( [a-z0-9_]+ )\.", $sBa seName, $a Regs)) {   262                                                       if  (ereg ("( [a-z0-9_]+ )\.", $sBa seName, $a Regs)) {
263                                                                $sBa seName = $ aRegs[1];   263                                                                $sBa seName = $ aRegs[1];
264                                                       }   264                                                       }
265                                               } else {   265                                               } else {
266                                                       $s BaseName =  ($sBaseNa me!="") ?  $sBaseName  : 'g_'. $ sCurrentTi me .'_1';   266                                                       $s BaseName =  ($sBaseNa me!="") ?  $sBaseName  : 'g_'. $ sCurrentTi me .'_1';
267                                               }   267                                               }
268                                      }   268                                      }
269     269  
270                                      $sExt =  moveUpload edImage( $ _FILES, 'e vent_photo ', $dir['t mp'] . $sB aseName, ' ', false ) ;   270                                      $sExt =  moveUpload edImage( $ _FILES, 'e vent_photo ', $dir['t mp'] . $sB aseName, ' ', false ) ;
271     271  
272                                      $sBaseNa me .= $sEx t;   272                                      $sBaseNa me .= $sEx t;
273     273  
274                                      $sPictur eName = $s BaseName;   274                                      $sPictur eName = $s BaseName;
275                                      $sThumbN ame   = 't humb_'.$sB aseName;   275                                      $sThumbN ame   = 't humb_'.$sB aseName;
276                                      $sIconNa me         = 'icon_'. $sBaseName ;   276                                      $sIconNa me         = 'icon_'. $sBaseName ;
277     277  
278                                      // resiz e for thum bnail   278                                      // resiz e for thum bnail
279                                      $vRes =  imageResiz e( $dir['t mp'] . $sB aseName, $ dir['sdati ngImage']  . $sThumbN ame, $this ->iThumbSi ze, $this- >iThumbSiz e );   279                                      $vRes =  imageResiz e( $dir['t mp'] . $sB aseName, $ dir['sdati ngImage']  . $sThumbN ame, $this ->iThumbSi ze, $this- >iThumbSiz e );
280                                      if ( $vR es != IMAG E_ERROR_SU CCESS )   280                                      if ( $vR es != IMAG E_ERROR_SU CCESS )
281                                               return SDA TING_ERROR _PHOTO_PRO CESS;   281                                               return SDA TING_ERROR _PHOTO_PRO CESS;
282                                      $vRes =  imageResiz e( $dir['t mp'] . $sB aseName, $ dir['sdati ngImage']  . $sPictur eName, $th is->iImgSi ze, $this- >iImgSize  );   282                                      $vRes =  imageResiz e( $dir['t mp'] . $sB aseName, $ dir['sdati ngImage']  . $sPictur eName, $th is->iImgSi ze, $this- >iImgSize  );
283                                      if ( $vR es != IMAG E_ERROR_SU CCESS )   283                                      if ( $vR es != IMAG E_ERROR_SU CCESS )
284                                               return SDA TING_ERROR _PHOTO_PRO CESS;   284                                               return SDA TING_ERROR _PHOTO_PRO CESS;
285                                      $vRes =  imageResiz e( $dir['t mp'] . $sB aseName, $ dir['sdati ngImage']  . $sIconNa me, $this- >iIconSize , $this->i IconSize ) ;   285                                      $vRes =  imageResiz e( $dir['t mp'] . $sB aseName, $ dir['sdati ngImage']  . $sIconNa me, $this- >iIconSize , $this->i IconSize ) ;
286                                      if ( $vR es != IMAG E_ERROR_SU CCESS )   286                                      if ( $vR es != IMAG E_ERROR_SU CCESS )
287                                               return SDA TING_ERROR _PHOTO_PRO CESS;   287                                               return SDA TING_ERROR _PHOTO_PRO CESS;
288                                      @unlink(  $dir['tmp '] . $sBas eName );   288                                      @unlink(  $dir['tmp '] . $sBas eName );
289                                      chmod( $ dir['sdati ngImage']  . $sPictur eName, 064 4 );   289                                      chmod( $ dir['sdati ngImage']  . $sPictur eName, 064 4 );
290                                      chmod( $ dir['sdati ngImage']  . $sThumbN ame, 0644  );   290                                      chmod( $ dir['sdati ngImage']  . $sThumbN ame, 0644  );
291                                      chmod( $ dir['sdati ngImage']  . $sIconNa me, 0644 ) ;   291                                      chmod( $ dir['sdati ngImage']  . $sIconNa me, 0644 ) ;
292                                      $sEventP hotoFilena me = proce ss_db_inpu t( $sPictu reName );   292                                      $sEventP hotoFilena me = proce ss_db_inpu t( $sPictu reName );
293                             }   293                             }
294                    }   294                    }
295     295  
296                    $sPi ctureSQL =  '';   296                    $sPi ctureSQL =  '';
297                    if ( $iEventID> 0 && $sEve ntPhotoFil ename!='')  {   297                    if ( $iEventID> 0 && $sEve ntPhotoFil ename!='')  {
298                             $sPict ureSQL = " `PhotoFile name` = '{ $sEventPho toFilename }',";   298                             $sPict ureSQL = " `PhotoFile name` = '{ $sEventPho toFilename }',";
299                    }   299                    }
300                    // e vent date   300                    // e vent date
301                    $sEv entStart =  strtotime ( $_REQUES T['event_s tart'] );   301                    $sEv entStart =  strtotime ( $_REQUES T['event_s tart'] );
302                    if (  $sEventSt art == -1  )   302                    if (  $sEventSt art == -1  )
303                             return  SDATING_E RROR_WRONG _DATE_FORM AT;   303                             return  SDATING_E RROR_WRONG _DATE_FORM AT;
304     304  
305                    if ( $this->bAd minMode) {   305                    if ( $this->bAd minMode) {
306                             $sEven tEnd = str totime( $_ POST['even t_end'] );   306                             $sEven tEnd = str totime( $_ POST['even t_end'] );
307                             //if (  $sEventEn d == -1 )   307                             //if (  $sEventEn d == -1 )
308                             //       return S DATING_ERR OR_WRONG_D ATE_FORMAT ;   308                             //       return S DATING_ERR OR_WRONG_D ATE_FORMAT ;
309                             $sEven tSaleStart  = strtoti me( $_POST ['event_sa le_start']  );   309                             $sEven tSaleStart  = strtoti me( $_POST ['event_sa le_start']  );
310                             //if (  $sEventSa leStart ==  -1 )   310                             //if (  $sEventSa leStart ==  -1 )
311                             //       return S DATING_ERR OR_WRONG_D ATE_FORMAT ;   311                             //       return S DATING_ERR OR_WRONG_D ATE_FORMAT ;
312                             $sEven tSaleEnd =  strtotime ( $_POST[' event_sale _end'] );   312                             $sEven tSaleEnd =  strtotime ( $_POST[' event_sale _end'] );
313                             //if (  $sEventSa leEnd == - 1 )   313                             //if (  $sEventSa leEnd == - 1 )
314                             //       return S DATING_ERR OR_WRONG_D ATE_FORMAT ;   314                             //       return S DATING_ERR OR_WRONG_D ATE_FORMAT ;
315                             //if (  $sEventEn d < $sEven tStart ||  $sEventSal eEnd < $sE ventSaleSt art || $sE ventStart  < $sEventS aleStart )   315                             //if (  $sEventEn d < $sEven tStart ||  $sEventSal eEnd < $sE ventSaleSt art || $sE ventStart  < $sEventS aleStart )
316                             //       return S DATING_ERR OR_WRONG_D ATE_FORMAT ;   316                             //       return S DATING_ERR OR_WRONG_D ATE_FORMAT ;
317                             $sEven tEndVal =  "FROM_UNIX TIME( {$sE ventEnd} ) ";   317                             $sEven tEndVal =  "FROM_UNIX TIME( {$sE ventEnd} ) ";
318                             $sEven tSaleStart Val = "FRO M_UNIXTIME ( {$sEvent SaleStart}  )";   318                             $sEven tSaleStart Val = "FRO M_UNIXTIME ( {$sEvent SaleStart}  )";
319                             $sEven tSaleEndVa l = "FROM_ UNIXTIME(  {$sEventSa leEnd} )";   319                             $sEven tSaleEndVa l = "FROM_ UNIXTIME(  {$sEventSa leEnd} )";
320                    } el se {   320                    } el se {
321                             $sEven tEndVal =  'NOW()';   321                             $sEven tEndVal =  'NOW()';
322                             $sEven tSaleStart Val = 'NOW ()';   322                             $sEven tSaleStart Val = 'NOW ()';
323                             $sEven tSaleEndVa l = 'NOW() ';   323                             $sEven tSaleEndVa l = 'NOW() ';
324                    }   324                    }
325     325  
326                    // e vent respo nsible   326                    // e vent respo nsible
327                    $sEv entRespId     = ($thi s->bAdminM ode) ? 0 :  (int)$aMe mberData[' ID'];   327                    $sEv entRespId     = ($thi s->bAdminM ode) ? 0 :  (int)$aMe mberData[' ID'];
328                    $sEv entRespNam e  = ($thi s->bAdminM ode) ? _t( 'Admin') :  process_d b_input( $ aMemberDat a['NickNam e'], 0, 1  );   328                    $sEv entRespNam e  = ($thi s->bAdminM ode) ? _t( 'Admin') :  process_d b_input( $ aMemberDat a['NickNam e'], 0, 1  );
329                    $sEv entRespEma il = ($thi s->bAdminM ode) ? $si te['email' ] : proces s_db_input ( $aMember Data['Emai l'], 0, 1  );   329                    $sEv entRespEma il = ($thi s->bAdminM ode) ? $si te['email' ] : proces s_db_input ( $aMember Data['Emai l'], 0, 1  );
330                    $sEv entRespPho ne = ($thi s->bAdminM ode) ? '66 6' : proce ss_db_inpu t( $aMembe rData['Pho ne'], 0, 1  );   330                    $sEv entRespPho ne = ($thi s->bAdminM ode) ? '66 6' : proce ss_db_inpu t( $aMembe rData['Pho ne'], 0, 1  );
331     331  
332                    $iEv entAgeLowe rFilter =  (int)getPa ram( 'sear ch_start_a ge' );   332                    $iEv entAgeLowe rFilter =  (int)getPa ram( 'sear ch_start_a ge' );
333                    $iEv entAgeUppe rFilter =  (int)getPa ram( 'sear ch_end_age ' );   333                    $iEv entAgeUppe rFilter =  (int)getPa ram( 'sear ch_end_age ' );
334     334  
335                    $sEv entMembers hipFilter  = "\'all\' ";   335                    $sEv entMembers hipFilter  = "\'all\' ";
336     336  
337                    $iEv entCountF  = (int)$_P OST['event _count_fem ale'];   337                    $iEv entCountF  = (int)$_P OST['event _count_fem ale'];
338                    $iEv entCountM  = (int)$_P OST['event _count_mal e'];   338                    $iEv entCountM  = (int)$_P OST['event _count_mal e'];
339     339  
340                    $dEv entPriceF  = '0.00';   340                    $dEv entPriceF  = '0.00';
341                    $dEv entPriceM  = '0.00';   341                    $dEv entPriceM  = '0.00';
342                    $dEv entPriceC  = '0.00';   342                    $dEv entPriceC  = '0.00';
343     343  
344                    // c hoose opti ons   344                    // c hoose opti ons
345                    $iEv entChooseP eriod = 5;   345                    $iEv entChooseP eriod = 5;
346     346  
347                    // a llow to vi ew partici pants   347                    // a llow to vi ew partici pants
348                    $iEv entAllowVi ew = '1';   348                    $iEv entAllowVi ew = '1';
349     349  
350                    if ( $iEventID= =-1) {   350                    if ( $iEventID= =-1) {
351                             $sNewU ri = uriGe nerate($sE ventTitle,  'SDatingE vents', 'E ntryUri',  100);   351                             $sNewU ri = uriGe nerate($sE ventTitle,  'SDatingE vents', 'E ntryUri',  100);
352                             //Comm ented elem ents   352                             //Comm ented elem ents
353                             /*`Eve ntEnd` = F ROM_UNIXTI ME( {$sEve ntEnd} ),* /   353                             /*`Eve ntEnd` = F ROM_UNIXTI ME( {$sEve ntEnd} ),* /
354                             /*`Tic ketSaleSta rt` = FROM _UNIXTIME(  {$sEventS aleStart}  ),*/   354                             /*`Tic ketSaleSta rt` = FROM _UNIXTIME(  {$sEventS aleStart}  ),*/
355                             /*`Tic ketSaleEnd ` = FROM_U NIXTIME( { $sEventSal eEnd} ),*/   355                             /*`Tic ketSaleEnd ` = FROM_U NIXTIME( { $sEventSal eEnd} ),*/
356                                356                             
357                             $vRes  = db_res(  "INSERT IN TO `SDatin gEvents` S ET   357                             $vRes  = db_res(  "INSERT IN TO `SDatin gEvents` S ET
358                                                       `T itle` = '{ $sEventTit le}',   358                                                       `T itle` = '{ $sEventTit le}',
359                                                       `E ntryUri` =  '{$sNewUr i}',   359                                                       `E ntryUri` =  '{$sNewUr i}',
360                                                       `D escription ` = '{$sEv entDesc}',   360                                                       `D escription ` = '{$sEv entDesc}',
361                                                       `S tatus` = ' Active',   361                                                       `S tatus` = ' Active',
362                                                       `S tatusMessa ge` = '{$s EventStatu sMessage}' ,   362                                                       `S tatusMessa ge` = '{$s EventStatu sMessage}' ,
363                                                       `C ountry` =  '{$sEventC ountry}',   363                                                       `C ountry` =  '{$sEventC ountry}',
364                                                       `C ity` = '{$ sEventCity }',   364                                                       `C ity` = '{$ sEventCity }',
365                                                       `P lace` = '{ $EventPlac e}',   365                                                       `P lace` = '{ $EventPlac e}',
366                                                       `P hotoFilena me` = '{$s EventPhoto Filename}' ,   366                                                       `P hotoFilena me` = '{$s EventPhoto Filename}' ,
367                                                       `E ventStart`  = FROM_UN IXTIME( {$ sEventStar t} ),   367                                                       `E ventStart`  = FROM_UN IXTIME( {$ sEventStar t} ),
368                                                       `E ventEnd` =  {$sEventE ndVal},   368                                                       `E ventEnd` =  {$sEventE ndVal},
369                                                       `T icketSaleS tart` = {$ sEventSale StartVal},   369                                                       `T icketSaleS tart` = {$ sEventSale StartVal},
370                                                       `T icketSaleE nd` = {$sE ventSaleEn dVal},   370                                                       `T icketSaleE nd` = {$sE ventSaleEn dVal},
371                                                       `R esponsible ID` = '{$s EventRespI d}',   371                                                       `R esponsible ID` = '{$s EventRespI d}',
372                                                       `R esponsible Name` = '{ $sEventRes pName}',   372                                                       `R esponsible Name` = '{ $sEventRes pName}',
373                                                       `R esponsible Email` = ' {$sEventRe spEmail}',   373                                                       `R esponsible Email` = ' {$sEventRe spEmail}',
374                                                       `R esponsible Phone` = ' {$sEventRe spPhone}',   374                                                       `R esponsible Phone` = ' {$sEventRe spPhone}',
375                                                       `E ventSexFil ter` = 'fe male,male' ,   375                                                       `E ventSexFil ter` = 'fe male,male' ,
376                                                       `E ventAgeLow erFilter`  = {$iEvent AgeLowerFi lter},   376                                                       `E ventAgeLow erFilter`  = {$iEvent AgeLowerFi lter},
377                                                       `E ventAgeUpp erFilter`  = {$iEvent AgeUpperFi lter},   377                                                       `E ventAgeUpp erFilter`  = {$iEvent AgeUpperFi lter},
378                                                       `E ventMember shipFilter ` = '{$sEv entMembers hipFilter} ',   378                                                       `E ventMember shipFilter ` = '{$sEv entMembers hipFilter} ',
379                                                       `T icketCount Female` =  {$iEventCo untF},   379                                                       `T icketCount Female` =  {$iEventCo untF},
380                                                       `T icketCount Male` = {$ iEventCoun tM},   380                                                       `T icketCount Male` = {$ iEventCoun tM},
381                                                       `T icketPrice Female` =  {$dEventPr iceF},   381                                                       `T icketPrice Female` =  {$dEventPr iceF},
382                                                       `T icketPrice Male` = {$ dEventPric eM},   382                                                       `T icketPrice Male` = {$ dEventPric eM},
383                                                       `C hoosePerio d` = {$iEv entChooseP eriod},   383                                                       `C hoosePerio d` = {$iEv entChooseP eriod},
384                                                       `A llowViewPa rticipants ` = {$iEve ntAllowVie w},   384                                                       `A llowViewPa rticipants ` = {$iEve ntAllowVie w},
385                                                       `T ags` = '{$ sTags}'   385                                                       `T ags` = '{$ sTags}'
386                                                       "  );   386                                                       "  );
387                             $iLast ID = mysql _insert_id ($GLOBALS[ 'MySQL']-> link);   387                             $iLast ID = mysql _insert_id ($GLOBALS[ 'MySQL']-> link);
388                             if ($i LastID>0)  {   388                             if ($i LastID>0)  {
389                                      $this->i LastInsert edID = $iL astID;   389                                      $this->i LastInsert edID = $iL astID;
390                                      reparseO bjTags( 'e vent', $iL astID );   390                                      reparseO bjTags( 'e vent', $iL astID );
391                             }   391                             }
392                    } el se {   392                    } el se {
393                             //$sNe wUri = uri Generate($ sEventTitl e, 'SDatin gEvents',  'EntryUri' , 100);   393                             //$sNe wUri = uri Generate($ sEventTitl e, 'SDatin gEvents',  'EntryUri' , 100);
394                             //Comm ented elem ents   394                             //Comm ented elem ents
395                             /*`Eve ntEnd` = F ROM_UNIXTI ME( {$sEve ntEnd} ),* /   395                             /*`Eve ntEnd` = F ROM_UNIXTI ME( {$sEve ntEnd} ),* /
396                             /*`Tic ketSaleSta rt` = FROM _UNIXTIME(  {$sEventS aleStart}  ),*/   396                             /*`Tic ketSaleSta rt` = FROM _UNIXTIME(  {$sEventS aleStart}  ),*/
397                             /*`Tic ketSaleEnd ` = FROM_U NIXTIME( { $sEventSal eEnd} ),*/   397                             /*`Tic ketSaleEnd ` = FROM_U NIXTIME( { $sEventSal eEnd} ),*/
398     398  
399                             $vRes  = db_res(  "UPDATE `S DatingEven ts` SET   399                             $vRes  = db_res(  "UPDATE `S DatingEven ts` SET
400                                                       `T itle` = '{ $sEventTit le}',   400                                                       `T itle` = '{ $sEventTit le}',
401                                                       `D escription ` = '{$sEv entDesc}',   401                                                       `D escription ` = '{$sEv entDesc}',
402                                                       `S tatus` = ' Active',   402                                                       `S tatus` = ' Active',
403                                                       `S tatusMessa ge` = '{$s EventStatu sMessage}' ,   403                                                       `S tatusMessa ge` = '{$s EventStatu sMessage}' ,
404                                                       `C ountry` =  '{$sEventC ountry}',   404                                                       `C ountry` =  '{$sEventC ountry}',
405                                                       `C ity` = '{$ sEventCity }',   405                                                       `C ity` = '{$ sEventCity }',
406                                                       `P lace` = '{ $EventPlac e}',   406                                                       `P lace` = '{ $EventPlac e}',
407                                                       {$ sPictureSQ L}   407                                                       {$ sPictureSQ L}
408                                                       `E ventStart`  = FROM_UN IXTIME( {$ sEventStar t} ),   408                                                       `E ventStart`  = FROM_UN IXTIME( {$ sEventStar t} ),
409                                                       `E ventEnd` =  {$sEventE ndVal},   409                                                       `E ventEnd` =  {$sEventE ndVal},
410                                                       `T icketSaleS tart` = {$ sEventSale StartVal},   410                                                       `T icketSaleS tart` = {$ sEventSale StartVal},
411                                                       `T icketSaleE nd` = {$sE ventSaleEn dVal},   411                                                       `T icketSaleE nd` = {$sE ventSaleEn dVal},
412                                                       `R esponsible ID` = '{$s EventRespI d}',   412                                                       `R esponsible ID` = '{$s EventRespI d}',
413                                                       `R esponsible Name` = '{ $sEventRes pName}',   413                                                       `R esponsible Name` = '{ $sEventRes pName}',
414                                                       `R esponsible Email` = ' {$sEventRe spEmail}',   414                                                       `R esponsible Email` = ' {$sEventRe spEmail}',
415                                                       `R esponsible Phone` = ' {$sEventRe spPhone}',   415                                                       `R esponsible Phone` = ' {$sEventRe spPhone}',
416                                                       `E ventSexFil ter` = 'fe male,male' ,   416                                                       `E ventSexFil ter` = 'fe male,male' ,
417                                                       `E ventAgeLow erFilter`  = {$iEvent AgeLowerFi lter},   417                                                       `E ventAgeLow erFilter`  = {$iEvent AgeLowerFi lter},
418                                                       `E ventAgeUpp erFilter`  = {$iEvent AgeUpperFi lter},   418                                                       `E ventAgeUpp erFilter`  = {$iEvent AgeUpperFi lter},
419                                                       `E ventMember shipFilter ` = '{$sEv entMembers hipFilter} ',   419                                                       `E ventMember shipFilter ` = '{$sEv entMembers hipFilter} ',
420                                                       `T icketCount Female` =  {$iEventCo untF},   420                                                       `T icketCount Female` =  {$iEventCo untF},
421                                                       `T icketCount Male` = {$ iEventCoun tM},   421                                                       `T icketCount Male` = {$ iEventCoun tM},
422                                                       `T icketPrice Female` =  {$dEventPr iceF},   422                                                       `T icketPrice Female` =  {$dEventPr iceF},
423                                                       `T icketPrice Male` = {$ dEventPric eM},   423                                                       `T icketPrice Male` = {$ dEventPric eM},
424                                                       `C hoosePerio d` = {$iEv entChooseP eriod},   424                                                       `C hoosePerio d` = {$iEv entChooseP eriod},
425                                                       `A llowViewPa rticipants ` = {$iEve ntAllowVie w},   425                                                       `A llowViewPa rticipants ` = {$iEve ntAllowVie w},
426                                                       `T ags` = '{$ sTags}'   426                                                       `T ags` = '{$ sTags}'
427                                                       WH ERE `ID` =  {$iEventI D}   427                                                       WH ERE `ID` =  {$iEventI D}
428                                                       "  );   428                                                       "  );
429                             repars eObjTags(  'event', $ iEventID ) ;   429                             repars eObjTags(  'event', $ iEventID ) ;
430                    }   430                    }
431                    retu rn SDATING _ERROR_SUC CESS;   431                    retu rn SDATING _ERROR_SUC CESS;
432           }   432           }
433     433  
434           /* *   434           /* *
435            *  page show  event lis t function   435            *  page show  event lis t function
436            *  @return H TML presen tation of  data   436            *  @return H TML presen tation of  data
437            * /   437            * /
438           fu nction Pag eSDatingSh owEvents()  {   438           fu nction Pag eSDatingSh owEvents()  {
439                    glob al $site;   439                    glob al $site;
440                    glob al $dir;   440                    glob al $dir;
441                    glob al $aPreVa lues;   441                    glob al $aPreVa lues;
442                    glob al $oTempl Config;   442                    glob al $oTempl Config;
443                    glob al $tmpl;   443                    glob al $tmpl;
444     444  
445                    $sEd itC = _t(' _Edit');   445                    $sEd itC = _t(' _Edit');
446                    $sDe leteC = _t ('_Delete' );   446                    $sDe leteC = _t ('_Delete' );
447                    $sSu reC = _t(" _Are you s ure");   447                    $sSu reC = _t(" _Are you s ure");
448                    $sTa gsC = _t(' _Tags');   448                    $sTa gsC = _t(' _Tags');
449     449  
450                    // c ollect inf ormation a bout curre nt member   450                    // c ollect inf ormation a bout curre nt member
451                    $aMe mber['ID']  = (int)$_ COOKIE['me mberID'];   451                    $aMe mber['ID']  = (int)$_ COOKIE['me mberID'];
452                    $aMe mberData =  getProfil eInfo( $aM ember['ID' ] );   452                    $aMe mberData =  getProfil eInfo( $aM ember['ID' ] );
453                    $sMe mberSex =  $aMemberDa ta['Sex'];   453                    $sMe mberSex =  $aMemberDa ta['Sex'];
454                    $aMe mbership =  getMember Membership Info( $aMe mber['ID']  );   454                    $aMe mbership =  getMember Membership Info( $aMe mber['ID']  );
455                    $bSh owFrom = ( int)$_REQU EST['from' ];   455                    $bSh owFrom = ( int)$_REQU EST['from' ];
456     456  
457                    //$s DateWhereC heck = ($t his->bAdmi nMode) ? " AND NOW()  < DATE_ADD (`SDatingE vents`.`Ev entEnd`, I NTERVAL `S DatingEven ts`.`Choos ePeriod` D AY)" : '';   457                    //$s DateWhereC heck = ($t his->bAdmi nMode) ? " AND NOW()  < DATE_ADD (`SDatingE vents`.`Ev entEnd`, I NTERVAL `S DatingEven ts`.`Choos ePeriod` D AY)" : '';
458                    $sDa teWhereChe ck = '';// 'A' commen ted like b ug   458                    $sDa teWhereChe ck = '';// 'A' commen ted like b ug
459                    $sCo mmonSelect SQL = "DIS TINCT `SDa tingEvents `.`ID`, `T itle`, `En tryUri`, ` Descriptio n`, `Statu sMessage`,  `Country` , `City`,  `Place`, ` PhotoFilen ame`, `Tag s`, ";   459                    $sCo mmonSelect SQL = "DIS TINCT `SDa tingEvents `.`ID`, `T itle`, `En tryUri`, ` Descriptio n`, `Statu sMessage`,  `Country` , `City`,  `Place`, ` PhotoFilen ame`, `Tag s`, ";
460                    $sCo mmonSelect SQL  .= "` EventStart `, UNIX_TI MESTAMP(`E ventStart` ) AS 'Even tStart_UTS ', ";   460                    $sCo mmonSelect SQL  .= "` EventStart `, UNIX_TI MESTAMP(`E ventStart` ) AS 'Even tStart_UTS ', ";
461                    $sCo mmonSelect SQL  .= "( UNIX_TIMES TAMP() - U NIX_TIMEST AMP(`Event Start`)) A S `sec`, ` Responsibl eID`, ";   461                    $sCo mmonSelect SQL  .= "( UNIX_TIMES TAMP() - U NIX_TIMEST AMP(`Event Start`)) A S `sec`, ` Responsibl eID`, ";
462                    $sCo mmonSelect SQL  .= "( NOW() > `E ventEnd` A ND NOW() <  DATE_ADD( `EventEnd` , INTERVAL  `ChoosePe riod` DAY) ) AS `Choo seActive`,  ";   462                    $sCo mmonSelect SQL  .= "( NOW() > `E ventEnd` A ND NOW() <  DATE_ADD( `EventEnd` , INTERVAL  `ChoosePe riod` DAY) ) AS `Choo seActive`,  ";
463                    $sCo mmonSelect SQL  .= "` AllowViewP articipant s`, (`SDat ingPartici pants`.`ID ` IS NOT N ULL) AS `I sParticipa nt` ";   463                    $sCo mmonSelect SQL  .= "` AllowViewP articipant s`, (`SDat ingPartici pants`.`ID ` IS NOT N ULL) AS `I sParticipa nt` ";
464                    $sLe ftJoinAddo nSQL = "LE FT JOIN `S DatingPart icipants`  ON `SDatin gParticipa nts`.`IDEv ent` = `SD atingEvent s`.`ID` AN D `SDating Participan ts`.`IDMem ber` = {$a Member['ID ']}";   464                    $sLe ftJoinAddo nSQL = "LE FT JOIN `S DatingPart icipants`  ON `SDatin gParticipa nts`.`IDEv ent` = `SD atingEvent s`.`ID` AN D `SDating Participan ts`.`IDMem ber` = {$a Member['ID ']}";
465                    $sSt atusActive SQL = "`SD atingEvent s`.`Status ` = 'Activ e'";   465                    $sSt atusActive SQL = "`SD atingEvent s`.`Status ` = 'Activ e'";
466                    $sOr derBySQL =  "ORDER BY  `SDatingE vents`.`Ev entStart`  DESC";   466                    $sOr derBySQL =  "ORDER BY  `SDatingE vents`.`Ev entStart`  DESC";
467     467  
468                    // b uild SQL q uery for e vent listi ng   468                    // b uild SQL q uery for e vent listi ng
469                    $sSh owQuery =  '';   469                    $sSh owQuery =  '';
470                    swit ch ( $_REQ UEST['show _events']  ) {   470                    swit ch ( $_REQ UEST['show _events']  ) {
471                             case ' country':   471                             case ' country':
472                                      // queri es for sho wing 'by c ountry'   472                                      // queri es for sho wing 'by c ountry'
473                                      $sShowQu ery = "   473                                      $sShowQu ery = "
474                                               SELECT   474                                               SELECT
475                                                       {$ sCommonSel ectSQL }   475                                                       {$ sCommonSel ectSQL }
476                                               FROM `SDat ingEvents`   476                                               FROM `SDat ingEvents`
477                                               {$sLeftJoi nAddonSQL}   477                                               {$sLeftJoi nAddonSQL}
478                                               WHERE   478                                               WHERE
479                                                       {$ sStatusAct iveSQL}   479                                                       {$ sStatusAct iveSQL}
480                                                       {$ sDateWhere Check}   480                                                       {$ sDateWhere Check}
481                                                       AN D `SDating Events`.`C ountry` =  '". proces s_db_input ($_REQUEST ['show_eve nts_countr y'], 1) ." '   481                                                       AN D `SDating Events`.`C ountry` =  '". proces s_db_input ($_REQUEST ['show_eve nts_countr y'], 1) ." '
482                                               {$sOrderBy SQL} {$sLi mitSQL}   482                                               {$sOrderBy SQL} {$sLi mitSQL}
483                                      ";   483                                      ";
484                                      $sCountS QL = "   484                                      $sCountS QL = "
485                                               SELECT COU NT(*) FROM  `SDatingE vents`   485                                               SELECT COU NT(*) FROM  `SDatingE vents`
486                                               WHERE   486                                               WHERE
487                                                       {$ sStatusAct iveSQL}   487                                                       {$ sStatusAct iveSQL}
488                                                       {$ sDateWhere Check}   488                                                       {$ sDateWhere Check}
489                                                       AN D `Country ` = '". pr ocess_db_i nput($_REQ UEST['show _events_co untry'], 1 ) ."'   489                                                       AN D `Country ` = '". pr ocess_db_i nput($_REQ UEST['show _events_co untry'], 1 ) ."'
490                                      ";   490                                      ";
491                                      break;   491                                      break;
492                             case ' my':   492                             case ' my':
493                                      // queri es for sho wing my ev ents   493                                      // queri es for sho wing my ev ents
494                                      $sShowQu ery = "   494                                      $sShowQu ery = "
495                                               SELECT   495                                               SELECT
496                                                       {$ sCommonSel ectSQL }   496                                                       {$ sCommonSel ectSQL }
497                                               FROM `SDat ingEvents`   497                                               FROM `SDat ingEvents`
498                                               {$sLeftJoi nAddonSQL}   498                                               {$sLeftJoi nAddonSQL}
499                                               WHERE   499                                               WHERE
500                                                       `R esponsible ID` = {$aM ember['ID' ]}   500                                                       `R esponsible ID` = {$aM ember['ID' ]}
501                                               {$sOrderBy SQL} {$sLi mitSQL}   501                                               {$sOrderBy SQL} {$sLi mitSQL}
502                                      ";   502                                      ";
503                                      $sCountS QL = "   503                                      $sCountS QL = "
504                                               SELECT COU NT(*) FROM  `SDatingE vents`   504                                               SELECT COU NT(*) FROM  `SDatingE vents`
505                                      ";   505                                      ";
506                                      break;   506                                      break;
507                             case ' all':   507                             case ' all':
508                             defaul t:   508                             defaul t:
509                                      // queri es for sho wing all a vailable e vents   509                                      // queri es for sho wing all a vailable e vents
510                                      $sShowQu ery = "   510                                      $sShowQu ery = "
511                                               SELECT   511                                               SELECT
512                                                       {$ sCommonSel ectSQL }   512                                                       {$ sCommonSel ectSQL }
513                                               FROM `SDat ingEvents`   513                                               FROM `SDat ingEvents`
514                                               {$sLeftJoi nAddonSQL}   514                                               {$sLeftJoi nAddonSQL}
515                                               WHERE   515                                               WHERE
516                                                       {$ sStatusAct iveSQL}   516                                                       {$ sStatusAct iveSQL}
517                                                       {$ sDateWhere Check}   517                                                       {$ sDateWhere Check}
518                                               {$sOrderBy SQL} {$sLi mitSQL}   518                                               {$sOrderBy SQL} {$sLi mitSQL}
519                                      ";   519                                      ";
520                                      $sCountS QL = "   520                                      $sCountS QL = "
521                                               SELECT COU NT(*) FROM  `SDatingE vents`   521                                               SELECT COU NT(*) FROM  `SDatingE vents`
522                                               WHERE   522                                               WHERE
523                                                       {$ sStatusAct iveSQL}   523                                                       {$ sStatusAct iveSQL}
524                                                       {$ sDateWhere Check}   524                                                       {$ sDateWhere Check}
525                                               ";   525                                               ";
526                    }   526                    }
527     527  
528     528  
529                    //// ////////// ////////// ////   529                    //// ////////// ////////// ////
530                    $iTo talNum = d b_value( $ sCountSQL  );   530                    $iTo talNum = d b_value( $ sCountSQL  );
531                    if(  !$iTotalNu m ) {   531                    if(  !$iTotalNu m ) {
532                             return  MsgBox(_t ( '_Sorry,  nothing f ound' ));   532                             return  MsgBox(_t ( '_Sorry,  nothing f ound' ));
533                    }   533                    }
534     534  
535                    $iPe rPage = (i nt)$_GET[' per_page'] ;   535                    $iPe rPage = (i nt)$_GET[' per_page'] ;
536                    if(  !$iPerPage  )   536                    if(  !$iPerPage  )
537                             $iPerP age = 10;   537                             $iPerP age = 10;
538     538  
539                    $iTo talPages =  ceil( $iT otalNum /  $iPerPage  );   539                    $iTo talPages =  ceil( $iT otalNum /  $iPerPage  );
540     540  
541                    $iCu rPage = (i nt)$_GET[' page'];   541                    $iCu rPage = (i nt)$_GET[' page'];
542     542  
543                    if(  $iCurPage  > $iTotalP ages )   543                    if(  $iCurPage  > $iTotalP ages )
544                             $iCurP age = $iTo talPages;   544                             $iCurP age = $iTo talPages;
545     545  
546                    if(  $iCurPage  < 1 )   546                    if(  $iCurPage  < 1 )
547                             $iCurP age = 1;   547                             $iCurP age = 1;
548     548  
549                    $sLi mitFrom =  ( $iCurPag e - 1 ) *  $iPerPage;   549                    $sLi mitFrom =  ( $iCurPag e - 1 ) *  $iPerPage;
550                    $sql Limit = "L IMIT {$sLi mitFrom},  {$iPerPage }";   550                    $sql Limit = "L IMIT {$sLi mitFrom},  {$iPerPage }";
551     551  
552                    $sSh owQuery .=  $sqlLimit ;   552                    $sSh owQuery .=  $sqlLimit ;
553     553  
554                    // p rocess dat abase quer ies   554                    // p rocess dat abase quer ies
555                    $vSh owRes = db _res( $sSh owQuery );   555                    $vSh owRes = db _res( $sSh owQuery );
556                    //// ////////// ////////// ////   556                    //// ////////// ////////// ////
557     557  
558                    $iSh owNum = my sql_num_ro ws( $vShow Res );   558                    $iSh owNum = my sql_num_ro ws( $vShow Res );
559     559  
560                    if (  $iShowNum  == 0 ) {   560                    if (  $iShowNum  == 0 ) {
561                             // sho w if no ev ents avail able   561                             // sho w if no ev ents avail able
562                             $sRetH tml .= Des ignBoxCont ent( _t('_ SpeedDatin g events') , '<center >'. _t('_N o events a vailable')  .'</cente r>', $oTem plConfig - > PageSDat ingShowEve nts_db_num  );   562                             $sRetH tml .= Des ignBoxCont ent( _t('_ SpeedDatin g events') , '<center >'. _t('_N o events a vailable')  .'</cente r>', $oTem plConfig - > PageSDat ingShowEve nts_db_num  );
563                    }   563                    }
564                    else  {   564                    else  {
565                             $sSpac erName = $ this -> sS pacerPath;   565                             $sSpac erName = $ this -> sS pacerPath;
566     566  
567                             // pri nt list of  events   567                             // pri nt list of  events
568                             while  ( $aResSQL  = mysql_f etch_assoc ($vShowRes ) ) {   568                             while  ( $aResSQL  = mysql_f etch_assoc ($vShowRes ) ) {
569     569  
570                                      $sImgEL  = ( strlen (trim($aRe sSQL['Phot oFilename' ])) && fil e_exists($ dir['sdati ngImage']  . $aResSQL ['PhotoFil ename']) )   570                                      $sImgEL  = ( strlen (trim($aRe sSQL['Phot oFilename' ])) && fil e_exists($ dir['sdati ngImage']  . $aResSQL ['PhotoFil ename']) )
571                                               ? "<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']} \" />"   571                                               ? "<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']} \" />"
572                                               : "<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}\" />" ;   572                                               : "<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}\" />" ;
573     573  
574                                      $sShowIn foC = _t(' _Show info ');   574                                      $sShowIn foC = _t(' _Show info ');
575                                      $sPartic ipantsC =  _t('_Parti cipants');   575                                      $sPartic ipantsC =  _t('_Parti cipants');
576                                      $sStatus MessageC =  _t('_Stat us message ');   576                                      $sStatus MessageC =  _t('_Stat us message ');
577                                      $sDateC  = _t('_Dat e');   577                                      $sDateC  = _t('_Dat e');
578                                      $sPlaceC  = _t('_Pl ace');   578                                      $sPlaceC  = _t('_Pl ace');
579                                      $sDescri ptionC = _ t('_Descri ption');   579                                      $sDescri ptionC = _ t('_Descri ption');
580                                      $sTitleC  = _t('_Ti tle');   580                                      $sTitleC  = _t('_Ti tle');
581                                      $sAction sC = _t('_ Actions');   581                                      $sAction sC = _t('_ Actions');
582                                      $sListOf Participan tsC = _t(' _List').'  '._t('_of' ).' '._t(' _Participa nts');   582                                      $sListOf Participan tsC = _t(' _List').'  '._t('_of' ).' '._t(' _Participa nts');
583                                      $sPosted ByC = _t(' _Posted by ');   583                                      $sPosted ByC = _t(' _Posted by ');
584                                      if ($aRe sSQL['Resp onsibleID' ] == 0) {   584                                      if ($aRe sSQL['Resp onsibleID' ] == 0) {
585                                               $sPostedBy Href = _t( '_Admin');   585                                               $sPostedBy Href = _t( '_Admin');
586                                      } else {   586                                      } else {
587                                               $aPostedBy  = $this-> GetProfile Data($aRes SQL['Respo nsibleID'] );   587                                               $aPostedBy  = $this-> GetProfile Data($aRes SQL['Respo nsibleID'] );
588                                               //$sPosted By = $aPos tedBy['Nic kName'];   588                                               //$sPosted By = $aPos tedBy['Nic kName'];
589                                               $sPostedBy Href = get ProfileLin k($aResSQL ['Responsi bleID']);   589                                               $sPostedBy Href = get ProfileLin k($aResSQL ['Responsi bleID']);
590                                               $sPostedBy Href = '<a  href="'.$ sPostedByH ref.'">'.$ aPostedBy[ 'NickName' ].'</a>';   590                                               $sPostedBy Href = '<a  href="'.$ sPostedByH ref.'">'.$ aPostedBy[ 'NickName' ].'</a>';
591                                      }   591                                      }
592     592  
593                                      $sGenUrl P = $this- >genUrl($a ResSQL['ID '], $aResS QL['EntryU ri'], 'par t');   593                                      $sGenUrl P = $this- >genUrl($a ResSQL['ID '], $aResS QL['EntryU ri'], 'par t');
594                                      $sViewPa rticipants Val = <<<E OF   594                                      $sViewPa rticipants Val = <<<E OF
595   <a href="{ $sGenUrlP} ">   595   <a href="{ $sGenUrlP} ">
596           {$ sListOfPar ticipantsC }   596           {$ sListOfPar ticipantsC }
597   </a>   597   </a>
598   EOF;   598   EOF;
599                                      $sViewPa rticipants  = ($aResS QL['AllowV iewPartici pants'] ==  '1') ? $s ViewPartic ipantsVal  : '';   599                                      $sViewPa rticipants  = ($aResS QL['AllowV iewPartici pants'] ==  '1') ? $s ViewPartic ipantsVal  : '';
600     600  
601                                      $sStatus Message =  process_li ne_output( $aResSQL[' StatusMess age']);   601                                      $sStatus Message =  process_li ne_output( $aResSQL[' StatusMess age']);
602                                      //$date_ format_php  = getPara m('php_dat e_format') ;   602                                      //$date_ format_php  = getPara m('php_dat e_format') ;
603                                      //$sDate Time = dat e( $date_f ormat_php,  strtotime ( $aResSQL ['EventSta rt'] ) );   603                                      //$sDate Time = dat e( $date_f ormat_php,  strtotime ( $aResSQL ['EventSta rt'] ) );
604                                      $sDateTi me = Local edDataTime ($aResSQL[ 'EventStar t_UTS']);   604                                      $sDateTi me = Local edDataTime ($aResSQL[ 'EventStar t_UTS']);
605                                      $sEvents Start = $s DateTime."  ("._forma t_when($aR esSQL['sec ']).")";   605                                      $sEvents Start = $s DateTime."  ("._forma t_when($aR esSQL['sec ']).")";
606                                      $sCountr y = ($aRes SQL['Count ry']!='')  ? _t($aPre Values['Co untry'][$a ResSQL['Co untry']][' LKey']) :  '';   606                                      $sCountr y = ($aRes SQL['Count ry']!='')  ? _t($aPre Values['Co untry'][$a ResSQL['Co untry']][' LKey']) :  '';
607                                      $sCity =  ($aResSQL ['City']!= '') ? ', ' .process_l ine_output ($aResSQL[ 'City']) :  '';   607                                      $sCity =  ($aResSQL ['City']!= '') ? ', ' .process_l ine_output ($aResSQL[ 'City']) :  '';
608                                      $sPlace  = ($aResSQ L['Place'] !='') ? ',  '.process _line_outp ut($aResSQ L['Place'] ) : '';   608                                      $sPlace  = ($aResSQ L['Place'] !='') ? ',  '.process _line_outp ut($aResSQ L['Place'] ) : '';
609                                      $sDescri ption = $a ResSQL['De scription' ];   609                                      $sDescri ption = $a ResSQL['De scription' ];
610     610  
611                                      $sTagsCo mmas = $aR esSQL['Tag s'];   611                                      $sTagsCo mmas = $aR esSQL['Tag s'];
612                                      $aTags =  split(',' , $sTagsCo mmas);   612                                      $aTags =  split(',' , $sTagsCo mmas);
613                                      $sTagsHr efs = '';   613                                      $sTagsHr efs = '';
614                                      foreach(  $aTags as  $sTagKey  ) {   614                                      foreach(  $aTags as  $sTagKey  ) {
615                                               $sTagHrefG en = $this ->genUrl(0 , $sTagKey , 'search' );   615                                               $sTagHrefG en = $this ->genUrl(0 , $sTagKey , 'search' );
616                                               $sTagsHref s .= <<<EO F   616                                               $sTagsHref s .= <<<EO F
617   <a href="{ $sTagHrefG en}" >{$sT agKey}</a> &nbsp;   617   <a href="{ $sTagHrefG en}" >{$sT agKey}</a> &nbsp;
618   EOF;   618   EOF;
619                                      }   619                                      }
620                                      $sTags =  <<<EOF   620                                      $sTags =  <<<EOF
621   <div class ="cls_res_ info_p">   621   <div class ="cls_res_ info_p">
622           {$ sTagsC}:&n bsp;{$sTag sHrefs}   622           {$ sTagsC}:&n bsp;{$sTag sHrefs}
623   </div>   623   </div>
624   EOF;   624   EOF;
625     625  
626                                      $sAction s = '';   626                                      $sAction s = '';
627                                      if ($aRe sSQL['Resp onsibleID' ]==(int)$_ COOKIE['me mberID'] & & $aResSQL ['Responsi bleID'] >  0) {   627                                      if ($aRe sSQL['Resp onsibleID' ]==(int)$_ COOKIE['me mberID'] & & $aResSQL ['Responsi bleID'] >  0) {
628                                               $sActions  = <<<EOF   628                                               $sActions  = <<<EOF
629   <div class ="cls_res_ info_p">   629   <div class ="cls_res_ info_p">
630           <a  href="{$_ SERVER['PH P_SELF']}"  onclick=" UpdateFiel d('EditEve ntID','{$a ResSQL['ID ']}');docu ment.forms .command_e dit_event. submit();r eturn fals e;" style= "text-tran sform:none ;">{$sEdit C}</a>&nbs p;   630           <a  href="{$_ SERVER['PH P_SELF']}"  onclick=" UpdateFiel d('EditEve ntID','{$a ResSQL['ID ']}');docu ment.forms .command_e dit_event. submit();r eturn fals e;" style= "text-tran sform:none ;">{$sEdit C}</a>&nbs p;
631           <a  href="{$_ SERVER['PH P_SELF']}"  onclick=" if (confir m('{$sSure C}')) {Upd ateField(' DeleteEven tID','{$aR esSQL['ID' ]}');docum ent.forms. command_de lete_event .submit();  } return  false;" st yle="text- transform: none;">{$s DeleteC}</ a>   631           <a  href="{$_ SERVER['PH P_SELF']}"  onclick=" if (confir m('{$sSure C}')) {Upd ateField(' DeleteEven tID','{$aR esSQL['ID' ]}');docum ent.forms. command_de lete_event .submit();  } return  false;" st yle="text- transform: none;">{$s DeleteC}</ a>
632   </div>   632   </div>
633   EOF;   633   EOF;
634                                      }   634                                      }
635     635  
636                                      $sGenUrl  = $this-> genUrl($aR esSQL['ID' ], $aResSQ L['EntryUr i']);   636                                      $sGenUrl  = $this-> genUrl($aR esSQL['ID' ], $aResSQ L['EntryUr i']);
637                                      $sImgEl  = $this->G etEventPic ture($aRes SQL['ID'],  $aResSQL[ 'PhotoFile name']);   637                                      $sImgEl  = $this->G etEventPic ture($aRes SQL['ID'],  $aResSQL[ 'PhotoFile name']);
638                                      /*<div c lass="cls_ res_info_p ">   638                                      /*<div c lass="cls_ res_info_p ">
639                                               {$sStatusM essageC}:  <div class ="clr3">{$ sStatusMes sage}</div >   639                                               {$sStatusM essageC}:  <div class ="clr3">{$ sStatusMes sage}</div >
640                                      </div>*/   640                                      </div>*/
641                                      $sMainCo ntent = << <EOF   641                                      $sMainCo ntent = << <EOF
642   <div class ="cls_resu lt_row">   642   <div class ="cls_resu lt_row">
643           <d iv class=" clear_both "></div>   643           <d iv class=" clear_both "></div>
644           {$ sImgEl}   644           {$ sImgEl}
645           <d iv class=" cls_res_in fo_nowidth " {$sDataS tyleWidth} >   645           <d iv class=" cls_res_in fo_nowidth " {$sDataS tyleWidth} >
646                    <div  class="cl s_res_info _p">   646                    <div  class="cl s_res_info _p">
647                             <a cla ss="action s" href="{ $sGenUrl}" >{$aResSQL ['Title']} </a>   647                             <a cla ss="action s" href="{ $sGenUrl}" >{$aResSQL ['Title']} </a>
648                    </di v>   648                    </di v>
649                    {$sT ags}   649                    {$sT ags}
650                    <div  class="cl s_res_info _p">   650                    <div  class="cl s_res_info _p">
651                             {$sDat eC}: <div  class="clr 3">{$sEven tsStart}</ div>   651                             {$sDat eC}: <div  class="clr 3">{$sEven tsStart}</ div>
652                    </di v>   652                    </di v>
653                    <div  class="cl s_res_info _p">   653                    <div  class="cl s_res_info _p">
654                             {$sPos tedByC}: < div class= "clr3">{$s PostedByHr ef}</div>   654                             {$sPos tedByC}: < div class= "clr3">{$s PostedByHr ef}</div>
655                    </di v>   655                    </di v>
656                    <div  class="cl s_res_info _p">   656                    <div  class="cl s_res_info _p">
657                             {$sPla ceC}: <div  class="cl r3">{$sCou ntry}{$sCi ty}{$sPlac e}</div>   657                             {$sPla ceC}: <div  class="cl r3">{$sCou ntry}{$sCi ty}{$sPlac e}</div>
658                    </di v>   658                    </di v>
659                    <div  class="cl s_res_info _p">   659                    <div  class="cl s_res_info _p">
660                             {$sDes criptionC} : <div cla ss="clr3"> {$sDescrip tion}</div >   660                             {$sDes criptionC} : <div cla ss="clr3"> {$sDescrip tion}</div >
661                    </di v>   661                    </di v>
662                    <div  class="cl s_res_info _p">   662                    <div  class="cl s_res_info _p">
663                             {$sVie wParticipa nts}   663                             {$sVie wParticipa nts}
664                    </di v>   664                    </di v>
665                    {$sA ctions}   665                    {$sA ctions}
666           </ div>   666           </ div>
667           <d iv class=" clear_both "></div>   667           <d iv class=" clear_both "></div>
668   </div>   668   </div>
669   EOF;   669   EOF;
670     670  
671                                      $sRetHtm l .= $sMai nContent;   671                                      $sRetHtm l .= $sMai nContent;
672                             }   672                             }
673     673  
674                             $iVar  = 2;   674                             $iVar  = 2;
675                             ////// ////////// ////////// /   675                             ////// ////////// ////////// /
676                             if ($t his->bUseF riendlyLin ks==false  || $_GET[' show_event s']!='all' ) { //old  variant   676                             if ($t his->bUseF riendlyLin ks==false  || $_GET[' show_event s']!='all' ) { //old  variant
677                                      if( $iTo talPages >  1)   677                                      if( $iTo talPages >  1)
678                                      {   678                                      {
679                                               $sRequest  = $_SERVER ['PHP_SELF '] . '?';   679                                               $sRequest  = $_SERVER ['PHP_SELF '] . '?';
680                                               $aFields =  array('sh ow_events' ,'action',  'show_eve nts_countr y');   680                                               $aFields =  array('sh ow_events' ,'action',  'show_eve nts_countr y');
681                                                 681                                              
682                                               foreach( $ aFields as  $field )   682                                               foreach( $ aFields as  $field )
683                                                       if ( isset( $ _GET[$fiel d] ) )   683                                                       if ( isset( $ _GET[$fiel d] ) )
684                                                                $sRe quest .= " &{$field}= " . htmlen tities( pr ocess_pass _data( $_G ET[$field]  ) );   684                                                                $sRe quest .= " &{$field}= " . htmlen tities( pr ocess_pass _data( $_G ET[$field]  ) );
685                                                 685                                              
686                                               $paginatio n = '<div  style="tex t-align: c enter; pos ition: rel ative;">'. _t("_Resul ts per pag e").':   686                                               $paginatio n = '<div  style="tex t-align: c enter; pos ition: rel ative;">'. _t("_Resul ts per pag e").':
687                                                                <sel ect name=" per_page"  onchange=" window.loc ation=\''  . $sReques t . '&per_ page=\' +  this.value ;">   687                                                                <sel ect name=" per_page"  onchange=" window.loc ation=\''  . $sReques t . '&per_ page=\' +  this.value ;">
688                                                                         <optio n value="1 0"' . ( $i PerPage ==  10 ? ' se lected="se lected"' :  '' ) . '> 10</option >   688                                                                         <optio n value="1 0"' . ( $i PerPage ==  10 ? ' se lected="se lected"' :  '' ) . '> 10</option >
689                                                                         <optio n value="2 0"' . ( $i PerPage ==  20 ? ' se lected="se lected"' :  '' ) . '> 20</option >   689                                                                         <optio n value="2 0"' . ( $i PerPage ==  20 ? ' se lected="se lected"' :  '' ) . '> 20</option >
690                                                                         <optio n value="5 0"' . ( $i PerPage ==  50 ? ' se lected="se lected"' :  '' ) . '> 50</option >   690                                                                         <optio n value="5 0"' . ( $i PerPage ==  50 ? ' se lected="se lected"' :  '' ) . '> 50</option >
691                                                                         <optio n value="1 00"' . ( $ iPerPage = = 100 ? '  selected=" selected"'  : '' ) .  '>100</opt ion>   691                                                                         <optio n value="1 00"' . ( $ iPerPage = = 100 ? '  selected=" selected"'  : '' ) .  '>100</opt ion>
692                                                                </se lect></div >' .   692                                                                </se lect></div >' .
693                                                       ge nPaginatio n( $iTotal Pages, $iC urPage, (  $sRequest  . '&page={ page}&per_ page='.$iP erPage ) ) ;   693                                                       ge nPaginatio n( $iTotal Pages, $iC urPage, (  $sRequest  . '&page={ page}&per_ page='.$iP erPage ) ) ;
694                                      }   694                                      }
695                                      else   695                                      else
696                                               $paginatio n = '';   696                                               $paginatio n = '';
697                             }   697                             }
698                             else i f ($this-> bUseFriend lyLinks &&  $_GET['sh ow_events' ]=='all')  { //new va tiant   698                             else i f ($this-> bUseFriend lyLinks &&  $_GET['sh ow_events' ]=='all')  { //new va tiant
699                                      if( $iTo talPages >  1) {   699                                      if( $iTo talPages >  1) {
700                                               //$sFriend lyAction =  'show_eve nts=all&ac tion=show' ;   700                                               //$sFriend lyAction =  'show_eve nts=all&ac tion=show' ;
701     701  
702                                               $sRequest  = $site['u rl'] . 'ev ents/all/' ;   702                                               $sRequest  = $site['u rl'] . 'ev ents/all/' ;
703                                               /*$aFields  = array(' show_event s','action ');   703                                               /*$aFields  = array(' show_event s','action ');
704     704  
705                                               foreach( $ aFields as  $field )   705                                               foreach( $ aFields as  $field )
706                                                       if ( isset( $ _GET[$fiel d] ) )   706                                                       if ( isset( $ _GET[$fiel d] ) )
707                                                                $sFr iendlyActi on .= "{$f ield}=" .  htmlentiti es( proces s_pass_dat a( $_GET[$ field] ) )  . '&';*/   707                                                                $sFr iendlyActi on .= "{$f ield}=" .  htmlentiti es( proces s_pass_dat a( $_GET[$ field] ) )  . '&';*/
708     708  
709                                               $paginatio n = '<div  style="tex t-align: c enter; pos ition: rel ative;">'. _t("_Resul ts per pag e").':   709                                               $paginatio n = '<div  style="tex t-align: c enter; pos ition: rel ative;">'. _t("_Resul ts per pag e").':
710                                                                <sel ect name=" per_page"  onchange=" window.loc ation=\''  . $sReques t . '\' +  this.value  + \'/1\'; ">   710                                                                <sel ect name=" per_page"  onchange=" window.loc ation=\''  . $sReques t . '\' +  this.value  + \'/1\'; ">
711                                                                         <optio n value="1 0"' . ( $i PerPage ==  10 ? ' se lected="se lected"' :  '' ) . '> 10</option >   711                                                                         <optio n value="1 0"' . ( $i PerPage ==  10 ? ' se lected="se lected"' :  '' ) . '> 10</option >
712                                                                         <optio n value="2 0"' . ( $i PerPage ==  20 ? ' se lected="se lected"' :  '' ) . '> 20</option >   712                                                                         <optio n value="2 0"' . ( $i PerPage ==  20 ? ' se lected="se lected"' :  '' ) . '> 20</option >
713                                                                         <optio n value="5 0"' . ( $i PerPage ==  50 ? ' se lected="se lected"' :  '' ) . '> 50</option >   713                                                                         <optio n value="5 0"' . ( $i PerPage ==  50 ? ' se lected="se lected"' :  '' ) . '> 50</option >
714                                                                         <optio n value="1 00"' . ( $ iPerPage = = 100 ? '  selected=" selected"'  : '' ) .  '>100</opt ion>   714                                                                         <optio n value="1 00"' . ( $ iPerPage = = 100 ? '  selected=" selected"'  : '' ) .  '>100</opt ion>
715                                                                </se lect></div >' .   715                                                                </se lect></div >' .
716                                                       ge nPaginatio n( $iTotal Pages, $iC urPage, (  $sRequest. $iPerPage  . '/{page} ' ) );   716                                                       ge nPaginatio n( $iTotal Pages, $iC urPage, (  $sRequest. $iPerPage  . '/{page} ' ) );
717                                      } else $ pagination  = '';   717                                      } else $ pagination  = '';
718                             }   718                             }
719                             ////// ////////// ////////// /   719                             ////// ////////// ////////// /
720                    }   720                    }
721     721  
722                    $sRe tHtml = $t his->Decor ateAsTable (_t('_All  Events'),  $sRetHtml. $paginatio n);   722                    $sRe tHtml = $t his->Decor ateAsTable (_t('_All  Events'),  $sRetHtml. $paginatio n);
723                    retu rn $sRetHt ml;   723                    retu rn $sRetHt ml;
724           }   724           }
725     725  
726           /* *   726           /* *
727            *  Compose r esult into  Wrapper c lass   727            *  Compose r esult into  Wrapper c lass
728            *   728            *
729            *  @param $s Caption      caption  of Box   729            *  @param $s Caption      caption  of Box
730            *  @param $s Value        inner te xt of box   730            *  @param $s Value        inner te xt of box
731            *  @return H TML presen tation of  data   731            *  @return H TML presen tation of  data
732            * /   732            * /
733           fu nction Dec orateAsTab le($sCapti on, $sValu e) {   733           fu nction Dec orateAsTab le($sCapti on, $sValu e) {
734                    $sVa lueF = <<< EOF   734                    $sVa lueF = <<< EOF
735   <div class ="cls_resu lt_wrapper ">   735   <div class ="cls_resu lt_wrapper ">
736           {$ sValue}   736           {$ sValue}
737   </div>   737   </div>
738   EOF;   738   EOF;
739                    $sDe cTbl = Des ignBoxCont ent ( _t($ sCaption),  $sValueF,  1 );   739                    $sDe cTbl = Des ignBoxCont ent ( _t($ sCaption),  $sValueF,  1 );
740                    retu rn $sDecTb l;   740                    retu rn $sDecTb l;
741           }   741           }
742     742  
743           /* *   743           /* *
744            *  page show  informati on about s pecified e vent   744            *  page show  informati on about s pecified e vent
745            *  @return H TML presen tation of  data   745            *  @return H TML presen tation of  data
746            * /   746            * /
747           fu nction Pag eSDatingSh owInfo() {   747           fu nction Pag eSDatingSh owInfo() {
748                    glob al $site;   748                    glob al $site;
749                    glob al $tmpl;   749                    glob al $tmpl;
750                    glob al $dir;   750                    glob al $dir;
751                    glob al $aPreVa lues;   751                    glob al $aPreVa lues;
752                    glob al $doll;   752                    glob al $doll;
753                    glob al $oTempl Config;   753                    glob al $oTempl Config;
754                    glob al $date_f ormat;   754                    glob al $date_f ormat;
755                    glob al $logged ;   755                    glob al $logged ;
756     756  
757                    // c ollect inf ormation a bout curre nt member   757                    // c ollect inf ormation a bout curre nt member
758                    if(  $logged['m ember'] )  {   758                    if(  $logged['m ember'] )  {
759                             $aMemb er['ID'] =  (int)$_CO OKIE['memb erID'];   759                             $aMemb er['ID'] =  (int)$_CO OKIE['memb erID'];
760                             $aMemb erData = g etProfileI nfo( $aMem ber['ID']  );   760                             $aMemb erData = g etProfileI nfo( $aMem ber['ID']  );
761                    } el se   761                    } el se
762                             $aMemb er['ID'] =  0;   762                             $aMemb er['ID'] =  0;
763     763  
764                    $sNo PhotoC = _ t('_No pho to');   764                    $sNo PhotoC = _ t('_No pho to');
765                    $sCh angeC = _t ('_Change' );   765                    $sCh angeC = _t ('_Change' );
766                    $sCa nBuyTicket C = _t('_Y ou can buy  the ticke t');   766                    $sCa nBuyTicket C = _t('_Y ou can buy  the ticke t');
767                    $sBu yTicketC =  _t('_Buy  ticket');   767                    $sBu yTicketC =  _t('_Buy  ticket');
768                    $sCo untryC = _ t('_Countr y');   768                    $sCo untryC = _ t('_Countr y');
769                    $sCi tyC = _t(' _City');   769                    $sCi tyC = _t(' _City');
770                    $sPl aceC = _t( '_Place');   770                    $sPl aceC = _t( '_Place');
771                    $sEv entStartC  = _t('_Eve nt start') ;   771                    $sEv entStartC  = _t('_Eve nt start') ;
772                    $sDa teC = _t(' _Date');   772                    $sDa teC = _t(' _Date');
773                    $sEv entEndC =  _t('_Event  end');   773                    $sEv entEndC =  _t('_Event  end');
774                    $sTi cketSaleSt artC = _t( '_Ticket s ale start' );   774                    $sTi cketSaleSt artC = _t( '_Ticket s ale start' );
775                    $sTi cketSaleEn dC = _t('_ Ticket sal e end');   775                    $sTi cketSaleEn dC = _t('_ Ticket sal e end');
776                    $sRe sponsibleP ersonC = _ t('_Respon sible pers on');   776                    $sRe sponsibleP ersonC = _ t('_Respon sible pers on');
777                    $sPo stedByC =  _t('_Poste d by');   777                    $sPo stedByC =  _t('_Poste d by');
778                    $sTi cketsLeftC  = _t('_Ti ckets left ');   778                    $sTi cketsLeftC  = _t('_Ti ckets left ');
779                    $sTi cketPriceC  = _t('_Ti cket price ');   779                    $sTi cketPriceC  = _t('_Ti cket price ');
780                    $sDe scriptionC  = _t('_De scription' );   780                    $sDe scriptionC  = _t('_De scription' );
781                    $sSa leStatusC  = _t('_Sal e status') ;   781                    $sSa leStatusC  = _t('_Sal e status') ;
782                    $sEv entC = _t( '_Event');   782                    $sEv entC = _t( '_Event');
783                    $sEd itC = _t(' _Edit');   783                    $sEd itC = _t(' _Edit');
784                    $sDe leteC = _t ('_Delete' );   784                    $sDe leteC = _t ('_Delete' );
785                    $sSu reC = _t(" _Are you s ure");   785                    $sSu reC = _t(" _Are you s ure");
786                    $sPi ctureC = _ t('_Pictur e');   786                    $sPi ctureC = _ t('_Pictur e');
787                    $sSt atusC = _t ('_Status' );   787                    $sSt atusC = _t ('_Status' );
788                    $sPh oneC = _t( '_Phone');   788                    $sPh oneC = _t( '_Phone');
789                    $sEm ailC = _t( '_E-mail') ;   789                    $sEm ailC = _t( '_E-mail') ;
790                    $sAc tionsC = _ t('_Action s');   790                    $sAc tionsC = _ t('_Action s');
791                    $sJo inC = _t(' _Join');   791                    $sJo inC = _t(' _Join');
792                    $sUn subscribeC  = _t('_Un subscribe' );   792                    $sUn subscribeC  = _t('_Un subscribe' );
793                    $sPa rticipants C = _t('_P articipant s');   793                    $sPa rticipants C = _t('_P articipant s');
794                    $sLi stOfPartic ipantsC =  _t('_List' ).' '._t(' _of').' '. _t('_Parti cipants');   794                    $sLi stOfPartic ipantsC =  _t('_List' ).' '._t(' _of').' '. _t('_Parti cipants');
795                    $sTa gsC = _t(' _Tags');   795                    $sTa gsC = _t(' _Tags');
796                    $sYO C = _t('_y /o');   796                    $sYO C = _t('_y /o');
797     797  
798                    /*$i EventID =  (int)$_REQ UEST['even t_id'];*/   798                    /*$i EventID =  (int)$_REQ UEST['even t_id'];*/
799                    $iEv entID = ($ this->bUse FriendlyLi nks) ? (in t)db_value ("SELECT ` ID` FROM ` SDatingEve nts` WHERE  `EntryUri `='" . $th is->proces s_html_db_ input($_RE QUEST['eve ntUri']) .  "' LIMIT  1") : (int )$_REQUEST ['event_id '];   799                    $iEv entID = ($ this->bUse FriendlyLi nks) ? (in t)db_value ("SELECT ` ID` FROM ` SDatingEve nts` WHERE  `EntryUri `='" . $th is->proces s_html_db_ input($_RE QUEST['eve ntUri']) .  "' LIMIT  1") : (int )$_REQUEST ['event_id '];
800     800  
801                    if ( $this->iLa stInserted ID > 0) {   801                    if ( $this->iLa stInserted ID > 0) {
802                             $iEven tID = $thi s->iLastIn sertedID;   802                             $iEven tID = $thi s->iLastIn sertedID;
803                             $this- >iLastInse rtedID = - 1;   803                             $this- >iLastInse rtedID = - 1;
804                    }   804                    }
805     805  
806                    $sQu ery =  "   806                    $sQu ery =  "
807                             SELECT   807                             SELECT
808                                      `SDating Events`.`I D` AS `Eve ntIDN`,   808                                      `SDating Events`.`I D` AS `Eve ntIDN`,
809                                      `Title`,   809                                      `Title`,
810                                      `EntryUr i`,   810                                      `EntryUr i`,
811                                      `Descrip tion`,   811                                      `Descrip tion`,
812                                      `PhotoFi lename`,   812                                      `PhotoFi lename`,
813                                      `StatusM essage`,   813                                      `StatusM essage`,
814                                      `Country `,   814                                      `Country `,
815                                      `City`,   815                                      `City`,
816                                      `Place`,   816                                      `Place`,
817                                      `Tags`,   817                                      `Tags`,
818                                      `EventSt art`,   818                                      `EventSt art`,
819                                      UNIX_TIM ESTAMP(`Ev entStart`)  AS 'Event Start_UTS' ,   819                                      UNIX_TIM ESTAMP(`Ev entStart`)  AS 'Event Start_UTS' ,
820                                      DATE_FOR MAT(`Event End`, '{$d ate_format }' ) AS Ev entEnd,   820                                      DATE_FOR MAT(`Event End`, '{$d ate_format }' ) AS Ev entEnd,
821                                      (NOW() >  `EventSta rt`) AS `E ventBegan` ,   821                                      (NOW() >  `EventSta rt`) AS `E ventBegan` ,
822                                      (NOW() <  `EventEnd `) AS `Eve ntNotFinis hed`,   822                                      (NOW() <  `EventEnd `) AS `Eve ntNotFinis hed`,
823                                      DATE_FOR MAT(`Ticke tSaleStart `, '{$date _format}'  ) AS 'Tick etSaleStar t',   823                                      DATE_FOR MAT(`Ticke tSaleStart `, '{$date _format}'  ) AS 'Tick etSaleStar t',
824                                      DATE_FOR MAT(`Ticke tSaleEnd`,  '{$date_f ormat}' )  AS 'Ticket SaleEnd',   824                                      DATE_FOR MAT(`Ticke tSaleEnd`,  '{$date_f ormat}' )  AS 'Ticket SaleEnd',
825                                      (NOW() >  `TicketSa leStart`)  AS `SaleBe gan`,   825                                      (NOW() >  `TicketSa leStart`)  AS `SaleBe gan`,
826                                      (NOW() <  `TicketSa leEnd`) AS  `SaleNotF inished`,   826                                      (NOW() <  `TicketSa leEnd`) AS  `SaleNotF inished`,
827                                      (UNIX_TI MESTAMP()  - UNIX_TIM ESTAMP(`Ev entStart`) ) AS `sec` ,   827                                      (UNIX_TI MESTAMP()  - UNIX_TIM ESTAMP(`Ev entStart`) ) AS `sec` ,
828                                      `Respons ibleID`,   828                                      `Respons ibleID`,
829                                      `Respons ibleName`,   829                                      `Respons ibleName`,
830                                      `Respons ibleEmail` ,   830                                      `Respons ibleEmail` ,
831                                      `Respons iblePhone` ,   831                                      `Respons iblePhone` ,
832                                      `TicketP riceFemale `,   832                                      `TicketP riceFemale `,
833                                      `TicketP riceMale`,   833                                      `TicketP riceMale`,
834                                      `TicketC ountFemale `,   834                                      `TicketC ountFemale `,
835                                      `TicketC ountMale`,   835                                      `TicketC ountMale`,
836                                      (NOW() >  `EventEnd ` AND NOW( ) < DATE_A DD(`EventE nd`, INTER VAL `Choos ePeriod` D AY)) AS `C hooseActiv e`,   836                                      (NOW() >  `EventEnd ` AND NOW( ) < DATE_A DD(`EventE nd`, INTER VAL `Choos ePeriod` D AY)) AS `C hooseActiv e`,
837                                      (`SDatin gParticipa nts`.`ID`  IS NOT NUL L) AS `IsP articipant `   837                                      (`SDatin gParticipa nts`.`ID`  IS NOT NUL L) AS `IsP articipant `
838                             FROM ` SDatingEve nts`   838                             FROM ` SDatingEve nts`
839                             LEFT J OIN `SDati ngParticip ants` ON   839                             LEFT J OIN `SDati ngParticip ants` ON
840                                      `SDating Participan ts`.`IDEve nt` = `SDa tingEvents `.`ID`   840                                      `SDating Participan ts`.`IDEve nt` = `SDa tingEvents `.`ID`
841                                      AND `SDa tingPartic ipants`.`I DMember` =  {$aMember ['ID']}   841                                      AND `SDa tingPartic ipants`.`I DMember` =  {$aMember ['ID']}
842                             WHERE   842                             WHERE
843                                      `SDating Events`.`I D` = {$iEv entID}   843                                      `SDating Events`.`I D` = {$iEv entID}
844                                      AND `SDa tingEvents `.`Status`  = 'Active '   844                                      AND `SDa tingEvents `.`Status`  = 'Active '
845                             ";   845                             ";
846     846  
847                    $aEv entData =  db_arr( $s Query );   847                    $aEv entData =  db_arr( $s Query );
848                    if (  !is_array ($aEventDa ta) || cou nt($aEvent Data) == 0  )   848                    if (  !is_array ($aEventDa ta) || cou nt($aEvent Data) == 0  )
849                             return  DesignBox Content( ' ', '<cente r>'. _t('_ Event is u navailable ') .'</cen ter>', $oT emplConfig  -> PageSD atingShowI nfo_db_num  );   849                             return  DesignBox Content( ' ', '<cente r>'. _t('_ Event is u navailable ') .'</cen ter>', $oT emplConfig  -> PageSD atingShowI nfo_db_num  );
850     850  
851                    $sQu ery = "   851                    $sQu ery = "
852                             SELECT  COUNT(*)   852                             SELECT  COUNT(*)
853                             FROM ` SDatingPar ticipants`   853                             FROM ` SDatingPar ticipants`
854                             LEFT J OIN `Profi les` ON   854                             LEFT J OIN `Profi les` ON
855                                      `SDating Participan ts`.`IDMem ber` = `Pr ofiles`.`I D`   855                                      `SDating Participan ts`.`IDMem ber` = `Pr ofiles`.`I D`
856                             WHERE   856                             WHERE
857                                      `SDating Participan ts`.`IDEve nt` = {$iE ventID}   857                                      `SDating Participan ts`.`IDEve nt` = {$iE ventID}
858                                      AND `Pro files`.`Se x` = '{$sM emberSex}'   858                                      AND `Pro files`.`Se x` = '{$sM emberSex}'
859                             ";   859                             ";
860                       860                    
861                    $aPa rtNum = db _arr( $sQu ery );   861                    $aPa rtNum = db _arr( $sQu ery );
862                    $iPa rtNum = (i nt)$aPartN um[0];   862                    $iPa rtNum = (i nt)$aPartN um[0];
863                    $iTi cketsLeft  = ( $aMemb erData['Se x'] == 'ma le' ? $aEv entData['T icketCount Male'] - $ iPartNum :  $aEventDa ta['Ticket CountFemal e'] - $iPa rtNum );   863                    $iTi cketsLeft  = ( $aMemb erData['Se x'] == 'ma le' ? $aEv entData['T icketCount Male'] - $ iPartNum :  $aEventDa ta['Ticket CountFemal e'] - $iPa rtNum );
864                    $iTi cketPrice  = (float)(  $aMemberD ata['Sex']  == 'male'  ? $aEvent Data['Tick etPriceMal e'] : $aEv entData['T icketPrice Female'] ) ;   864                    $iTi cketPrice  = (float)(  $aMemberD ata['Sex']  == 'male'  ? $aEvent Data['Tick etPriceMal e'] : $aEv entData['T icketPrice Female'] ) ;
865     865  
866                    // c hange part icipant UI D   866                    // c hange part icipant UI D
867                    $sEr rorMessage  = '';   867                    $sEr rorMessage  = '';
868                    if (  isset($_P OST['chang e_uid']) & & $_POST[' change_uid '] == 'on'  ) {   868                    if (  isset($_P OST['chang e_uid']) & & $_POST[' change_uid '] == 'on'  ) {
869                             // che ck if this  UID doesn 't exist f or this ev ent   869                             // che ck if this  UID doesn 't exist f or this ev ent
870                             $sNewU id = proce ss_db_inpu t($_POST[' participan t_uid']);   870                             $sNewU id = proce ss_db_inpu t($_POST[' participan t_uid']);
871                             $aExis tUid = db_ arr( "SELE CT `ID` FR OM `SDatin gParticipa nts`   871                             $aExis tUid = db_ arr( "SELE CT `ID` FR OM `SDatin gParticipa nts`
872                                                                                  WHERE `I DEvent` =  {$iEventID }   872                                                                                  WHERE `I DEvent` =  {$iEventID }
873                                                                                  AND `IDM ember` <>  {$aMember[ 'ID']}   873                                                                                  AND `IDM ember` <>  {$aMember[ 'ID']}
874                                                                                  AND LOWE R(`Partici pantUID`)  = LOWER('$ sNewUid')"  );   874                                                                                  AND LOWE R(`Partici pantUID`)  = LOWER('$ sNewUid')"  );
875                             if ( ! $aExistUid ['ID'] ) {   875                             if ( ! $aExistUid ['ID'] ) {
876                                      $vRes =  db_res( "U PDATE `SDa tingPartic ipants`   876                                      $vRes =  db_res( "U PDATE `SDa tingPartic ipants`
877                                                                                  SET `Par ticipantUI D` = '$sNe wUid'   877                                                                                  SET `Par ticipantUI D` = '$sNe wUid'
878                                                                                  WHERE `I DEvent` =  $iEventID   878                                                                                  WHERE `I DEvent` =  $iEventID
879                                                                                  AND `IDM ember` = { $aMember[' ID']}" );   879                                                                                  AND `IDM ember` = { $aMember[' ID']}" );
880                                      if ( !$v Res )   880                                      if ( !$v Res )
881                                               $sErrorMes sage = _t( '_Cant cha nge partic ipant UID' );   881                                               $sErrorMes sage = _t( '_Cant cha nge partic ipant UID' );
882                             } else  {   882                             } else  {
883                                      $sErrorM essage = _ t('_UID al ready exis ts');   883                                      $sErrorM essage = _ t('_UID al ready exis ts');
884                             }   884                             }
885                    }   885                    }
886     886  
887                    // i f ticket i s free the n buy it h ere withou t any chec kouts   887                    // i f ticket i s free the n buy it h ere withou t any chec kouts
888                    if (  isset($_P OST['purch ase_ticket ']) && $_P OST['purch ase_ticket '] == 'on'  && !$aEve ntData['Is Participan t'] and $l ogged['mem ber'] ) {   888                    if (  isset($_P OST['purch ase_ticket ']) && $_P OST['purch ase_ticket '] == 'on'  && !$aEve ntData['Is Participan t'] and $l ogged['mem ber'] ) {
889                             if ( $ aEventData ['SaleBega n'] && $aE ventData[' SaleNotFin ished'] &&  $iTickets Left > 0 & & $iTicket Price <= 0 .0 ) {   889                             if ( $ aEventData ['SaleBega n'] && $aE ventData[' SaleNotFin ished'] &&  $iTickets Left > 0 & & $iTicket Price <= 0 .0 ) {
890                                      // inser t into par ticipants  table   890                                      // inser t into par ticipants  table
891                                      $iPartic ipantUID =  $aMemberD ata['NickN ame'] . $i EventID .  rand(100,  999);   891                                      $iPartic ipantUID =  $aMemberD ata['NickN ame'] . $i EventID .  rand(100,  999);
892                                      $vRes =  db_res( "I NSERT INTO  `SDatingP articipant s` SET `ID Event` = { $iEventID} , `IDMembe r` = {$aMe mber['ID'] }, `Partic ipantUID`  = '{$iPart icipantUID }'", 0 );   892                                      $vRes =  db_res( "I NSERT INTO  `SDatingP articipant s` SET `ID Event` = { $iEventID} , `IDMembe r` = {$aMe mber['ID'] }, `Partic ipantUID`  = '{$iPart icipantUID }'", 0 );
893                                      if ( !$v Res ) {   893                                      if ( !$v Res ) {
894                                               $sErrorMes sage = _t( 'Error: Pa rticipant  subscripti on error') ;   894                                               $sErrorMes sage = _t( 'Error: Pa rticipant  subscripti on error') ;
895                                      } else {   895                                      } else {
896                                               $sSubject  = getParam ( 't_SDati ngCongratu lation_sub ject' );   896                                               $sSubject  = getParam ( 't_SDati ngCongratu lation_sub ject' );
897                                               $sMessage  = getParam ( 't_SDati ngCongratu lation' );   897                                               $sMessage  = getParam ( 't_SDati ngCongratu lation' );
898     898  
899                                               $aPlus = a rray();   899                                               $aPlus = a rray();
900                                               $aPlus['Na meSDating' ] = $aEven tData['Tit le'];   900                                               $aPlus['Na meSDating' ] = $aEven tData['Tit le'];
901                                               $aPlus['Pl aceSDating '] = $aEve ntData['Pl ace'];   901                                               $aPlus['Pl aceSDating '] = $aEve ntData['Pl ace'];
902                                               $aPlus['Wh enStarSDat ing'] = $a EventData[ 'EventStar t'];   902                                               $aPlus['Wh enStarSDat ing'] = $a EventData[ 'EventStar t'];
903                                               $aPlus['Pe rsonalUID' ] = $iPart icipantUID ;   903                                               $aPlus['Pe rsonalUID' ] = $iPart icipantUID ;
904                                               $sGenUrl =  $this->ge nUrl($iEve ntID, $aEv entData['E ntryUri']) ;   904                                               $sGenUrl =  $this->ge nUrl($iEve ntID, $aEv entData['E ntryUri']) ;
905                                               $aPlus['Li nkSDatingE vent'] = $ sGenUrl;   905                                               $aPlus['Li nkSDatingE vent'] = $ sGenUrl;
906     906  
907                                               $vMailRes  = sendMail ( $aMember Data['Emai l'], $sSub ject, $sMe ssage, $aM ember['ID' ], $aPlus  );   907                                               $vMailRes  = sendMail ( $aMember Data['Emai l'], $sSub ject, $sMe ssage, $aM ember['ID' ], $aPlus  );
908     908  
909                                               if ( !$vMa ilRes )   909                                               if ( !$vMa ilRes )
910                                                       $_ POST['resu lt'] = 3;   910                                                       $_ POST['resu lt'] = 3;
911                                               else   911                                               else
912                                                       $_ POST['resu lt'] = 1;   912                                                       $_ POST['resu lt'] = 1;
913                                      }   913                                      }
914                             } else  {   914                             } else  {
915                                      $_POST[' result'] =  -1;   915                                      $_POST[' result'] =  -1;
916                             }   916                             }
917                    }   917                    }
918                    else if ( isset ($_POST['j oin_event' ]) && $_PO ST['join_e vent'] ==  'on' && $l ogged['mem ber'] ) {   918                    else if ( isset ($_POST['j oin_event' ]) && $_PO ST['join_e vent'] ==  'on' && $l ogged['mem ber'] ) {
919                             // ins ert into p articipant s table   919                             // ins ert into p articipant s table
920                             $iPart icipantUID  = $aMembe rData['Nic kName'] .  $iEventID  . rand(100 , 999);   920                             $iPart icipantUID  = $aMembe rData['Nic kName'] .  $iEventID  . rand(100 , 999);
921                             $vRes  = db_res(  "INSERT IN TO `SDatin gParticipa nts` SET ` IDEvent` =  {$iEventI D}, `IDMem ber` = {$a Member['ID ']}, `Part icipantUID ` = '{$iPa rticipantU ID}'", 0 ) ;   921                             $vRes  = db_res(  "INSERT IN TO `SDatin gParticipa nts` SET ` IDEvent` =  {$iEventI D}, `IDMem ber` = {$a Member['ID ']}, `Part icipantUID ` = '{$iPa rticipantU ID}'", 0 ) ;
922                             if ( ! $vRes ) {   922                             if ( ! $vRes ) {
923                                      $sErrorM essage = _ t('Error:  Participan t subscrip tion error ');   923                                      $sErrorM essage = _ t('Error:  Participan t subscrip tion error ');
924                                      $sRetHtm l .= '<scr ipt type=" text/javas cript">ale rt("'._t(  '_Sorry, y ou\'re alr eady joine d' ).'");< /script>';   924                                      $sRetHtm l .= '<scr ipt type=" text/javas cript">ale rt("'._t(  '_Sorry, y ou\'re alr eady joine d' ).'");< /script>';
925                             } else  {   925                             } else  {
926                                      $sSubjec t = getPar am( 't_SDa tingCongra tulation_s ubject' );   926                                      $sSubjec t = getPar am( 't_SDa tingCongra tulation_s ubject' );
927                                      $sMessag e = getPar am( 't_SDa tingCongra tulation'  );   927                                      $sMessag e = getPar am( 't_SDa tingCongra tulation'  );
928     928  
929                                      $aPlus =  array();   929                                      $aPlus =  array();
930                                      $aPlus[' NameSDatin g'] = $aEv entData['T itle'];   930                                      $aPlus[' NameSDatin g'] = $aEv entData['T itle'];
931                                      $aPlus[' PlaceSDati ng'] = $aE ventData[' Place'];   931                                      $aPlus[' PlaceSDati ng'] = $aE ventData[' Place'];
932                                      $aPlus[' WhenStarSD ating'] =  $aEventDat a['EventSt art'];   932                                      $aPlus[' WhenStarSD ating'] =  $aEventDat a['EventSt art'];
933                                      $aPlus[' PersonalUI D'] = $iPa rticipantU ID;   933                                      $aPlus[' PersonalUI D'] = $iPa rticipantU ID;
934                                      $sGenUrl  = $this-> genUrl($iE ventID, $a EventData[ 'EntryUri' ]);   934                                      $sGenUrl  = $this-> genUrl($iE ventID, $a EventData[ 'EntryUri' ]);
935                                      $aPlus[' LinkSDatin gEvent'] =  $sGenUrl;   935                                      $aPlus[' LinkSDatin gEvent'] =  $sGenUrl;
936     936  
937                                      $vMailRe s = sendMa il( $aMemb erData['Em ail'], $sS ubject, $s Message, $ aMember['I D'], $aPlu s );   937                                      $vMailRe s = sendMa il( $aMemb erData['Em ail'], $sS ubject, $s Message, $ aMember['I D'], $aPlu s );
938     938  
939                                      $sRetHtm l .= '<scr ipt type=" text/javas cript">ale rt("'._t(' _You have  successful ly joined  this Event ').'");</s cript>';   939                                      $sRetHtm l .= '<scr ipt type=" text/javas cript">ale rt("'._t(' _You have  successful ly joined  this Event ').'");</s cript>';
940     940  
941                                      if ( !$v MailRes )   941                                      if ( !$v MailRes )
942                                               $_POST['re sult'] = 3 ;   942                                               $_POST['re sult'] = 3 ;
943                                      else   943                                      else
944                                               $_POST['re sult'] = 1 ;   944                                               $_POST['re sult'] = 1 ;
945                             }   945                             }
946                    } el seif ( iss et($_POST[ 'unsubscri be_event'] ) && $_POS T['unsubsc ribe_event '] == 'on'  && $logge d['member' ] ) {   946                    } el seif ( iss et($_POST[ 'unsubscri be_event'] ) && $_POS T['unsubsc ribe_event '] == 'on'  && $logge d['member' ] ) {
947                             // rem ove from p articipant s table   947                             // rem ove from p articipant s table
948                             $vRes  = db_res(" DELETE FRO M `SDating Participan ts` WHERE  `IDEvent`  = {$iEvent ID} AND `I DMember` =  {$aMember ['ID']} LI MIT 1");   948                             $vRes  = db_res(" DELETE FRO M `SDating Participan ts` WHERE  `IDEvent`  = {$iEvent ID} AND `I DMember` =  {$aMember ['ID']} LI MIT 1");
949                             if (my sql_affect ed_rows($G LOBALS['My SQL']->lin k) == 0) {   949                             if (my sql_affect ed_rows($G LOBALS['My SQL']->lin k) == 0) {
950                                      $sErrorM essage = _ t('Error:  Participan t unsubscr iption err or');   950                                      $sErrorM essage = _ t('Error:  Participan t unsubscr iption err or');
951                                      $sRetHtm l .= '<scr ipt type=" text/javas cript">ale rt("'._t(  '_Error Oc cured' ).' ");</scrip t>';   951                                      $sRetHtm l .= '<scr ipt type=" text/javas cript">ale rt("'._t(  '_Error Oc cured' ).' ");</scrip t>';
952                             } else  {   952                             } else  {
953                                      $sRetHtm l .= '<scr ipt type=" text/javas cript">ale rt("'._t(' _You have  successful ly unsubsc ribe from  Event').'" );</script >';   953                                      $sRetHtm l .= '<scr ipt type=" text/javas cript">ale rt("'._t(' _You have  successful ly unsubsc ribe from  Event').'" );</script >';
954                             }   954                             }
955                    } el seif ( iss et($_POST[ 'join_even t']) && $_ POST['join _event'] = = 'on' &&  $logged['m ember']==f alse ) {   955                    } el seif ( iss et($_POST[ 'join_even t']) && $_ POST['join _event'] = = 'on' &&  $logged['m ember']==f alse ) {
956                             $this- >CheckLogg ed();   956                             $this- >CheckLogg ed();
957                    }   957                    }
958     958  
959                    $aMe mberPart =  db_arr( " SELECT `ID `, `Partic ipantUID`  FROM `SDat ingPartici pants`   959                    $aMe mberPart =  db_arr( " SELECT `ID `, `Partic ipantUID`  FROM `SDat ingPartici pants`
960                                                                                           WHERE `IDE vent` = {$ iEventID}   960                                                                                           WHERE `IDE vent` = {$ iEventID}
961                                                                                           AND `IDMem ber` = {$a Member['ID ']}" );   961                                                                                           AND `IDMem ber` = {$a Member['ID ']}" );
962     962  
963                    $sEr rElems = ' ';   963                    $sEr rElems = ' ';
964                    if (  isset($_P OST['resul t']) ) {   964                    if (  isset($_P OST['resul t']) ) {
965                             $sResu lt = '';   965                             $sResu lt = '';
966                             switch  ( $_POST[ 'result']  ) {   966                             switch  ( $_POST[ 'result']  ) {
967                                      case '-1 ':   $sRes ult = _t(' _RESULT-1' ); break;   967                                      case '-1 ':   $sRes ult = _t(' _RESULT-1' ); break;
968                                      case '0' :    $sRes ult = _t(' _RESULT0') ; break;   968                                      case '0' :    $sRes ult = _t(' _RESULT0') ; break;
969                                      case '1' :    $sRes ult = _t(' _RESULT1_T HANK', $aE ventData[' Title'] ,  $aEventDat a['EventSt art']); br eak;   969                                      case '1' :    $sRes ult = _t(' _RESULT1_T HANK', $aE ventData[' Title'] ,  $aEventDat a['EventSt art']); br eak;
970                                      case '3' :    $sRes ult = _t(' _RESULT_SD ATING_MAIL _NOT_SENT' ); break;   970                                      case '3' :    $sRes ult = _t(' _RESULT_SD ATING_MAIL _NOT_SENT' ); break;
971                                      case '10 00': $sRes ult = _t(' _RESULT100 0'); break ;   971                                      case '10 00': $sRes ult = _t(' _RESULT100 0'); break ;
972                             }   972                             }
973                             $sErrE lems .= '< div class= "err">'.$s Result.'</ div>';   973                             $sErrE lems .= '< div class= "err">'.$s Result.'</ div>';
974                    }   974                    }
975     975  
976                    $sPi cElement =  '';   976                    $sPi cElement =  '';
977                    $sSp acerName =  $this ->  sSpacerPat h;   977                    $sSp acerName =  $this ->  sSpacerPat h;
978                    if (  strlen(tr im($aEvent Data['Phot oFilename' ])) && fil e_exists($ dir['sdati ngImage']  . $aEventD ata['Photo Filename'] ) ) {   978                    if (  strlen(tr im($aEvent Data['Phot oFilename' ])) && fil e_exists($ dir['sdati ngImage']  . $aEventD ata['Photo Filename'] ) ) {
979                             $sPicN ame = $sit e['sdating Image'].$a EventData[ 'PhotoFile name'];   979                             $sPicN ame = $sit e['sdating Image'].$a EventData[ 'PhotoFile name'];
980                             $sPicE lement .=  "<img clas s=\"photo\ " alt=\"\"  style=\"w idth:{$thi s -> iImgS ize}px;hei ght:{$this  -> iImgSi ze}px;back ground-ima ge:url({$s PicName}); \" src=\"{ $sSpacerNa me}\" bord er=\"0\" / >";   980                             $sPicE lement .=  "<img clas s=\"photo\ " alt=\"\"  style=\"w idth:{$thi s -> iImgS ize}px;hei ght:{$this  -> iImgSi ze}px;back ground-ima ge:url({$s PicName}); \" src=\"{ $sSpacerNa me}\" bord er=\"0\" / >";
981                             $sPicE lement1 .=  '   981                             $sPicE lement1 .=  '
982                                      <img src ="'.$site[ 'sdatingIm age'].$aEv entData['P hotoFilena me'].'" bo rder="0" a lt="'._t(' _SDating p hoto alt',  $aEventDa ta['Title' ]).'" />';   982                                      <img src ="'.$site[ 'sdatingIm age'].$aEv entData['P hotoFilena me'].'" bo rder="0" a lt="'._t(' _SDating p hoto alt',  $aEventDa ta['Title' ]).'" />';
983                    } el se {   983                    } el se {
984                             $sPicN aName = "{ $site['url ']}templat es/tmpl_{$ tmpl}/{$th is -> sPic NotAvail}" ;   984                             $sPicN aName = "{ $site['url ']}templat es/tmpl_{$ tmpl}/{$th is -> sPic NotAvail}" ;
985                             $sPicE lement .=  "<img clas s=\"photo\ " alt=\"\"  style=\"w idth:{$thi s -> iImgS ize}px;hei ght:{$this  -> iImgSi ze}px;back ground-ima ge:url({$s PicNaName} );\" src=\ "{$sSpacer Name}\" bo rder=\"0\"  />";   985                             $sPicE lement .=  "<img clas s=\"photo\ " alt=\"\"  style=\"w idth:{$thi s -> iImgS ize}px;hei ght:{$this  -> iImgSi ze}px;back ground-ima ge:url({$s PicNaName} );\" src=\ "{$sSpacer Name}\" bo rder=\"0\"  />";
986                             $sPicE lement1 .=  '   986                             $sPicE lement1 .=  '
987                                      <div ali gn="center " class="t ext" style ="width: 2 00px; heig ht: 150px;  vertical- align: mid dle; line- height: 15 0px; borde r: 1px sol id silver; ">'.$sNoPh otoC.'</di v>';   987                                      <div ali gn="center " class="t ext" style ="width: 2 00px; heig ht: 150px;  vertical- align: mid dle; line- height: 15 0px; borde r: 1px sol id silver; ">'.$sNoPh otoC.'</di v>';
988                    }   988                    }
989     989  
990                    /*$s InnerData  = '';   990                    /*$s InnerData  = '';
991                    if (  $aMemberP art['ID']  ) {   991                    if (  $aMemberP art['ID']  ) {
992                             if ( $ aEventData ['EventBeg an'] && $a EventData[ 'EventNotF inished']  ) {   992                             if ( $ aEventData ['EventBeg an'] && $a EventData[ 'EventNotF inished']  ) {
993                                      $sInnerD ata .= _t( '_Event st arted');   993                                      $sInnerD ata .= _t( '_Event st arted');
994                             }   994                             }
995                             elseif  ( $aEvent Data['Choo seActive']  ) {   995                             elseif  ( $aEvent Data['Choo seActive']  ) {
996                                      $sInnerD ata .= _t( '_Event fi nished') . ". <a href =\"{$_SERV ER['PHP_SE LF']}?acti on=select_ match&even t_id={$iEv entID}\">" . _t('_Cho ose partic ipants you  liked') . "</a>";   996                                      $sInnerD ata .= _t( '_Event fi nished') . ". <a href =\"{$_SERV ER['PHP_SE LF']}?acti on=select_ match&even t_id={$iEv entID}\">" . _t('_Cho ose partic ipants you  liked') . "</a>";
997                             } else  {   997                             } else  {
998                                      if ( str len($sErro rMessage)  )   998                                      if ( str len($sErro rMessage)  )
999                                               $sInnerDat a .= "<div  align=\"c enter\" cl ass=\"err\ " style=\" width: 100 %;\">{$sEr rorMessage }</div>\n" ;   999                                               $sInnerDat a .= "<div  align=\"c enter\" cl ass=\"err\ " style=\" width: 100 %;\">{$sEr rorMessage }</div>\n" ;
1000                                               $sInnerDat a .= _t('_ You are pa rticipant  of event') .'<br />';   1000                                               $sInnerDat a .= _t('_ You are pa rticipant  of event') .'<br />';
1001                                               $sParticip antUID = h tmlspecial chars($aMe mberPart[' Participan tUID']);   1001                                               $sParticip antUID = h tmlspecial chars($aMe mberPart[' Participan tUID']);
1002                                               $sInnerDat a .= <<<EO F   1002                                               $sInnerDat a .= <<<EO F
1003   <center>   1003   <center>
1004           <f orm id="ch angeUIDFor m" action= "{$_SERVER ['PHP_SELF ']}?action =show_info &event_id= {$iEventID }" method= "post" sty le="margin : 2px;">   1004           <f orm id="ch angeUIDFor m" action= "{$_SERVER ['PHP_SELF ']}?action =show_info &event_id= {$iEventID }" method= "post" sty le="margin : 2px;">
1005                    <inp ut type="h idden" nam e="change_ uid" value ="on" />   1005                    <inp ut type="h idden" nam e="change_ uid" value ="on" />
1006                    <inp ut type="t ext" class ="no" name ="particip ant_uid" v alue="{$sP articipant UID}" size ="20" maxl ength="30"  style="ve rtical-ali gn: middle ;" />&nbsp ;   1006                    <inp ut type="t ext" class ="no" name ="particip ant_uid" v alue="{$sP articipant UID}" size ="20" maxl ength="30"  style="ve rtical-ali gn: middle ;" />&nbsp ;
1007                    <inp ut type="s ubmit" cla ss="no" va lue="{$sCh angeC}" st yle="width : 80px; ve rtical-ali gn: middle " />   1007                    <inp ut type="s ubmit" cla ss="no" va lue="{$sCh angeC}" st yle="width : 80px; ve rtical-ali gn: middle " />
1008           </ form>   1008           </ form>
1009   </center>   1009   </center>
1010   EOF;   1010   EOF;
1011                             }   1011                             }
1012                    }   1012                    }
1013                    else if ( $aEve ntData['Sa leBegan']  and $aEven tData['Sal eNotFinish ed'] and $ logged['me mber'] ) {   1013                    else if ( $aEve ntData['Sa leBegan']  and $aEven tData['Sal eNotFinish ed'] and $ logged['me mber'] ) {
1014                             if ( $ iTicketsLe ft > 0 ) {   1014                             if ( $ iTicketsLe ft > 0 ) {
1015                                      if ( $iT icketPrice  > 0.0 ) {   1015                                      if ( $iT icketPrice  > 0.0 ) {
1016                                               $sInnerDat a .= <<<EO F   1016                                               $sInnerDat a .= <<<EO F
1017   {$sCanBuyT icketC}<br  />   1017   {$sCanBuyT icketC}<br  />
1018   <center>   1018   <center>
1019           <f orm id="bu yTicketFor m" action= "{$site['u rl']}check out.php" m ethod="pos t" style=" margin: 2p x;">   1019           <f orm id="bu yTicketFor m" action= "{$site['u rl']}check out.php" m ethod="pos t" style=" margin: 2p x;">
1020                    <inp ut type="h idden" nam e="action"  value="co llect" />   1020                    <inp ut type="h idden" nam e="action"  value="co llect" />
1021                    <inp ut type="h idden" nam e="checkou t_action"  value="spe eddating"  />   1021                    <inp ut type="h idden" nam e="checkou t_action"  value="spe eddating"  />
1022                    <inp ut type="h idden" nam e="data" v alue="{$iE ventID}" / >   1022                    <inp ut type="h idden" nam e="data" v alue="{$iE ventID}" / >
1023                    <inp ut type="h idden" nam e="amount"  value="{$ iTicketPri ce}" />   1023                    <inp ut type="h idden" nam e="amount"  value="{$ iTicketPri ce}" />
1024                    <inp ut type="s ubmit" cla ss="no" va lue="{$sBu yTicketC}"  style="wi dth: 100px ; vertical -align: mi ddle;" />   1024                    <inp ut type="s ubmit" cla ss="no" va lue="{$sBu yTicketC}"  style="wi dth: 100px ; vertical -align: mi ddle;" />
1025           </ form>   1025           </ form>
1026   </center>   1026   </center>
1027   EOF;   1027   EOF;
1028                                      }   1028                                      }
1029                                      else {   1029                                      else {
1030                                               $sInnerDat a .= <<<EO F   1030                                               $sInnerDat a .= <<<EO F
1031   {$sCanBuyT icketC}<br  />   1031   {$sCanBuyT icketC}<br  />
1032   <center>   1032   <center>
1033           <f orm id="bu yTicketFor m" action= "{$_SERVER ['PHP_SELF ']}?action =show_info &event_id= {$iEventID }" method= "post" sty le="margin : 2px;">   1033           <f orm id="bu yTicketFor m" action= "{$_SERVER ['PHP_SELF ']}?action =show_info &event_id= {$iEventID }" method= "post" sty le="margin : 2px;">
1034                    <inp ut type="h idden" nam e="purchas e_ticket"  value="on"  />   1034                    <inp ut type="h idden" nam e="purchas e_ticket"  value="on"  />
1035                    <inp ut type="s ubmit" cla ss="no" va lue="{$sBu yTicketC}"  style="wi dth: 100px ; vertical -align: mi ddle;" />   1035                    <inp ut type="s ubmit" cla ss="no" va lue="{$sBu yTicketC}"  style="wi dth: 100px ; vertical -align: mi ddle;" />
1036           </ form>   1036           </ form>
1037   </center>   1037   </center>
1038   EOF;   1038   EOF;
1039                                      }   1039                                      }
1040                             } else  {   1040                             } else  {
1041                                      $sInnerD ata .=  _t ('_No tick ets left') ;   1041                                      $sInnerD ata .=  _t ('_No tick ets left') ;
1042                             }   1042                             }
1043                    } el seif ( $aE ventData[' SaleBegan' ] ) {   1043                    } el seif ( $aE ventData[' SaleBegan' ] ) {
1044                             $sInne rData .=   _t('_Sale  finished') ;   1044                             $sInne rData .=   _t('_Sale  finished') ;
1045                    } el se {   1045                    } el se {
1046                             $sInne rData .=   _t('_Sale  not starte d yet');   1046                             $sInne rData .=   _t('_Sale  not starte d yet');
1047                    }*/   1047                    }*/
1048     1048  
1049                    $sSt atusMessag e = proces s_line_out put($aEven tData['Sta tusMessage ']);   1049                    $sSt atusMessag e = proces s_line_out put($aEven tData['Sta tusMessage ']);
1050                    $sCo untryPic =  _t($aPreV alues['Cou ntry'][$aE ventData[' Country']] ['LKey']);   1050                    $sCo untryPic =  _t($aPreV alues['Cou ntry'][$aE ventData[' Country']] ['LKey']);
1051                    $sCi ty = proce ss_line_ou tput($aEve ntData['Ci ty']);   1051                    $sCi ty = proce ss_line_ou tput($aEve ntData['Ci ty']);
1052                    $sPl ace = proc ess_line_o utput($aEv entData['P lace']);   1052                    $sPl ace = proc ess_line_o utput($aEv entData['P lace']);
1053                    $sRe sponsibleP erson = pr ocess_line _output($a EventData[ 'Responsib leName']);   1053                    $sRe sponsibleP erson = pr ocess_line _output($a EventData[ 'Responsib leName']);
1054                    if ( $aEventDat a['Respons ibleID'] = = 0) {   1054                    if ( $aEventDat a['Respons ibleID'] = = 0) {
1055                             $sPost edByHref =  _t('_Admi n');   1055                             $sPost edByHref =  _t('_Admi n');
1056                    } el se {   1056                    } el se {
1057                             $aPost edBy = $th is->GetPro fileData($ aEventData ['Responsi bleID']);   1057                             $aPost edBy = $th is->GetPro fileData($ aEventData ['Responsi bleID']);
1058                             //$sPo stedBy = $ aPostedBy[ 'NickName' ];   1058                             //$sPo stedBy = $ aPostedBy[ 'NickName' ];
1059                             $sPost edByHref =  getProfil eLink($aEv entData['R esponsible ID']);   1059                             $sPost edByHref =  getProfil eLink($aEv entData['R esponsible ID']);
1060                             $sPost edByHref =  '<a href= "'.$sPoste dByHref.'" >'.$aPoste dBy['NickN ame'].'</a >';   1060                             $sPost edByHref =  '<a href= "'.$sPoste dByHref.'" >'.$aPoste dBy['NickN ame'].'</a >';
1061                    }   1061                    }
1062                    $sPh one = proc ess_line_o utput($aEv entData['R esponsible Phone']);   1062                    $sPh one = proc ess_line_o utput($aEv entData['R esponsible Phone']);
1063                    $sEm ail = proc ess_line_o utput($aEv entData['R esponsible Email']);   1063                    $sEm ail = proc ess_line_o utput($aEv entData['R esponsible Email']);
1064                    $sTi cketPrice  = ($iTicke tPrice > 0 .0) ? $dol l . $iTick etPrice :  _t('_free' );   1064                    $sTi cketPrice  = ($iTicke tPrice > 0 .0) ? $dol l . $iTick etPrice :  _t('_free' );
1065                    $sDe scription  = $aEventD ata['Descr iption'];   1065                    $sDe scription  = $aEventD ata['Descr iption'];
1066                    $sTi tle = proc ess_line_o utput($aEv entData['T itle']);   1066                    $sTi tle = proc ess_line_o utput($aEv entData['T itle']);
1067     1067  
1068                    $sTa gsVals = ' ';   1068                    $sTa gsVals = ' ';
1069                    $sTa gsCommas =  $aEventDa ta['Tags'] ;   1069                    $sTa gsCommas =  $aEventDa ta['Tags'] ;
1070                    $aTa gs = split (',', $sTa gsCommas);   1070                    $aTa gs = split (',', $sTa gsCommas);
1071                    fore ach( $aTag s as $sTag Key ) {   1071                    fore ach( $aTag s as $sTag Key ) {
1072                             if ($s TagKey !=  '') {   1072                             if ($s TagKey !=  '') {
1073                                      if( isse t($aTagsPo st[$sTagKe y] ) )   1073                                      if( isse t($aTagsPo st[$sTagKe y] ) )
1074                                               $aTagsPost [$sTagKey] ++;   1074                                               $aTagsPost [$sTagKey] ++;
1075                                      else   1075                                      else
1076                                               $aTagsPost [$sTagKey]  = 1;   1076                                               $aTagsPost [$sTagKey]  = 1;
1077                             }   1077                             }
1078                    }   1078                    }
1079     1079  
1080                    if ( count($aTa gsPost)) {   1080                    if ( count($aTa gsPost)) {
1081                             foreac h( $aTagsP ost as $va rKey => $v arValue )  {   1081                             foreac h( $aTagsP ost as $va rKey => $v arValue )  {
1082                                      $sTagHre fGen = $th is->genUrl (0, $varKe y, 'search ');   1082                                      $sTagHre fGen = $th is->genUrl (0, $varKe y, 'search ');
1083                                      $sTagsVa ls .= <<<E OF   1083                                      $sTagsVa ls .= <<<E OF
1084   <span styl e="vertica l-align:mi ddle;"><im g src="{$s ite['icons ']}tag.png " class="m arg_icon"  alt="" />< /span>   1084   <span styl e="vertica l-align:mi ddle;"><im g src="{$s ite['icons ']}tag.png " class="m arg_icon"  alt="" />< /span>
1085   <a class=" actions" h ref="{$sTa gHrefGen}"  style="te xt-transfo rm:capital ize;" >{$v arKey}</a> &nbsp;({$v arValue})   1085   <a class=" actions" h ref="{$sTa gHrefGen}"  style="te xt-transfo rm:capital ize;" >{$v arKey}</a> &nbsp;({$v arValue})
1086   <br />   1086   <br />
1087   EOF;   1087   EOF;
1088                             }   1088                             }
1089                    }   1089                    }
1090     1090  
1091                    $sAc tions = '' ;   1091                    $sAc tions = '' ;
1092                    if ( $aEventDat a['Respons ibleID']== (int)$_COO KIE['membe rID']) {   1092                    if ( $aEventDat a['Respons ibleID']== (int)$_COO KIE['membe rID']) {
1093                             $sActi ons = <<<E OF   1093                             $sActi ons = <<<E OF
1094   <div class ="padds">   1094   <div class ="padds">
1095           <i mg src="{$ site['icon s']}categ_ edit.png"  alt="{$sEd itC}" titl e="{$sEdit C}" class= "marg_icon " />   1095           <i mg src="{$ site['icon s']}categ_ edit.png"  alt="{$sEd itC}" titl e="{$sEdit C}" class= "marg_icon " />
1096           <a  class="ac tions" hre f="{$_SERV ER['PHP_SE LF']}" onc lick="Upda teField('E ditEventID ','{$aEven tData['Eve ntIDN']}') ;document. forms.comm and_edit_e vent.submi t();return  false;" s tyle="text -transform :none;">{$ sEditC}</a >&nbsp;   1096           <a  class="ac tions" hre f="{$_SERV ER['PHP_SE LF']}" onc lick="Upda teField('E ditEventID ','{$aEven tData['Eve ntIDN']}') ;document. forms.comm and_edit_e vent.submi t();return  false;" s tyle="text -transform :none;">{$ sEditC}</a >&nbsp;
1097   </div>   1097   </div>
1098   <div class ="padds">   1098   <div class ="padds">
1099           <i mg src="{$ site['icon s']}action _block.gif " alt="{$s EditC}" ti tle="{$sEd itC}" clas s="marg_ic on" />   1099           <i mg src="{$ site['icon s']}action _block.gif " alt="{$s EditC}" ti tle="{$sEd itC}" clas s="marg_ic on" />
1100           <a  class="ac tions" hre f="{$_SERV ER['PHP_SE LF']}" onc lick="if ( confirm('{ $sSureC}') ) {UpdateF ield('Dele teEventID' ,'{$aEvent Data['Even tIDN']}'); document.f orms.comma nd_delete_ event.subm it(); } re turn false ;" style=" text-trans form:none; ">{$sDelet eC}</a>   1100           <a  class="ac tions" hre f="{$_SERV ER['PHP_SE LF']}" onc lick="if ( confirm('{ $sSureC}') ) {UpdateF ield('Dele teEventID' ,'{$aEvent Data['Even tIDN']}'); document.f orms.comma nd_delete_ event.subm it(); } re turn false ;" style=" text-trans form:none; ">{$sDelet eC}</a>
1101   </div>   1101   </div>
1102   EOF;   1102   EOF;
1103                    }   1103                    }
1104                    $sUs ersActions  = '';   1104                    $sUs ersActions  = '';
1105                    $sPa rtProfSQL  = "SELECT  * FROM `SD atingParti cipants` W HERE `IDEv ent`={$iEv entID} AND  `IDMember `={$aMembe r['ID']}";   1105                    $sPa rtProfSQL  = "SELECT  * FROM `SD atingParti cipants` W HERE `IDEv ent`={$iEv entID} AND  `IDMember `={$aMembe r['ID']}";
1106                    $aPa rtProfSQL  = db_arr($ sPartProfS QL);   1106                    $aPa rtProfSQL  = db_arr($ sPartProfS QL);
1107                    if ( mysql_affe cted_rows( $GLOBALS[' MySQL']->l ink) == 0)  { //no ma tches   1107                    if ( mysql_affe cted_rows( $GLOBALS[' MySQL']->l ink) == 0)  { //no ma tches
1108                             $sUser sActions =  <<<EOF   1108                             $sUser sActions =  <<<EOF
1109   <div class ="padds">   1109   <div class ="padds">
1110           <i mg src="{$ site['icon s']}_membe rship.jpg"  alt="{$sJ oinC}" tit le="{$sJoi nC}" class ="marg_ico n" />   1110           <i mg src="{$ site['icon s']}_membe rship.jpg"  alt="{$sJ oinC}" tit le="{$sJoi nC}" class ="marg_ico n" />
1111           <a  class="ac tions" hre f="{$_SERV ER['PHP_SE LF']}" onc lick="docu ment.forms .JoinEvent Form.submi t(); retur n false;"  >   1111           <a  class="ac tions" hre f="{$_SERV ER['PHP_SE LF']}" onc lick="docu ment.forms .JoinEvent Form.submi t(); retur n false;"  >
1112                    {$sJ oinC}   1112                    {$sJ oinC}
1113           </ a>   1113           </ a>
1114   </div>   1114   </div>
1115   EOF;   1115   EOF;
1116                    } el se {   1116                    } el se {
1117                             $sUser sActions =  <<<EOF   1117                             $sUser sActions =  <<<EOF
1118   <div class ="padds">   1118   <div class ="padds">
1119           <i mg src="{$ site['icon s']}action _block.gif " alt="{$s Unsubscrib eC}" title ="{$sUnsub scribeC}"  class="mar g_icon" />   1119           <i mg src="{$ site['icon s']}action _block.gif " alt="{$s Unsubscrib eC}" title ="{$sUnsub scribeC}"  class="mar g_icon" />
1120           <a  class="ac tions" hre f="{$_SERV ER['PHP_SE LF']}" onc lick="docu ment.forms .Unsubscri beEventFor m.submit() ; return f alse;" >   1120           <a  class="ac tions" hre f="{$_SERV ER['PHP_SE LF']}" onc lick="docu ment.forms .Unsubscri beEventFor m.submit() ; return f alse;" >
1121                    {$sU nsubscribe C}   1121                    {$sU nsubscribe C}
1122           </ a>   1122           </ a>
1123   </div>   1123   </div>
1124   EOF;   1124   EOF;
1125                    }   1125                    }
1126     1126  
1127                    $vPa rtProfiles Res = db_r es( "   1127                    $vPa rtProfiles Res = db_r es( "
1128                             SELECT  `Profiles `.*, `SDat ingPartici pants`.`Pa rticipantU ID` AS `UI D` FROM `S DatingPart icipants`   1128                             SELECT  `Profiles `.*, `SDat ingPartici pants`.`Pa rticipantU ID` AS `UI D` FROM `S DatingPart icipants`
1129                             INNER  JOIN `Prof iles` ON ` SDatingPar ticipants` .`IDMember ` = `Profi les`.`ID`   1129                             INNER  JOIN `Prof iles` ON ` SDatingPar ticipants` .`IDMember ` = `Profi les`.`ID`
1130                             WHERE  `SDatingPa rticipants `.`IDEvent ` = '{$iEv entID}'   1130                             WHERE  `SDatingPa rticipants `.`IDEvent ` = '{$iEv entID}'
1131                             ORDER  BY RAND()  LIMIT 2" ) ;   1131                             ORDER  BY RAND()  LIMIT 2" ) ;
1132                    $sPa rticipants  = '';   1132                    $sPa rticipants  = '';
1133                    whil e ( $aPart Profiles =  mysql_fet ch_assoc($ vPartProfi lesRes) )  {   1133                    whil e ( $aPart Profiles =  mysql_fet ch_assoc($ vPartProfi lesRes) )  {
1134                             $iUser IsOnline =  get_user_ online_sta tus($aPart Profiles[' ID']);   1134                             $iUser IsOnline =  get_user_ online_sta tus($aPart Profiles[' ID']);
1135                             $sCont  = get_mem ber_thumbn ail($aPart Profiles[' ID'], 'non e' ) . '<b r /><cente r>' . getP rofileOnli neStatus(  $iUserIsOn line ) . ' </center>' ;   1135                             $sCont  = get_mem ber_thumbn ail($aPart Profiles[' ID'], 'non e' ) . '<b r /><cente r>' . getP rofileOnli neStatus(  $iUserIsOn line ) . ' </center>' ;
1136                             $sThum b = get_me mber_thumb nail($aPar tProfiles[ 'ID'], 'no ne' );   1136                             $sThum b = get_me mber_thumb nail($aPar tProfiles[ 'ID'], 'no ne' );
1137                             $sProf Link = get ProfileLin k($aPartPr ofiles['ID ']);   1137                             $sProf Link = get ProfileLin k($aPartPr ofiles['ID ']);
1138                             $sAge  = age( $aP artProfile s['DateOfB irth'] ).  $sYOC;   1138                             $sAge  = age( $aP artProfile s['DateOfB irth'] ).  $sYOC;
1139                             $sPart icipants . = <<<EOF   1139                             $sPart icipants . = <<<EOF
1140   <div style ="float:le ft;text-al ign:center ;margin-ri ght:10px;p osition:re lative;">   1140   <div style ="float:le ft;text-al ign:center ;margin-ri ght:10px;p osition:re lative;">
1141           {$ sThumb}   1141           {$ sThumb}
1142           <d iv class=" browse_nic k" style=" width:{$th is->iThumb Size}px;">   1142           <d iv class=" browse_nic k" style=" width:{$th is->iThumb Size}px;">
1143                    <a h ref="{$sPr ofLink}">{ $aPartProf iles['Nick Name']}</a >: {$sAge}   1143                    <a h ref="{$sPr ofLink}">{ $aPartProf iles['Nick Name']}</a >: {$sAge}
1144           </ div>   1144           </ div>
1145   </div>   1145   </div>
1146   EOF;   1146   EOF;
1147                    }   1147                    }
1148     1148  
1149                    $sAd minTickets Part = ''; $sAdminTic ketsPart2= '';   1149                    $sAd minTickets Part = ''; $sAdminTic ketsPart2= '';
1150                    $sSt atusSect =  '';   1150                    $sSt atusSect =  '';
1151                    if ( $aEventDat a['Respons ibleID']== 0) {   1151                    if ( $aEventDat a['Respons ibleID']== 0) {
1152                             $sAdmi nTicketsPa rt = <<<EO F   1152                             $sAdmi nTicketsPa rt = <<<EO F
1153   <div class ="cls_res_ info">   1153   <div class ="cls_res_ info">
1154           {$ sEventEndC }: <div cl ass="clr3" >{$aEventD ata['Event End']}</di v>   1154           {$ sEventEndC }: <div cl ass="clr3" >{$aEventD ata['Event End']}</di v>
1155   </div>   1155   </div>
1156   <div class ="cls_res_ info">   1156   <div class ="cls_res_ info">
1157           {$ sTicketSal eStartC}:  <div class ="clr3">{$ aEventData ['TicketSa leStart']} </div>   1157           {$ sTicketSal eStartC}:  <div class ="clr3">{$ aEventData ['TicketSa leStart']} </div>
1158   </div>   1158   </div>
1159   <div class ="cls_res_ info">   1159   <div class ="cls_res_ info">
1160           {$ sTicketSal eEndC}: <d iv class=" clr3">{$aE ventData[' TicketSale End']}</di v>   1160           {$ sTicketSal eEndC}: <d iv class=" clr3">{$aE ventData[' TicketSale End']}</di v>
1161   </div>   1161   </div>
1162   EOF;   1162   EOF;
1163                             $sAdmi nTicketsPa rt2 = <<<E OF   1163                             $sAdmi nTicketsPa rt2 = <<<E OF
1164   <div class ="cls_res_ info">   1164   <div class ="cls_res_ info">
1165           {$ sTicketsLe ftC}: <div  class="cl r3">{$iTic ketsLeft}< /div>   1165           {$ sTicketsLe ftC}: <div  class="cl r3">{$iTic ketsLeft}< /div>
1166   </div>   1166   </div>
1167   <div class ="cls_res_ info">   1167   <div class ="cls_res_ info">
1168           {$ sTicketPri ceC}: <div  class="cl r3">{$sTic ketPrice}< /div>   1168           {$ sTicketPri ceC}: <div  class="cl r3">{$sTic ketPrice}< /div>
1169   </div>   1169   </div>
1170   <tr class= "panel">   1170   <tr class= "panel">
1171           <t d colspan= "2" align= "center" c lass="prof ile_header "><b>{$sSa leStatusC} </b></td>   1171           <t d colspan= "2" align= "center" c lass="prof ile_header "><b>{$sSa leStatusC} </b></td>
1172   </tr>   1172   </tr>
1173   <!-- <tr>   1173   <!-- <tr>
1174           <t d colspan= "2" align= "left" cla ss="profil e_td_2">   1174           <t d colspan= "2" align= "left" cla ss="profil e_td_2">
1175                    {$sI nnerData}   1175                    {$sI nnerData}
1176           </ td>   1176           </ td>
1177   </tr> -->   1177   </tr> -->
1178   EOF;   1178   EOF;
1179     1179  
1180                             $sStat usSectFDB  = <<<EOF   1180                             $sStat usSectFDB  = <<<EOF
1181   <div class ="cls_res_ info">   1181   <div class ="cls_res_ info">
1182           <d iv class=" clr3">{$sS tatusMessa ge}</div>   1182           <d iv class=" clr3">{$sS tatusMessa ge}</div>
1183   </div>   1183   </div>
1184   <div class ="clear_bo th"></div>   1184   <div class ="clear_bo th"></div>
1185   EOF;   1185   EOF;
1186     1186  
1187                             $sStat usSect = D esignBoxCo ntent($sSt atusC, $sS tatusSectF DB, 1);   1187                             $sStat usSect = D esignBoxCo ntent($sSt atusC, $sS tatusSectF DB, 1);
1188                    }   1188                    }
1189     1189  
1190                    $sIm ageSectFDB  = <<<EOF   1190                    $sIm ageSectFDB  = <<<EOF
1191   <div class ="photoBlo ck">   1191   <div class ="photoBlo ck">
1192           {$ sPicElemen t}   1192           {$ sPicElemen t}
1193   </div>   1193   </div>
1194   <div class ="clear_bo th"></div>   1194   <div class ="clear_bo th"></div>
1195   EOF;   1195   EOF;
1196                    $sIm ageSect =  DesignBoxC ontent($sE ventC.' '. $sPictureC , $sImageS ectFDB, 1) ;   1196                    $sIm ageSect =  DesignBoxC ontent($sE ventC.' '. $sPictureC , $sImageS ectFDB, 1) ;
1197     1197  
1198                    $sAc tionsSectF DB = <<<EO F   1198                    $sAc tionsSectF DB = <<<EO F
1199   {$sUsersAc tions}   1199   {$sUsersAc tions}
1200   {$sActions }   1200   {$sActions }
1201   <div class ="clear_bo th"></div>   1201   <div class ="clear_bo th"></div>
1202   EOF;   1202   EOF;
1203                    $sAc tionsSect  = DesignBo xContent($ sActionsC,  $sActions SectFDB, 1 );   1203                    $sAc tionsSect  = DesignBo xContent($ sActionsC,  $sActions SectFDB, 1 );
1204     1204  
1205                    $sEv entsStart  = _format_ when($aEve ntData['se c']);   1205                    $sEv entsStart  = _format_ when($aEve ntData['se c']);
1206                    $sDa teTime = L ocaledData Time($aEve ntData['Ev entStart_U TS']);   1206                    $sDa teTime = L ocaledData Time($aEve ntData['Ev entStart_U TS']);
1207     1207  
1208                    $sSu bjectSectF DB = <<<EO F   1208                    $sSu bjectSectF DB = <<<EO F
1209   <div class ="cls_res_ info">   1209   <div class ="cls_res_ info">
1210           {$ sCountryC} : <div cla ss="clr3"> {$sCountry Pic}</div>   1210           {$ sCountryC} : <div cla ss="clr3"> {$sCountry Pic}</div>
1211   </div>   1211   </div>
1212   <div class ="cls_res_ info">   1212   <div class ="cls_res_ info">
1213           {$ sCityC}: < div class= "clr3">{$s City}</div >   1213           {$ sCityC}: < div class= "clr3">{$s City}</div >
1214   </div>   1214   </div>
1215   <div class ="cls_res_ info">   1215   <div class ="cls_res_ info">
1216           {$ sPlaceC}:  <div class ="clr3">{$ sPlace}</d iv>   1216           {$ sPlaceC}:  <div class ="clr3">{$ sPlace}</d iv>
1217   </div>   1217   </div>
1218   <div class ="cls_res_ info">   1218   <div class ="cls_res_ info">
1219           {$ sDateC}: < div class= "clr3">{$s DateTime}  ({$sEvents Start})</d iv>   1219           {$ sDateC}: < div class= "clr3">{$s DateTime}  ({$sEvents Start})</d iv>
1220   </div>   1220   </div>
1221   {$sAdminTi cketsPart}   1221   {$sAdminTi cketsPart}
1222   <div class ="cls_res_ info">   1222   <div class ="cls_res_ info">
1223           {$ sPostedByC }: <div cl ass="clr3" >{$sPosted ByHref}</d iv>   1223           {$ sPostedByC }: <div cl ass="clr3" >{$sPosted ByHref}</d iv>
1224   </div>   1224   </div>
1225   {$sAdminTi cketsPart2 }   1225   {$sAdminTi cketsPart2 }
1226   <div class ="clear_bo th"></div>   1226   <div class ="clear_bo th"></div>
1227   EOF;   1227   EOF;
1228                    $sSu bjectSect  = DesignBo xContent($ sTitle, $s SubjectSec tFDB, 1);   1228                    $sSu bjectSect  = DesignBo xContent($ sTitle, $s SubjectSec tFDB, 1);
1229     1229  
1230                    $sDe scriptionS ectFDB = < <<EOF   1230                    $sDe scriptionS ectFDB = < <<EOF
1231   <div class ="cls_res_ info">   1231   <div class ="cls_res_ info">
1232           <d iv class=" clr3">{$sD escription }</div>   1232           <d iv class=" clr3">{$sD escription }</div>
1233   </div>   1233   </div>
1234   <div class ="clear_bo th"></div>   1234   <div class ="clear_bo th"></div>
1235   EOF;   1235   EOF;
1236                    $sDe scriptionS ect = Desi gnBoxConte nt($sDescr iptionC, $ sDescripti onSectFDB,  1);   1236                    $sDe scriptionS ect = Desi gnBoxConte nt($sDescr iptionC, $ sDescripti onSectFDB,  1);
1237     1237  
1238                    $sGe nUrlP = $t his->genUr l($iEventI D, $aEvent Data['Entr yUri'], 'p art');   1238                    $sGe nUrlP = $t his->genUr l($iEventI D, $aEvent Data['Entr yUri'], 'p art');
1239     1239  
1240                    $sPa rticipants SectFDB =  <<<EOF   1240                    $sPa rticipants SectFDB =  <<<EOF
1241   {$sPartici pants}   1241   {$sPartici pants}
1242   <div class ="clear_bo th"></div>   1242   <div class ="clear_bo th"></div>
1243   <div class ="padds" s tyle="heig ht:23px;ve rtical-ali gn:middle; ">   1243   <div class ="padds" s tyle="heig ht:23px;ve rtical-ali gn:middle; ">
1244           <s pan style= "vertical- align: mid dle;">   1244           <s pan style= "vertical- align: mid dle;">
1245                    <img  src="{$si te['icons' ]}grs.gif"  alt="" ti tle="" cla ss="marg_i con" />   1245                    <img  src="{$si te['icons' ]}grs.gif"  alt="" ti tle="" cla ss="marg_i con" />
1246           </ span>   1246           </ span>
1247           <s pan>   1247           <s pan>
1248                    <a c lass="acti ons" href= "{$sGenUrl P}">   1248                    <a c lass="acti ons" href= "{$sGenUrl P}">
1249                             {$sLis tOfPartici pantsC}   1249                             {$sLis tOfPartici pantsC}
1250                    </a>   1250                    </a>
1251           </ span>   1251           </ span>
1252   </div>   1252   </div>
1253   EOF;   1253   EOF;
1254                    $sPa rticipants Sect = Des ignBoxCont ent($sPart icipantsC,  $sPartici pantsSectF DB, 1);   1254                    $sPa rticipants Sect = Des ignBoxCont ent($sPart icipantsC,  $sPartici pantsSectF DB, 1);
1255     1255  
1256                    $sTa gsSectFDB  = <<<EOF   1256                    $sTa gsSectFDB  = <<<EOF
1257   {$sTagsVal s}   1257   {$sTagsVal s}
1258   <div class ="clear_bo th"></div>   1258   <div class ="clear_bo th"></div>
1259   EOF;   1259   EOF;
1260                    $sTa gsSect = ( $sTagsVals =='') ? ''  : DesignB oxContent( "<div clas s=\"cls_re s_thumb\"> {$sTagsC}< /div>", $s TagsSectFD B, 1);   1260                    $sTa gsSect = ( $sTagsVals =='') ? ''  : DesignB oxContent( "<div clas s=\"cls_re s_thumb\"> {$sTagsC}< /div>", $s TagsSectFD B, 1);
1261     1261  
1262                    $sGe nUrlJ = $t his->genUr l($iEventI D, $aEvent Data['Entr yUri']);   1262                    $sGe nUrlJ = $t his->genUr l($iEventI D, $aEvent Data['Entr yUri']);
1263     1263  
1264                    //{$ sBreadCrum bs}   1264                    //{$ sBreadCrum bs}
1265                    $sRe tHtml .= < <<EOF   1265                    $sRe tHtml .= < <<EOF
1266   <form id=" JoinEventF orm" actio n="{$sGenU rlJ}" meth od="post">   1266   <form id=" JoinEventF orm" actio n="{$sGenU rlJ}" meth od="post">
1267           <i nput type= "hidden" n ame="join_ event" val ue="on" />   1267           <i nput type= "hidden" n ame="join_ event" val ue="on" />
1268   </form>   1268   </form>
1269   <form id=" Unsubscrib eEventForm " action=" {$sGenUrlJ }" method= "post">   1269   <form id=" Unsubscrib eEventForm " action=" {$sGenUrlJ }" method= "post">
1270           <i nput type= "hidden" n ame="unsub scribe_eve nt" value= "on" />   1270           <i nput type= "hidden" n ame="unsub scribe_eve nt" value= "on" />
1271   </form>   1271   </form>
1272     1272  
1273   {$sErrElem s}   1273   {$sErrElem s}
1274   <div>   1274   <div>
1275           <d iv class=" clear_both "></div>   1275           <d iv class=" clear_both "></div>
1276           <d iv class=" cls_info_l eft">   1276           <d iv class=" cls_info_l eft">
1277                    {$sI mageSect}   1277                    {$sI mageSect}
1278                    {$sA ctionsSect }   1278                    {$sA ctionsSect }
1279           </ div>   1279           </ div>
1280           <d iv class=" cls_info">   1280           <d iv class=" cls_info">
1281                    {$sS ubjectSect }   1281                    {$sS ubjectSect }
1282                    {$sD escription Sect}   1282                    {$sD escription Sect}
1283                    {$sS tatusSect}   1283                    {$sS tatusSect}
1284                    {$sP articipant sSect}   1284                    {$sP articipant sSect}
1285                    {$sT agsSect}   1285                    {$sT agsSect}
1286           </ div>   1286           </ div>
1287           <d iv class=" clear_both "></div>   1287           <d iv class=" clear_both "></div>
1288   </div>   1288   </div>
1289   <div class ="clear_bo th"></div>   1289   <div class ="clear_bo th"></div>
1290   EOF;   1290   EOF;
1291     1291  
1292                    retu rn $sRetHt ml;   1292                    retu rn $sRetHt ml;
1293           }   1293           }
1294     1294  
1295           /* *   1295           /* *
1296            *  page show  participa nts functi on   1296            *  page show  participa nts functi on
1297            *  @return H TML presen tation of  data   1297            *  @return H TML presen tation of  data
1298            * /   1298            * /
1299           fu nction Pag eSDatingSh owParticip ants() {   1299           fu nction Pag eSDatingSh owParticip ants() {
1300                    glob al $site;   1300                    glob al $site;
1301                    glob al $oTempl Config;   1301                    glob al $oTempl Config;
1302     1302  
1303                    $sRe tHtml = '' ;   1303                    $sRe tHtml = '' ;
1304                    $sYO C = _t('_y /o');   1304                    $sYO C = _t('_y /o');
1305                    $sEv entPartici pantsC = _ t('_Event  participan ts');   1305                    $sEv entPartici pantsC = _ t('_Event  participan ts');
1306                    $sLi stOfPartic ipantsC =  _t('_List' ).' '._t(' _of').' '. _t('_Parti cipants');   1306                    $sLi stOfPartic ipantsC =  _t('_List' ).' '._t(' _of').' '. _t('_Parti cipants');
1307     1307  
1308                    // c ollect inf ormation a bout curre nt member   1308                    // c ollect inf ormation a bout curre nt member
1309                    if(  $logged['m ember'] )  {   1309                    if(  $logged['m ember'] )  {
1310                             $aMemb er['ID'] =  (int)$_CO OKIE['memb erID'];   1310                             $aMemb er['ID'] =  (int)$_CO OKIE['memb erID'];
1311                             $aMemb erData = g etProfileI nfo( $aMem ber['ID']  );   1311                             $aMemb erData = g etProfileI nfo( $aMem ber['ID']  );
1312                    } el se   1312                    } el se
1313                             $aMemb er['ID'] =  0;   1313                             $aMemb er['ID'] =  0;
1314     1314  
1315                    $aMe mbership =  getMember Membership Info( $aMe mber['ID']  );   1315                    $aMe mbership =  getMember Membership Info( $aMe mber['ID']  );
1316     1316  
1317                    /*$i EventID =  (int)$_REQ UEST['even t_id'];*/   1317                    /*$i EventID =  (int)$_REQ UEST['even t_id'];*/
1318                    $iEv entID = ($ this->bUse FriendlyLi nks) ? (in t)db_value ("SELECT ` ID` FROM ` SDatingEve nts` WHERE  `EntryUri `='" . $th is->proces s_html_db_ input($_RE QUEST['eve ntUri']) .  "' LIMIT  1") : (int )$_REQUEST ['event_id '];   1318                    $iEv entID = ($ this->bUse FriendlyLi nks) ? (in t)db_value ("SELECT ` ID` FROM ` SDatingEve nts` WHERE  `EntryUri `='" . $th is->proces s_html_db_ input($_RE QUEST['eve ntUri']) .  "' LIMIT  1") : (int )$_REQUEST ['event_id '];
1319     1319  
1320                    $sQu ery = "   1320                    $sQu ery = "
1321                             SELECT  `ID`, `Ti tle`,   1321                             SELECT  `ID`, `Ti tle`,
1322                                      (NOW() >  `EventEnd ` AND NOW( ) < DATE_A DD(`EventE nd`, INTER VAL `Choos ePeriod` D AY)) AS `C hooseActiv e`   1322                                      (NOW() >  `EventEnd ` AND NOW( ) < DATE_A DD(`EventE nd`, INTER VAL `Choos ePeriod` D AY)) AS `C hooseActiv e`
1323                             FROM ` SDatingEve nts`   1323                             FROM ` SDatingEve nts`
1324                             WHERE   1324                             WHERE
1325                                      `ID` = ' {$iEventID }' AND `St atus` = 'A ctive' AND  `AllowVie wParticipa nts` = 1";   1325                                      `ID` = ' {$iEventID }' AND `St atus` = 'A ctive' AND  `AllowVie wParticipa nts` = 1";
1326                    $aEv entData =  db_arr( $s Query );   1326                    $aEv entData =  db_arr( $s Query );
1327                    if (  !$aEventD ata['ID']  )   1327                    if (  !$aEventD ata['ID']  )
1328                             return  DesignBox Content( ' ', '<cente r>'. _t('_ Event is u navailable ') .'</cen ter>', $oT emplConfig  -> PageSD atingShowP articipant s_db_num ) ;   1328                             return  DesignBox Content( ' ', '<cente r>'. _t('_ Event is u navailable ') .'</cen ter>', $oT emplConfig  -> PageSD atingShowP articipant s_db_num ) ;
1329     1329  
1330                    $sRe tHtml .= ' <div class ="text">'. process_li ne_output( $aEventDat a['Title'] ).'</div>' ;   1330                    $sRe tHtml .= ' <div class ="text">'. process_li ne_output( $aEventDat a['Title'] ).'</div>' ;
1331     1331  
1332                    // l ist of par ticipants   1332                    // l ist of par ticipants
1333                    $aSe lfPart = d b_arr( "SE LECT `ID`  FROM `SDat ingPartici pants`   1333                    $aSe lfPart = d b_arr( "SE LECT `ID`  FROM `SDat ingPartici pants`
1334                                                                                  WHERE `I DEvent` =  '{$iEventI D}'   1334                                                                                  WHERE `I DEvent` =  '{$iEventI D}'
1335                                                                                  AND `IDM ember` = { $aMember[' ID']}" );   1335                                                                                  AND `IDM ember` = { $aMember[' ID']}" );
1336                    $iPa rtPage = ( isset($_RE QUEST['par t_page']))  ? (int)$_ REQUEST['p art_page']  : 1;   1336                    $iPa rtPage = ( isset($_RE QUEST['par t_page']))  ? (int)$_ REQUEST['p art_page']  : 1;
1337                    $iPa rtPPerPage  = (isset( $_REQUEST[ 'part_p_pe r_page']))  ? (int)$_ REQUEST['p art_p_per_ page'] : 3 0;   1337                    $iPa rtPPerPage  = (isset( $_REQUEST[ 'part_p_pe r_page']))  ? (int)$_ REQUEST['p art_p_per_ page'] : 3 0;
1338                    $iLi mitFirst =  (int)($iP artPage -  1) * $iPar tPPerPage;   1338                    $iLi mitFirst =  (int)($iP artPage -  1) * $iPar tPPerPage;
1339                    $vPa rtProfiles Res = db_r es( "SELEC T `Profile s`.*, `SDa tingPartic ipants`.`P articipant UID` AS `U ID`   1339                    $vPa rtProfiles Res = db_r es( "SELEC T `Profile s`.*, `SDa tingPartic ipants`.`P articipant UID` AS `U ID`
1340                                                                                           FROM `SDat ingPartici pants`   1340                                                                                           FROM `SDat ingPartici pants`
1341                                                                                           INNER JOIN  `Profiles ` ON `SDat ingPartici pants`.`ID Member` =  `Profiles` .`ID`   1341                                                                                           INNER JOIN  `Profiles ` ON `SDat ingPartici pants`.`ID Member` =  `Profiles` .`ID`
1342                                                                                           WHERE `SDa tingPartic ipants`.`I DEvent` =  {$iEventID }   1342                                                                                           WHERE `SDa tingPartic ipants`.`I DEvent` =  {$iEventID }
1343                                                                                           ORDER BY ` Profiles`. `NickName`   1343                                                                                           ORDER BY ` Profiles`. `NickName`
1344                                                                                           LIMIT {$iL imitFirst} , {$iPartP PerPage}"  );   1344                                                                                           LIMIT {$iL imitFirst} , {$iPartP PerPage}"  );
1345                    $aTo tal = db_a rr( "SELEC T COUNT(*)  FROM `SDa tingPartic ipants`   1345                    $aTo tal = db_a rr( "SELEC T COUNT(*)  FROM `SDa tingPartic ipants`
1346                                                                                  WHERE `S DatingPart icipants`. `IDEvent`  = {$iEvent ID}" );   1346                                                                                  WHERE `S DatingPart icipants`. `IDEvent`  = {$iEvent ID}" );
1347     1347  
1348                    $iPa rtProfiles Total = (i nt)$aTotal [0];   1348                    $iPa rtProfiles Total = (i nt)$aTotal [0];
1349                    $iPa gesNum = c eil( $iPar tProfilesT otal / $iP artPPerPag e );   1349                    $iPa gesNum = c eil( $iPar tProfilesT otal / $iP artPPerPag e );
1350                    $sGe nUrlP = $t his->genUr l($iEventI D, '', 'pa rt', true) ;   1350                    $sGe nUrlP = $t his->genUr l($iEventI D, '', 'pa rt', true) ;
1351                    $sPa rtGetUrl =  $sGenUrlP  . (isset( $_REQUEST[ 'part_p_pe r_page'])  ? '&part_p _per_page= '. (int)$_ REQUEST['p art_p_per_ page'] : ' ');   1351                    $sPa rtGetUrl =  $sGenUrlP  . (isset( $_REQUEST[ 'part_p_pe r_page'])  ? '&part_p _per_page= '. (int)$_ REQUEST['p art_p_per_ page'] : ' ');
1352     1352  
1353                    if (  $iPartPro filesTotal  == 0 ) {   1353                    if (  $iPartPro filesTotal  == 0 ) {
1354                             $sRetH tml .= _t( '_There ar e no parti cipants fo r this eve nt');   1354                             $sRetH tml .= _t( '_There ar e no parti cipants fo r this eve nt');
1355                    } el se {   1355                    } el se {
1356                             if ( $ iPagesNum  > 1 ) {   1356                             if ( $ iPagesNum  > 1 ) {
1357                                      $sRetHtm l .= '<div  class="te xt">'._t(' _Pages').' :&nbsp;';   1357                                      $sRetHtm l .= '<div  class="te xt">'._t(' _Pages').' :&nbsp;';
1358     1358  
1359                                      for ( $i  = 1; $i < = $iPagesN um; $i++ )  {   1359                                      for ( $i  = 1; $i < = $iPagesN um; $i++ )  {
1360                                               if ( $i ==  $iPartPag e )   1360                                               if ( $i ==  $iPartPag e )
1361                                                       $s RetHtml .=  "[{$i}]&n bsp;";   1361                                                       $s RetHtml .=  "[{$i}]&n bsp;";
1362                                               else   1362                                               else
1363                                                       $s RetHtml .=  "<a href= \"{$sPartG etUrl}&par t_page={$i }\">{$i}</ a>&nbsp;";   1363                                                       $s RetHtml .=  "<a href= \"{$sPartG etUrl}&par t_page={$i }\">{$i}</ a>&nbsp;";
1364                                      }   1364                                      }
1365                                      $sRetHtm l .= '</di v><br />';   1365                                      $sRetHtm l .= '</di v><br />';
1366                             }   1366                             }
1367     1367  
1368                             $sProf ilesTrs =  '';   1368                             $sProf ilesTrs =  '';
1369                             while  ( $part_pr ofiles_arr  = mysql_f etch_assoc ($vPartPro filesRes)  ) {   1369                             while  ( $part_pr ofiles_arr  = mysql_f etch_assoc ($vPartPro filesRes)  ) {
1370                                      $iUserIs Online = g et_user_on line_statu s($part_pr ofiles_arr [ID]);   1370                                      $iUserIs Online = g et_user_on line_statu s($part_pr ofiles_arr [ID]);
1371                                      $sCont =  get_membe r_thumbnai l($part_pr ofiles_arr ['ID'], 'n one' ) . ' <br /><cen ter>' . ge tProfileOn lineStatus ( $iUserIs Online ) .  '</center >';   1371                                      $sCont =  get_membe r_thumbnai l($part_pr ofiles_arr ['ID'], 'n one' ) . ' <br /><cen ter>' . ge tProfileOn lineStatus ( $iUserIs Online ) .  '</center >';
1372                                      $sThumb  = get_memb er_thumbna il($part_p rofiles_ar r['ID'], ' none' );   1372                                      $sThumb  = get_memb er_thumbna il($part_p rofiles_ar r['ID'], ' none' );
1373                                      $sProfLi nk = getPr ofileLink( $part_prof iles_arr[' ID']);   1373                                      $sProfLi nk = getPr ofileLink( $part_prof iles_arr[' ID']);
1374                                      $sAge =  age( $part _profiles_ arr['DateO fBirth'] ) . $sYOC;   1374                                      $sAge =  age( $part _profiles_ arr['DateO fBirth'] ) . $sYOC;
1375                                      $sProfil esTrs .= < <<EOF   1375                                      $sProfil esTrs .= < <<EOF
1376   <div style ="float:le ft;text-al ign:center ;margin-ri ght:10px;p osition:re lative;">   1376   <div style ="float:le ft;text-al ign:center ;margin-ri ght:10px;p osition:re lative;">
1377           {$ sThumb}   1377           {$ sThumb}
1378           <d iv class=" browse_nic k" style=" width:{$th is->iThumb Size}px;">   1378           <d iv class=" browse_nic k" style=" width:{$th is->iThumb Size}px;">
1379                    <a h ref="{$sPr ofLink}">{ $part_prof iles_arr[' NickName'] }</a>: {$s Age}   1379                    <a h ref="{$sPr ofLink}">{ $part_prof iles_arr[' NickName'] }</a>: {$s Age}
1380           </ div>   1380           </ div>
1381   </div>   1381   </div>
1382   EOF;   1382   EOF;
1383                             }   1383                             }
1384     1384  
1385                             $sNick nameC = _t ('_Nicknam e');   1385                             $sNick nameC = _t ('_Nicknam e');
1386                             $sDate OfBirthC =  _t('_Date OfBirth');   1386                             $sDate OfBirthC =  _t('_Date OfBirth');
1387                             $sSexC  = _t('_Se x');   1387                             $sSexC  = _t('_Se x');
1388                             $sEven tUIDC = _t ('_Event U ID');   1388                             $sEven tUIDC = _t ('_Event U ID');
1389     1389  
1390                             $sPage sHref = '' ;   1390                             $sPage sHref = '' ;
1391                             if ( $ iPagesNum  > 1 ) {   1391                             if ( $ iPagesNum  > 1 ) {
1392                                      $sPagesH ref .= '<d iv class=" text">'._t ('_Pages') .':&nbsp;' ;   1392                                      $sPagesH ref .= '<d iv class=" text">'._t ('_Pages') .':&nbsp;' ;
1393                                      for ( $i  = 1; $i < = $iPagesN um; $i++ )  {   1393                                      for ( $i  = 1; $i < = $iPagesN um; $i++ )  {
1394                                               if ( $i ==  $iPartPag e )   1394                                               if ( $i ==  $iPartPag e )
1395                                                       $s PagesHref  .= "[{$i}] &nbsp;";   1395                                                       $s PagesHref  .= "[{$i}] &nbsp;";
1396                                               else   1396                                               else
1397                                                       $s PagesHref  .= "<a hre f=\"{$sPar tGetUrl}&p art_page={ $i}\">{$i} </a>&nbsp; ";   1397                                                       $s PagesHref  .= "<a hre f=\"{$sPar tGetUrl}&p art_page={ $i}\">{$i} </a>&nbsp; ";
1398                                      }   1398                                      }
1399                                      $sPagesH ref .= '</ div><br /> ';   1399                                      $sPagesH ref .= '</ div><br /> ';
1400                             }   1400                             }
1401     1401  
1402                             $sRetH tml .= $sP rofilesTrs  . $sPages Href;   1402                             $sRetH tml .= $sP rofilesTrs  . $sPages Href;
1403                    }   1403                    }
1404                    $sRe tHtml .= ' <div class ="clear_bo th"></div> ';   1404                    $sRe tHtml .= ' <div class ="clear_bo th"></div> ';
1405     1405  
1406                    retu rn DesignB oxContent(  $sListOfP articipant sC, $sRetH tml, 1 );   1406                    retu rn DesignB oxContent(  $sListOfP articipant sC, $sRetH tml, 1 );
1407           }   1407           }
1408     1408  
1409           /* *   1409           /* *
1410            *  page show  filer for m function   1410            *  page show  filer for m function
1411            *  @return H TML presen tation of  data   1411            *  @return H TML presen tation of  data
1412            * /   1412            * /
1413           fu nction Pag eSDatingSh owForm() {   1413           fu nction Pag eSDatingSh owForm() {
1414                    glob al $aPreVa lues;   1414                    glob al $aPreVa lues;
1415                    glob al $oTempl Config;   1415                    glob al $oTempl Config;
1416                    glob al $enable _event_cre ating;   1416                    glob al $enable _event_cre ating;
1417                    glob al $logged ;   1417                    glob al $logged ;
1418     1418  
1419                    $sSh owCalendar C = _t('_S how calend ar');   1419                    $sSh owCalendar C = _t('_S how calend ar');
1420                    $sAd dNewEventC  = _t('_Ad d new even t');   1420                    $sAd dNewEventC  = _t('_Ad d new even t');
1421                    $sSh owAllEvent sC = _t('_ Show all e vents');   1421                    $sSh owAllEvent sC = _t('_ Show all e vents');
1422                    $sSh owEventsBy CountryC =  _t('_Show  events by  country') ;   1422                    $sSh owEventsBy CountryC =  _t('_Show  events by  country') ;
1423                    $sSh owC = _t(' _Show');   1423                    $sSh owC = _t(' _Show');
1424     1424  
1425                    // c ollect inf ormation a bout curre nt member   1425                    // c ollect inf ormation a bout curre nt member
1426                    if(  $logged['m ember'] )  {   1426                    if(  $logged['m ember'] )  {
1427                             $aMemb er['ID'] =  (int)$_CO OKIE['memb erID'];   1427                             $aMemb er['ID'] =  (int)$_CO OKIE['memb erID'];
1428                             $aMemb erData = g etProfileI nfo( $aMem ber['ID']  );   1428                             $aMemb erData = g etProfileI nfo( $aMem ber['ID']  );
1429                    }   1429                    }
1430                       1430                    
1431                    $aSh ow = array ();   1431                    $aSh ow = array ();
1432                    $sCo untryDisab led = 'dis abled="dis abled"';   1432                    $sCo untryDisab led = 'dis abled="dis abled"';
1433     1433  
1434                    if (  $_REQUEST ['show_eve nts'] == ' country' )  {   1434                    if (  $_REQUEST ['show_eve nts'] == ' country' )  {
1435                             $aShow ['country' ] = proces s_db_input ($_REQUEST ['show_eve nts_countr y'], 1);   1435                             $aShow ['country' ] = proces s_db_input ($_REQUEST ['show_eve nts_countr y'], 1);
1436                             $sCoun tryDisable d = '';   1436                             $sCoun tryDisable d = '';
1437                    }   1437                    }
1438     1438  
1439                    $sBl ockForCale ndarAndEve ntDiv = '' ;   1439                    $sBl ockForCale ndarAndEve ntDiv = '' ;
1440                    if(  $oTemplCon fig -> cus tomize['ev ents']['sh owTopButto ns'] ) {   1440                    if(  $oTemplCon fig -> cus tomize['ev ents']['sh owTopButto ns'] ) {
1441                             $sBloc kForCalend arAndEvent Div .= <<< EOF   1441                             $sBloc kForCalend arAndEvent Div .= <<< EOF
1442   <div align ="center"  class="blo ckForCalen darAndEven t">   1442   <div align ="center"  class="blo ckForCalen darAndEven t">
1443           <a  href="{$_ SERVER['PH P_SELF']}? action=cal endar">{$s ShowCalend arC}</a>   1443           <a  href="{$_ SERVER['PH P_SELF']}? action=cal endar">{$s ShowCalend arC}</a>
1444   EOF;   1444   EOF;
1445                             if( $e nable_even t_creating  and $logg ed['member '] ) {   1445                             if( $e nable_even t_creating  and $logg ed['member '] ) {
1446                                      $sBlockF orCalendar AndEventDi v .= "| <a  href=\"{$ _SERVER['P HP_SELF']} ?action=ne w\">{$sAdd NewEventC} </a>";   1446                                      $sBlockF orCalendar AndEventDi v .= "| <a  href=\"{$ _SERVER['P HP_SELF']} ?action=ne w\">{$sAdd NewEventC} </a>";
1447                             }   1447                             }
1448                             $sBloc kForCalend arAndEvent Div .= '</ div>';   1448                             $sBloc kForCalend arAndEvent Div .= '</ div>';
1449                    }   1449                    }
1450     1450  
1451                    $sSh owEventsCh k = ($_REQ UEST['show _events']  == 'all')  ? 'checked ="checked" ' : '';   1451                    $sSh owEventsCh k = ($_REQ UEST['show _events']  == 'all')  ? 'checked ="checked" ' : '';
1452                    $sCo untryChk =  ($_REQUES T['show_ev ents'] ==  'country')  ? 'checke d="checked "' : '';   1452                    $sCo untryChk =  ($_REQUES T['show_ev ents'] ==  'country')  ? 'checke d="checked "' : '';
1453     1453  
1454                    $sCo untryOptio ns = '';   1454                    $sCo untryOptio ns = '';
1455                    $sSe lCountry =  isset($aS how['count ry']) ? $a Show['coun try'] : $a MemberData ['Country' ];   1455                    $sSe lCountry =  isset($aS how['count ry']) ? $a Show['coun try'] : $a MemberData ['Country' ];
1456                    fore ach ( $aPr eValues['C ountry'] a s $key =>  $value ) {   1456                    fore ach ( $aPr eValues['C ountry'] a s $key =>  $value ) {
1457                             $sCoun trySelecte d = ( $sSe lCountry = = $key ) ?  'selected ="selected "' : '';   1457                             $sCoun trySelecte d = ( $sSe lCountry = = $key ) ?  'selected ="selected "' : '';
1458                             $sCoun tryOptions  .= "<opti on value=\ "{$key}\"  ". $sCount rySelected  ." >". _t ($value['L Key']) ."< /option>";   1458                             $sCoun tryOptions  .= "<opti on value=\ "{$key}\"  ". $sCount rySelected  ." >". _t ($value['L Key']) ."< /option>";
1459                    }   1459                    }
1460     1460  
1461           $s RetHtml =  <<<EOF   1461           $s RetHtml =  <<<EOF
1462   <center>   1462   <center>
1463           <s cript lang uage="Java Script" ty pe="text/j avascript" >   1463           <s cript lang uage="Java Script" ty pe="text/j avascript" >
1464           <! --   1464           <! --
1465                    func tion updat eShowContr ols()   1465                    func tion updat eShowContr ols()
1466                    {   1466                    {
1467                             docume nt.getElem entById('s how_events _select_id ').disable d = !(docu ment.getEl ementById( 'show_even ts_country _id').chec ked);   1467                             docume nt.getElem entById('s how_events _select_id ').disable d = !(docu ment.getEl ementById( 'show_even ts_country _id').chec ked);
1468                    }   1468                    }
1469           -- >   1469           -- >
1470           </ script>   1470           </ script>
1471           {$ sBlockForC alendarAnd EventDiv}   1471           {$ sBlockForC alendarAnd EventDiv}
1472           <f orm id="sh owEventsFo rm" action ="{$_SERVE R['PHP_SEL F']}" meth od="get">   1472           <f orm id="sh owEventsFo rm" action ="{$_SERVE R['PHP_SEL F']}" meth od="get">
1473                    <tab le cellpad ding="4" c ellspacing ="0" borde r="0" clas s="text" w idth="600" >   1473                    <tab le cellpad ding="4" c ellspacing ="0" borde r="0" clas s="text" w idth="600" >
1474                             <tr>   1474                             <tr>
1475                                      <td alig n="left" c olspan="2"  class="te xt">   1475                                      <td alig n="left" c olspan="2"  class="te xt">
1476                                               <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} / >   1476                                               <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} / >
1477                                               &nbsp;<lab el for="sh ow_events_ all_id">{$ sShowAllEv entsC}</la bel>   1477                                               &nbsp;<lab el for="sh ow_events_ all_id">{$ sShowAllEv entsC}</la bel>
1478                                      </td>   1478                                      </td>
1479                             </tr>   1479                             </tr>
1480                             <tr>   1480                             <tr>
1481                                      <td alig n="left" w idth="300"  class="te xt">   1481                                      <td alig n="left" w idth="300"  class="te xt">
1482                                               <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} />   1482                                               <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} />
1483                                               &nbsp;<lab el for="sh ow_events_ country_id ">{$sShowE ventsByCou ntryC}</la bel>   1483                                               &nbsp;<lab el for="sh ow_events_ country_id ">{$sShowE ventsByCou ntryC}</la bel>
1484                                      </td>   1484                                      </td>
1485                                      <td alig n="left" c lass="text ">   1485                                      <td alig n="left" c lass="text ">
1486                                               <select cl ass="no" n ame="show_ events_cou ntry" id=" show_event s_select_i d" {$sCoun tryDisable d} >{$sCou ntryOption s}</select >   1486                                               <select cl ass="no" n ame="show_ events_cou ntry" id=" show_event s_select_i d" {$sCoun tryDisable d} >{$sCou ntryOption s}</select >
1487                                      </td>   1487                                      </td>
1488                             </tr>   1488                             </tr>
1489                    </ta ble>   1489                    </ta ble>
1490                    <br  />   1490                    <br  />
1491                    <inp ut type="s ubmit" cla ss="no" va lue="{$sSh owC}" />   1491                    <inp ut type="s ubmit" cla ss="no" va lue="{$sSh owC}" />
1492                    <inp ut type="h idden" nam e="action"  value="sh ow" />   1492                    <inp ut type="h idden" nam e="action"  value="sh ow" />
1493                    <inp ut type="h idden" nam e="from" v alue="0" / >   1493                    <inp ut type="h idden" nam e="from" v alue="0" / >
1494           </ form>   1494           </ form>
1495   </center>   1495   </center>
1496   EOF;   1496   EOF;
1497     1497  
1498                    retu rn DesignB oxContent(  _t('_Sele ct events  to show'),  $sRetHtml , $oTemplC onfig -> P ageSDating ShowForm_d b_num );   1498                    retu rn DesignB oxContent(  _t('_Sele ct events  to show'),  $sRetHtml , $oTemplC onfig -> P ageSDating ShowForm_d b_num );
1499           }   1499           }
1500     1500  
1501           /* *   1501           /* *
1502            *  page show  filer for m function   1502            *  page show  filer for m function
1503            *  @return H TML presen tation of  data   1503            *  @return H TML presen tation of  data
1504            * /   1504            * /
1505           fu nction Pag eSDatingCa lendar() {   1505           fu nction Pag eSDatingCa lendar() {
1506                    glob al $dir;   1506                    glob al $dir;
1507                    glob al $site;   1507                    glob al $site;
1508                    glob al $sdatin gThumbWidt h;   1508                    glob al $sdatin gThumbWidt h;
1509                    glob al $sdatin gThumbHeig ht;   1509                    glob al $sdatin gThumbHeig ht;
1510                    glob al $aPreVa lues;   1510                    glob al $aPreVa lues;
1511                    glob al $oTempl Config;   1511                    glob al $oTempl Config;
1512     1512  
1513                    $iPi cSize = $t his->iIcon Size + 15;   1513                    $iPi cSize = $t his->iIcon Size + 15;
1514     1514  
1515                    // c ollect inf ormation a bout curre nt member   1515                    // c ollect inf ormation a bout curre nt member
1516                    $aMe mber['ID']  = (int)$_ COOKIE['me mberID'];   1516                    $aMe mber['ID']  = (int)$_ COOKIE['me mberID'];
1517                    $aMe mberData =  getProfil eInfo( $aM ember['ID' ] );   1517                    $aMe mberData =  getProfil eInfo( $aM ember['ID' ] );
1518                    $sMe mberSex =  $aMemberDa ta['Sex'];   1518                    $sMe mberSex =  $aMemberDa ta['Sex'];
1519                    $aMe mbership =  getMember Membership Info( $aMe mber['ID']  );   1519                    $aMe mbership =  getMember Membership Info( $aMe mber['ID']  );
1520     1520  
1521                    // n ow year, m onth and d ay   1521                    // n ow year, m onth and d ay
1522                    list ($iNowYear , $iNowMon th, $iNowD ay) = expl ode( '-',  date('Y-m- d') );   1522                    list ($iNowYear , $iNowMon th, $iNowD ay) = expl ode( '-',  date('Y-m- d') );
1523                    // c urrent yea r, month,  month name , day, day s in month   1523                    // c urrent yea r, month,  month name , day, day s in month
1524                    if (  isset($_R EQUEST['mo nth']) ) {   1524                    if (  isset($_R EQUEST['mo nth']) ) {
1525                             list($ iCurMonth,  $iCurYear ) = explod e( '-', $_ REQUEST['m onth'] );   1525                             list($ iCurMonth,  $iCurYear ) = explod e( '-', $_ REQUEST['m onth'] );
1526                             $iCurM onth = (in t)$iCurMon th;   1526                             $iCurM onth = (in t)$iCurMon th;
1527                             $iCurY ear = (int )$iCurYear ;   1527                             $iCurY ear = (int )$iCurYear ;
1528                    }   1528                    }
1529                    else  {   1529                    else  {
1530                             list($ iCurMonth,  $iCurYear ) = explod e( '-', da te('n-Y')  );   1530                             list($ iCurMonth,  $iCurYear ) = explod e( '-', da te('n-Y')  );
1531                    }   1531                    }
1532                    list ($sCurMont hName, $iC urDaysInMo nth) = exp lode( '-',  date('F-t ', mktime(  0, 0, 0,  $iCurMonth , $iNowDay , $iCurYea r )) );   1532                    list ($sCurMont hName, $iC urDaysInMo nth) = exp lode( '-',  date('F-t ', mktime(  0, 0, 0,  $iCurMonth , $iNowDay , $iCurYea r )) );
1533                    // p revious mo nth year,  month   1533                    // p revious mo nth year,  month
1534                    $iPr evYear = $ iCurYear;   1534                    $iPr evYear = $ iCurYear;
1535                    $iPr evMonth =  $iCurMonth  - 1;   1535                    $iPr evMonth =  $iCurMonth  - 1;
1536                    if (  $iPrevMon th <= 0 )  {   1536                    if (  $iPrevMon th <= 0 )  {
1537                             $iPrev Month = 12 ;   1537                             $iPrev Month = 12 ;
1538                             $iPrev Year--;   1538                             $iPrev Year--;
1539                    }   1539                    }
1540                    // n ext month  year, mont h   1540                    // n ext month  year, mont h
1541                    $iNe xtYear = $ iCurYear;   1541                    $iNe xtYear = $ iCurYear;
1542                    $iNe xtMonth =  $iCurMonth  + 1;   1542                    $iNe xtMonth =  $iCurMonth  + 1;
1543                    if (  $iNextMon th > 12 )  {   1543                    if (  $iNextMon th > 12 )  {
1544                             $iNext Month = 1;   1544                             $iNext Month = 1;
1545                             $iNext Year++;   1545                             $iNext Year++;
1546                    }   1546                    }
1547                    // d ays in pre vious mont h   1547                    // d ays in pre vious mont h
1548                    $iPr evDaysInMo nth = (int )date( 't' , mktime(  0, 0, 0, $ iPrevMonth , $iNowDay , $iPrevYe ar ) );   1548                    $iPr evDaysInMo nth = (int )date( 't' , mktime(  0, 0, 0, $ iPrevMonth , $iNowDay , $iPrevYe ar ) );
1549                    // d ays-of-wee k of first  day in cu rrent mont h   1549                    // d ays-of-wee k of first  day in cu rrent mont h
1550                    $iFi rstDayDow  = (int)dat e( 'w', mk time( 0, 0 , 0, $iCur Month, 1,  $iCurYear  ) );   1550                    $iFi rstDayDow  = (int)dat e( 'w', mk time( 0, 0 , 0, $iCur Month, 1,  $iCurYear  ) );
1551                    // f rom which  day of pre vious mont h calendar  starts   1551                    // f rom which  day of pre vious mont h calendar  starts
1552                    $iPr evShowFrom  = $iPrevD aysInMonth  - $iFirst DayDow + 1 ;   1552                    $iPr evShowFrom  = $iPrevD aysInMonth  - $iFirst DayDow + 1 ;
1553     1553  
1554                    // s elect even ts array   1554                    // s elect even ts array
1555                    $aCa lendarEven ts = array ();   1555                    $aCa lendarEven ts = array ();
1556                    $sCo untryFilte r = 'all';   1556                    $sCo untryFilte r = 'all';
1557                    $sRC alendarCou ntry = iss et($_REQUE ST['calend ar_country ']) ? $_RE QUEST['cal endar_coun try'] : $a MemberData ['Country' ];   1557                    $sRC alendarCou ntry = iss et($_REQUE ST['calend ar_country ']) ? $_RE QUEST['cal endar_coun try'] : $a MemberData ['Country' ];
1558                    $sRC alendarCou ntry = ($s RCalendarC ountry=='' ) ? 'all'  : $sRCalen darCountry  ;   1558                    $sRC alendarCou ntry = ($s RCalendarC ountry=='' ) ? 'all'  : $sRCalen darCountry  ;
1559                    if (  $sRCalend arCountry  == 'all' )  {   1559                    if (  $sRCalend arCountry  == 'all' )  {
1560                             $sCoun tryFilter  = '';   1560                             $sCoun tryFilter  = '';
1561                    }   1561                    }
1562                    else  {   1562                    else  {
1563                             $sCoun tryFilter  = 'AND `Co untry` = \ ''. proces s_db_input ($sRCalend arCountry)  . '\'';   1563                             $sCoun tryFilter  = 'AND `Co untry` = \ ''. proces s_db_input ($sRCalend arCountry)  . '\'';
1564                    }   1564                    }
1565     1565  
1566                    $sRe quest = "S ELECT `ID` , `Title`,  `PhotoFil ename`, DA YOFMONTH(` EventStart `) AS `Eve ntDay`, MO NTH(`Event Start`) AS  `EventMon th` FROM ` SDatingEve nts`   1566                    $sRe quest = "S ELECT `ID` , `Title`,  `PhotoFil ename`, DA YOFMONTH(` EventStart `) AS `Eve ntDay`, MO NTH(`Event Start`) AS  `EventMon th` FROM ` SDatingEve nts`
1567                                                                WHER E ( MONTH( `EventStar t`) = {$iC urMonth} A ND YEAR(`E ventStart` ) = {$iCur Year} OR   1567                                                                WHER E ( MONTH( `EventStar t`) = {$iC urMonth} A ND YEAR(`E ventStart` ) = {$iCur Year} OR
1568                                                                                  MONTH( D ATE_ADD(`E ventStart` , INTERVAL  1 MONTH)  ) = {$iCur Month} AND  YEAR( DAT E_ADD(`Eve ntStart`,  INTERVAL 1  MONTH) )  = {$iCurYe ar} OR   1568                                                                                  MONTH( D ATE_ADD(`E ventStart` , INTERVAL  1 MONTH)  ) = {$iCur Month} AND  YEAR( DAT E_ADD(`Eve ntStart`,  INTERVAL 1  MONTH) )  = {$iCurYe ar} OR
1569                                                                                  MONTH( D ATE_SUB(`E ventStart` , INTERVAL  1 MONTH)  ) = {$iCur Month} AND  YEAR( DAT E_SUB(`Eve ntStart`,  INTERVAL 1  MONTH) )  = {$iCurYe ar} )   1569                                                                                  MONTH( D ATE_SUB(`E ventStart` , INTERVAL  1 MONTH)  ) = {$iCur Month} AND  YEAR( DAT E_SUB(`Eve ntStart`,  INTERVAL 1  MONTH) )  = {$iCurYe ar} )
1570                                                                {$sC ountryFilt er}   1570                                                                {$sC ountryFilt er}
1571                                                                AND  `Status` =  'Active'   1571                                                                AND  `Status` =  'Active'
1572                                                                ";   1572                                                                ";
1573     1573  
1574                    $vEv entsRes =  db_res( $s Request );   1574                    $vEv entsRes =  db_res( $s Request );
1575                    whil e ( $aEven tData = my sql_fetch_ assoc($vEv entsRes) )  {   1575                    whil e ( $aEven tData = my sql_fetch_ assoc($vEv entsRes) )  {
1576                             $aCale ndarEvents ["{$aEvent Data['Even tDay']}-{$ aEventData ['EventMon th']}"][$a EventData[ 'ID']]['Ti tle'] = $a EventData[ 'Title'];   1576                             $aCale ndarEvents ["{$aEvent Data['Even tDay']}-{$ aEventData ['EventMon th']}"][$a EventData[ 'ID']]['Ti tle'] = $a EventData[ 'Title'];
1577                             $aCale ndarEvents ["{$aEvent Data['Even tDay']}-{$ aEventData ['EventMon th']}"][$a EventData[ 'ID']]['Ph otoFilenam e'] = $aEv entData['P hotoFilena me'];   1577                             $aCale ndarEvents ["{$aEvent Data['Even tDay']}-{$ aEventData ['EventMon th']}"][$a EventData[ 'ID']]['Ph otoFilenam e'] = $aEv entData['P hotoFilena me'];
1578                    }   1578                    }
1579     1579  
1580                    // m ake calend ar grid   1580                    // m ake calend ar grid
1581                    $bPr eviousMont h = ($iFir stDayDow >  0 ? true  : false);   1581                    $bPr eviousMont h = ($iFir stDayDow >  0 ? true  : false);
1582                    $bNe xtMonth =  false;   1582                    $bNe xtMonth =  false;
1583                    $iCu rrentDay =  ($bPrevio usMonth) ?  $iPrevSho wFrom : 1;   1583                    $iCu rrentDay =  ($bPrevio usMonth) ?  $iPrevSho wFrom : 1;
1584     1584  
1585                    for  ($i = 0; $ i < 6; $i+ +) {   1585                    for  ($i = 0; $ i < 6; $i+ +) {
1586                             for ($ j = 0; $j  < 7; $j++)  {   1586                             for ($ j = 0; $j  < 7; $j++)  {
1587                                      $aCalend arGrid[$i] [$j]['day' ] = $iCurr entDay;   1587                                      $aCalend arGrid[$i] [$j]['day' ] = $iCurr entDay;
1588                                      $aCalend arGrid[$i] [$j]['mont h'] = ($bP reviousMon th ? $iPre vMonth : ( $bNextMont h ? $iNext Month : $i CurMonth)) ;   1588                                      $aCalend arGrid[$i] [$j]['mont h'] = ($bP reviousMon th ? $iPre vMonth : ( $bNextMont h ? $iNext Month : $i CurMonth)) ;
1589                                      $aCalend arGrid[$i] [$j]['curr ent'] = (! $bPrevious Month && ! $bNextMont h);   1589                                      $aCalend arGrid[$i] [$j]['curr ent'] = (! $bPrevious Month && ! $bNextMont h);
1590                                      $aCalend arGrid[$i] [$j]['toda y'] = ($iN owYear ==  $iCurYear  && $iNowMo nth == $iC urMonth &&  $iNowDay  == $iCurre ntDay && ! $bPrevious Month && ! $bNextMont h);   1590                                      $aCalend arGrid[$i] [$j]['toda y'] = ($iN owYear ==  $iCurYear  && $iNowMo nth == $iC urMonth &&  $iNowDay  == $iCurre ntDay && ! $bPrevious Month && ! $bNextMont h);
1591                                      // make  day increm ent   1591                                      // make  day increm ent
1592                                      $iCurren tDay++;   1592                                      $iCurren tDay++;
1593                                      if ( $bP reviousMon th && $iCu rrentDay >  $iPrevDay sInMonth )  {   1593                                      if ( $bP reviousMon th && $iCu rrentDay >  $iPrevDay sInMonth )  {
1594                                               $bPrevious Month = fa lse;   1594                                               $bPrevious Month = fa lse;
1595                                               $iCurrentD ay = 1;   1595                                               $iCurrentD ay = 1;
1596                                      }   1596                                      }
1597                                      if ( !$b PreviousMo nth && !$b NextMonth  && $iCurre ntDay > $i CurDaysInM onth ) {   1597                                      if ( !$b PreviousMo nth && !$b NextMonth  && $iCurre ntDay > $i CurDaysInM onth ) {
1598                                               $bNextMont h = true;   1598                                               $bNextMont h = true;
1599                                               $iCurrentD ay = 1;   1599                                               $iCurrentD ay = 1;
1600                                      }   1600                                      }
1601                             }   1601                             }
1602                    }   1602                    }
1603     1603  
1604                    $sSh owEventsBy CountryC =  _t('_Show  events by  country') ;   1604                    $sSh owEventsBy CountryC =  _t('_Show  events by  country') ;
1605                    $sAl lC = _t('_ All');   1605                    $sAl lC = _t('_ All');
1606                    $sPr evC = _t(' _Prev');   1606                    $sPr evC = _t(' _Prev');
1607                    $sNe xtC = _t(' _Next');   1607                    $sNe xtC = _t(' _Next');
1608                    $sSu ndaySC = _ t('_Sunday _short');   1608                    $sSu ndaySC = _ t('_Sunday _short');
1609                    $sMo ndaySC = _ t('_Monday _short');   1609                    $sMo ndaySC = _ t('_Monday _short');
1610                    $sTu esdaySC =  _t('_Tuesd ay_short') ;   1610                    $sTu esdaySC =  _t('_Tuesd ay_short') ;
1611                    $sWe dnesdaySC  = _t('_Wed nesday_sho rt');   1611                    $sWe dnesdaySC  = _t('_Wed nesday_sho rt');
1612                    $sTh ursdaySC =  _t('_Thur sday_short ');   1612                    $sTh ursdaySC =  _t('_Thur sday_short ');
1613                    $sFr idaySC = _ t('_Friday _short');   1613                    $sFr idaySC = _ t('_Friday _short');
1614                    $sSa turdaySC =  _t('_Satu rday_short ');   1614                    $sSa turdaySC =  _t('_Satu rday_short ');
1615                    $sNo PhotoC = _ t('_No pho to');   1615                    $sNo PhotoC = _ t('_No pho to');
1616                    $sCa lendarC =  _t('_Calen dar');   1616                    $sCa lendarC =  _t('_Calen dar');
1617     1617  
1618                    $sCa lendarOpti ons = '';   1618                    $sCa lendarOpti ons = '';
1619                    $sCa lSel = ( $ sRCalendar Country ==  'all' ) ?  'selected ="selected "' : '';   1619                    $sCa lSel = ( $ sRCalendar Country ==  'all' ) ?  'selected ="selected "' : '';
1620                    $sCa lendarOpti ons .= '<o ption valu e="all" '.  $sCalSel  ." >{$sAll C}</option >";   1620                    $sCa lendarOpti ons .= '<o ption valu e="all" '.  $sCalSel  ." >{$sAll C}</option >";
1621                    fore ach ( $aPr eValues['C ountry'] a s $key =>  $value ) {   1621                    fore ach ( $aPr eValues['C ountry'] a s $key =>  $value ) {
1622                             $sCalK eySel = (  $sRCalenda rCountry = = "{$key}"  ) ? 'sele cted="sele cted"' : ' ';   1622                             $sCalK eySel = (  $sRCalenda rCountry = = "{$key}"  ) ? 'sele cted="sele cted"' : ' ';
1623                             $sCuon tryVal = _ t($value[' LKey']);   1623                             $sCuon tryVal = _ t($value[' LKey']);
1624                             $sCale ndarOption s .= "<opt ion value= \"{$key}\"  {$sCalKey Sel} >{$sC uontryVal} </option>" ;   1624                             $sCale ndarOption s .= "<opt ion value= \"{$key}\"  {$sCalKey Sel} >{$sC uontryVal} </option>" ;
1625                    }   1625                    }
1626     1626  
1627                    $sCa lendarCoun try = (iss et($_REQUE ST['calend ar_country '])) ? '&c alendar_co untry='. p rocess_pas s_data($_R EQUEST['ca lendar_cou ntry']) :  '';   1627                    $sCa lendarCoun try = (iss et($_REQUE ST['calend ar_country '])) ? '&c alendar_co untry='. p rocess_pas s_data($_R EQUEST['ca lendar_cou ntry']) :  '';
1628                    $sCa lendarPrev Href = $_S ERVER['PHP _SELF']."? action=cal endar&mont h={$iPrevM onth}-{$iP revYear}". $sCalendar Country;   1628                    $sCa lendarPrev Href = $_S ERVER['PHP _SELF']."? action=cal endar&mont h={$iPrevM onth}-{$iP revYear}". $sCalendar Country;
1629                    $sCu rMonYear =  _t('_'.$s CurMonthNa me) .', '.  $iCurYear ;   1629                    $sCu rMonYear =  _t('_'.$s CurMonthNa me) .', '.  $iCurYear ;
1630                    $sCa lendarNext Href = $_S ERVER['PHP _SELF']."? action=cal endar&mont h={$iNextM onth}-{$iN extYear}". $sCalendar Country;   1630                    $sCa lendarNext Href = $_S ERVER['PHP _SELF']."? action=cal endar&mont h={$iNextM onth}-{$iN extYear}". $sCalendar Country;
1631     1631  
1632                    $sCa lTableTrs  = '';   1632                    $sCa lTableTrs  = '';
1633                    for  ($i = 0; $ i < 6; $i+ +) {   1633                    for  ($i = 0; $ i < 6; $i+ +) {
1634                             $sCalT ableTrs .=  '<tr>';   1634                             $sCalT ableTrs .=  '<tr>';
1635                             for ($ j = 0; $j  < 7; $j++)  {   1635                             for ($ j = 0; $j  < 7; $j++)  {
1636                                      if ( $aC alendarGri d[$i][$j][ 'today'] )   1636                                      if ( $aC alendarGri d[$i][$j][ 'today'] )
1637                                               $sCellClas s = 'calen dar_today' ;   1637                                               $sCellClas s = 'calen dar_today' ;
1638                                      elseif (  $aCalenda rGrid[$i][ $j]['curre nt'] )   1638                                      elseif (  $aCalenda rGrid[$i][ $j]['curre nt'] )
1639                                               $sCellClas s = 'calen dar_curren t';   1639                                               $sCellClas s = 'calen dar_curren t';
1640                                      else   1640                                      else
1641                                               $sCellClas s = 'calen dar_non_cu rrent';   1641                                               $sCellClas s = 'calen dar_non_cu rrent';
1642     1642  
1643                                      $sCalTab leTrs .= < <<EOF   1643                                      $sCalTab leTrs .= < <<EOF
1644   <td style= "width:100 px;height: 100px;" cl ass="{$sCe llClass}"> {$aCalenda rGrid[$i][ $j]['day'] }   1644   <td style= "width:100 px;height: 100px;" cl ass="{$sCe llClass}"> {$aCalenda rGrid[$i][ $j]['day'] }
1645   EOF;   1645   EOF;
1646     1646  
1647                                      $vDayMon thValue =  $aCalendar Grid[$i][$ j]['day']  .'-'.  $aC alendarGri d[$i][$j][ 'month'];   1647                                      $vDayMon thValue =  $aCalendar Grid[$i][$ j]['day']  .'-'.  $aC alendarGri d[$i][$j][ 'month'];
1648                                      if ( iss et($aCalen darEvents[ $vDayMonth Value]) &&  is_array( $aCalendar Events[$vD ayMonthVal ue]) ) {   1648                                      if ( iss et($aCalen darEvents[ $vDayMonth Value]) &&  is_array( $aCalendar Events[$vD ayMonthVal ue]) ) {
1649                                               foreach (  $aCalendar Events[$vD ayMonthVal ue] as $ev entID => $ eventArr )  {   1649                                               foreach (  $aCalendar Events[$vD ayMonthVal ue] as $ev entID => $ eventArr )  {
1650                                                       $s EventThumb name = get ThumbNameB yPictureNa me($eventA rr['PhotoF ilename'],  true);   1650                                                       $s EventThumb name = get ThumbNameB yPictureNa me($eventA rr['PhotoF ilename'],  true);
1651                                                       $s GenUrl = $ this->genU rl($eventI D, '', 'en try', true );   1651                                                       $s GenUrl = $ this->genU rl($eventI D, '', 'en try', true );
1652     1652  
1653                                                       if  ( strlen( trim($sEve ntThumbnam e)) && fil e_exists($ dir['sdati ngImage']  . $sEventT humbname)  ) {   1653                                                       if  ( strlen( trim($sEve ntThumbnam e)) && fil e_exists($ dir['sdati ngImage']  . $sEventT humbname)  ) {
1654                                                                $sCa lTableTrs  .= <<<EOF   1654                                                                $sCa lTableTrs  .= <<<EOF
1655   <div>   1655   <div>
1656   <a href="{ $sGenUrl}" >   1656   <a href="{ $sGenUrl}" >
1657           <i mg src="{$ site['sdat ingImage'] }icon_{$ev entArr['Ph otoFilenam e']}" bord er="0" alt ="{$eventA rr['Title' ]}" title= "{$eventAr r['Title'] }" style=" margin: 2p x;" />   1657           <i mg src="{$ site['sdat ingImage'] }icon_{$ev entArr['Ph otoFilenam e']}" bord er="0" alt ="{$eventA rr['Title' ]}" title= "{$eventAr r['Title'] }" style=" margin: 2p x;" />
1658   </a>   1658   </a>
1659   </div>   1659   </div>
1660   EOF;   1660   EOF;
1661                                                       }  else {   1661                                                       }  else {
1662                                                                glob al $tmpl;   1662                                                                glob al $tmpl;
1663                                                                $sSp acerName =  $this ->  sSpacerPat h;   1663                                                                $sSp acerName =  $this ->  sSpacerPat h;
1664                                                                $sNa name = $si te['url']. 'templates /tmpl_'.$t mpl.'/'.$t his -> sPi cNotAvail;   1664                                                                $sNa name = $si te['url']. 'templates /tmpl_'.$t mpl.'/'.$t his -> sPi cNotAvail;
1665                                                                $sCa lTableTrs  .= <<<EOF   1665                                                                $sCa lTableTrs  .= <<<EOF
1666   <div>   1666   <div>
1667           <a  href="{$s GenUrl}">   1667           <a  href="{$s GenUrl}">
1668                    <img  src="{$sS pacerName} " style="w idth:64px; height:64p x; backgro und-image:  url({$sNa name});" c lass="phot o1" alt=""  />   1668                    <img  src="{$sS pacerName} " style="w idth:64px; height:64p x; backgro und-image:  url({$sNa name});" c lass="phot o1" alt=""  />
1669           </ a>   1669           </ a>
1670   </div>   1670   </div>
1671   EOF;   1671   EOF;
1672                                                       }   1672                                                       }
1673                                               }   1673                                               }
1674                                      }   1674                                      }
1675     1675  
1676                                      $sCalTab leTrs .= ' </td>';   1676                                      $sCalTab leTrs .= ' </td>';
1677                             }   1677                             }
1678                             $sCalT ableTrs .=  '</tr>';   1678                             $sCalT ableTrs .=  '</tr>';
1679                    }   1679                    }
1680     1680  
1681                    $sRe tHtml = << <EOF   1681                    $sRe tHtml = << <EOF
1682   <br />   1682   <br />
1683   <div align ="center"  style="mar gin-bottom : 10px;">   1683   <div align ="center"  style="mar gin-bottom : 10px;">
1684           <f orm id="ca lendarCoun tryForm" a ction="{$_ SERVER['PH P_SELF']}"  method="g et" style= "margin: 0 px;">   1684           <f orm id="ca lendarCoun tryForm" a ction="{$_ SERVER['PH P_SELF']}"  method="g et" style= "margin: 0 px;">
1685                    <inp ut type="h idden" nam e="action"  value="ca lendar" />   1685                    <inp ut type="h idden" nam e="action"  value="ca lendar" />
1686                    <inp ut type="h idden" nam e="month"  value="{$i CurMonth}- {$iCurYear }" />   1686                    <inp ut type="h idden" nam e="month"  value="{$i CurMonth}- {$iCurYear }" />
1687                    {$sS howEventsB yCountryC} &nbsp;   1687                    {$sS howEventsB yCountryC} &nbsp;
1688                    <sel ect class= "no" name= "calendar_ country" o nchange="j avascript:  document. forms['cal endarCount ryForm'].s ubmit();"  style="ver tical-alig n: middle; ">{$sCalen darOptions }</select>   1688                    <sel ect class= "no" name= "calendar_ country" o nchange="j avascript:  document. forms['cal endarCount ryForm'].s ubmit();"  style="ver tical-alig n: middle; ">{$sCalen darOptions }</select>
1689           </ form>   1689           </ form>
1690     1690  
1691           <t able cellp adding="1"  cellspaci ng="1" bor der="0" wi dth="100%"  class="te xt" style= "text-alig n:center;m argin-top: 10px;">   1691           <t able cellp adding="1"  cellspaci ng="1" bor der="0" wi dth="100%"  class="te xt" style= "text-alig n:center;m argin-top: 10px;">
1692                    <tr>   1692                    <tr>
1693                             <td cl ass="calen dar_curren t" style=" padding: 3 px;">   1693                             <td cl ass="calen dar_curren t" style=" padding: 3 px;">
1694                                      <a href= "{$sCalend arPrevHref }">{$sPrev C}</a>   1694                                      <a href= "{$sCalend arPrevHref }">{$sPrev C}</a>
1695                             </td>   1695                             </td>
1696                             <td co lspan="5"  class="cal endar_curr ent">{$sCu rMonYear}< /td>   1696                             <td co lspan="5"  class="cal endar_curr ent">{$sCu rMonYear}< /td>
1697                             <td cl ass="calen dar_curren t" style=" padding: 3 px;">   1697                             <td cl ass="calen dar_curren t" style=" padding: 3 px;">
1698                                      <a href= "{$sCalend arNextHref }">{$sNext C}</a>   1698                                      <a href= "{$sCalend arNextHref }">{$sNext C}</a>
1699                             </td>   1699                             </td>
1700                    </tr >   1700                    </tr >
1701                    <tr>   1701                    <tr>
1702                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sS undaySC}</ td>   1702                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sS undaySC}</ td>
1703                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sM ondaySC}</ td>   1703                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sM ondaySC}</ td>
1704                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sT uesdaySC}< /td>   1704                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sT uesdaySC}< /td>
1705                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sW ednesdaySC }</td>   1705                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sW ednesdaySC }</td>
1706                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sT hursdaySC} </td>   1706                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sT hursdaySC} </td>
1707                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sF ridaySC}</ td>   1707                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sF ridaySC}</ td>
1708                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sS aturdaySC} </td>   1708                             <td st yle="width :{$iPicSiz e}px;" cla ss="calend ar_non_cur rent">{$sS aturdaySC} </td>
1709                    </tr >   1709                    </tr >
1710           {$ sCalTableT rs}   1710           {$ sCalTableT rs}
1711           </ table>   1711           </ table>
1712   </div>   1712   </div>
1713   <br />   1713   <br />
1714   EOF;   1714   EOF;
1715     1715  
1716                    retu rn DesignB oxContent(  $sCalenda rC, $sRetH tml, $oTem plConfig - > PageSDat ingCalenda r_db_num ) ;   1716                    retu rn DesignB oxContent(  $sCalenda rC, $sRetH tml, $oTem plConfig - > PageSDat ingCalenda r_db_num ) ;
1717   }   1717   }
1718     1718  
1719           fu nction Gen erateZapat ecCode($sE l1, $sEl2)  {   1719           fu nction Gen erateZapat ecCode($sE l1, $sEl2)  {
1720                    $iCu rYear = da te("Y");   1720                    $iCu rYear = da te("Y");
1721                    $iCu rMonth = d ate("m");   1721                    $iCu rMonth = d ate("m");
1722                    $iCu rDay = dat e("d");   1722                    $iCu rDay = dat e("d");
1723     1723  
1724                    //Re comendatio n: if you  switch it  to 12H sta ndart, don `t forget  set 'elect ric' to tr ue (to kee p events w orking)   1724                    //Re comendatio n: if you  switch it  to 12H sta ndart, don `t forget  set 'elect ric' to tr ue (to kee p events w orking)
1725     1725  
1726                    $sRe s = <<<EOF   1726                    $sRe s = <<<EOF
1727   Zapatec.Ca lendar.set up({   1727   Zapatec.Ca lendar.set up({
1728           fi rstDay           : 1,   1728           fi rstDay           : 1,
1729           we ekNumbers        : tr ue,   1729           we ekNumbers        : tr ue,
1730           sh owOthers         : tr ue,   1730           sh owOthers         : tr ue,
1731           sh owsTime          : tr ue,   1731           sh owsTime          : tr ue,
1732           ti meFormat         : "2 4",   1732           ti meFormat         : "2 4",
1733           st ep               : 2,   1733           st ep               : 2,
1734           ra nge              : [{ $iCurYear} .{$iCurMon th}, 2099. 12],   1734           ra nge              : [{ $iCurYear} .{$iCurMon th}, 2099. 12],
1735           el ectric           : fa lse,   1735           el ectric           : fa lse,
1736           si ngleClick        : tr ue,   1736           si ngleClick        : tr ue,
1737           in putField         : "{ $sEl1}",   1737           in putField         : "{ $sEl1}",
1738           bu tton             : "{ $sEl2}",   1738           bu tton             : "{ $sEl2}",
1739           if Format           : "% Y-%m-%d %H :%M:%S",   1739           if Format           : "% Y-%m-%d %H :%M:%S",
1740           da Format           : "% Y/%m/%d",   1740           da Format           : "% Y/%m/%d",
1741           al ign              : "B r"   1741           al ign              : "B r"
1742   });   1742   });
1743   EOF;   1743   EOF;
1744                    retu rn $sRes;   1744                    retu rn $sRes;
1745           }   1745           }
1746     1746  
1747           /* *   1747           /* *
1748            *  page show  add new e vent form  function   1748            *  page show  add new e vent form  function
1749            *  @return H TML presen tation of  data   1749            *  @return H TML presen tation of  data
1750            * /   1750            * /
1751           fu nction Pag eSDatingNe wEventForm ($iEventID =0, $arrEr r = NULL)  {   1751           fu nction Pag eSDatingNe wEventForm ($iEventID =0, $arrEr r = NULL)  {
1752                    $thi s->CheckLo gged();   1752                    $thi s->CheckLo gged();
1753                    glob al $site;   1753                    glob al $site;
1754                    glob al $aPreVa lues;   1754                    glob al $aPreVa lues;
1755                    glob al $oTempl Config;   1755                    glob al $oTempl Config;
1756                    glob al $date_f ormat;   1756                    glob al $date_f ormat;
1757                    glob al $logged ;   1757                    glob al $logged ;
1758     1758  
1759                    // c ollect inf ormation a bout curre nt member   1759                    // c ollect inf ormation a bout curre nt member
1760                    $aMe mber['ID']  = (int)$_ COOKIE['me mberID'];   1760                    $aMe mber['ID']  = (int)$_ COOKIE['me mberID'];
1761                    $aMe mberData =  getProfil eInfo( $aM ember['ID' ] );   1761                    $aMe mberData =  getProfil eInfo( $aM ember['ID' ] );
1762                    $sMe mberCountr y = ($this ->bAdminMo de) ? getP aram( 'def ault_count ry' ) : $a MemberData ['Country' ];   1762                    $sMe mberCountr y = ($this ->bAdminMo de) ? getP aram( 'def ault_count ry' ) : $a MemberData ['Country' ];
1763                    $sPl easeFillAl lFieldsC =  _t('_Plea se fill up  all field s');   1763                    $sPl easeFillAl lFieldsC =  _t('_Plea se fill up  all field s');
1764                    $sTi tleC = _t( '_Title');   1764                    $sTi tleC = _t( '_Title');
1765                    $sDe scriptionC  = _t('_De scription' );   1765                    $sDe scriptionC  = _t('_De scription' );
1766                    $sSt atusMessag eC = _t('_ Status mes sage');   1766                    $sSt atusMessag eC = _t('_ Status mes sage');
1767                    $sCo untryC = _ t('_Countr y');   1767                    $sCo untryC = _ t('_Countr y');
1768                    $sCi tyC = _t(' _City');   1768                    $sCi tyC = _t(' _City');
1769                    $sPl aceC = _t( '_Place');   1769                    $sPl aceC = _t( '_Place');
1770                    $sVe nuePhotoC  = _t('_Ven ue photo') ;   1770                    $sVe nuePhotoC  = _t('_Ven ue photo') ;
1771                    $sEv entStartC  = _t('_Eve nt start') ;   1771                    $sEv entStartC  = _t('_Eve nt start') ;
1772                    $sEv entEndC =  _t('_Event  end');   1772                    $sEv entEndC =  _t('_Event  end');
1773                    $sTi cketSaleSt artC = _t( '_Ticket s ale start' );   1773                    $sTi cketSaleSt artC = _t( '_Ticket s ale start' );
1774                    $sTi cketSaleEn dC = _t('_ Ticket sal e end');   1774                    $sTi cketSaleEn dC = _t('_ Ticket sal e end');
1775                    $sFe maleTicket CountC = _ t('_Female  ticket co unt');   1775                    $sFe maleTicket CountC = _ t('_Female  ticket co unt');
1776                    $sMa leTicketCo untC = _t( '_Male tic ket count' );   1776                    $sMa leTicketCo untC = _t( '_Male tic ket count' );
1777                    $sPo stEventC =  _t('_Post  Event');   1777                    $sPo stEventC =  _t('_Post  Event');
1778                    $sAd dNewEventC  = _t('_Ad d new even t');   1778                    $sAd dNewEventC  = _t('_Ad d new even t');
1779                    $sTa gsC = _t(' _Tags');   1779                    $sTa gsC = _t(' _Tags');
1780                    $sCo mmitC = _t ('_Apply C hanges');   1780                    $sCo mmitC = _t ('_Apply C hanges');
1781                    $sCh ooseC = _t ('_Choose' );   1781                    $sCh ooseC = _t ('_Choose' );
1782                    $sCl earC = _t( '_Clear');   1782                    $sCl earC = _t( '_Clear');
1783     1783  
1784                    $sEv entURL = $ _SERVER['P HP_SELF'];   1784                    $sEv entURL = $ _SERVER['P HP_SELF'];
1785     1785  
1786                    if ( $iEventID> 0) {   1786                    if ( $iEventID> 0) {
1787                             $sEven tSQL = "SE LECT * FRO M `SDating Events` WH ERE `ID` =  {$iEventI D} LIMIT 1 ";   1787                             $sEven tSQL = "SE LECT * FRO M `SDating Events` WH ERE `ID` =  {$iEventI D} LIMIT 1 ";
1788                             $aEven t = db_arr ( $sEventS QL );   1788                             $aEven t = db_arr ( $sEventS QL );
1789                             $sEven tTitle = h tmlspecial chars($aEv ent['Title ']);   1789                             $sEven tTitle = h tmlspecial chars($aEv ent['Title ']);
1790                             $sEven tTags = ht mlspecialc hars($aEve nt['Tags'] );   1790                             $sEven tTags = ht mlspecialc hars($aEve nt['Tags'] );
1791                                1791                             
1792                             $sEven tDesc = $a Event['Des cription'] ;   1792                             $sEven tDesc = $a Event['Des cription'] ;
1793                             $sEven tStatusMsg  = htmlspe cialchars( $aEvent['S tatusMessa ge']);   1793                             $sEven tStatusMsg  = htmlspe cialchars( $aEvent['S tatusMessa ge']);
1794                             $sSele ctedCountr y = htmlsp ecialchars ($aEvent[' Country']) ;   1794                             $sSele ctedCountr y = htmlsp ecialchars ($aEvent[' Country']) ;
1795                             $sSity Src = $sit e['flags'] .strtolowe r($sSelect edCountry) ;   1795                             $sSity Src = $sit e['flags'] .strtolowe r($sSelect edCountry) ;
1796                             $sEven tCity = ht mlspecialc hars($aEve nt['City'] );   1796                             $sEven tCity = ht mlspecialc hars($aEve nt['City'] );
1797                             $sEven tPlace = h tmlspecial chars($aEv ent['Place ']);   1797                             $sEven tPlace = h tmlspecial chars($aEv ent['Place ']);
1798                             $sEven tEnd = $aE vent['Tick etSaleEnd' ];   1798                             $sEven tEnd = $aE vent['Tick etSaleEnd' ];
1799                             $sEven tStart = $ aEvent['Ev entStart'] ;   1799                             $sEven tStart = $ aEvent['Ev entStart'] ;
1800                             $sFema leTicketCo unt = (int )$aEvent[' TicketCoun tFemale'];   1800                             $sFema leTicketCo unt = (int )$aEvent[' TicketCoun tFemale'];
1801                             $sMale TicketCoun t = (int)$ aEvent['Ti cketCountM ale'];   1801                             $sMale TicketCoun t = (int)$ aEvent['Ti cketCountM ale'];
1802     1802  
1803                             //$sPo stPicture  = $aEvent[ 'PostPhoto '];   1803                             //$sPo stPicture  = $aEvent[ 'PostPhoto '];
1804                             //if ( $sPostImag e != '')    1804                             //if ( $sPostImag e != '') 
1805                             //       $sPostPi ctureTag =  '<img src ="'.$site[ 'blogImage '].'big_'. $sPostImag e.'" style ="position :static;"  />';   1805                             //       $sPostPi ctureTag =  '<img src ="'.$site[ 'blogImage '].'big_'. $sPostImag e.'" style ="position :static;"  />';
1806                             $sEdit edIdElemen t = '<inpu t type="hi dden" name ="EditedEv entID" id= "EditedEve ntID" valu e="'.$iEve ntID.'" /> ';   1806                             $sEdit edIdElemen t = '<inpu t type="hi dden" name ="EditedEv entID" id= "EditedEve ntID" valu e="'.$iEve ntID.'" /> ';
1807     1807  
1808                             $sPost EventC = $ sCommitC;   1808                             $sPost EventC = $ sCommitC;
1809                             $sPost Action = ' event_upda ted';   1809                             $sPost Action = ' event_upda ted';
1810                             $sAddN ewEventC =  _t('_Edit  event');   1810                             $sAddN ewEventC =  _t('_Edit  event');
1811                             $sANEv entAction  = "event_s ave";   1811                             $sANEv entAction  = "event_s ave";
1812                             //$sJS Ins = "Upd ateField(' EditEventI D','{$iEve ntID}');";   1812                             //$sJS Ins = "Upd ateField(' EditEventI D','{$iEve ntID}');";
1813                             //$sEd itIdStr =  '<input ty pe="hidden " name="Ed itedEventI D" value=" '.$iEventI D.'">';   1813                             //$sEd itIdStr =  '<input ty pe="hidden " name="Ed itedEventI D" value=" '.$iEventI D.'">';
1814                             $sEven tURL = $th is->genUrl ($iEventID , $aEvent[ 'EntryUri' ]);   1814                             $sEven tURL = $th is->genUrl ($iEventID , $aEvent[ 'EntryUri' ]);
1815                             //$sEv entURL = " ?action=sh ow_info&ev ent_id={$i EventID}";   1815                             //$sEv entURL = " ?action=sh ow_info&ev ent_id={$i EventID}";
1816                    } el se {   1816                    } el se {
1817                             $sEven tTitle = i sset($_POS T['event_t itle']) ?  process_db _input($_P OST['event _title'],  1) : '';   1817                             $sEven tTitle = i sset($_POS T['event_t itle']) ?  process_db _input($_P OST['event _title'],  1) : '';
1818                             $sEven tTags = is set($_POST ['event_ta gs']) ? pr ocess_db_i nput($_POS T['event_t ags'], 1)  : '';   1818                             $sEven tTags = is set($_POST ['event_ta gs']) ? pr ocess_db_i nput($_POS T['event_t ags'], 1)  : '';
1819                             $sEven tDesc = is set($_POST ['event_de sc']) ? $t his->proce ss_html_db _input($_P OST['event _desc']) :  '';   1819                             $sEven tDesc = is set($_POST ['event_de sc']) ? $t his->proce ss_html_db _input($_P OST['event _desc']) :  '';
1820                             $sEven tStatusMsg  = isset($ _POST['eve nt_statusm sg']) ? pr ocess_db_i nput($_POS T['event_s tatusmsg'] , 1) : '';   1820                             $sEven tStatusMsg  = isset($ _POST['eve nt_statusm sg']) ? pr ocess_db_i nput($_POS T['event_s tatusmsg'] , 1) : '';
1821                             $sSele ctedCountr y = isset( $_POST['ev ent_countr y']) ? pro cess_db_in put($_POST ['event_co untry'], 1 ) : $sMemb erCountry;   1821                             $sSele ctedCountr y = isset( $_POST['ev ent_countr y']) ? pro cess_db_in put($_POST ['event_co untry'], 1 ) : $sMemb erCountry;
1822                             $sSity Src = $sit e['flags'] .strtolowe r($sSelect edCountry) ;   1822                             $sSity Src = $sit e['flags'] .strtolowe r($sSelect edCountry) ;
1823                             $sEven tCity = is set($_POST ['event_ci ty']) ? pr ocess_db_i nput($_POS T['event_c ity'], 1)  : '';   1823                             $sEven tCity = is set($_POST ['event_ci ty']) ? pr ocess_db_i nput($_POS T['event_c ity'], 1)  : '';
1824                             $sEven tPlace = i sset($_POS T['event_p lace']) ?  process_db _input($_P OST['event _place'],  1) : '';   1824                             $sEven tPlace = i sset($_POS T['event_p lace']) ?  process_db _input($_P OST['event _place'],  1) : '';
1825                             $sEven tEnd = iss et($_POST[ 'event_end ']) ? proc ess_db_inp ut($_POST[ 'event_end '], 1) : s trftime( s tr_replace ('%i','%M' , $date_fo rmat) );   1825                             $sEven tEnd = iss et($_POST[ 'event_end ']) ? proc ess_db_inp ut($_POST[ 'event_end '], 1) : s trftime( s tr_replace ('%i','%M' , $date_fo rmat) );
1826                             $sFema leTicketCo unt = isse t($_POST[' event_coun t_female'] ) ? (int)$ _POST['eve nt_count_f emale'] :  '';   1826                             $sFema leTicketCo unt = isse t($_POST[' event_coun t_female'] ) ? (int)$ _POST['eve nt_count_f emale'] :  '';
1827                             $sMale TicketCoun t = isset( $_POST['ev ent_count_ male']) ?  (int)$_POS T['event_c ount_male' ] : '';   1827                             $sMale TicketCoun t = isset( $_POST['ev ent_count_ male']) ?  (int)$_POS T['event_c ount_male' ] : '';
1828                             $sPost Action = ' event_save ';   1828                             $sPost Action = ' event_save ';
1829                             $sANEv entAction  = "new";   1829                             $sANEv entAction  = "new";
1830                    }   1830                    }
1831     1831  
1832                    $sCo untriesOpt ions = '';   1832                    $sCo untriesOpt ions = '';
1833                       1833                    
1834                    fore ach ( $aPr eValues['C ountry'] a s $key =>  $value ) {   1834                    fore ach ( $aPr eValues['C ountry'] a s $key =>  $value ) {
1835                             $sSC =  ($sSelect edCountry  == $key) ?  'selected ="selected "' : '';   1835                             $sSC =  ($sSelect edCountry  == $key) ?  'selected ="selected "' : '';
1836                             $sVal  = _t($valu e['LKey']) ;   1836                             $sVal  = _t($valu e['LKey']) ;
1837                             $sCoun triesOptio ns .= "<op tion value =\"{$key}\ " {$sSC}>{ $sVal}</op tion>";   1837                             $sCoun triesOptio ns .= "<op tion value =\"{$key}\ " {$sSC}>{ $sVal}</op tion>";
1838                    }   1838                    }
1839     1839  
1840                    $sJS Code = <<< EOF   1840                    $sJS Code = <<< EOF
1841   <script ty pe="text/j avascript" >   1841   <script ty pe="text/j avascript" >
1842   <!--   1842   <!--
1843           fu nction Aut oSelectFla g() {   1843           fu nction Aut oSelectFla g() {
1844                    var  vElem = do cument.get ElementByI d('event_c ountry_id' );   1844                    var  vElem = do cument.get ElementByI d('event_c ountry_id' );
1845                    chan geFlag(vEl em.value);   1845                    chan geFlag(vEl em.value);
1846           }   1846           }
1847     1847  
1848           fu nction cha ngeFlag(fl agISO)   1848           fu nction cha ngeFlag(fl agISO)
1849           {   1849           {
1850                    flag Image = do cument.get ElementByI d('flagIma geId');   1850                    flag Image = do cument.get ElementByI d('flagIma geId');
1851                    flag Image.src  = '{$site[ 'flags']}'  + flagISO .toLowerCa se() + '.g if';   1851                    flag Image.src  = '{$site[ 'flags']}'  + flagISO .toLowerCa se() + '.g if';
1852           }   1852           }
1853   //-->   1853   //-->
1854   </script>   1854   </script>
1855   EOF;   1855   EOF;
1856     1856  
1857                    $sZa patecCalen dar = '';   1857                    $sZa patecCalen dar = '';
1858                    //if  ( $_REQUE ST['action '] == 'new ' ) {   1858                    //if  ( $_REQUE ST['action '] == 'new ' ) {
1859                             $sAdmi nCalendars  = '';   1859                             $sAdmi nCalendars  = '';
1860                             if ($t his->bAdmi nMode) {   1860                             if ($t his->bAdmi nMode) {
1861                                      $sAdminC alendars =  $this->Ge nerateZapa tecCode('e vent_end_i d','end_ch oose_id')  .   1861                                      $sAdminC alendars =  $this->Ge nerateZapa tecCode('e vent_end_i d','end_ch oose_id')  .
1862                                               $this->Gen erateZapat ecCode('ev ent_sale_s tart_id',' sale_start _choose_id ') .   1862                                               $this->Gen erateZapat ecCode('ev ent_sale_s tart_id',' sale_start _choose_id ') .
1863                                               $this->Gen erateZapat ecCode('ev ent_sale_e nd_id','sa le_end_cho ose_id');   1863                                               $this->Gen erateZapat ecCode('ev ent_sale_e nd_id','sa le_end_cho ose_id');
1864                             }   1864                             }
1865                             $sZapa tecCalenda r = $this- >GenerateZ apatecCode ('event_st art_id','s tart_choos e_id') . $ sAdminCale ndars;   1865                             $sZapa tecCalenda r = $this- >GenerateZ apatecCode ('event_st art_id','s tart_choos e_id') . $ sAdminCale ndars;
1866                    //}   1866                    //}
1867     1867  
1868                    //// php valida ting field s   1868                    //// php valida ting field s
1869                    $sTs tyle = ($a rrErr['Tit le'] ? 'bl ock' : 'no ne');   1869                    $sTs tyle = ($a rrErr['Tit le'] ? 'bl ock' : 'no ne');
1870                    $sDs tyle = ($a rrErr['Des cription']  ? 'block'  : 'none') ;   1870                    $sDs tyle = ($a rrErr['Des cription']  ? 'block'  : 'none') ;
1871                    $sSM style = ($ arrErr['St atus messa ge'] ? 'bl ock' : 'no ne');   1871                    $sSM style = ($ arrErr['St atus messa ge'] ? 'bl ock' : 'no ne');
1872                    $sCs tyle = ($a rrErr['Cit y'] ? 'blo ck' : 'non e');   1872                    $sCs tyle = ($a rrErr['Cit y'] ? 'blo ck' : 'non e');
1873                    $sPs tyle = ($a rrErr['Pla ce'] ? 'bl ock' : 'no ne');   1873                    $sPs tyle = ($a rrErr['Pla ce'] ? 'bl ock' : 'no ne');
1874                    $sES style = ($ arrErr['Ev ent start' ] ? 'block ' : 'none' );   1874                    $sES style = ($ arrErr['Ev ent start' ] ? 'block ' : 'none' );
1875                    $sEE style = ($ arrErr['Ev ent end']  ? 'block'  : 'none');   1875                    $sEE style = ($ arrErr['Ev ent end']  ? 'block'  : 'none');
1876                    $sTS Sstyle = ( $arrErr['T icket Sale  Start'] ?  'block' :  'none');   1876                    $sTS Sstyle = ( $arrErr['T icket Sale  Start'] ?  'block' :  'none');
1877                    $sTS Estyle = ( $arrErr['T icket Sale  End'] ? ' block' : ' none');   1877                    $sTS Estyle = ( $arrErr['T icket Sale  End'] ? ' block' : ' none');
1878                    $sFT Cstyle = ( $arrErr['F emale Tick et Count']  ? 'block'  : 'none') ;   1878                    $sFT Cstyle = ( $arrErr['F emale Tick et Count']  ? 'block'  : 'none') ;
1879                    $sMT Cstyle = ( $arrErr['M ale Ticket  Count'] ?  'block' :  'none');   1879                    $sMT Cstyle = ( $arrErr['M ale Ticket  Count'] ?  'block' :  'none');
1880                    //er ror messag es   1880                    //er ror messag es
1881                    $sTm sg = ($arr Err['Title '] ? _t( ' _'.$arrErr ['Title']  ) : '' );   1881                    $sTm sg = ($arr Err['Title '] ? _t( ' _'.$arrErr ['Title']  ) : '' );
1882                    $sDm sg = ($arr Err['Descr iption'] ?  _t( '_'.$ arrErr['De scription' ] ) : '' ) ;   1882                    $sDm sg = ($arr Err['Descr iption'] ?  _t( '_'.$ arrErr['De scription' ] ) : '' ) ;
1883                    $sSM msg = ($ar rErr['Stat us message '] ? _t( ' _'.$arrErr ['Status m essage'] )  : '' );   1883                    $sSM msg = ($ar rErr['Stat us message '] ? _t( ' _'.$arrErr ['Status m essage'] )  : '' );
1884                    $sCm sg = ($arr Err['City' ] ? _t( '_ '.$arrErr[ 'City'] )  : '' );   1884                    $sCm sg = ($arr Err['City' ] ? _t( '_ '.$arrErr[ 'City'] )  : '' );
1885                    $sPm sg = ($arr Err['Place '] ? _t( ' _'.$arrErr ['Place']  ) : '' );   1885                    $sPm sg = ($arr Err['Place '] ? _t( ' _'.$arrErr ['Place']  ) : '' );
1886                    $sES msg = ($ar rErr['Even t start']  ? _t( '_'. $arrErr['E vent start '] ) : ''  );   1886                    $sES msg = ($ar rErr['Even t start']  ? _t( '_'. $arrErr['E vent start '] ) : ''  );
1887                    $sEE msg = ($ar rErr['Even t end'] ?  _t( '_'.$a rrErr['Eve nt end'] )  : '' );   1887                    $sEE msg = ($ar rErr['Even t end'] ?  _t( '_'.$a rrErr['Eve nt end'] )  : '' );
1888                    $sTS Smsg = ($a rrErr['Tic ket Sale S tart'] ? _ t( '_'.$ar rErr['Tick et Sale St art'] ) :  '' );   1888                    $sTS Smsg = ($a rrErr['Tic ket Sale S tart'] ? _ t( '_'.$ar rErr['Tick et Sale St art'] ) :  '' );
1889                    $sTS Emsg = ($a rrErr['Tic ket Sale E nd'] ? _t(  '_'.$arrE rr['Ticket  Sale End' ] ) : '' ) ;   1889                    $sTS Emsg = ($a rrErr['Tic ket Sale E nd'] ? _t(  '_'.$arrE rr['Ticket  Sale End' ] ) : '' ) ;
1890                    $sFT Cmsg = ($a rrErr['Fem ale Ticket  Count'] ?  _t( '_'.$ arrErr['Fe male Ticke t Count']  ) : '' );   1890                    $sFT Cmsg = ($a rrErr['Fem ale Ticket  Count'] ?  _t( '_'.$ arrErr['Fe male Ticke t Count']  ) : '' );
1891                    $sMT Cmsg = ($a rrErr['Mal e Ticket C ount'] ? _ t( '_'.$ar rErr['Male  Ticket Co unt'] ) :  '' );   1891                    $sMT Cmsg = ($a rrErr['Mal e Ticket C ount'] ? _ t( '_'.$ar rErr['Male  Ticket Co unt'] ) :  '' );
1892     1892  
1893     1893  
1894                    $sAd minSalesPa rt='';   1894                    $sAd minSalesPa rt='';
1895                    $sSt atusMess=' ';   1895                    $sSt atusMess=' ';
1896                    if ( $this->bAd minMode) {   1896                    if ( $this->bAd minMode) {
1897                             $sStat usMess = < <<EOF   1897                             $sStat usMess = < <<EOF
1898   <tr class= "vc">   1898   <tr class= "vc">
1899           <t d class="f orm_label" >{$sStatus MessageC}: </td>   1899           <t d class="f orm_label" >{$sStatus MessageC}: </td>
1900           <t d class="f orm_value" >   1900           <t d class="f orm_value" >
1901                    <div  class="ed it_error"  style="dis play:{$sSM style}">   1901                    <div  class="ed it_error"  style="dis play:{$sSM style}">
1902                             {$sSMm sg}   1902                             {$sSMm sg}
1903                    </di v>   1903                    </di v>
1904                    <inp ut class=" form_input " type="te xt" name=" event_stat usmsg" id= "event_sta tusmsg_id"  value="{$ sEventStat usMsg}" />   1904                    <inp ut class=" form_input " type="te xt" name=" event_stat usmsg" id= "event_sta tusmsg_id"  value="{$ sEventStat usMsg}" />
1905           </ td>   1905           </ td>
1906   </tr>   1906   </tr>
1907   EOF;   1907   EOF;
1908     1908  
1909                             $sAdmi nSalesPart  = <<<EOF   1909                             $sAdmi nSalesPart  = <<<EOF
1910   <tr class= "vc">   1910   <tr class= "vc">
1911           <t d class="f orm_label" >{$sEventE ndC}:</td>   1911           <t d class="f orm_label" >{$sEventE ndC}:</td>
1912           <t d class="f orm_value" >   1912           <t d class="f orm_value" >
1913                    <!--  <input ty pe="text"  class="no"  name="eve nt_end" id ="event_en d_id" size ="20" valu e="{$sEven tEnd}" />- ->   1913                    <!--  <input ty pe="text"  class="no"  name="eve nt_end" id ="event_en d_id" size ="20" valu e="{$sEven tEnd}" />- ->
1914                    <div  class="ed it_error"  style="dis play:{$sEE style}">   1914                    <div  class="ed it_error"  style="dis play:{$sEE style}">
1915                             {$sEEm sg}   1915                             {$sEEm sg}
1916                    </di v>   1916                    </di v>
1917                    <inp ut type="t ext" class ="form_inp ut_date" n ame="event _end" id=" event_end_ id" value= "" />   1917                    <inp ut type="t ext" class ="form_inp ut_date" n ame="event _end" id=" event_end_ id" value= "" />
1918                    <inp ut type="b utton" id= "end_choos e_id" valu e="{$sChoo seC}" />   1918                    <inp ut type="b utton" id= "end_choos e_id" valu e="{$sChoo seC}" />
1919                    <inp ut type="b utton" id= "end_clear _id" onCli ck="docume nt.getElem entById('e vent_end_i d').value  = ''; " va lue="{$sCl earC}" />   1919                    <inp ut type="b utton" id= "end_clear _id" onCli ck="docume nt.getElem entById('e vent_end_i d').value  = ''; " va lue="{$sCl earC}" />
1920           </ td>   1920           </ td>
1921   </tr>   1921   </tr>
1922   <tr class= "vc">   1922   <tr class= "vc">
1923           <t d class="f orm_label" >{$sTicket SaleStartC }:</td>   1923           <t d class="f orm_label" >{$sTicket SaleStartC }:</td>
1924           <t d class="f orm_value" >   1924           <t d class="f orm_value" >
1925                    <div  class="ed it_error"  style="dis play:{$sTS Sstyle}">   1925                    <div  class="ed it_error"  style="dis play:{$sTS Sstyle}">
1926                             {$sTSS msg}   1926                             {$sTSS msg}
1927                    </di v>   1927                    </di v>
1928                    <inp ut type="t ext" class ="form_inp ut_date" n ame="event _sale_star t" id="eve nt_sale_st art_id" va lue="" />   1928                    <inp ut type="t ext" class ="form_inp ut_date" n ame="event _sale_star t" id="eve nt_sale_st art_id" va lue="" />
1929                    <inp ut type="b utton" id= "sale_star t_choose_i d" value=" {$sChooseC }" />   1929                    <inp ut type="b utton" id= "sale_star t_choose_i d" value=" {$sChooseC }" />
1930                    <inp ut type="b utton" id= "sale_star t_clear_id " onClick= "document. getElement ById('even t_sale_sta rt_id').va lue = '';  " value="{ $sClearC}"  />   1930                    <inp ut type="b utton" id= "sale_star t_clear_id " onClick= "document. getElement ById('even t_sale_sta rt_id').va lue = '';  " value="{ $sClearC}"  />
1931           </ td>   1931           </ td>
1932   </tr>   1932   </tr>
1933   <tr class= "vc">   1933   <tr class= "vc">
1934           <t d class="f orm_label" >{$sTicket SaleEndC}: </td>   1934           <t d class="f orm_label" >{$sTicket SaleEndC}: </td>
1935           <t d class="f orm_value" >   1935           <t d class="f orm_value" >
1936                    <div  class="ed it_error"  style="dis play:{$sTS Estyle}">   1936                    <div  class="ed it_error"  style="dis play:{$sTS Estyle}">
1937                             {$sTSE msg}   1937                             {$sTSE msg}
1938                    </di v>   1938                    </di v>
1939                    <inp ut type="t ext" class ="form_inp ut_date" n ame="event _sale_end"  id="event _sale_end_ id" value= "" />   1939                    <inp ut type="t ext" class ="form_inp ut_date" n ame="event _sale_end"  id="event _sale_end_ id" value= "" />
1940                    <inp ut type="b utton" id= "sale_end_ choose_id"  value="{$ sChooseC}"  />   1940                    <inp ut type="b utton" id= "sale_end_ choose_id"  value="{$ sChooseC}"  />
1941                    <inp ut type="b utton" id= "sale_end_ clear_id"  onClick="d ocument.ge tElementBy Id('event_ sale_end_i d').value  = ''; " va lue="{$sCl earC}" />   1941                    <inp ut type="b utton" id= "sale_end_ clear_id"  onClick="d ocument.ge tElementBy Id('event_ sale_end_i d').value  = ''; " va lue="{$sCl earC}" />
1942           </ td>   1942           </ td>
1943   </tr>   1943   </tr>
1944   <tr class= "vc">   1944   <tr class= "vc">
1945           <t d class="f orm_label" >{$sFemale TicketCoun tC}:</td>   1945           <t d class="f orm_label" >{$sFemale TicketCoun tC}:</td>
1946           <t d class="f orm_value" >   1946           <t d class="f orm_value" >
1947                    <div  class="ed it_error"  style="dis play:{$sFT Cstyle}">   1947                    <div  class="ed it_error"  style="dis play:{$sFT Cstyle}">
1948                             {$sFTC msg}   1948                             {$sFTC msg}
1949                    </di v>   1949                    </di v>
1950                    <inp ut type="t ext" class ="form_inp ut_count"  name="even t_count_fe male" id=" event_coun t_female_i d" value=" {$sFemaleT icketCount }" />   1950                    <inp ut type="t ext" class ="form_inp ut_count"  name="even t_count_fe male" id=" event_coun t_female_i d" value=" {$sFemaleT icketCount }" />
1951           </ td>   1951           </ td>
1952   </tr>   1952   </tr>
1953   <tr class= "vc">   1953   <tr class= "vc">
1954           <t d class="f orm_label" >{$sMaleTi cketCountC }:</td>   1954           <t d class="f orm_label" >{$sMaleTi cketCountC }:</td>
1955           <t d class="f orm_value" >   1955           <t d class="f orm_value" >
1956                    <div  class="ed it_error"  style="dis play:{$sMT Cstyle}">   1956                    <div  class="ed it_error"  style="dis play:{$sMT Cstyle}">
1957                             {$sMTC msg}   1957                             {$sMTC msg}
1958                    </di v>   1958                    </di v>
1959                    <inp ut type="t ext" class ="form_inp ut_count"  name="even t_count_ma le" id="ev ent_count_ male_id" v alue="{$sM aleTicketC ount}" />   1959                    <inp ut type="t ext" class ="form_inp ut_count"  name="even t_count_ma le" id="ev ent_count_ male_id" v alue="{$sM aleTicketC ount}" />
1960           </ td>   1960           </ td>
1961   </tr>   1961   </tr>
1962   EOF;   1962   EOF;
1963                    }   1963                    }
1964     1964  
1965                    $sRe tHtml = << <EOF   1965                    $sRe tHtml = << <EOF
1966   {$sJSCode}   1966   {$sJSCode}
1967   <form id=" newEventFo rm" action ="{$sEvent URL}" meth od="post"  enctype="m ultipart/f orm-data">   1967   <form id=" newEventFo rm" action ="{$sEvent URL}" meth od="post"  enctype="m ultipart/f orm-data">
1968   <table cla ss="addEve ntForm">   1968   <table cla ss="addEve ntForm">
1969           <t r class="v c">   1969           <t r class="v c">
1970                    <td  class="for m_label">{ $sTitleC}: </td>   1970                    <td  class="for m_label">{ $sTitleC}: </td>
1971                    <td  class="for m_value">   1971                    <td  class="for m_value">
1972                             <div c lass="edit _error" st yle="displ ay:{$sTsty le}">   1972                             <div c lass="edit _error" st yle="displ ay:{$sTsty le}">
1973                                      {$sTmsg}   1973                                      {$sTmsg}
1974                             </div>   1974                             </div>
1975                             <input  class="fo rm_input"  type="text " name="ev ent_title"  id="event _title_id"  value="{$ sEventTitl e}" />   1975                             <input  class="fo rm_input"  type="text " name="ev ent_title"  id="event _title_id"  value="{$ sEventTitl e}" />
1976                    </td >   1976                    </td >
1977           </ tr>   1977           </ tr>
1978           <t r class="v c">   1978           <t r class="v c">
1979                    <td  class="for m_label">{ $sTagsC}:< /td>   1979                    <td  class="for m_label">{ $sTagsC}:< /td>
1980                    <td  class="for m_value">   1980                    <td  class="for m_value">
1981                             <input  class="fo rm_input"  type="text " name="ev ent_tags"  value="{$s EventTags} " />   1981                             <input  class="fo rm_input"  type="text " name="ev ent_tags"  value="{$s EventTags} " />
1982                    </td >   1982                    </td >
1983           </ tr>   1983           </ tr>
1984           <t r class="v c">   1984           <t r class="v c">
1985                    <td  class="for m_label">{ $sDescript ionC}:</td >   1985                    <td  class="for m_label">{ $sDescript ionC}:</td >
1986                    <td  class="for m_value">   1986                    <td  class="for m_value">
1987                             <div c lass="edit _error" st yle="displ ay:{$sDsty le}">   1987                             <div c lass="edit _error" st yle="displ ay:{$sDsty le}">
1988                                      {$sDmsg}   1988                                      {$sDmsg}
1989                             </div>   1989                             </div>
1990                             <texta rea class= "classfied sTextArea"  name="eve nt_desc" i d="event_d esc_id" st yle="width :700px;hei ght:400px; ">{$sEvent Desc}</tex tarea>   1990                             <texta rea class= "classfied sTextArea"  name="eve nt_desc" i d="event_d esc_id" st yle="width :700px;hei ght:400px; ">{$sEvent Desc}</tex tarea>
1991                    </td >   1991                    </td >
1992           </ tr>   1992           </ tr>
1993           {$ sStatusMes s}   1993           {$ sStatusMes s}
1994           <t r class="v c">   1994           <t r class="v c">
1995                    <td  class="for m_label">{ $sCountryC }:</td>   1995                    <td  class="for m_label">{ $sCountryC }:</td>
1996                    <td  class="for m_value">   1996                    <td  class="for m_value">
1997                             <selec t class="f orm_select " name="ev ent_countr y" id="eve nt_country _id" oncha nge="javas cript: cha ngeFlag(th is.value); ">   1997                             <selec t class="f orm_select " name="ev ent_countr y" id="eve nt_country _id" oncha nge="javas cript: cha ngeFlag(th is.value); ">
1998                                      {$sCount riesOption s}   1998                                      {$sCount riesOption s}
1999                             </sele ct>   1999                             </sele ct>
2000                             <img i d="flagIma geId" src= "{$sSitySr c}.gif" al t="flag" / >   2000                             <img i d="flagIma geId" src= "{$sSitySr c}.gif" al t="flag" / >
2001                    </td >   2001                    </td >
2002           </ tr>   2002           </ tr>
2003           <t r class="v c">   2003           <t r class="v c">
2004                    <td  class="for m_label">{ $sCityC}:< /td>   2004                    <td  class="for m_label">{ $sCityC}:< /td>
2005                    <td  align="lef t">   2005                    <td  align="lef t">
2006                             <div c lass="edit _error" st yle="displ ay:{$sCsty le}">   2006                             <div c lass="edit _error" st yle="displ ay:{$sCsty le}">
2007                                      {$sCmsg}   2007                                      {$sCmsg}
2008                             </div>   2008                             </div>
2009                             <input  type="tex t" class=" form_input " name="ev ent_city"  id="event_ city_id" v alue="{$sE ventCity}"  />   2009                             <input  type="tex t" class=" form_input " name="ev ent_city"  id="event_ city_id" v alue="{$sE ventCity}"  />
2010                    </td >   2010                    </td >
2011           </ tr>   2011           </ tr>
2012           <t r class="v c">   2012           <t r class="v c">
2013                    <td  class="for m_label">{ $sPlaceC}: </td>   2013                    <td  class="for m_label">{ $sPlaceC}: </td>
2014                    <td  class="for m_value">   2014                    <td  class="for m_value">
2015                             <div c lass="edit _error" st yle="displ ay:{$sPsty le}">   2015                             <div c lass="edit _error" st yle="displ ay:{$sPsty le}">
2016                                      {$sPmsg}   2016                                      {$sPmsg}
2017                             </div>   2017                             </div>
2018                             <input  type="tex t" class=" form_input " name="ev ent_place"  id="event _place_id"  value="{$ sEventPlac e}" />   2018                             <input  type="tex t" class=" form_input " name="ev ent_place"  id="event _place_id"  value="{$ sEventPlac e}" />
2019                    </td >   2019                    </td >
2020           </ tr>   2020           </ tr>
2021           <t r class="v c">   2021           <t r class="v c">
2022                    <td  class="for m_label">{ $sVenuePho toC}:</td>   2022                    <td  class="for m_label">{ $sVenuePho toC}:</td>
2023                    <td  class="for m_value">   2023                    <td  class="for m_value">
2024                             <input  type="fil e" class=" form_file"  name="eve nt_photo"  id="event_ photo_id"  />   2024                             <input  type="fil e" class=" form_file"  name="eve nt_photo"  id="event_ photo_id"  />
2025                    </td >   2025                    </td >
2026           </ tr>   2026           </ tr>
2027           <t r class="v c">   2027           <t r class="v c">
2028                    <td  class="for m_label">{ $sEventSta rtC}:</td>   2028                    <td  class="for m_label">{ $sEventSta rtC}:</td>
2029                    <td  class="for m_value">   2029                    <td  class="for m_value">
2030                             <div c lass="edit _error" st yle="displ ay:{$sESst yle}">   2030                             <div c lass="edit _error" st yle="displ ay:{$sESst yle}">
2031                                      {$sESmsg }   2031                                      {$sESmsg }
2032                             </div>   2032                             </div>
2033                             <input  type="tex t" class=" form_input _date" nam e="event_s tart" id=" event_star t_id" valu e="{$sEven tStart}" r eadonly="r eadonly" / >   2033                             <input  type="tex t" class=" form_input _date" nam e="event_s tart" id=" event_star t_id" valu e="{$sEven tStart}" r eadonly="r eadonly" / >
2034                             <input  type="but ton" id="s tart_choos e_id" valu e="{$sChoo seC}" />   2034                             <input  type="but ton" id="s tart_choos e_id" valu e="{$sChoo seC}" />
2035                             <input  type="but ton" id="s tart_clear _id" onCli ck="docume nt.getElem entById('e vent_start _id').valu e = ''; "  value="{$s ClearC}" / >   2035                             <input  type="but ton" id="s tart_clear _id" onCli ck="docume nt.getElem entById('e vent_start _id').valu e = ''; "  value="{$s ClearC}" / >
2036                    </td >   2036                    </td >
2037           </ tr>   2037           </ tr>
2038           {$ sAdminSale sPart}   2038           {$ sAdminSale sPart}
2039           <t r class="v c">   2039           <t r class="v c">
2040                    <td  class="for m_colspan"  colspan=" 2">   2040                    <td  class="for m_colspan"  colspan=" 2">
2041                             <input  type="hid den" name= "action" v alue="{$sA NEventActi on}" />   2041                             <input  type="hid den" name= "action" v alue="{$sA NEventActi on}" />
2042                             {$sEdi tedIdEleme nt}   2042                             {$sEdi tedIdEleme nt}
2043                             <input  type="sub mit" class ="form_sub mit" name= "{$sPostAc tion}" val ue="{$sPos tEventC}"   2043                             <input  type="sub mit" class ="form_sub mit" name= "{$sPostAc tion}" val ue="{$sPos tEventC}"
2044                               styl e="vertica l-align: m iddle;marg in-top:10p x;" />   2044                               styl e="vertica l-align: m iddle;marg in-top:10p x;" />
2045                    </td >   2045                    </td >
2046           </ tr>   2046           </ tr>
2047   </table>   2047   </table>
2048   </form>   2048   </form>
2049   <!-- Loadi ng Calenda r JavaScri pt files - ->   2049   <!-- Loadi ng Calenda r JavaScri pt files - ->
2050       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_src/ utils.js"> </script>   2050       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_src/ utils.js"> </script>
2051       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_src/ calendar.j s"></scrip t>   2051       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_src/ calendar.j s"></scrip t>
2052       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_src/ calendar-s etup.js">< /script>   2052       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_src/ calendar-s etup.js">< /script>
2053     2053  
2054   <!-- Loadi ng languag e definiti on file -- >   2054   <!-- Loadi ng languag e definiti on file -- >
2055       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_lang /calendar- en.js"></s cript>   2055       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ca lendar/cal endar_lang /calendar- en.js"></s cript>
2056     2056  
2057   <script ty pe="text/j avascript" >   2057   <script ty pe="text/j avascript" >
2058   //<![CDATA [   2058   //<![CDATA [
2059           {$ sZapatecCa lendar}   2059           {$ sZapatecCa lendar}
2060   //]]>   2060   //]]>
2061   onload=Aut oSelectFla g();   2061   onload=Aut oSelectFla g();
2062   </script>   2062   </script>
2063   EOF;   2063   EOF;
2064     2064  
2065                    retu rn DesignB oxContent(  $sAddNewE ventC, $sR etHtml, $o TemplConfi g -> PageS DatingNewE vent_db_nu m );   2065                    retu rn DesignB oxContent(  $sAddNewE ventC, $sR etHtml, $o TemplConfi g -> PageS DatingNewE vent_db_nu m );
2066           }   2066           }
2067     2067  
2068           fu nction Sho wSearchRes ult() {   2068           fu nction Sho wSearchRes ult() {
2069                    $sRe tHtml = '' ;   2069                    $sRe tHtml = '' ;
2070                    $sSe archedTag  = process_ db_input(  $_REQUEST[ 'tagKey']  );   2070                    $sSe archedTag  = process_ db_input(  $_REQUEST[ 'tagKey']  );
2071                    //$i MemberID =  $_REQUEST ['ownerID' ];   2071                    //$i MemberID =  $_REQUEST ['ownerID' ];
2072                    glob al $site;   2072                    glob al $site;
2073                    glob al $aPreVa lues;   2073                    glob al $aPreVa lues;
2074                    glob al $tmpl;   2074                    glob al $tmpl;
2075                    glob al $dir;   2075                    glob al $dir;
2076     2076  
2077                    $dat e_format_p hp = getPa ram('php_d ate_format ');   2077                    $dat e_format_p hp = getPa ram('php_d ate_format ');
2078                    $sTa gsC = _t(' _Tags');   2078                    $sTa gsC = _t(' _Tags');
2079                    $sTa gC = _t('_ Tag');   2079                    $sTa gC = _t('_ Tag');
2080                    $sSh owInfoC =  _t('_Show  info');   2080                    $sSh owInfoC =  _t('_Show  info');
2081                    $sPa rticipants C = _t('_P articipant s');   2081                    $sPa rticipants C = _t('_P articipant s');
2082                    $sSt atusMessag eC = _t('_ Status mes sage');   2082                    $sSt atusMessag eC = _t('_ Status mes sage');
2083                    $sDa teC = _t(' _Date');   2083                    $sDa teC = _t(' _Date');
2084                    $sPl aceC = _t( '_Place');   2084                    $sPl aceC = _t( '_Place');
2085                    $sDe scriptionC  = _t('_De scription' );   2085                    $sDe scriptionC  = _t('_De scription' );
2086                    $sTi tleC = _t( '_Title');   2086                    $sTi tleC = _t( '_Title');
2087                    $sAc tionsC = _ t('_Action s');   2087                    $sAc tionsC = _ t('_Action s');
2088                    $sLi stOfPartic ipantsC =  _t('_List' ).' '._t(' _of').' '. _t('_Parti cipants');   2088                    $sLi stOfPartic ipantsC =  _t('_List' ).' '._t(' _of').' '. _t('_Parti cipants');
2089     2089  
2090                    $sSp acerName =  $this ->  sSpacerPat h;   2090                    $sSp acerName =  $this ->  sSpacerPat h;
2091     2091  
2092                    //$s CategoryAd don = ($iC ategoryID> 0) ? "AND  `BlogPosts `.`Categor yID` = {$i CategoryID }" : '';   2092                    //$s CategoryAd don = ($iC ategoryID> 0) ? "AND  `BlogPosts `.`Categor yID` = {$i CategoryID }" : '';
2093                    $sBl ogPosts =  '';   2093                    $sBl ogPosts =  '';
2094                    $sEv entSQL = " SELECT * F ROM `SDati ngEvents`" ;   2094                    $sEv entSQL = " SELECT * F ROM `SDati ngEvents`" ;
2095                    $vBl ogPosts =  db_res( $s EventSQL ) ;   2095                    $vBl ogPosts =  db_res( $s EventSQL ) ;
2096                    whil e ( $aResS QL = mysql _fetch_ass oc($vBlogP osts) ) {   2096                    whil e ( $aResS QL = mysql _fetch_ass oc($vBlogP osts) ) {
2097                             $sDate Time = dat e( $date_f ormat_php,  strtotime ( $aResSQL ['EventSta rt'] ) );   2097                             $sDate Time = dat e( $date_f ormat_php,  strtotime ( $aResSQL ['EventSta rt'] ) );
2098     2098  
2099                             $sCoun try = ($aR esSQL['Cou ntry']!='' ) ? _t($aP reValues[' Country'][ $aResSQL[' Country']] ['LKey'])  : '';   2099                             $sCoun try = ($aR esSQL['Cou ntry']!='' ) ? _t($aP reValues[' Country'][ $aResSQL[' Country']] ['LKey'])  : '';
2100                             $sCity  = ($aResS QL['City'] !='') ? ',  '.process _line_outp ut($aResSQ L['City'])  : '';   2100                             $sCity  = ($aResS QL['City'] !='') ? ',  '.process _line_outp ut($aResSQ L['City'])  : '';
2101                             $sPlac e = ($aRes SQL['Place ']!='') ?  ', '.proce ss_line_ou tput($aRes SQL['Place ']) : '';   2101                             $sPlac e = ($aRes SQL['Place ']!='') ?  ', '.proce ss_line_ou tput($aRes SQL['Place ']) : '';
2102                             $sDesc ription =  /*process_ text_withl inks_outpu t*/($aResS QL['Descri ption']);   2102                             $sDesc ription =  /*process_ text_withl inks_outpu t*/($aResS QL['Descri ption']);
2103     2103  
2104                             $sImgE L = ( strl en(trim($a ResSQL['Ph otoFilenam e'])) && f ile_exists ($dir['sda tingImage' ] . $aResS QL['PhotoF ilename'])  )   2104                             $sImgE L = ( strl en(trim($a ResSQL['Ph otoFilenam e'])) && f ile_exists ($dir['sda tingImage' ] . $aResS QL['PhotoF ilename'])  )
2105                                      ? "<img  class=\"ph oto1\" alt =\"\" styl e=\"width: {$this->iT humbSize}p x;height:{ $this->iTh umbSize}px ;backgroun d-image:ur l({$site[' sdatingIma ge']}thumb _{$aResSQL ['PhotoFil ename']}); \" src=\"{ $sSpacerNa me}\" />"   2105                                      ? "<img  class=\"ph oto1\" alt =\"\" styl e=\"width: {$this->iT humbSize}p x;height:{ $this->iTh umbSize}px ;backgroun d-image:ur l({$site[' sdatingIma ge']}thumb _{$aResSQL ['PhotoFil ename']}); \" src=\"{ $sSpacerNa me}\" />"
2106                                      : "<img  class=\"ph oto1\" alt =\"\" styl e=\"width: {$this->iT humbSize}p x;height:{ $this->iTh umbSize}px ;backgroun d-image:ur l({$site[' url']}temp lates/tmpl _{$tmpl}/{ $this->sPi cNotAvail} );\" src=\ "{$sSpacer Name}\" /> ";   2106                                      : "<img  class=\"ph oto1\" alt =\"\" styl e=\"width: {$this->iT humbSize}p x;height:{ $this->iTh umbSize}px ;backgroun d-image:ur l({$site[' url']}temp lates/tmpl _{$tmpl}/{ $this->sPi cNotAvail} );\" src=\ "{$sSpacer Name}\" /> ";
2107     2107  
2108                             $sTags Commas = $ aResSQL['T ags'];   2108                             $sTags Commas = $ aResSQL['T ags'];
2109                             $aTags  = split(' ,', $sTags Commas);   2109                             $aTags  = split(' ,', $sTags Commas);
2110     2110  
2111                             $sTags Hrefs = '' ;   2111                             $sTags Hrefs = '' ;
2112                             foreac h( $aTags  as $sTagKe y ) {   2112                             foreac h( $aTags  as $sTagKe y ) {
2113                                      $sTagHre fGen = $th is->genUrl (0, $sTagK ey, 'searc h');   2113                                      $sTagHre fGen = $th is->genUrl (0, $sTagK ey, 'searc h');
2114                                      $sTagsHr efs .= <<< EOF   2114                                      $sTagsHr efs .= <<< EOF
2115   <a href="{ $sTagHrefG en}" >{$sT agKey}</a> &nbsp;   2115   <a href="{ $sTagHrefG en}" >{$sT agKey}</a> &nbsp;
2116   EOF;   2116   EOF;
2117                             }   2117                             }
2118     2118  
2119                             $sGenU rl = $this ->genUrl($ aResSQL['I D'], $aRes SQL['Entry Uri']);   2119                             $sGenU rl = $this ->genUrl($ aResSQL['I D'], $aRes SQL['Entry Uri']);
2120     2120  
2121                             if (in _array($sS earchedTag ,$aTags))  {   2121                             if (in _array($sS earchedTag ,$aTags))  {
2122                                      $sBlogPo sts .= <<< EOF   2122                                      $sBlogPo sts .= <<< EOF
2123   <div class ="cls_resu lt_row">   2123   <div class ="cls_resu lt_row">
2124           <d iv class=" thumbnail_ block" sty le="float: left;">   2124           <d iv class=" thumbnail_ block" sty le="float: left;">
2125                    <a h ref="{$sGe nUrl}">   2125                    <a h ref="{$sGe nUrl}">
2126                             {$sImg EL}   2126                             {$sImg EL}
2127                    </a>   2127                    </a>
2128           </ div>   2128           </ div>
2129           <d iv class=" cls_res_in fo_nowidth " {$sDataS tyleWidth} >   2129           <d iv class=" cls_res_in fo_nowidth " {$sDataS tyleWidth} >
2130                    <div  class="cl s_res_info _p">   2130                    <div  class="cl s_res_info _p">
2131                             <a cla ss="action s" href="{ $sGenUrl}" >{$aResSQL ['Title']} </a>   2131                             <a cla ss="action s" href="{ $sGenUrl}" >{$aResSQL ['Title']} </a>
2132                    </di v>   2132                    </di v>
2133                    <div  class="cl s_res_info _p">   2133                    <div  class="cl s_res_info _p">
2134                             {$sTag sC}:&nbsp; {$sTagsHre fs}   2134                             {$sTag sC}:&nbsp; {$sTagsHre fs}
2135                    </di v>   2135                    </di v>
2136                    <!--  <div clas s="cls_res _info_p">   2136                    <!--  <div clas s="cls_res _info_p">
2137                             {$sSta tusMessage C}: <div c lass="clr3 ">{$sStatu sMessage}< /div>   2137                             {$sSta tusMessage C}: <div c lass="clr3 ">{$sStatu sMessage}< /div>
2138                    </di v> -->   2138                    </di v> -->
2139                    <div  class="cl s_res_info _p">   2139                    <div  class="cl s_res_info _p">
2140                             {$sDat eC}: <div  class="clr 3">{$sDate Time}</div >   2140                             {$sDat eC}: <div  class="clr 3">{$sDate Time}</div >
2141                    </di v>   2141                    </di v>
2142                    <div  class="cl s_res_info _p">   2142                    <div  class="cl s_res_info _p">
2143                             {$sPla ceC}: <div  class="cl r3">{$sCou ntry}{$sCi ty}{$sPlac e}</div>   2143                             {$sPla ceC}: <div  class="cl r3">{$sCou ntry}{$sCi ty}{$sPlac e}</div>
2144                    </di v>   2144                    </di v>
2145                    <div  class="cl s_res_info _p">   2145                    <div  class="cl s_res_info _p">
2146                             {$sDes criptionC} : <div cla ss="clr3"> {$sDescrip tion}</div >   2146                             {$sDes criptionC} : <div cla ss="clr3"> {$sDescrip tion}</div >
2147                    </di v>   2147                    </di v>
2148                    <div  class="cl s_res_info _p">   2148                    <div  class="cl s_res_info _p">
2149                             {$sVie wParticipa nts}   2149                             {$sVie wParticipa nts}
2150                    </di v>   2150                    </di v>
2151           </ div>   2151           </ div>
2152           <d iv class=" clear_both "></div>   2152           <d iv class=" clear_both "></div>
2153   </div>   2153   </div>
2154   EOF;   2154   EOF;
2155                             }   2155                             }
2156                    }   2156                    }
2157     2157  
2158                    $sBl ogPosts =  ($sBlogPos ts == '')  ? MsgBox(_ t( '_Sorry , nothing  found' ))  : $sBlogPo sts;   2158                    $sBl ogPosts =  ($sBlogPos ts == '')  ? MsgBox(_ t( '_Sorry , nothing  found' ))  : $sBlogPo sts;
2159                    retu rn $this-> DecorateAs Table($sTa gC.' - '.$ sSearchedT ag, $sBlog Posts);   2159                    retu rn $this-> DecorateAs Table($sTa gC.' - '.$ sSearchedT ag, $sBlog Posts);
2160           }   2160           }
2161     2161  
2162           /* *   2162           /* *
2163            *  SQL Get a ll Profile s data by  Profile Id   2163            *  SQL Get a ll Profile s data by  Profile Id
2164            *   2164            *
2165              * @param $ iProfileId   2165              * @param $ iProfileId
2166            *  @return S QL data   2166            *  @return S QL data
2167            * /   2167            * /
2168           fu nction Get ProfileDat a($iProfil eId) {   2168           fu nction Get ProfileDat a($iProfil eId) {
2169                    retu rn getProf ileInfo( $ iProfileId  );   2169                    retu rn getProf ileInfo( $ iProfileId  );
2170           }   2170           }
2171     2171  
2172           fu nction Get EventPictu re($iEvent ID, $sEven tPicName=' DOLPHIN')  {   2172           fu nction Get EventPictu re($iEvent ID, $sEven tPicName=' DOLPHIN')  {
2173                    glob al $dir;   2173                    glob al $dir;
2174                    glob al $site;   2174                    glob al $site;
2175                    glob al $tmpl;   2175                    glob al $tmpl;
2176                    $sSp acerName =  $this ->  sSpacerPat h;   2176                    $sSp acerName =  $this ->  sSpacerPat h;
2177                    if ( $sEventPic Name=='DOL PHIN') {   2177                    if ( $sEventPic Name=='DOL PHIN') {
2178                             $sRequ est = "SEL ECT `Photo Filename`, `Title` FR OM `SDatin gEvents` W HERE `ID`  = {$iEvent ID} LIMIT  1";   2178                             $sRequ est = "SEL ECT `Photo Filename`, `Title` FR OM `SDatin gEvents` W HERE `ID`  = {$iEvent ID} LIMIT  1";
2179                             $aResP ic = db_ar r($sReques t);   2179                             $aResP ic = db_ar r($sReques t);
2180                             $sEven tPicName =  $aResPic[ 'PhotoFile name'];   2180                             $sEven tPicName =  $aResPic[ 'PhotoFile name'];
2181                             $this- >iThumbSiz e = 45;   2181                             $this- >iThumbSiz e = 45;
2182                             $sAlt  = $aResPic ['Title'];   2182                             $sAlt  = $aResPic ['Title'];
2183                             $sType Pic = "ico n_";   2183                             $sType Pic = "ico n_";
2184                    } el se {   2184                    } el se {
2185                             $sType Pic = "thu mb_";   2185                             $sType Pic = "thu mb_";
2186                             $sAlt  = $sEventP icName;   2186                             $sAlt  = $sEventP icName;
2187                    }   2187                    }
2188     2188  
2189                    $sGe nUrl = $th is->genUrl ($iEventID , '', 'ent ry', true) ;   2189                    $sGe nUrl = $th is->genUrl ($iEventID , '', 'ent ry', true) ;
2190     2190  
2191                    $sEv entPicName  = ( strle n(trim($sE ventPicNam e)) && fil e_exists($ dir['sdati ngImage']  . $sEventP icName) )   2191                    $sEv entPicName  = ( strle n(trim($sE ventPicNam e)) && fil e_exists($ dir['sdati ngImage']  . $sEventP icName) )
2192                                      ? "<img  class=\"ph oto1\" sty le=\"width :{$this->i ThumbSize} px;height: {$this->iT humbSize}p x;backgrou nd-image:u rl({$site[ 'sdatingIm age']}{$sT ypePic}{$s EventPicNa me});\" sr c=\"{$sSpa cerName}\"  alt=\"{$s Alt}\" />"   2192                                      ? "<img  class=\"ph oto1\" sty le=\"width :{$this->i ThumbSize} px;height: {$this->iT humbSize}p x;backgrou nd-image:u rl({$site[ 'sdatingIm age']}{$sT ypePic}{$s EventPicNa me});\" sr c=\"{$sSpa cerName}\"  alt=\"{$s Alt}\" />"
2193                                      : "<img  class=\"ph oto1\" sty le=\"width :{$this->i ThumbSize} px;height: {$this->iT humbSize}p x;backgrou nd-image:u rl({$site[ 'url']}tem plates/tmp l_{$tmpl}/ {$this->sP icNotAvail });\" src= \"{$sSpace rName}\" a lt=\"{$sAl t}\" />";   2193                                      : "<img  class=\"ph oto1\" sty le=\"width :{$this->i ThumbSize} px;height: {$this->iT humbSize}p x;backgrou nd-image:u rl({$site[ 'url']}tem plates/tmp l_{$tmpl}/ {$this->sP icNotAvail });\" src= \"{$sSpace rName}\" a lt=\"{$sAl t}\" />";
2194                    $sEv entPic = < <<EOF   2194                    $sEv entPic = < <<EOF
2195   <div  clas s="thumbna il_block"  style="flo at:left;">   2195   <div  clas s="thumbna il_block"  style="flo at:left;">
2196           <a  href="{$s GenUrl}">   2196           <a  href="{$s GenUrl}">
2197                    {$sE ventPicNam e}   2197                    {$sE ventPicNam e}
2198           </ a>   2198           </ a>
2199   </div>   2199   </div>
2200   EOF;   2200   EOF;
2201                    retu rn $sEvent Pic;   2201                    retu rn $sEvent Pic;
2202           }   2202           }
2203     2203  
2204           fu nction gen Url($iEntr yId, $sEnt ryUri, $sT ype='entry ', $bForce  = false)  { //sType  - entry /  part/searc h   2204           fu nction gen Url($iEntr yId, $sEnt ryUri, $sT ype='entry ', $bForce  = false)  { //sType  - entry /  part/searc h
2205                    glob al $site;   2205                    glob al $site;
2206     2206  
2207                    if ( $bForce) {   2207                    if ( $bForce) {
2208                             $sEntr yUri = db_ value("SEL ECT `Entry Uri` FROM  `SDatingEv ents` WHER E `ID`='{$ iEntryId}'  LIMIT 1") ;   2208                             $sEntr yUri = db_ value("SEL ECT `Entry Uri` FROM  `SDatingEv ents` WHER E `ID`='{$ iEntryId}'  LIMIT 1") ;
2209                    }   2209                    }
2210     2210  
2211                    $sMa inUrl = $s ite['url'] ;   2211                    $sMa inUrl = $s ite['url'] ;
2212     2212  
2213                    if ( $this->bUs eFriendlyL inks) {   2213                    if ( $this->bUs eFriendlyL inks) {
2214                             $sUrl  = $sMainUr l."events/ {$sType}/{ $sEntryUri }";   2214                             $sUrl  = $sMainUr l."events/ {$sType}/{ $sEntryUri }";
2215                    } el se {   2215                    } el se {
2216                             $sUrl  = '';   2216                             $sUrl  = '';
2217                             switch  ($sType)  {   2217                             switch  ($sType)  {
2218                                      case 'en try':   2218                                      case 'en try':
2219                                               $sUrl = "{ $sMainUrl} events.php ?action=sh ow_info&ev ent_id={$i EntryId}";   2219                                               $sUrl = "{ $sMainUrl} events.php ?action=sh ow_info&ev ent_id={$i EntryId}";
2220                                               break;   2220                                               break;
2221                                      case 'pa rt':   2221                                      case 'pa rt':
2222                                               $sUrl = "{ $sMainUrl} events.php ?action=sh ow_part&ev ent_id={$i EntryId}";   2222                                               $sUrl = "{ $sMainUrl} events.php ?action=sh ow_part&ev ent_id={$i EntryId}";
2223                                               break;   2223                                               break;
2224                                      case 'se arch':   2224                                      case 'se arch':
2225                                               $sUrl = "{ $sMainUrl} events.php ?action=se arch_by_ta g&tagKey={ $sEntryUri }";   2225                                               $sUrl = "{ $sMainUrl} events.php ?action=se arch_by_ta g&tagKey={ $sEntryUri }";
2226                                               break;   2226                                               break;
2227                             }   2227                             }
2228                    }   2228                    }
2229                    retu rn $sUrl;   2229                    retu rn $sUrl;
2230           }   2230           }
2231     2231  
2232           fu nction Gen AnyBlockCo ntent($sOr der='last' , $iProfil eID=0, $sL imit="LIMI T 5" ) {   2232           fu nction Gen AnyBlockCo ntent($sOr der='last' , $iProfil eID=0, $sL imit="LIMI T 5" ) {
2233                    glob al $site;   2233                    glob al $site;
2234                    glob al $short_ date_forma t;   2234                    glob al $short_ date_forma t;
2235     2235  
2236                    $php _date_form at = getPa ram( 'php_ date_forma t' );   2236                    $php _date_form at = getPa ram( 'php_ date_forma t' );
2237                    $iBl ogLimitCha rs = (int) getParam(" max_blog_p review");   2237                    $iBl ogLimitCha rs = (int) getParam(" max_blog_p review");
2238                    $sCl ockIcon =  getTemplat eIcon( 'cl ock.gif' ) ;   2238                    $sCl ockIcon =  getTemplat eIcon( 'cl ock.gif' ) ;
2239     2239  
2240                    $sOr derS = '';   2240                    $sOr derS = '';
2241                    swit ch ($sOrde r) {   2241                    swit ch ($sOrde r) {
2242                             case ' last':   2242                             case ' last':
2243                             case ' latest':   2243                             case ' latest':
2244                                      $sOrderS  = "ORDER  BY `EventS tart` DESC ";   2244                                      $sOrderS  = "ORDER  BY `EventS tart` DESC ";
2245                                      break;   2245                                      break;
2246                             case ' rand':   2246                             case ' rand':
2247                                      $sOrderS  = "ORDER  BY RAND()" ;   2247                                      $sOrderS  = "ORDER  BY RAND()" ;
2248                                      break;   2248                                      break;
2249                             case ' first':   2249                             case ' first':
2250                                      $sOrderS  = "ORDER  BY `EventS tart` ASC" ;   2250                                      $sOrderS  = "ORDER  BY `EventS tart` ASC" ;
2251                                      break;   2251                                      break;
2252                    }   2252                    }
2253                    $sPr ofileS = ( $iProfileI D>0) ? "(` SDatingEve nts`.`Resp onsibleID`  = '{$iPro fileID}' O R `SDating Participan ts`.`IDMem ber` = '{$ iProfileID }')" : '1' ;   2253                    $sPr ofileS = ( $iProfileI D>0) ? "(` SDatingEve nts`.`Resp onsibleID`  = '{$iPro fileID}' O R `SDating Participan ts`.`IDMem ber` = '{$ iProfileID }')" : '1' ;
2254     2254  
2255                    $sQu ery = "   2255                    $sQu ery = "
2256                             SELECT  DISTINCT  `SDatingEv ents`. * ,  `Profiles `.`NickNam e` ,   2256                             SELECT  DISTINCT  `SDatingEv ents`. * ,  `Profiles `.`NickNam e` ,
2257                             UNIX_T IMESTAMP(  `SDatingEv ents`.`Eve ntStart` )  AS `DateT ime_f`    2257                             UNIX_T IMESTAMP(  `SDatingEv ents`.`Eve ntStart` )  AS `DateT ime_f` 
2258                             FROM ` SDatingEve nts`    2258                             FROM ` SDatingEve nts` 
2259                              INN E R   JOIN   `Profiles`   ON   `Profiles` .`ID`   =   `SDatingEv ents`.`Res ponsibleID `     2259                              L E FT   JOIN   `Profiles`   ON   `Profiles` .`ID`   =   `SDatingEv ents`.`Res ponsibleID `  
2260                             LEFT J OIN `SDati ngParticip ants` ON ` SDatingPar ticipants` .`IDEvent`  = `SDatin gEvents`.` ID`    2260                             LEFT J OIN `SDati ngParticip ants` ON ` SDatingPar ticipants` .`IDEvent`  = `SDatin gEvents`.` ID` 
2261                             WHERE  {$sProfile S}   2261                             WHERE  {$sProfile S}
2262                             AND `S DatingEven ts`.`Statu s` = 'Acti ve'   2262                             AND `S DatingEven ts`.`Statu s` = 'Acti ve'
2263                             {$sOrd erS}   2263                             {$sOrd erS}
2264                             {$sLim it}   2264                             {$sLim it}
2265                    ";   2265                    ";
2266     2266  
2267                    $rBl ogs = db_r es( $sQuer y );   2267                    $rBl ogs = db_r es( $sQuer y );
2268     2268  
2269                    if(  !mysql_num _rows( $rB logs ) )   2269                    if(  !mysql_num _rows( $rB logs ) )
2270                             return  MsgBox(_t ('_Sorry,  nothing fo und'));   2270                             return  MsgBox(_t ('_Sorry,  nothing fo und'));
2271     2271  
2272                    $sBl ocks = '';   2272                    $sBl ocks = '';
2273                    whil e( $aBlog  = mysql_fe tch_assoc(  $rBlogs )  ) {   2273                    whil e( $aBlog  = mysql_fe tch_assoc(  $rBlogs )  ) {
2274                             $sPic  = $this->G etEventPic ture($aBlo g['ID']);   2274                             $sPic  = $this->G etEventPic ture($aBlo g['ID']);
2275     2275  
2276                             $sGenU rl = $this ->genUrl($ aBlog['ID' ], $aBlog[ 'EntryUri' ]);   2276                             $sGenU rl = $this ->genUrl($ aBlog['ID' ], $aBlog[ 'EntryUri' ]);
2277     2277  
2278                             $sLink More = '';   2278                             $sLink More = '';
2279                             if( st rlen( $aBl og['Descri ption']) >  $iBlogLim itChars )    2279                             if( st rlen( $aBl og['Descri ption']) >  $iBlogLim itChars ) 
2280                                      $sLinkMo re = "...  <a href=\" {$sGenUrl} \">"._t('_ Read more' )."</a>";   2280                                      $sLinkMo re = "...  <a href=\" {$sGenUrl} \">"._t('_ Read more' )."</a>";
2281     2281  
2282                             $sBlog Snippet =  mb_substr(  strip_tag s( $aBlog[ 'Descripti on'] ), 0,  $iBlogLim itChars )  . $sLinkMo re;   2282                             $sBlog Snippet =  mb_substr(  strip_tag s( $aBlog[ 'Descripti on'] ), 0,  $iBlogLim itChars )  . $sLinkMo re;
2283                             //$sDa taTimeForm atted = da te( $php_d ate_format , $aBlog[' DateTime_f '] );   2283                             //$sDa taTimeForm atted = da te( $php_d ate_format , $aBlog[' DateTime_f '] );
2284                             $sData TimeFormat ted = Loca ledDataTim e($aBlog[' DateTime_f ']);   2284                             $sData TimeFormat ted = Loca ledDataTim e($aBlog[' DateTime_f ']);
2285                             $sBloc ks .= <<<E OF   2285                             $sBloc ks .= <<<E OF
2286   <div class ="blog_blo ck">   2286   <div class ="blog_blo ck">
2287           <d iv class=" icon_block ">   2287           <d iv class=" icon_block ">
2288                    {$sP ic}   2288                    {$sP ic}
2289           </ div>   2289           </ div>
2290           <d iv class=" blog_wrapp er_n">   2290           <d iv class=" blog_wrapp er_n">
2291                    <div  class="bl og_subject _n">   2291                    <div  class="bl og_subject _n">
2292                             <a hre f="{$sGenU rl}" class ="bottom_t ext">   2292                             <a hre f="{$sGenU rl}" class ="bottom_t ext">
2293                                      {$aBlog[ 'Title']}   2293                                      {$aBlog[ 'Title']}
2294                             </a>   2294                             </a>
2295                    </di v>   2295                    </di v>
2296                    <div  class="bl ogInfo">   2296                    <div  class="bl ogInfo">
2297                             <span> <img src=" {$sClockIc on}" alt=" " />{$sDat aTimeForma tted} </sp an>   2297                             <span> <img src=" {$sClockIc on}" alt=" " />{$sDat aTimeForma tted} </sp an>
2298                    </di v>   2298                    </di v>
2299                    <div  class="bl ogSnippet" >   2299                    <div  class="bl ogSnippet" >
2300                             {$sBlo gSnippet}   2300                             {$sBlo gSnippet}
2301                    </di v>   2301                    </di v>
2302           </ div>   2302           </ div>
2303   </div>   2303   </div>
2304   <div class ="clear_bo th"></div>   2304   <div class ="clear_bo th"></div>
2305   EOF;   2305   EOF;
2306                    }   2306                    }
2307     2307  
2308                    if ( $sBlocks = = '') $sBl ocks = Msg Box(_t('_S orry, noth ing found' ));   2308                    if ( $sBlocks = = '') $sBl ocks = Msg Box(_t('_S orry, noth ing found' ));
2309                    retu rn $sBlock s;   2309                    retu rn $sBlock s;
2310           }   2310           }
2311     2311  
2312           fu nction pro cess_html_ db_input(  $sText ) {   2312           fu nction pro cess_html_ db_input(  $sText ) {
2313                    retu rn addslas hes( clear _xss( trim ( process_ pass_data(  $sText )) ));   2313                    retu rn addslas hes( clear _xss( trim ( process_ pass_data(  $sText )) ));
2314           }   2314           }
2315   }   2315   }
2316     2316  
2317   ?>   2317   ?>