-
Posts
601 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Frank Vèssia
-
Hi guys, suddenly I'm logging out continuously as admin, after few minutes of sometimes seconds. Is there something I have to check? I tried to clean averything, cache, sessions (I'm using DB sessions), etc... I'm using 2.6.1 master
-
I had a website with a lot of subdomains, now I want to redirect all subdomains to internal pages, is there a way to do this with jumplinks? I would like also to suggest a couple of small "improvements" as result of my experience with this fantastic module. 1. possibility to filter 404 errors per type, like images, pages, css, etc.. I have a lot of 404 errors and having such option could be very helpful. 2. check for already created jumplink. When moving a lot of pages sometimes I created duplicated links without noticing...
-
with the horst's help I found out the problem is related to the watermark jpg file, when pim tries to access to the jpg, this cause the javascript to generate the error, I'm still investigating more but at this point pim is not the direct cause, just to be clear
-
horst, yes it's how you described, strangely... I tried with android latest version and it doesn't work, from ipad2 it works... I PMd you
-
I figured out the problem, it's the pim module...If I comment the part where add the watermark it works also on mobile, the question is why??
-
Hi guys, I'm working on a code for uploading images via jQuery with fineuploader script. The code is working good on desktop, but on mobile I got an "unknown" error from jquery but i think the problem is inside the php. Basically I upload the images in a temp dir, after that I create a page for each image which contains an image field and attach the image. I also use PIM module for adding a watermark. PHP <?php header("content-type: text/plain"); $method = $_SERVER["REQUEST_METHOD"]; if ($method == "POST" && $input->urlSegmentStr=='') { $arr = ""; $uploadpath = $config->paths->root.$config->tmp_upload; $u = new WireUpload('qqfile'); $u->setMaxFiles(5); $u->setOverwrite(false); $u->setMaxFileSize(2048*2048); $u->setDestinationPath($uploadpath); $u->setValidExtensions(array('jpg', 'jpeg')); $minWidth = 300; $minHeight = 300; $maxWidth = 4500; $maxHeight = 4500; // execute upload and check for errors $files = $u->execute(); $error = ""; $userpage = $pages->get("template=member,userlink=$user"); $wmi = $config->paths->root.$config->site_cdn."wm.png"; $options = array('outputFormat'=>'jpg','quality'=>70); $pim = $modules->get('PageImageManipulator'); foreach($files as $file){ $tempImg = $uploadpath . $file; $newFile = $uploadpath . $_POST['qquuid'].'.jpg'; @rename($tempImg, $newFile); // I rename the file because ios uploads file using the same name "image.jpg" if (file_exists($newFile)){ list($width, $height) = getimagesize($newFile); if(!$newFile){ $error .= "Immagine non valida"; } if ($width < $minWidth){ $error .= "Immagine troppo piccola"; } if ($height < $minHeight){ $error .= "Immagine troppo piccola"; } if ($width > $maxWidth){ $error .= "Immagine troppo grande"; } if ($height > $maxHeight){ $error .= "Immagine troppo grande"; } if(!$u->getErrors() && $error==''){ $p = new Page(); $p->template = $templates->get("pic"); $p->parent = $userpage; $p->name = time(); $p->status = Page::statusUnpublished; $p->save(); $p->image = $pim->imLoad($newFile, $options)->watermarkLogo($wmi, 'southeast', 4)->pimSave(); if($p->save()){ $arr = array('success' => true); } }else{ $arr = array('error' => implode(",",$u->getErrors())); } unlink($newFile); }else{ unlink($tempImg); } } echo json_encode($arr, JSON_FORCE_OBJECT); } ?> jQuery var photoUpload = $("#photouploader"); if (photoUpload.length > 0){ var maxLimit = $(photoUpload).data('maxuploads'); var runningp = 0; $("#photouploader").fineUploader({ debug: true, maxConnections: 20, request: { endpoint: $(photoUpload).data('endpoint') }, retry: { enableAuto: true, maxAutoAttempts: 1 }, validation: { allowedExtensions: ["jpg", "jpeg"], acceptFiles: ["image/jpeg"], sizeLimit: 4194304, itemLimit: maxLimit, stopOnFirstInvalidFile:true, image: { maxHeight: 4500, maxWidth: 4500, minHeight: 300, minWidth: 300 } }, messages:{ sizeError: '{file} è troppo grande. Massimo {sizeLimit}', tooManyItemsError: 'Hai cercato di caricare ({netItems}) immagini. Puoi caricarne massimo {itemLimit}', typeError: 'Estensione non valida, solo {extensions}', noFilesError: 'Nessun file selezionatov', maxWidthImageError: 'Il file è tropo grande in larghezza', maxHeightImageError: 'Il file è troppo grande in altezza' }, text: { defaultResponseError: 'Errore sconosciuto' } }).on('submit', function () { runningp++; }).on('complete', function (event, id, fileName, responseJSON) { runningp--; if(runningp==0 && responseJSON.success){ $(location).attr('href',$("#photouploader").data('dest')); } }).on('error', function (event, id, name, errorReason) { alert(qq.format("Errore nel file '{}' Motivo: {}", name, errorReason)); $('#photouploader').fineUploader('reset'); }); } I think the error is in the php because I can see the file is being uploaded in the temp dir, after that I got the error from js, so could be something after the moving file...but I don't know for sure, and the js gives me only "unknown error" impossible to debug on mobile
-
maybe you already solved but the default bitnami installation has different admin url, /admin
-
I created my own "comment" module at the end...
-
Hi guys, after a long pause on this project, I relaunched few days ago the new version of lymeta.com a website offering free high resolution photos, royalty free under creative commons zero license. Anyone can submit a photo and participate. I made a very simple design, flat and responsive, hope you like it. Cheers.
- 1 reply
-
- 12
-
-
FieldtypePageWithDate & InputfieldPageWithDate
Frank Vèssia replied to Raymond Geerts's topic in Modules/Plugins
Great I will update the module asap, thanks -
If I want to add more statuses like 2,3,4 etc..., do you suggest an hook (if possible) or creating a duplicate of comments module and add statuses directly to the module?
-
Yes, if I set to "comments must be approved..." the status is set to 0 (pending). It's like you said, the moderation settings are overriding the api settings.
-
Tried, no differences, comment published with status 1.
-
I'm trying to set a comment status when posting new comment via API but pw set to 1 even I set to -2 or 0. Am I missing something? I tried to play with some options in admin, like activating akismet, or quite save... with no luck. I'm using PW dev 2.5.19 $text = $sanitizer->text($input->post->txt); $root = $pages->get("template=member,userlink=$user"); $c = new Comment(); $c->text = $text; $c->cite = $user->name; $c->created = time(); $c->email = $user->email; $c->user_agent = $_SERVER['HTTP_USER_AGENT']; $c->ip = $_SERVER['REMOTE_ADDR']; $c->created_users_id = $user->id; $c->sort = count($root->comments)+1; $c->status = -2; // just for testing $root->of(false); $root->comments->add($c); if($root->save()){ $root->of(true); print "success"; }
-
FieldtypePageWithDate & InputfieldPageWithDate
Frank Vèssia replied to Raymond Geerts's topic in Modules/Plugins
well, there is a huge amount of files and stuff here let me think about a solution, thanks for now -
FieldtypePageWithDate & InputfieldPageWithDate
Frank Vèssia replied to Raymond Geerts's topic in Modules/Plugins
Hi, tried right now. Now I get this Notice, better than the Warning Notice: Undefined offset: 0 in /home/public_html/site/modules/FieldtypePageWithDate/FieldtypePageWithDate.module on line 281 but still after the notice the code is executed correctly -
FieldtypePageWithDate & InputfieldPageWithDate
Frank Vèssia replied to Raymond Geerts's topic in Modules/Plugins
I'm sorry but the problem still persist. Strange thing is after the error has been displayed the code is executed and it works...just got that error and since I'm using ajax call to perform that code I stuck there because of the error. Edit: disabling debug mode on PW I get this working... -
FieldtypePageWithDate & InputfieldPageWithDate
Frank Vèssia replied to Raymond Geerts's topic in Modules/Plugins
I'm having an issue using this module. my code is this: if($input->post->addfriend && $user->isLoggedin()){ $page->of(false); $page->friends_waiting->add($user); $page->save(); } I get this error Warning: array_filter() expects parameter 1 to be array, null given in /home/public_html/site/modules/FieldtypePageWithDate/FieldtypePageWithDate.module on line 280 -
probably bug in dev for subselector with roles
Frank Vèssia replied to Frank Vèssia's topic in API & Templates
probably I confused a bit but yes it's a problem of access...I'll figure something else for this edit: oh easy, I just granted access "view" to user template to a specific role, now it's working, thanks Soma -
probably bug in dev for subselector with roles
Frank Vèssia replied to Frank Vèssia's topic in API & Templates
mmm i tried, same result, because i'm not trying to access to users page, i'm searching for "picture" template and trying to filter by user typology. Picture template ahs a parent which is the Profile page, this page has a page filed connected to user, user has a typology field, this is i'm filtering by. -
probably bug in dev for subselector with roles
Frank Vèssia replied to Frank Vèssia's topic in API & Templates
any idea how to workaround on this? -
I personally use Horst module wireMailSMTP configured with Amazon SES and a simple code + cronjob. <?php // some config variables //these two variables should match the cronjob setting. $hour_interval = 9; // interval time in hours the cronjob is working, ex.: from 14:00 to 23:00 $cron_minute = 5; // cronjob execution every tot minute. $daily_sends = ($hour_interval * 60) / $cron_minute; $max_days = 5; // for how long I want to send the newsletter in a week ? max 7 days // this variable tells me how many times I have to send the newsletter based on the previous variables. $total_sends = $daily_sends * $max_days; $total_users = $users->find("privacy_newsletter=1,roles!=1016,limit=2")->getTotal(); // this limit tells me how many users I have to select per send to complete all the newsletter in the interval I configured previously ($max_days + cronjob settings) $limit = round( $total_users / $total_sends ); /******** INIT THE MAIL **********/ $mail = wireMail(); /******** IF ALL CICLES ARE COMPLETED RESET THE MAIL SENT LOG **********/ // 'cicles' field is an integer incremented every newsletter send if($page->cicles >= $total_sends){ $mail->sentLogReset(); // reset cicles variables $page->of(false); $page->cicles = 0; $page->save(); $page->of(true); } /******** SET THE START FOR USER SELECTION **********/ $start = $page->cicles * $limit; /******** USER SELECTION **********/ $members = $users->find("privacy_newsletter=1,roles!=1016,sort=created,start=$start,limit=$limit"); $to = $members->explode('email'); $mail->to($to); /******** SET THE NEWSLETTER CONTENT **********/ $mail->subject("LATEST NEWS"); $mail->bodyHTML($page->newsletter->last()->bodyhtml); // 'newsletter' field is s repeater with just a textarea field, the current newsletter is the latest item of the page. /******** SEND NEWSLETTER **********/ $numSent = $mail->sendBulk(true)->useSentLog(true)->send(); $page->of(false); $page->cicles++; $page->save(); $page->of(true); I just created a page with this template and call the url from cronjob. I'm still optimizing some steps but right now it's working well . Next step is create the cronjob directly from php using some libraries i'm studying so I don't have to check my variables and the cronjob. I send 2-3k mails per day and using Amazon is really cheap compared to other systems.
-
I finally solved using ->filter instead of ->slice like so $limit = 10; $start = ( $input->pageNum - 1 ) * $limit; $notys = $user->notifications->filter("start=$start,limit=$limit,sort=-created");
-
Thanks I will check the code
-
ah ok. Well, I already made something 90% similar for the previous version (but plain code no module) so I know exactly the complexity...in worst case I will do it by myself... and maybe share it to the community