Jump to content

Frank Vèssia

Members
  • Posts

    585
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Frank Vèssia

  1. 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
  2. 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...
  3. 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
  4. 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
  5. 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.
  6. 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.
  7. 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");
  8. 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
  9. I'm looking forward to see how to implement the avatars into comments Awesome design here. Did you have the chance to play with the new comments system? I'm trying to show up the votes also but I'm having some issues, they don't display into comments using the options inside the render array. I asked here https://processwire.com/talk/topic/8912-display-votes-on-new-comments-system/
  10. mmm yes this is an option but I just wanted to use the render buit in function and code just the part I need to add
  11. It's possible to hook the $comments->render() function to show more data based on some default value of the comment? My goal is to display the user's profile picture and i can get the picture using the "cite" value of the comment
  12. I'm using the new comments system and I'm trying to figure out how to display votes. Looking into the module I found the options but it seems it's not working <?php echo $page->comments->render(array( 'headline' => '<h4 class="small-title">Comments</h4>', 'commentHeader' => '<a href="/profile/{cite}/">{cite}</a> <span class="timeago text-muted" title="{created}">{created}</span>', 'dateFormat' => 'c', 'encoding' => 'UTF-8', 'admin' => false, 'useVotes' => 1, 'upvoteFormat' => '↑{cnt}', 'downvoteFormat' => '↓{cnt}', )); ?> In comment field options votes are enabled also and both css and js are included...any idea?
  13. Any idea? Maybe they are still in development and some functions don't work?
  14. wow, this is exactly what I was looking for, amazing thanks for the link
  15. yes of course...I can display correctly all notifications
  16. I tried to use ->slice assuming notifications were WireArray but I get error $notifications = $user->notifications->slice($start,$limit); Catchable fatal error: Argument 1 passed to NotificationArray::__construct() must be an instance of Page, none given,
  17. How to get the time (in any format) when a pagearray item has been added or removed? I don't think is possible since the data stored into db are just references of the page with no info about the date, maybe writing a custom FieldTypePage module?
  18. Is there a way to limit/sort/paginate the new notifications system? I'm using notifications in front end like so <?php foreach($user->notifications as $no) { } ?> I tried ->slice with no effect...
  19. I’m in the process of rebuilding what I started almost 3 years ago, a social network using PW. Since 2012 many things are changed in PW core so I decided now to rewrite everything with different approach. Since I have a tight deadline I need help in developing some modules. Right now I need: Media uploader module, a front end image/video uploader and editing interface with these features: - Multiple upload via input file and drag and drop interface - Support for mobile devices (access to phone/tablet media library) - Option to store files into PW assets or external disk like Amazon S3 - Resize and watermark on the fly before save the final image - For Video, send file to encoding.com and manage all the workflow - General validation, both server and user side (jquery) Inside the social, a media content (image or video) is a PW page and not a direct file, with a series of specific fields. Therefore an image is a page with some fields, the most relevants are: - title - description - image, the file field composed of two files, the image and a copy of it, with mosaic effect, for guest users there are other fields not relevant for the module… The workflow is like so: Picture: - the user uploads one or more pictures - the interface shows the progress - the files are temporary uploaded in a secure directory - a page is created, each per picture, with a temporary name - the files, resized and watermarked are saved into the respective pages or into amazon s3 bucket (maybe can be a parameter the admin can choose inside the module option) - temp files are deleted - photo pages are saved with unpublished status because each photo needs at least a title. - the user is redirect to the “edit photos” page where he can sees the list of unpublished photos which need at least the title to be published. - the user can click a thumbnail and go into a page with a simple form, with a photo preview and some fields he can fill, only the title is mandatory for publication. - the other fields are saved normally into the picture page. In case files are uploaded into amazon there should be the possibility to access to the files, later inside any templates, with similar pw api and resize functions, (p$age->image->size / $page->image->url) creating the versions into pw assets and leave the original big image into amazon. Video: same as the picture with the only difference the video file is not saved into the PW assets directory but into amazon s3 bucket, not optional. only the thumbnails are saved into the pw assets. The encoding of the video (save in two different formats, for desktop and mobile, watermark and thumbnails creation) is processed by encoding.com via api and cUrl functions After files upload the user is redirect into the “edit video” page where he can sees a default thumbnail for each video is in the encoding process with a label (encoding in process). When the encoding is finished, encoding.com send a callback to a specific url, the module saves the thumbnails into the video page, links the amazon s3 video and the user can now publish the video adding at least the title into a form similar to the one for the photos. I also have a licence for http://fineuploader.com/ i think is very good for this and I already used it for the previous version, he supports upload into amazon buckets as well. I think this is pretty much everything, maybe something can be different and I’m open to suggestion for the workflow of course My budget for this module is 400 eur. If someone is interested please contact me via forum or via email at complementaryart [at] gmail.com Thanks
  20. I don't know where to post this... Maybe I found a "bug" using this selector $pages->find("template=picture,image.count=2,limit=10,parent=[pagefield1.pagefield2=xxx]"); What happend here is it I call this selector from an url segment like /photos/new-users/ where "new-users" is the segment. If I'm logged in with admin role I can see the result, otherwise (other role or guest) not. I already checked all my roles and they are ok with permissions, and removing the subselector get me the result for every role or guest. It's something related with this subselector and roles I guess...any idea? I'm using latest dev 2.5.14 pagefield1 is a pagefiled connected with user template. pagefield2 is normal pagefiled. Edit: removing the urlSegment1 doesn't affect the result, so it's roles/subselector
  21. Nico, I'm using your module in many sites, it's great...but just one think, what about pagination? I would like to add something like {pageNum} or similar into title format like {title} - {sitename} - {pageNum} Other idea: what about having a title format based on template? I have a photo website and and I would like to create custom title for each photo, I cannot edit each photo one by one, right now I detect the template in my head.inc and for those pages I add a custom title but could be nice having something inside your module example: I have "picture" template and I would like the title as: {phototitle} - This is a Photo by {author} for category {category.title} where phototitle & author & (category is a pagefield so I can access other data like title) are fields of picture template
  22. after years working on PW it's always a bit difficult get in mind all the new stuff inside new versions, but it's a pleasure of course
×
×
  • Create New...