Recent content by LPH

  1. LPH

    Switch case fallthrough

    OMG. I've looked at this code for months. Thank you for pointing out a very huge error. I can now see that it was originally an if-elseif and I didn't properly change it to a switch.
  2. LPH

    Switch case fallthrough

    I guess my knowledge is too rough on using switch. Isn't a default not necessary when the options are all provided in the switch? Is it worth putting in the default: // do nothing ? As an update, the change in this block of code didn't fix the error. It did lead me to question the WordPress...
  3. LPH

    Switch case fallthrough

    The following code does not show an error in PhpStorm IDE but this leads to a switch fallthrough (which I didn't intentionally do in the block of code). $author_option = $this->options['select_author']; switch ( $author_option ) { case ( $author_option...
  4. LPH

    XF 2.2 Is the public type in router necessary?

    I'm curious if the public type in router is necessary. The type was missing in code I wrote a few years ago but the code still appeared to work. Hovering over the router() with PhpStorm shows null | string. I went ahead and added the public type but am really curious what it does since 'admin'...
  5. LPH

    XF 2.2 UserAlert Author

    That is cool. Thank you!
  6. LPH

    XF 2.2 UserAlert Author

    The following code has worked for quite some time, but I've moved it to its own class and am now getting the statement: Expected parameter of type 'void|\XF\Entity\User', '\XF\Mvc\Entity\Entity' provided /** * @param $post * * @return void */ public function...
  7. LPH

    XF 2.2 External call to get username/usergroups

    Try a dump after the conditional. if ($groupid != '5') { dump($groupid); } Alternatively, you can place any dump for a different variable above that area to see if something is being returned.
  8. LPH

    XF 2.2 Updating Free Widget Addon But ...

    This is a good idea. Currently, I've shifted to an XF page and template but want to change as I learn more XF.
  9. LPH

    XF 2.2 Error in PhpStorm terminal building addon

    This was the solution, in case someone else runs into this problem. MAMP Pro php.ini had the mysqli driver commented. I uncommented it and restarted the server. However, this didn't work. It took a complete reboot of the machine and now the add on rebuilt properly under 7.4.16.
  10. LPH

    XF 2.2 Error in PhpStorm terminal building addon

    The following error happens in PhpStorm terminal when attempting to build an addon. Fatal error: Uncaught Error: Call to undefined function mysqli_report() in C:\MAMP\htdocs\community\src\XF.php:113 Stack trace: #0 C:\MAMP\htdocs\community\src\XF.php(75): XF::standardizeEnvironment() #1...
  11. LPH

    XF 2.2 Updating Free Widget Addon But ...

    Right. Sorry @XFA -- I was half asleep. The challenge is -- if a user places the widget on the sidebar then it should be block-minorHeader and if placed in the page I'm designing then it should be block-header. I'll leave it block-minorHeader in the addon template until I figure out a way.
  12. LPH

    XF 2.2 Updating Free Widget Addon But ...

    I hope this is the best place to ask because it is a free add-on I built for XF 2. I'm updating the widget so that it can show properly above the forum list. Unfortunately, the title is using class=block-minorHeader rather than block-header. I can change the CSS through inspect and see that...
  13. LPH

    Thread Stencil -- Default and customizable content for posts per forum [Deleted]

    Did you find an answer? I fixed this error by using phpMyAdmin, clicking the XF database, going into xf_forum -> structure -> drop thread_stencil from the database.
  14. LPH

    XF 2.2 fn deprecated to fnBbCode

    OK. Here is from community/src/XF/EditHistory/Post.php starting at line 75 public function getHtmlFormattedContent($text, Entity $content = null) { return \XF::app()->templater()->func('bb_code', [$text, 'post', $content]); } And here was what was tried return...
Top Bottom