18. File Comparison Report

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

18.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.2\inc\classes BxDolEvents.php Mon Jun 16 05:18:34 2008 UTC
2 Dolphin-v.6.1.3\inc\classes BxDolEvents.php Wed Jul 16 09:51:19 2008 UTC

18.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 74 4480
Changed 41 132
Inserted 5 9
Removed 27 158

18.3 Comparison options

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

18.4 Active regular expressions

No regular expressions were active.

18.5 Comparison detail

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