Jump to content

fruid

Members
  • Posts

    679
  • Joined

  • Last visited

  • Days Won

    3

fruid last won the day on August 25 2022

fruid had the most liked content!

Recent Profile Visitors

2,436 profile views

fruid's Achievements

Hero Member

Hero Member (6/6)

87

Reputation

  1. I want the users to be able to subscribe to different lists depending on the page the subscribe form appears on. Is that doable? My guess is it should be, since it would be similar to the functionality of "following" a topic here in the ProcessWire forum – doesn't the forum use ProMailer for email updates? I read through the documentation and neither "custom fields" nor "users/pages list type" would accomplish what I want. Not the former as it would just save the page info (let's say that's I have a custom field for that) along with email address and whatnot in the user entry of the subscriber's list, and not the latter as it would just allow for a closed list of pre-defined users that no-one can subscribe to if they so wish. Thanks for help! I know ProMailer is a pro module but I cannot find (or access?) the ProMailer forum anymore.
  2. Thanks @ryan I didn't see that checkbox but I did see an input field Number of Seconds to Cache Exchange Rate Data It was set to 86400, so I set it to 0 and saved. Then I was able to see the table with all codes, names, symbols and rates. Now I also see the checkbox. Weird, I am still on version 3. Anyways, yes, HKD is listed. (Actually not one currency was working before). Now it seems to work again. I wonder, if I need to do this regularly i.e. lower the number of seconds when the cache is cleared?
  3. I'm having troubles using the methods ->getName() and ->getNames() $cc = wire('modules')->get('ServiceCurrencyConversion'); $currencyArray = $cc->getNames(); // array (0) $currency = 'HKD'; $cc->getName($currency); // null warnings: PHP Warning: Undefined array key "HKD" in .../ServiceCurrencyConversion/ServiceCurrencyConversion.module:341 PHP Warning: Trying to access array offset on value of type null in .../ServiceCurrencyConversion/ServiceCurrencyConversion.module:341 I logged into my openexchangerates.org account and there seems to be no outage. Any ideas what this could be?
  4. Any news on that front? I have an images field on a page with a CKEditor field. When I add to that text content a gif from the images field, the gif gets resized and is not animated. I understand this is a bug that is yet to be fixed but is there a workaround in the meantime? Since I'm not displaying the images programmatically I cannot use the API e.g. Pageimage::getOriginal()
  5. I thought extending the user class was not possible since it's a special case and I should use the module approach instead. Has that change in the meantime?
  6. Though this is very helpful, I am still not sure how this works. I can do stuff like this: i.e. access the custom public methods of the user object from outside the class. I have also of course no problem accessing private classes within the here discussed user extension class. However, how does the code change when I define and use a public method from inside and from outside the class. Do I need to pass it the $event?
  7. Hello dear processwirers, I hope you are doing well. I'm a bit stuck implementing this module. Since the "Edit Profile"-form renders when the GET-params are "profile=1" But that form also submits to the same page with the same GET-params "profile=1" I don't see how I can redirect the page upon form submission without ruling out the case that the user is just on the edit profile page. That also means that when the form was submitted and I refresh the page, the browser asks me if I want to resubmit. In more technical terms: how can I edit the form action URL? Thanks for help!
  8. I meant only return /de/ or /en/, is there no native method to do that?
  9. what's the best way to return the user's current language specific URL segment? I mean for example /en/ or /de/ depending on the user's active language?
  10. I want to create a web app where users can login/register via Google I've seen a handful of modules that promise similar things including Oauth2Login, SocialLogin and GoogleClientAPI What I need is the user to be able to login/register via their Google-account and upon that to be logged-in both in their PW-CMS account as well as in their respective Gmail-account in the browser and me to have access to specific data via Google API. My guess is I would need to combine two modules? Maybe GoogleClientAPI with LoginRegister? Or GoogleClientAPI with LoginRegisterPro? Or can GoogleClientAPI do both? Thanks for suggestions!
  11. I'm trying to create a hook that would populate my SEO-Markup fields automatically with some field values of the page upon saving. For some reason I cannot access the MediaManager image field's ->media property and its properties, it returns null. I do see this in the tracy console though… //ready.php $wire->addHookBefore('Pages::saveReady', function($event) use($sanitizer) { $page = $event->arguments[0]; if (!$page->id) return; if ($page->isChanged('seo_title') || $page->isChanged('seo_image') || $page->isChanged('seo_description')) return; // SEO image :D if ($page->seo_image == '') { $filled = false; bd($page->mema_images); // see screenshot bd($page->mema_images->count); // 3 if ($page->mema_images->count > 0) { $imageURL = $page->mema_images->first->media->url; bd($imageURL); // null :( $filled = true; } if ($filled == true) { $imageURL = strval($imageURL); $page->seo_image = $imageURL; $page->message('SEO image was filled because it was empty :D'); $filled = false; } } // SEO description :D - this works fine if ($page->seo_description == '') { $filled = false; $description = ''; if ($page->preview != '') { $filled = true; $description = $page->preview; } if ($filled == true) { $description = SEOcleanUp($description, $sanitizer); $page->seo_description = $description; $page->message('SEO description was filled because it was empty :D'); $filled = false; } } $event->arguments(0, $page); });
  12. The module still needs quite some improvement. One issue that needs attendance is the following. I build a selector and select a page array from the database. $selector = $this->createSelector($this->q, $category); bd($selector); $unfilteredMatches = $this->pages("$selector, start=0, limit=99999"); As discussed in this thread it's (so far) impossible to select pages based on language specific field values. So the query looks through the field values in all languages for the search term. Since this is not what I want, instead I want the query to only match the fields values of the current user language, I do another loop and within that loop, with the method buildSnippets() I create the snippets for the markup. If this returns null (this is now language specific) I sort out the page entirely. $strippedFieldValue = strip_tags($fieldValue); // Find the position of the search term in the field value $position = stripos($strippedFieldValue, $searchTerm); // If the search term is not found, return an empty string if ($position === false) { return false; } So basically I'm selecting once via selector and then narrow it down with a loop. That works for a one-term search query or an exact phrase, but it makes sense that It won't and doesn't work when the search operand is on the fancier side as listed here: https://processwire.com/docs/selectors/operators/#contains What would you suggest? Is my approach so far sensible? Should I hard-code a different loop condition for each of the fancy search operands? I want to give the module-user (not enduser but admin user) the option to adjust the search operand in the module's settings. Thanks for help!
  13. OK I found the culprit. I was initiating the module on a custom page class just to make use of one method., not a good idea.. Now that I found a work-around it works fine and I can uninstall with no issues.
×
×
  • Create New...