public function index()
 {
     $this->view->page_title = t('Free Chat Room Dating');
     $this->view->meta_description = t('Find Your Match at The Best Free Online Dating Site with Free Chat Rooms, Single Chat Meet People');
     $this->view->meta_keywords = t('chat, speed dating, meet singles, dating, free dating, chat room, chat webcam');
     $this->view->h1_title = t('Welcome to <span class="pH3">Free Chat Room</span> on <span class="pH0">%site_name%</span>!');
     $this->view->chat_room = Url::clean((new SysVar())->parse(DbConfig::getSetting('chatApi')));
     $this->output();
 }
 public function index()
 {
     $this->view->page_title = t('Free Video Room, Live Speed Dating ChatRoulette');
     $this->view->meta_description = t('Free Live Speed Dating with the Chatroulette of %site_name%, Meet new people near you and make new friends, sex friends and free flirting, Free online dating site for singles without registration with Video Chat Rooms!');
     $this->view->meta_keywords = t('chat, chatroulette, sex friend, single, speed dating, meet singles, dating, free dating, chat room, chat webcam');
     $this->view->h1_title = t('Welcome to <span class="pH1">Speed Dating ChatRoulette</span> of <span class="pH0">%site_name%</span>!');
     $this->view->chatroulette = Url::clean((new SysVar())->parse(DbConfig::getSetting('chatrouletteApi')));
     $this->output();
 }
 public function carouselProfiles($iOffset = 0, $iLimit = 25)
 {
     $oUser = $this->oUserModel->getProfiles(SearchCoreModel::LATEST, $iOffset, $iLimit);
     if (empty($oUser)) {
         return;
     }
     echo '<script>$(function(){$("#foo").carouFredSel()});</script>
     <div class="transparent p1"><div class="img_carousel"><div id="foo">';
     foreach ($oUser as $oRow) {
         $sFirstName = $this->oStr->upperFirst($oRow->firstName);
         $sCity = $this->oStr->upperFirst($oRow->city);
         echo '<div class="carouselTooltip"><p><strong>';
         if (!UserCore::auth() && !AdminCore::auth()) {
             $aHttpParams = ['ref' => $this->oHttpRequest->currentController(), 'a' => 'carousel', 'u' => $oRow->username, 'f_n' => $sFirstName, 's' => $oRow->sex];
             echo t('Meet %0% on %site_name%!', '<a href="' . $this->oUser->getProfileLink($oRow->username) . '">' . $sFirstName . '</a>'), '</strong><br /><em>', t('I am a %0% and I am looking %1%.', $oRow->sex, $oRow->matchSex), '<br />', t('I from %0%, %1%.', t($oRow->country), $sCity), '</em></p><a rel="nofollow" href="', Uri::get('user', 'signup', 'step1', '?' . Url::httpBuildQuery($aHttpParams), false), '"><img src="', $this->getUserAvatar($oRow->username, $oRow->sex, 150, 'Members'), '" alt="', t('Meet %0% on %site_name%', $oRow->username), '" class="splash_avatar" /></a>';
         } else {
             echo t('Meet %0% on %site_name%!', $sFirstName), '</strong><br /><em>', t('I am a %0% and I am looking %1%.', $oRow->sex, $oRow->matchSex), '<br />', t('I from %0%, %1%.', t($oRow->country), $sCity), '</em></p><a href="', $this->oUser->getProfileLink($oRow->username), '"><img src="', $this->getUserAvatar($oRow->username, $oRow->sex, 150, 'Members'), '" alt="', t('Meet %0% on %site_name%', $oRow->username), '" class="splash_avatar" /></a>';
         }
         echo '</div>';
     }
     echo '</div><div class="clearfix"></div></div></div>';
 }
 /**
  * Get the Post Data.
  *
  * @return array
  */
 protected function getPostDatas()
 {
     $rRawPost = Stream::getInput();
     $aRawPost = explode('&', $rRawPost);
     $aPostData = array();
     foreach ($aRawPost as $sKeyVal) {
         $aKeyVal = explode('=', $sKeyVal);
         if (count($aKeyVal) == 2) {
             $aPostData[$aKeyVal[0]] = Url::encode($aKeyVal[1]);
         }
         unset($aKeyVal);
     }
     unset($aRawPost);
     return $aPostData;
 }
 public function parseJs($sContent)
 {
     if ($this->_bJavaCompiler) {
         file_put_contents($this->_sTmpFilePath, $sContent);
         $sJsMinified = exec("java -jar {$this->_sYuiCompressorPath} {$this->_sTmpFilePath} --type js --charset utf-8");
         unlink($this->_sTmpFilePath);
     } else {
         // If we can open connection to Google Closure
         // Google Closure has a max limit of 200KB POST size, and will break JS with eval-command
         // URL-encoded file contents
         $sContentEncoded = \PH7\Framework\Url\Url::encode($sContent);
         // Closure Host
         $sHost = 'closure-compiler.appspot.com';
         if (strlen($sContentEncoded) < 200000 && preg_match('/[^a-z]eval\\(/ism', $sContent) == 0 && ($rSocket = @pfsockopen($sHost, 80))) {
             // Working vars
             $sJsMinified = '';
             $sServiceUri = '/compile';
             $sVars = 'js_code=' . $sContentEncoded . '&compilation_level=SIMPLE_OPTIMIZATIONS&output_format=text&output_info=compiled_code';
             // Compose HTTP request header
             $sHeader = "Host: {$sHost}\r\n";
             $sHeader .= "User-Agent: PHP Script\r\n";
             $sHeader .= "Content-Type: application/x-www-form-urlencoded\r\n";
             $sHeader .= "Content-Length: " . strlen($sVars) . "\r\n";
             $sHeader .= "Connection: close\r\n\r\n";
             fputs($rSocket, "POST {$sServiceUri}  HTTP/1.0\r\n");
             fputs($rSocket, $sHeader . $sVars);
             while (!feof($rSocket)) {
                 $sJsMinified .= fgets($rSocket);
             }
             fclose($rSocket);
             $sJsMinified = preg_replace('/^HTTP.+[\\r\\n]{2}/ims', '', $sJsMinified);
         } else {
             // remove comments
             //$sContent = preg_replace("/((?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/)|(?:\/\/.*))/", "", $sContent);
             // remove tabs, spaces, etc. */
             $sContent = str_replace(array("\r", "\t", '  ', '    ', '     '), '', $sContent);
             // remove other spaces before/after ) */
             $sContent = preg_replace(array('(( )+\\))', '(\\)( )+)'), ')', $sContent);
             /**
              * Inclusion of JSMin
              */
             $sJsMinified = Minify\Js::minify($sContent);
         }
     }
     return $sJsMinified;
 }
 /**
  * For download file.
  *
  * @param string $sFile file in download.
  * @param string $sName if file in download.
  * @param string $sMimeType Optional, default value is NULL.
  * @return void
  */
 public function download($sFile, $sName, $sMimeType = null)
 {
     /*
      This function takes a path to a file to output ($sFile),
      the filename that the browser will see ($sName) and
      the MIME type of the file ($sMimeType, optional).
     
      If you want to do something on download abort/finish,
      register_shutdown_function('function_name');
     */
     //if (!is_readable($sFile)) exit('File not found or inaccessible!');
     $sName = \PH7\Framework\Url\Url::decode($sName);
     // Clean the name file
     /* Figure out the MIME type (if not specified) */
     if (empty($sMimeType)) {
         $sFileExtension = $this->getFileExt($sFile);
         $mGetMimeType = $this->getMimeType($sFileExtension);
         if (!empty($mGetMimeType)) {
             $sMimeType = $mGetMimeType;
         } else {
             $sMimeType = 'application/force-download';
         }
     }
     @ob_end_clean();
     // Turn off output buffering to decrease CPU usage
     (new \PH7\Framework\Navigation\Browser())->nocache();
     // No cache
     $sPrefix = \PH7\Framework\Registry\Registry::getInstance()->site_name . '_';
     // the prefix
     header('Content-Type: ' . $sMimeType);
     header('Content-Disposition: attachment; filename=' . \PH7\Framework\Parse\Url::clean($sPrefix) . $sName);
     header('Content-Transfer-Encoding: binary');
     header('Accept-Ranges: bytes');
     header('Content-Length: ' . $this->size($sFile));
     readfile($sFile);
 }
 * @author         Pierre-Henry Soria <*****@*****.**>
 * @copyright      (c) 2012-2016, Pierre-Henry Soria. All Rights Reserved.
 * @license        GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
 * @package        PH7 / App / System / Core / Asset / Ajax / Popup
 */
