Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by rick

  1. @wbmnfktr Yes it does. Even the fractional star rating, eg, 5, 4.75, 4.5 ... to 0 works.
  2. For other's and my reference: Sorting pages by stars requires the comment field name prefix, eg: // From previous post... $pc = $p->children('sort=-comments.stars, limit=12'); // Returns pages with 5 stars, then 4.5 stars, etc. I must have mistyped the comment field name before. My apologies. Thanks for your help @dragan.
  3. $this->halt(); As shown at the bottom of this thread. Is this what you are referring to?
  4. Yes Sir, I've tried a few combinations with the same results. I haven't seen anything in the source regarding an average other than the public function stars itself.
  5. @dragan, I'm using the core comments with star rating field type. Yes, the test code doesn't return any errors... // Tracy console $p = wire('pages')->get('template=my_template,include=all'); if($p->hasChildren) { $pc = $p->children('sort=stars, limit=12'); // One of many combinations I've tried d($pc); } But the results (12) are not sorted by stars, rather the results are returned in the order the pages were created (Id)... total => 34 start => 0 limit => 12 pager => "1 to 12 of 34" (13) items => array (12) Page:0 => array (5) ... Page:11 => array (5) selectors => "parent_id=1026, sort=stars, limit=12, status<1024" (49) [edit] Also, each template has the comments (fieldtypecomment) and stars are enabled.
  6. Howdy all, Is there a means to return pages sorted by star ratings? I apologize if I have missed a topic, but I haven't found anything related with my searches. Thanks for your help!
  7. I believe what you are looking for might be answered here.... If not, please elaborate and someone will jump in and help.
  8. Hello all. I've been lookin' at this for a couple of days now with no luck. I have a localhost test site where I set up an example as shown in example #2 in this article. The test template has page numbers enabled. There are 20 pages using the test template. $results = wire('pages')->find("template=test,sort=-published,limit=12"); $pagination = $results->renderPager(); echo $pagination; foreach($results as $result){ blah, blah, blah } The pager is rendered correctly, ie., 1 2 Next, including the link href attributes: ?page=2 for the second and Next links. The problem is the same pages are returned regardless of which link I click. There are no error messages. The response header shows page 2. Tracy shows the following for $results: count => 12 total => 20 start => 0 limit => 12 pager => "1 to 12 of 20" (13) items => array (12) What am I missing? Thanks for your help!
  9. It's been acting this way for the past 2 weeks for me.
  10. You have three forms on one page, so provide a hidden element with a unique name (as @horst suggests), then test for the form name when submitted and process accordingly. The page with your forms... <form> <input type="hidden" name="form1" value="form1" /> ... // Your form data collection fields </form> ... <form> <input type="hidden" name="form2" value="form2" /> ... // Your form data collection fields </form> ... <form> <input type="hidden" name="form3" value="form3" /> ... // Your form data collection fields </form> Then within your page, test for each... <?php if( $input->post->form1 == "form1" ) { // process your data and send your message for option 1 } elseif ( $input->post->form2 == "form2" ) { // process your data and send your message for option 2 } elseif ( $input->post->form3 == "form3" ) { // process your data and send your message for option 3 } // render your page as normal
  11. Howdy! I am following this blog post. I have set up two completely new (blank profile) installs of pw dev.132 on localhost (lamp) PHP7.2 and Apache 2.4.29. The only additions to each default site for testing are: localhost/site1: Added Page1 and User1 localhost/site2: Added Page2 and User2 Both sites have Tracy installed. No other modules (other than defaults) are installed. From Tracy's console (Site2): $path = '/var/www/site1/'; $url = 'localhost/site1/'; $site = new ProcessWire($path, $url); $items = $site->pages->find("template=admin,name=users,include=all"); foreach($items as $item) { d($item->name); } yeilds: ERROR: Cannot redeclare ProcessWire\setting() (previously declared in /var/www/site1/wire/core/FunctionsAPI.php:680) on line: 680 in /var/www/site2/wire/core/FunctionsAPI.php According to searches of processwire/setting() indicates a namespace error. But both installations are identical. This error is generated whether I specify users or pages in the selector, or switch to Site1. Can someone please point me in the right direction. Thank you!
  12. Even if you do it manually (depending on your host), the cron setup is simple. Letsencrypt does a good job of covering the bases.
  13. Remmina has always worked well for me when I want a visual interface to a remote machine. As @FrancisChung mentions, the probable latency would make remote development aggravating at least regardless of the chosen application.
  14. Howdy y'all, I have an issue with the field-template context dialog box being empty; No iframe content nor body content is present. This is a new localhost install of 3.0.123. Tracy is the only module installed. The log files do not indicate any errors. Console network shows, 200: http://.../setup/field/edit?id=1&fieldgroup_id=98&modal=1&process_template=1. I can right-click and open this same link in a new tab and the field-template context edit functions correctly, i.e., the filedgroups_fields table shows the correct data override. It just does not display the context edit form in the dialog box when you click a field to edit. Any help is appreciated! Thanks!
  15. Not sure, but I think lower case is specified.
  16. Hello Frank, and welcome to the forum. I'm going to assume that both those session paths are writable. Are other session settings set correctly, eg, referer_check, etc.? Is your /site/config.php readable? Is apache running as the correct user? Other more knowledgeable people will chime in as they get here, so don't fret. Glad to have you on board.
  17. The site looks good! I did notice a couple of grammar errors in the docs, but otherwise, it looks good.
  18. Howdy @quickjeff, I'm using two fields, one for the visitor's ip and another for the timestamp. The visitor's ip allows for unique visits, and also for telling you who is visiting your site often. On another note, google analytics gives you this same information, and much more.
  19. You don't need to track an IP unless you are requiring information unique to a user. Just the timestamp in a mysql table is sufficient to give you a hit counter by date. There are quite a few apache log analyzers out there, but I haven't used them since google provides the information for me. I prefer to not make things more complicated than need be.
  20. Howdy @mr-fan! This is just my $.02. While PW can certainly handle such a simple task, to me, it is overkill. And I don't want 100K+ pages in my tree. In one project, I use a simple mysql table to store the unix timestamp as a simple counter. In another project, I use PW's features to track more complex data for affiliates. Regardless of the method you use, google analytics gives you the visitor data you used to get with dedicated visitor tracking scripts. Even if you store visitor IP with the timestamp, you can use php's dns lookup to gather information on a desired ip address, although I don't recommend using that function on every ip entry. I haven't noticed any performance degradation with either method. But I'm looking at only a few hundred to a few thousands hit per day on those domains. Your milage may vary. ? Hope this helps.
  21. Thanks to you both. @flydev that solution sounds better. @bernhard, I just tried the url checker module and it throws errors when building a form dynamically through the API.
  22. How do I place a button next to the URL text field on a form created from the API? I have the following code to create the text field to display on the form and it works as expected. This text field contains a URL. I want to place a button next to this field that will open the URL in another tab. $field = $this->wire('modules')->get("InputfieldText"); $field->attr('id+name', 'some_link'); $field->title = "Link"; $field->label="Some Link"; $field->columnWidth = 50; $field->value = $this->some_link; $wrapper->add($field); The result of what I want is this: [ some_link ] [ view ] where the view button opens the URL in a different tab. Can someone offer some insight?
  • Create New...