192. File Comparison Report

Produced on Mon May 12 13:05:04 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.

192.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\inc\classes BxDolEvents.php Thu Mar 6 09:13:34 2008 UTC
2 Dolphin-v.6.1.0\inc\classes BxDolEvents.php Sat Apr 26 08:19:14 2008 UTC

192.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 95 4220
Changed 58 252
Inserted 28 84
Removed 8 18

192.3 Comparison options

Whitespace
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

192.4 Active regular expressions

No regular expressions were active.

192.5 Comparison detail

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