namespace PH7;

defined('PH7') or exit('Restricted access');
use PH7\Framework\Mvc\Request\Http, PH7\Framework\Layout\Html\Design, PH7\Framework\Url\Url, PH7\Framework\Mvc\Router\Uri, PH7\Framework\Url\Header;
if (AdminCore::auth() || UserCore::auth() || AffiliateCore::auth()) {
    $oHttpRequest = new Http();
    $oDesign = new Design();
    $oDesign->htmlHeader();
    $oDesign->usefulHtmlHeader();
    echo '<div class="center">';
    if ($oHttpRequest->getExists(array('mod', 'ctrl', 'act', 'id'))) {
        $sLabel = $oHttpRequest->get('label');
        $sMod = $oHttpRequest->get('mod');
        $sCtrl = $oHttpRequest->get('ctrl');
        $sAct = $oHttpRequest->get('act');
        $mId = $oHttpRequest->get('id');
        ConfirmCoreForm::display(array('label' => Url::decode($sLabel), 'module' => $sMod, 'controller' => $sCtrl, 'action' => $sAct, 'id' => $mId));
    } else {
        echo '<p>' . t('Bad parameters in the URL!') . '</p>';
    }
    echo '</div>';
    $oDesign->htmlFooter();
    unset($oHttpRequest, $oDesign);
} else {
    Header::redirect(Uri::get('user', 'signup', 'step1'), t('You must be registered to report an abuse.'));
}
 /**
  * The HTML code for displaying the QR Code.
  *
  * @return void
  */
 public function display()
 {
     echo '<p class="center"><img src="' . Url::clean($this->get()) . '" alt="QR Code" /></p>';
 }
