function __construct() { //Create a new PHPMailer instance $mail = new PHPMailer(); //Tell PHPMailer to use SMTP $mail->isSMTP(); //Set the hostname of the mail server $mail->Host = FConfig::getValue('email_smtp_url'); //Whether to use SMTP authentication $mail->SMTPAuth = true; //Username to use for SMTP authentication - use full email address for gmail $mail->Username = FConfig::getValue('email_smtp_user'); //Password to use for SMTP authentication $mail->Password = FConfig::getValue('email_smtp_pass'); //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission $mail->Port = FConfig::getValue('email_smtp_port'); //Set the encryption system to use - ssl (deprecated) or tls $mail->SMTPSecure = 'tls'; // Set encoding $mail->CharSet = 'UTF-8'; // Set email format to HTML $mail->isHTML(true); //Set who the message is to be sent from $mail->setFrom(FConfig::getValue('email_sender_email'), FConfig::getValue('email_sender_name')); $this->phpMailer = $mail; }
/** * Call this method to get singleton * * @return FAnalytics */ public static function getInstance() { static $inst = null; if ($inst === null) { $inst = new Analytics(FConfig::getValue('trackingID'), FConfig::getValue('analytics_site_url')); } return $inst; }
public static function checkAvailableReferral($userId) { $sql = "SELECT id FROM " . self::REFERRALS_TABLE . " WHERE referring_user = "******" AND exchange_date IS NULL AND exchanged = false LIMIT " . FConfig::getValue('creditsByAlbum'); $availableReferrals = mysql_query($sql); $qty = mysql_num_rows($availableReferrals); if ($qty == FConfig::getValue('creditsByAlbum')) { $ids = array(); while ($referral = mysql_fetch_object($availableReferrals)) { $ids[] = $referral->id; } return $ids; } else { return false; } }
$project->set('pro_status', $proStatus); } else { // Si el usuario es guest entonces guardar proyecto en tabla temporal $project = ORM::for_table(TmpProject::getTable())->create(); $project->set('pro_tmp_id', sha1(time() . $app->getHelper('StringHelper')->generateRandomString())); $project->set('pro_status', Project::PROJECT_STATUS_ACTIVE); } $project->set('pro_cod', date('ymdHis')); //TODO candidate to be deprecated $project->set('pro_tit', ucfirst($proTitle)); $project->set('pro_descripcion', preg_replace("/\n/", "<br/>", $proDescription)); //$project->set('pro_budget', $_POST['pro_budget']); deprecated $projectDate = str_replace('/', '-', $proDate); $projectDate = date('Y-m-d H:i:s', strtotime($projectDate)); $project->set('pro_date', $projectDate); $dateEndTime = DateHelper::addDaysToTime(time(), FConfig::getValue("maxDaysToAdjudicate")); $project->set('pro_date_end', date('Y-m-d H:i:s', $dateEndTime)); $project->set('pro_cant', $proQty); $project->set('pro_length', $proLength); $project->set('pro_country', $proPais); $project->set('pro_state', $proEstado); $project->set('pro_city', $proCity); $project->set('pro_address', $proDireccion); $project->set('pro_cp', $proCp); $project->set('pro_type', $proType); $project->set('pro_category', $proCategory); $project->set('pro_environment', $proEnvironment); $project->set('pro_moment', $proMoment); $proDeadline = str_replace('/', '-', $proDeadline); if (!empty($proDeadline)) { $projectDeadline = date('Y-m-d H:i:s', strtotime($proDeadline));
<body class="<?php echo $section_name; ?> "> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', '<?php echo FConfig::getValue('trackingID'); ?> ', '<?php echo FConfig::getValue('analytics_site_url'); ?> '); ga('send', 'pageview'); </script> <script type="text/javascript"> var fototeaTracking = { trackEnabled: true, sendEvent: function(category, action, label, value){ if (fototeaTracking.trackEnabled == true){ if (value){ ga('send', 'event', category, action, label, value); } else {
// // } // // } // // header("location:../subirImagen?a=".$_REQUEST['album']); // // } if ($act == "addFoto") { $file = $_FILES['file']; if ($file['size'] > 0) { $albumId = $_REQUEST['album']; // Validar cantidad maxima de fotos $fotos = listAll("albumes_det", "WHERE ad_a_id = '" . $albumId . "' AND ad_status='S'"); $rows_fotos = mysql_num_rows($fotos); if ($rows_fotos >= FConfig::getValue('maxFilesByAlbum')) { return "error"; } $fileNameComplete = $file['name']; $fileNameArray = explode(".", $fileNameComplete); $fileName = $fileNameArray[0]; $extension = end($fileNameArray); // if (file_exists($pathFile)){ // return 'error'; // } $user = getCurrentUser(); $perfilSha1 = sha1($user->id); $albumSha1 = sha1($albumId); updateTable("albumes", "a_status = 'S'", "a_id = '" . $albumId . "'"); $photo_id = insertTable("albumes_det", "'','" . $albumId . "','" . $fileNameComplete . "','" . $user->id . "','','S',NOW(),0"); $fileNameUnique = $fileName . "_" . $photo_id . "." . $extension;
<?php use Fototea\Config\FConfig; use Fototea\Util\FMailer; require '../vendor/autoload.php'; $name = $_REQUEST['name']; $mensaje = $_REQUEST['mensaje']; $email = $_REQUEST['email']; $asunto = $_REQUEST['asunto']; $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'nombre' => $name, 'email' => $email, 'asunto' => $asunto, 'mensaje' => $mensaje); $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/contactoEmail.html')); $mailer = new FMailer(); $receivers = array(array('email' => FConfig::getValue('contacto_email'), 'name' => FConfig::getValue('contacto_name'))); $mailer->setReceivers($receivers); $mailer->sendEmail($asunto, $body); $arreglo[] = array('resp' => "Se ha enviado la información"); echo json_encode($arreglo);
$validTypes = array('image/png', 'image/jpeg', 'image/jpg', 'image/gif'); if (!in_array($file['type'], $validTypes)) { $response->status = 'error'; $response->message = 'invalid file'; echo json_encode($response); die; } $fileInfo = getimagesize($file['tmp_name']); $tmpImageWidth = $fileInfo[0]; $tmpImageHeight = $fileInfo[1]; $tmpImageType = $fileInfo[2]; //TODO validate type , if not valid type (profile or cover) return error $type = $_GET['type']; $aspectRatio = $_GET['cropRatio'] | 1; //if ($type == 'profile') { if ($tmpImageWidth < FConfig::getValue($type . '_image_width') || $tmpImageHeight < FConfig::getValue($type . '_image_height')) { $response->status = 'error'; $response->message = 'invalid image size'; echo json_encode($response); die; } //} // if ($type == 'cover') { // if (($source_image_width < FConfig::getValue('cover_image_width')) || ($source_image_height < FConfig::getValue('cover_image_height'))) { // $response->status = 'error'; // $response->message = 'invalid image size'; // echo json_encode($response); // die(); // } // } //TODO validate image size
<?php use Fototea\Config\FConfig; use Fototea\Models\User; use Fototea\Util\DateHelper; $hostname_h = FConfig::getValue('db_hostname'); $database_h = FConfig::getValue('db_name'); $username_h = FConfig::getValue('db_user'); $password_h = FConfig::getValue('db_password'); $db = mysql_pconnect($hostname_h, $username_h, $password_h) or trigger_error(mysql_error(), E_USER_ERROR); $db_select = mysql_select_db($database_h, $db); //funcion para validar session function validaSession() { if (!isset($_COOKIE['id'])) { //@header("location:login"); return false; } else { return true; } } //fin funcion //funcion signOut function signOut() { setcookie('user', '', time() - 3600); setcookie('id', '', time() - 3600); clearReferer(); return true; } // fin funcion signOut
public static function emailProjectOwner($offer, $winner, $project, $projectOwner) { // Enviar correo a cliente $asunto = "Has adjudicado un proyecto. ¡Buen Trabajo!"; $params = array('site_url' => UrlHelper::getUrl(), 'logo_url' => UrlHelper::getUrl('images/logo_footer.png'), 'check_url' => UrlHelper::getUrl('images/check_green.gif'), 'client_name' => $projectOwner['full_name'], 'oferta_winner' => $offer->bid, 'proyecto_titulo' => $project->pro_tit, 'projecto_date' => DateHelper::getShortDate($project->pro_date), 'proyecto_url' => UrlHelper::getProjectUrl($project->pro_id), 'photograph_name' => $winner['full_name'], 'photograph_email' => $winner['email'], 'photograph_phone' => $winner['movil'], 'photograph_location' => $winner['ciudad'] . ', ' . $winner['direccion']); $mailer = new FMailer(); $body = $mailer->replaceParameters($params, file_get_contents(UrlHelper::getBasePath() . '/views/emails/adjudicarProyectosClienteEmail.html')); $receivers = array(array('email' => $projectOwner['email'])); $mailer->setReceivers($receivers); $mailer->setBCC(array(array('email' => FConfig::getValue('contacto_email')))); $mailer->sendEmail($asunto, $body); }
?> <!--&oid=--><?php //echo $rs_proj->id ?> <!--" class="font12 txtNaranja">Editar propuesta</a>--> <!-- --><?php //endif ?> </div> <div class="col-xs-2"> <div class="proBoxUserContFot"> <div class="left"> <div> <img alt="Imagen de usuario" src="<?php echo FConfig::getThumbUrl($rs_proj->project_owner['profile_image_url'], FConfig::getValue('profile_image_width'), FConfig::getValue('profile_image_height')); ?> " width="60" height="60" class="img-circle"> </div> </div> <div class="left proBoxUser"> <div class="font12 fontW400">Publicado por:</div> <div><a href="perfil?us=<?php echo $rs_proj->project_owner['act_code']; ?> " class="third-link fontW400"><?php echo $rs_proj->project_owner['full_name']; ?> </a></div> <div class="rating"> <!--<?php echo $rs_proj->project_owner_ratings['stars'];
$current_user = getCurrentUser(); //the current user if (!$current_user) { die('invalid user'); //TODO handle this } else { if ($current_user->id == $user_info['id']) { $same_user = true; } } //REVIEWS TAB $review = ratings($user_info['id']); $img_cover = $user_info['cover_image_url']; $img_profile = $user_info['profile_image_url']; $cover_url = FConfig::getThumbUrl($img_cover, FConfig::getValue('cover_image_width'), FConfig::getValue('cover_image_height')); $profile_url = FConfig::getThumbUrl($img_profile, FConfig::getValue('profile_image_width'), FConfig::getValue('profile_image_height')); $cover_edit_url = FConfig::getThumbUrl($img_cover, 400, 400); $profile_edit_url = FConfig::getThumbUrl($img_profile, 400, 400); $user_info['ciudad'] = ucfirst($user_info['ciudad']); $user_info['descripcion'] = substr(ucfirst($user_info['descripcion']), 0, 140); $current_tab = $_GET['act']; if (!$current_tab) { if ($same_user) { if ($user_info['user_type'] == User::USER_TYPE_PHOTOGRAPHER) { $current_tab = 'proyectos'; } else { //cliente $current_tab = 'misproyectos'; } } else { $current_tab = "info";
}); // Eliminar album function deleteAlbum(){ var conf = confirm("¿Está seguro que desea eliminar el álbum?"); if(conf == true){ document.getElementById('deleteAlbumForm').submit(); } } function checkAddAble(){ var currentQtyFiles = jQuery('.dropzone .dz-preview.dz-image-preview').length; if (currentQtyFiles < <?php echo FConfig::getValue('maxFilesByAlbum'); ?> ){ myDropzone.enable(); jQuery('.dropzone .dz-message').show(); } else { myDropzone.disable(); jQuery('.dropzone .dz-message').hide(); } } jQuery(document).ready(function(){ // Fill license field var license="<?php echo $rs_album->a_license; ?>
public static function getRealAvailableCredits($userId, $qtyAlbums) { if ($userId == null || $qtyAlbums === null) { return false; } $originalCredit = self::getOriginalCredit($userId); $creditAvailable = max(0, FConfig::getValue('defaultAlbumsByPhotographer') + $originalCredit - $qtyAlbums); return $creditAvailable; }
<?php use Fototea\Config\FConfig; ORM::configure('mysql:host=' . FConfig::getValue('db_hostname') . ';dbname=' . FConfig::getValue('db_name')); ORM::configure('username', FConfig::getValue('db_user')); ORM::configure('password', FConfig::getValue('db_password')); ORM::configure('logging', FConfig::getValue('db_query_log')); //Date and locale function