Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/08/2023 in all areas

  1. This is a ProcessWire Fieldtype/Inputfield module so use on the frontend isn't something that's supported directly. If you have FormBuilder then the readme explains how to enable InputfieldStars for FormBuilder. If you are using the PW forms API for the frontend then it's really beyond the scope of this module support topic, but you can refer to forum topics like this: Essentially you would do something like this: /** @var InputfieldForm $form */ $form = $modules->get('InputfieldForm'); /** @var InputfieldStars $f */ $f = $modules->get('InputfieldStars'); $f->name = 'stars'; $f->label = 'Stars'; $form->add($f); echo $form->render(); Plus seeing as you are outside the PW admin the inputfield-specific JS and CSS are not going to be automatically included so you'll need to add them to your template file manually: <link href="/site/modules/FieldtypeStars/InputfieldStars.css" rel="stylesheet"> <script src="/site/modules/FieldtypeStars/rater-js/rater-js.js"></script> <script src="/site/modules/FieldtypeStars/InputfieldStars.js"></script>
    2 points
  2. That would actually be the start in the page array. To get a specific page, based on a selector with start and limit, you might want to look at this: https://processwire.com/api/ref/wire-input/page-num/ This way you can actually go straight to the specific page, like 3 of 7.
    2 points
  3. But actuals logs, stack and software version plus taking note of all files timestamp before doing any modif should be the minimum to help here.
    1 point
  4. You see this? That's fine! It's part of ProcessWire since version 3.0.152 - see here: https://processwire.com/blog/posts/pw-3.0.152/#new-ability-to-specify-custom-page-classes It tries to extend the Page class.
    1 point
  5. @gnarly Thanks, I added it to the post ? Welcome to the forums!
    1 point
  6. For noobs like me that needs a ";" on the end. when you get an "unexpected } on line 17". But thank you it's tremendously helpful having these examples.
    1 point
  7. Hi @theoretic Without details about how "big" the database is, I do not see any risks to upgrade to InnoDB. You should read the introduction made by @teppo and the post written by @ryan https://weekly.pw/issue/223/ https://processwire.com/blog/posts/using-innodb-with-processwire/ A nice and short explanation by @clsource : https://github.com/joyofpw/how-to-install-processwire#which-engine-is-better-myisam-or-innodb And of course, ingesting the official mysql dev doc (choose the right version according to your setup): https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html You might need to adjust some buffer settings, to get a first insight of it, you could run mysql-tuner, it take seconds to install and run, in order to get an easy to read report (steps below). ### Install wget (mandatory) ``` apt-get update apt-get install -y wget ``` ### Download mysqltuner ``` wget http://mysqltuner.pl/ -O mysqltuner.pl wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv ``` ### Run MySQLTuner ``` chmod u+x mysqltuner.pl ./mysqltuner.pl --user $MYSQL_USER --pass $MYSQL_PASSWORD ```
    1 point
  8. $session->foo = 'Foo!'; $wire->addHookBefore("Page::render", function ($event) { bd('hook fired'); bd($this->wire->session->foo); bd($this->wire()->session->foo); bd($event->wire->session->foo); bd($event->wire()->session->foo); bd($event->session->foo); bd($event->session->get('foo')); bd(wire()->session->foo); }); Choose whatever you like bist ? I prefer $this->wire->session->foo
    1 point
  9. I saw differnt ways to handle ajax calls. I use 2. and 3.(for more complex projects) 1. Ajax folder with php files for each request, which include processwire index.php 2. URL-Hooks https://processwire.com/blog/posts/pw-3.0.173/#new-type-of-hook-for-handling-request-urls 3. AppAPI Module https://processwire.com/modules/app-api/ (Uses URL-Hooks or pageNotFound-Hook) 4. ajax.php template file https://github.com/kreativan/wirekit-core/blob/main/site-wirekit-core/templates/ajax.php 5. ajax request logic in each template file
    1 point
  10. Be careful with your site. ? Please create a backup of your website files and database first before trying anything else. No access is better than no site. Does your /reset.php work or do you see a 404 page not found page or errors at all? If it does work you could try this code to create a new SUPERUSER: <?php // if previously tried with this solution // https://processwire-recipes.com/recipes/resetting-admin-password-via-api/ // you need to include ProcessWire here as well - line below // require "index.php"; $newadmin = new User(); $newadmin->of(false); $newadmin->name = "newCmsAdminUser"; $newadmin->email = "user@domain.tld"; $newadmin->pass = "aSecurePasswordHere"; $newadmin->addRole("superuser"); $newadmin->save(); $newadmin->of(true); ?> I really don't know if this will work with ProcessWire 2.2.3 or if you need further adjustments.
    1 point
×
×
  • Create New...