Beispiel #9
0
 /**
  * Generate a Report Link.
  *
  * @param integer $iId
  * @param string $sUsername
  * @param string $sFirstName
  * @param string $sSex
  * @internal We do not use \PH7\Framework\Url\Url::httpBuildQuery() method for the first condition otherwise the URL is distorted and it does not work.
  * @return void
  */
 public function report($iId, $sUsername, $sFirstName, $sSex)
 {
     $sReportLink = \PH7\UserCore::auth() ? Uri::get('report', 'main', 'abuse', '?spammer=' . $iId . '&amp;url=' . $this->oHttpRequest->currentUrl() . '&amp;type=' . Registry::getInstance()->module, false) . '" data-popup="block-page' : Uri::get('user', 'signup', 'step1', '?' . Url::httpBuildQuery(array('msg' => t('You must register to report this person.'), 'ref' => 'profile', 'a' => 'report', 'u' => $sUsername, 'f_n' => $sFirstName, 's' => $sSex)), false);
     echo '<a rel="nofollow" href="', $sReportLink, '" title="', t('Report Abuse'), '">', t('Report'), '</a>';
 }
Beispiel #10
0
 /**
  * Get information on the software license.
  *
  * @access private
  * @return mixed (array | boolean) Returns license information in an array or FALSE if an error occurred.
  */
 private function _getLicInfo()
 {
     $oCache = (new Cache())->start('str/core', 'license', 3600 * 192);
     // Stored for 8 days
     if (!($mData = $oCache->get())) {
         $sFields = 'siteid=' . Url::encode($this->_sHostName) . '&hostip=' . Url::encode($this->_sHostIp);
         $rCh = curl_init();
         curl_setopt($rCh, CURLOPT_URL, self::CHECK_LICENSE_URL);
         curl_setopt($rCh, CURLOPT_POST, 1);
         curl_setopt($rCh, CURLOPT_POSTFIELDS, $sFields);
         curl_setopt($rCh, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($rCh, CURLOPT_FRESH_CONNECT, 1);
         $mResult = curl_exec($rCh);
         curl_close($rCh);
         unset($rCh);
         $oDom = new \DOMDocument();
         if (@(!$oDom->loadXML($mResult))) {
             return false;
         }
         foreach ($oDom->getElementsByTagName('license') as $oLic) {
             $sKey = $oLic->getElementsByTagName('key')->item(0)->nodeValue;
             $sKey2 = $oLic->getElementsByTagName('key2')->item(0)->nodeValue;
             $sCopyrightKey = $oLic->getElementsByTagName('copyright-key')->item(0)->nodeValue;
             $sMsg = $oLic->getElementsByTagName('message')->item(0)->nodeValue;
             $iExpire = $oLic->getElementsByTagName('expire')->item(0)->nodeValue;
             $iValid = $oLic->getElementsByTagName('status')->item(0)->nodeValue;
         }
         unset($oDom, $oLic);
         $mData = array('key' => $sKey, 'key2' => $sKey2, 'copyright_key' => $sCopyrightKey, 'message' => $sMsg, 'expire' => $iExpire, 'status' => $iValid);
         $oCache->put($mData);
     }
     unset($oCache);
     return $mData;
 }
 public function index()
 {
     $oUserModel = new UserModel();
     // Add the style sheet for the Tabs Menu
     $this->design->addCss(PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_CSS, 'tabs.css');
     // Add the JavaScript file for the Ajax Friend
     $this->design->addJs(PH7_LAYOUT . PH7_SYS . PH7_MOD . $this->registry->module . PH7_SH . PH7_TPL . PH7_TPL_MOD_NAME . PH7_SH . PH7_JS, 'friend.js');
     // Set the Profile username
     $this->sUsername = $this->httpRequest->get('username', 'string');
     // Set the Profile ID and Visitor ID
     $this->iProfileId = $oUserModel->getId(null, $this->sUsername);
     $this->iVisitorId = (int) $this->session->get('member_id');
     // Read the Profile information
     $oUser = $oUserModel->readProfile($this->iProfileId);
     if (!empty($oUser->username) && $this->str->equalsIgnoreCase($this->sUsername, $oUser->username)) {
         // The administrators can view all profiles and profile visits are not saved.
         if (!AdminCore::auth()) {
             $this->_initPrivacy($oUserModel, $this->iProfileId, $this->iVisitorId);
         }
         // Gets the Profile background
         $this->view->img_background = $oUserModel->getBackground($this->iProfileId, 1);
         $oFields = $oUserModel->getInfoFields($this->iProfileId);
         unset($oUserModel);
         $sFirstName = !empty($oUser->firstName) ? $this->str->escape($this->str->upperFirst($oUser->firstName), true) : '';
         $sLastName = !empty($oUser->lastName) ? $this->str->escape($this->str->upperFirst($oUser->lastName), true) : '';
         $sMiddleName = !empty($oFields->middleName) ? $this->str->escape($this->str->upperFirst($oFields->middleName), true) : '';
         $sCountry = !empty($oFields->country) ? $oFields->country : '';
         $sCity = !empty($oFields->city) ? $this->str->escape($this->str->upperFirst($oFields->city), true) : '';
         $sState = !empty($oFields->state) ? $this->str->escape($this->str->upperFirst($oFields->state), true) : '';
         $sDescription = !empty($oFields->description) ? Emoticon::init(Ban::filterWord($oFields->description)) : '';
         // Age
         $this->view->birth_date = $this->dateTime->get($oUser->birthDate)->date();
         $aAge = explode('-', $oUser->birthDate);
         $iAge = (new Framework\Math\Measure\Year($aAge[0], $aAge[1], $aAge[2]))->get();
         // Links of the Menubar
         $iNbFriend = FriendModel::totalFriends($this->iProfileId);
         $sNbFriend = $iNbFriend > 0 ? ' (' . $iNbFriend . ')' : '';
         $sFriendTxt = $iNbFriend <= 1 ? $iNbFriend == 1 ? t('Friend:') : t('No Friends') : t('Friends:');
         if ($this->sUserAuth) {
             $iNbMutFriend = (new FriendModel())->get($this->iVisitorId, $this->iProfileId, null, true, null, null, null, null);
             $sNbMutFriend = $iNbMutFriend > 0 ? ' (' . $iNbMutFriend . ')' : '';
             $sMutFriendTxt = $iNbMutFriend <= 1 ? $iNbMutFriend == 1 ? t('Mutual Friend:') : t('No Mutual Friends') : t('Mutuals Friends:');
         }
         $sMailLink = $this->sUserAuth ? Uri::get('mail', 'main', 'compose', $this->sUsername) : Uri::get('user', 'signup', 'step1', '?' . Url::httpBuildQuery(array('msg' => t('You need to free register for send a message to %0%.', $sFirstName), 'ref' => 'profile', 'a' => 'mail', 'u' => $this->sUsername, 'f_n' => $sFirstName, 's' => $oUser->sex)), false);
         $sMessengerLink = $this->sUserAuth ? 'javascript:void(0)" onclick="Messenger.chatWith(\'' . $this->sUsername . '\')' : Uri::get('user', 'signup', 'step1', '?' . Url::httpBuildQuery(array('msg' => t('You need to free register for talk to %0%.', $sFirstName), 'ref' => 'profile', 'a' => 'messenger', 'u' => $this->sUsername, 'f_n' => $sFirstName, 's' => $oUser->sex)), false);
         $sBefriendLink = $this->sUserAuth ? 'javascript:void(0)" onclick="friend(\'add\',' . $this->iProfileId . ',\'' . (new Framework\Security\CSRF\Token())->generate('friend') . '\')' : Uri::get('user', 'signup', 'step1', '?' . Url::httpBuildQuery(array('msg' => t('Free Sign up for %site_name% to become friend with %0%.', $sFirstName), 'ref' => 'profile', 'a' => 'befriend&', 'u' => $this->sUsername, 'f_n' => $sFirstName, 's' => $oUser->sex)), false);
         $this->view->page_title = t('Meet %0%, A beautiful %1% looking some %2% - %3% years - %4% - %5% %6%', $sFirstName, t($oUser->sex), t($oUser->matchSex), $iAge, t($sCountry), $sCity, $sState);
         $this->view->meta_description = t('Meet %0% %1% | %2% - %3%', $sFirstName, $sLastName, $this->sUsername, substr($sDescription, 0, 100));
         $this->view->h1_title = t('Meet <span class="pH1">%0%</span> on <span class="pH0">%site_name%</span>', $sFirstName);
         $this->view->h2_title = t('A <span class="pH1">%0%</span> of <span class="pH3">%1% years</span>, from <span class="pH2">%2%, %3% %4%</span>', t($oUser->sex), $iAge, t($sCountry), $sCity, $sState);
         $this->view->avatarDesign = new AvatarDesignCore();
         // Avatar Design Class
         // Member Menubar
         $this->view->friend_link = $sFriendTxt . $sNbFriend;
         if ($this->sUserAuth) {
             $this->view->mutual_friend_link = $sMutFriendTxt . $sNbMutFriend;
         }
         $this->view->mail_link = $sMailLink;
         $this->view->messenger_link = $sMessengerLink;
         $this->view->befriend_link = $sBefriendLink;
         // Set parameters Google Map
         $oMap = new Map();
         $oMap->setCenter($sCity . ' ' . $sState . ' ' . t($sCountry));
         $oMap->setSize('600px', '300px');
         $oMap->setDivId('profileMap');
         $oMap->setZoom(12);
         $oMap->addMarkerByAddress($sCity . ' ' . $sState . ' ' . t($sCountry), t('Meet %0% near here!', $this->sUsername));
         $oMap->generate();
         $this->view->map = $oMap->getMap();
         unset($oMap);
         $this->view->id = $this->iProfileId;
         $this->view->username = $this->sUsername;
         $this->view->first_name = $sFirstName;
         $this->view->last_name = $sLastName;
         $this->view->middle_name = $sMiddleName;
         $this->view->sex = $oUser->sex;
         $this->view->match_sex = $oUser->matchSex;
         $this->view->match_sex_search = str_replace(array('[code]', ','), '&amp;sex%5B%5D=', '[code]' . $oUser->matchSex);
         $this->view->age = $iAge;
         $this->view->country = t($sCountry);
         $this->view->country_code = $sCountry;
         $this->view->city = $sCity;
         $this->view->state = $sState;
         $this->view->description = nl2br($sDescription);
         $this->view->join_date = VDate::textTimeStamp($oUser->joinDate);
         $this->view->last_activity = VDate::textTimeStamp($oUser->lastActivity);
         $this->view->fields = $oFields;
         $this->view->is_logged = $this->sUserAuth;
         $this->view->is_himself_profile = $this->str->equals($this->iVisitorId, $this->iProfileId);
         // Stat Profile
         Statistic::setView($this->iProfileId, 'Members');
     } else {
         $this->_notFound();
     }
     $this->output();
 }
 /**
  * Get Profile Link with the link to the registration form if the user is not connected.
  *
  * @param string $sUsername
  * @param string $sFirstName
  * @param string $sSex
  * @return string The link
  */
 public function getProfileSignupLink($sUsername, $sFirstName, $sSex)
 {
     if (!self::auth() && !AdminCore::auth()) {
         $aHttpParams = ['ref' => (new Framework\Mvc\Request\Http())->currentController(), 'a' => Framework\Registry\Registry::getInstance()->action, 'u' => $sUsername, 'f_n' => $sFirstName, 's' => $sSex];
         $sLink = Uri::get('user', 'signup', 'step1', '?' . Framework\Url\Url::httpBuildQuery($aHttpParams), false);
     } else {
         $sLink = $this->getProfileLink($sUsername);
     }
     return $sLink;
 }