function showBlockEvents($sCaption) { global $site; global $short_date_format; $php_date_format = getParam('php_date_format'); //$iBlogLimitChars = (int)getParam("max_classified_preview"); $iBlogLimitChars = (int) getParam("max_blog_preview"); $ID = $this->_iProfileID; $sQuery = "\r\n\t\t\tSELECT DISTINCT `SDatingEvents`. * , `Profiles`.`NickName`,\r\n\t\t\tUNIX_TIMESTAMP( `SDatingEvents`.`EventStart` ) as `DateTime_f`\r\n\t\t\tFROM `SDatingEvents` \r\n\t\t\tLEFT JOIN `Profiles` ON `Profiles`.`ID` = `SDatingEvents`.`ResponsibleID` \r\n\t\t\tWHERE `SDatingEvents`.`ResponsibleID` = {$ID} AND\r\n\t\t\t`SDatingEvents`.`Status` = 'Active'\r\n\t\t\tORDER BY `EventStart` DESC \r\n\t\t\tLIMIT 5\r\n\t\t"; $rBlogs = db_res($sQuery); if (!mysql_num_rows($rBlogs)) { return ''; } ob_start(); ?> <div id="container_events"> <?php $oEvents = new BxDolEvents(); while ($aBlog = mysql_fetch_assoc($rBlogs)) { $sPic = $oEvents->GetEventPicture($aBlog['ID']); $sLinkMore = ''; if (strlen($aBlog['Description']) > $iBlogLimitChars) { //$sLinkMore = "... <a href=\"".$site['url']."blog.php?owner=".$ID."&show=blog&blogID=".$aBlog['PostID']."\">"._t('_Read more')."</a>"; $sLinkMore = "... <a href=\"" . $site['url'] . "events.php?action=show_info&event_id=" . $aBlog['ID'] . "\">" . _t('_Read more') . "</a>"; } $sBlogSnippet = mb_substr(strip_tags($aBlog['Description']), 0, $iBlogLimitChars) . $sLinkMore; ?> <div class="thumbnail_block" style="float:left;width:45px;height:45px;margin-right:10px;margin-top:10px;position:relative;"> <?php echo $sPic; ?> </div> <div class="blog_wrapper" style="width:290px;float:left;position:relative;"> <div class="blogHead1"> <?php echo '<a href="' . $site['url'] . 'events.php?action=show_info&event_id=' . $aBlog['ID'] . '" class="bottom_text">'; ?> <?php echo $aBlog['Title']; ?> </a> </div> <div class="blogInfo"> <span><img src="<?php echo getTemplateIcon('clock.gif'); ?> " /><?php echo date($php_date_format, $aBlog['DateTime_f']) . ' '; ?> </span> </div> <div class="blogSnippet"> <?php echo $sBlogSnippet; ?> </div> </div> <div class="clear_both"></div> <?php } ?> </div> <?php $ret = ob_get_clean(); $show_hide = $this->genShowHideItem('container_events'); echo DesignBoxContent(_t($sCaption), $ret, 1, $show_hide); }
function PageCompEvents($sCaption, &$sShowHide) { global $site; global $short_date_format; $php_date_format = getParam('php_date_format'); //$iBlogLimitChars = (int)getParam("max_classified_preview"); $iBlogLimitChars = (int) getParam("max_blog_preview"); global $p_arr; $ID = $p_arr['ID']; if ($ID > 0) { /*$sQuery = " SELECT DISTINCT `SDatingEvents`. * , `Profiles`.`NickName`, UNIX_TIMESTAMP( `SDatingEvents`.`EventStart` ) as `DateTime_f` FROM `SDatingEvents` LEFT JOIN `Profiles` ON `Profiles`.`ID` = `SDatingEvents`.`ResponsibleID` WHERE `SDatingEvents`.`ResponsibleID` = {$ID} AND `SDatingEvents`.`Status` = 'Active' ORDER BY `EventStart` DESC LIMIT 5 ";*/ $sQuery = "\r\n\t\t\t\tSELECT DISTINCT `SDatingEvents`. * , `Profiles`.`NickName` ,\r\n\t\t\t\tUNIX_TIMESTAMP( `SDatingEvents`.`EventStart` ) AS `DateTime_f` \r\n\t\t\t\tFROM `SDatingEvents` \r\n\t\t\t\tINNER JOIN `Profiles` ON `Profiles`.`ID` = `SDatingEvents`.`ResponsibleID` \r\n\t\t\t\tINNER JOIN `SDatingParticipants` ON `SDatingParticipants`.`IDEvent` = `SDatingEvents`.`ID` \r\n\t\t\t\tWHERE (\r\n\t\t\t\t`SDatingEvents`.`ResponsibleID` = '{$ID}'\r\n\t\t\t\tOR `SDatingParticipants`.`IDMember` = '{$ID}'\r\n\t\t\t\t)\r\n\t\t\t\tAND `SDatingEvents`.`Status` = 'Active'\r\n\t\t\t\tORDER BY `EventStart` DESC \r\n\t\t\t\tLIMIT 5\r\n\t\t\t"; $rBlogs = db_res($sQuery); if (!mysql_num_rows($rBlogs)) { return ''; } ob_start(); ?> <div id="container_events"> <?php $oEvents = new BxDolEvents(); while ($aBlog = mysql_fetch_assoc($rBlogs)) { $sPic = $oEvents->GetEventPicture($aBlog['ID']); $sLinkMore = ''; if (strlen($aBlog['Description']) > $iBlogLimitChars) { //$sLinkMore = "... <a href=\"".$site['url']."blog.php?owner=".$ID."&show=blog&blogID=".$aBlog['PostID']."\">"._t('_Read more')."</a>"; $sLinkMore = "... <a href=\"" . $site['url'] . "events.php?action=show_info&event_id=" . $aBlog['ID'] . "\">" . _t('_Read more') . "</a>"; } $sBlogSnippet = substr(strip_tags($aBlog['Description']), 0, $iBlogLimitChars) . $sLinkMore; ?> <div class="icon_block"> <?php echo $sPic; ?> </div> <div class="blog_wrapper_n"> <div class="blog_subject_n"> <?php echo '<a href="' . $site['url'] . 'events.php?action=show_info&event_id=' . $aBlog['ID'] . '" class="bottom_text">'; ?> <?php echo $aBlog['Title']; ?> </a> </div> <div class="blogInfo"> <span><img src="<?php echo getTemplateIcon('clock.gif'); ?> " /><?php echo date($php_date_format, $aBlog['DateTime_f']) . ' '; ?> </span> </div> <div class="blogSnippet"> <?php echo $sBlogSnippet; ?> </div> </div> <div class="clear_both"></div> <?php } ?> </div> <?php $ret = ob_get_clean(); $show_hide = genShowHideItem('container_events'); $sShowHide = $show_hide; return $ret; //echo DesignBoxContent( _t( $sCaption ), $ret, 1, $show_hide ); } else { return MsgBox(_t('_im_textNoCurrUser')); } }
function PageCompEventsContent($sCaption) { global $site; global $date_format; $php_date_format = getParam('php_date_format'); $mode = $_REQUEST['events_mode']; if ($mode != 'rand' and $mode != 'latest') { $mode = 'latest'; } $menu = '<div class="dbTopMenu">'; foreach (array('latest', 'rand') as $myMode) { switch ($myMode) { case 'latest': $OrderBy = '`EventStart` DESC'; $sTabTitle = _t('_Latest'); break; case 'rand': $OrderBy = 'RAND()'; $sTabTitle = _t('_Random'); break; } if ($mode == $myMode) { $sqlOrderBy = $OrderBy; $menu .= "\r\n\t\t\t<div class=\"active\">{$sTabTitle}</div>"; } else { $menu .= "\r\n\t\t\t<div class=\"notActive\">\r\n\t\t\t\t<a href=\"{$_SERVER['PHP_SELF']}?events_mode={$myMode}\" class=\"top_members_menu\" onclick=\"getHtmlData( 'show_events', this.href+'&show_only=events'); return false;\">{$sTabTitle}</a>\r\n\t\t\t</div>"; } } $menu .= ' <div class="clear_both"></div> </div>'; $aTotalNum = db_arr("\r\n\t\tSELECT\r\n\t\t\tCOUNT(*) FROM `SDatingEvents`\r\n\t\tWHERE\r\n\t\t\t`Status` = 'Active'\r\n\t\t"); $iTotalNum = $aTotalNum[0]; if ($iTotalNum) { //$iResPerPage = (int)getParam("max_events_on_home"); $iResPerPage = (int) getParam("max_blogs_on_home"); //$iResPerPage = 3; $iTotalPages = ceil($iTotalNum / $iResPerPage); $page = (int) $_REQUEST['events_page']; if ($page < 1 or $mode == 'rand') { $page = 1; } if ($page > $iTotalPages) { $page = $iTotalPages; } $sqlLimitFrom = ($page - 1) * $iResPerPage; //$iBlogLimitChars = (int)getParam("max_classified_preview"); $iBlogLimitChars = (int) getParam("max_blog_preview"); //$iBlogLimitChars = 50; $sBlogQuery = "\r\n\t\t\tSELECT DISTINCT `SDatingEvents`. * , `Profiles`.`NickName`,\r\n\t\t\tUNIX_TIMESTAMP( `SDatingEvents`.`EventStart` ) as `DateTime_f`,\r\n\t\t\tLEFT(`SDatingEvents`.`Description`, {$iBlogLimitChars}) as 'Description_f'\r\n\t\t\tFROM `SDatingEvents` \r\n\t\t\tLEFT JOIN `Profiles` ON `Profiles`.`ID` = `SDatingEvents`.`ResponsibleID` \r\n\t\t\tWHERE\r\n\t\t\t`SDatingEvents`.`Status` = 'Active'\r\n\t\t\tORDER BY {$sqlOrderBy}\r\n\t\t\tLIMIT {$sqlLimitFrom}, {$iResPerPage}\r\n\t\t"; $rBlog = db_res($sBlogQuery); $ret = ''; $oEvents = new BxDolEvents(); $ret .= '<div class="clear_both"></div>'; while ($arr = mysql_fetch_array($rBlog)) { $sPic = $oEvents->GetEventPicture($arr['ID']); $sLinkMore = ''; if (strlen($arr['Description']) == $iBlogLimitChars) { $sLinkMore = "... <a href=\"" . $site['url'] . "events.php?action=show_info&event_id=" . $arr['ID'] . "\">" . _t('_Read more') . "</a>"; } $ret .= ' <div class="icon_block"> ' . $sPic . ' </div> <div class="blog_wrapper_n"> <div class="blog_subject_n"> <a href="' . $site['url'] . 'events.php?action=show_info&event_id=' . $arr['ID'] . '" class="bottom_text">' . process_line_output($arr['Title']) . '</a> </div> <div class="blog_author">' . '<span>' . _t('_By Author', $arr['NickName'], $arr['NickName']) . '</span>' . '<span><img src="' . getTemplateIcon('clock.gif') . '" />' . date($php_date_format, $arr['DateTime_f']) . '</span>' . '</div> <div class="blog_text">' . strip_tags(process_html_output($arr['Description_f'])) . $sLinkMore . '</div> </div>'; } $ret .= '<div class="clear_both"></div>'; } else { $ret .= '<div class="no_result"><div>' . _t("_No events available") . '</div></div>'; } if ($iTotalPages > 1) { $ret .= ' <div class="dbBottomMenu">'; if ($page > 1) { $prevPage = $page - 1; $ret .= "\r\n\t\t\t\t<a href=\"{$_SERVER['PHP_SELF']}?events_mode={$mode}&events_page={$prevPage}\"\r\n\t\t\t\t class=\"backMembers\"\r\n\t\t\t\t onclick=\"getHtmlData( 'show_events', this.href+'&show_only=events'); return false;\">" . _t('_Back') . "</a>\r\n\t\t\t"; } if ($page < $iTotalPages) { $nextPage = $page + 1; $ret .= "\r\n\t\t\t\t<a href=\"{$_SERVER['PHP_SELF']}?events_mode={$mode}&events_page={$nextPage}\"\r\n\t\t\t\t class=\"moreMembers\"\r\n\t\t\t\t onclick=\"getHtmlData( 'show_events', this.href+'&show_only=events'); return false;\">" . _t('_Next') . "</a>\r\n\t\t\t"; } $ret .= ' <div class="clear_both"></div> </div>'; } return DesignBoxContent(_t($sCaption), $ret, 1, $menu); }