Jump to content

androbey

Members
  • Posts

    77
  • Joined

  • Last visited

Everything posted by androbey

  1. In addition to @louisstephens response: I think number 2 is more likely to be an input place for other meta tags (see overview). There you can also find info about what "robots" tag is used for and also info about "canonical". As for your other question on how to "improve your SEO": you may find more info when looking up the meta tags. Not all of them are used by search engines for the ranking (if this is your primary concern).
  2. Hi @horst, I just wanted to draw attention to a problem that might affect some in the future if TLS (or STARTTLS) is used. I wasn't sure where to put my concerns, so I decided to write them down in the support forum. Some email hosting providers will shut down TLS 1.0 support in the future (or already did so). The way your module currently relies on the SMTP class (when using PHP version >= 5.6.7) it only (and exclusively) supports TLS version 1.0 (see here https://github.com/horst-n/WireMailSmtp/blob/master/smtp_classes/smtp.php#L1295). The issue is better described by one comment on the PHP forum: https://www.php.net/manual/en/function.stream-socket-enable-crypto.php#119122. Can you maybe integrate an option to allow specifying one of the available PHP crypto type constants? Hopefully I don't bother you with this and maybe it is useful for somebody. Thank you for your work in any case!
  3. Hi everybody, unfortunately I am facing an issue, which I am both not able to resolve and don't know if here is the "right" place to ask for help. However, I am hoping that some of you can give me advice. To summarize what I want to do: From inside a template file I want to get page content from a file which is outside the site directory and using current ProcessWire session information (to "authenticate" the user, or rather just check if user is logged in or not). The external script is in a folder which lies on the same level as site and wire directories. Inside my template file I have: <?php function getContents($url){ $c = curl_init($url); curl_setopt($c, CURLOPT_VERBOSE, 1); curl_setopt($c, CURLOPT_COOKIEJAR, '/tmp/cookies.txt'); curl_setopt($c, CURLOPT_COOKIEFILE, '/tmp/cookies.txt'); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_COOKIE, $_SERVER['HTTP_COOKIE']); $content = curl_exec($c); curl_close($c); return $content; } $url = $config->externalURL . 'data/getEntries.php'; $response = getContents($url); From inside the external script ("getEntries.php") I "check" if user is logged in like: <?php namespace ProcessWire; //bootstrapping ProcessWire require('../../index.php'); function getAccessStatus(){ $session = wire('session'); //following does not work, because $session is empty, also $_SERVER['HTTP_COOKIE'] is null. if(wire('user')->isLoggedin() == true){ $res['success'] = true; $res['status'] = 'OK'; }else{ $res['success'] = false; $res['status'] = 'No Auth'; } return $res; } Am I missing something or is what I want to achieve not possible this way? Hopefully someone can help. Thank you, Andreas
  4. Hi, you can check if the checkbox is checked and check it in your page like this: // sanitize as text first! if($input->your_checkbox_name == "on"){ //checkbox cheked $page->your_checkbox = 1; //if checkbox not set value is 0 }
  5. Hi everyone, I have problems once again. This time it's about setting a certain field of a repeater item from a different page. This is what I have so far: I create a new repeater item on Page A via api using following code: // template of page A $item = $page->repeater_field->getNewItem(); //set content to fields.. $item->save(); $item_id = $item->id; //returns e.g. for $item_id = 1222 Now the goal is to set a field of that particular repeater item from Page B. But I am not able to get to the particular repater item to set a field. // template of page B $ref = $pages->get($page->page_a_reference->id); //With following code I get the repeater field items, but I cannot access (or determine) the repeater item I would like to get (with ID 1222). $rep = $ref->repeater_field; //Following code returns null //$rep = $ref->get(1222); What do I do wrong, or better asked, how can I set a field of a repeater item from different page?
  6. Hi @Flashmaster82, according to your post I assume two things: you try to build a navigation option to switch languages on the frontend of your site you have a plain text field called "language_icon" (and you store there a string representing the filename e.g. se.svg) If the above is not the case, please correct me or follow @macrura's post if you mean the admin page. Otherwise the following: You need to get the path to where the image or icon is stored. If that is e.g. in your site/templates/img folder, one way woul be: $config->urls->templates . "img/" . $language->language_icon Also, to actually display the icon you would have to use an image/picture tag inside the option tag.
  7. Hi @Michkael, that looks like, if the CSS (file) is not loaded correctly. What does dev tools' console say? Do mean with "config.ini" ProcessWire's "config.php"?
  8. HI @hellboy and welcome to ProcessWire ? In your function sendMail() you write : data: {test: "test"} The first test in this case wouldn't be a string but a variable. Try to change that into: data: {"test":"test"}
  9. I also did some research the last days about GDPR and want to share some notes on that. Most of the information is taken off official sources, but is without engagement. To add one thing to @szabesz note: Beginning with GDPR in May 18 the state will be that you are allowed to set cookies without any further approval from the user, if they (the cookies) are necessary so that you site or service works. Usually that are session cookies, or cookies that store the user's language. Every other cookie (to track or analyse user data) needs permission to be set (the so called "opt-in"). In this case you are not allowed to set the cookie without user permission. In general (and in most situations enough) you need some things in order to be compliant with GDPR: a up-to-date data protection policy on the website frontend a GDPR compliant data processing contract with all companies that handle personal user data according to your order (like the hosting provider, or e.g. Google Analytics, or whatever..) a documentation of technical and organisational measures a list of all data processing activities That does not take into account if you handle very sensitive personal data (e.g. race or relegion). So of course, not all is related to ProcessWire, but only implementing technical measures is not enough to get compliant. At the end the note, that a very important part is also to document all things related to data privacy (regulations). We - as the data processors - have to burden of proof.
  10. Hi @Maddogi, did you also make sure that "German" is selected in your user profile?
  11. Hi @flydev, thank you for your answer. It helped me finding my mistake (although I am not understanding what my mistake actually is). //this does not work (no output) $field = 'donationtext'.$lang; $test = $this->field; //this does work however $testArr = $this->data['donationtext'.$lang];
  12. Hi @Zeka, thank you for this link, didn't find that one. However, that did not worked out well for me. After applying the concept of Adrian, I always got the not default language outputted. I have a hardcoded version now. It's not good practice, but it does its job.
  13. Hi there, I feel like I have another rather stupid question, but I am stucked in a problem. I wrote a small module, which makes use of the multi-language option. The inputfield code looks like this: $donationText = $this->modules->InputfieldCKEditor; $donationText->useLanguages = true; $donationText->name = 'donationtext'; $donationText->label = 'Donation CTA Text'; $donationText->value = $this->donationtext; $donationText->required = true; $wrapper->add($donationText); My simplified render method in the module looks like this: public function renderDonationCTA(){ echo $this->donationtext; } However, when I call this method in my template code only the default language gets outputted. What did I miss or what can I do, in order to output the inserted text in the "right" language?
  14. Hi there, I was wondering if it is possible to use an image field with the popular "Simple Contact Form" of @justb3a? When I tried I got the following error message (without even "uploading" an image): Call to a member function path() on null in C:\xampp\htdocs\pw2\wire\modules\Fieldtype\FieldtypeFile.module on line 184 As I don't want to save messages on the server (so just sending an image), it shouln't be a security issue, I guess. But is it possible to use an image field with the SimpleContactForm module?
  15. Hi @szabesz, thanks for pointing out. Definitely will have a look at this module. Seems to be a more practicable way, like @Robin S wrote.
  16. Hi @Robin S, thank you very much for your reply. Really appreciate your help. You are right, in general my logic wouldn't make sense at all. In my case this field serves as a kind of archive (which is necessary to satisfy a duty to preserve records), even though I know it's not ideal. Anyway, I think I have still a lot to learn about hooks and how to use them. Have a good day!
  17. Hello, I'm rather new to ProcessWire, but love all the possibilities it gives us. Also, I'm a rather unexperienced developer, so please forgive me. What I like to achieve: I want to prevent users (that are not superusers) from deleting files (which are uploaded through/with a file field in ProcessWire) or at least to send a mail when someone deletes that file. I'm developing a kind-of intranet for a NPO in order to push digitalisation. However, for quality management, files should not be deleted unnoticed by not authorized persons. Is this kind of thing even hookable? I found with the help of Captian Hook, that there is a delete hook for fields and also this one: $this->addHookBefore('Fieldtype::deleteField', function(HookEvent $event) But I'm afraid that this won't help for my issue, will it? Here's my very first attempt of a module.. class Disabledelete extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Disable File Delete Functionality', 'version' => 3, 'summary' => 'Should disable delete functionality for files.', 'singular' => true, 'autoload' => true, ); } public function init() { $this->addHookBefore("File::deleteField", $this, "disableDelete"); } public function ___disableDelete($event) { //But what to do here? (If even here!) } } Hope you can help me out there!
  18. Hi @flydev, thank you for replying. Works as expected. Thank you for your help!
  19. Hello again! Unfortunately I came across another problem. I have a "regular" ProcessWire setup and want to create a separate php script. That script should be executed by a cron job and is bootstrapped with my PW setup. Main goal is to send mails which are stored in a email field. My problem: I want to access a specific field from a template where only specific users have access to. Right now, the cron job is executed as "guest", of course. How can I bypass this restriction, so that I have access to that specific field (it's only one email field)? Does it make sense to set current user via api? Hope you can help me out there. Cheers, Andreas
  20. Hi bernhard, thank you for your tips. You're right, using a workaround I could nearly get the desired outcome. However, I would say that both solutions come with a huge downside (uploading more images than necessary..) .
  21. I think it would be a great advantage for images to have an option to translate image tags, alongside the translatable description field (when using PWs language feature at all). This feature could improve the multi language support in ProcessWire even further, thus the usability of it. As a side effect that would also mean, that image tags could be easily used with the search engine, when dealing with a lot of images.
  22. Hi @heldercervantes, thanks for your reply. I see and I was afraid to hear that. Personally, I wouldn't have a big problem using extra fields for that purpose, but it looses a lot of usability for the actual client using the feature. As I am using the build in API to find images based on tags (and the capabilities that comes along with that), it would mean a huge loss for my current implementation. Thanks also for the hint to add it to the feature request list. Will add it there.
  23. Hello there, I was wondering if it's possible to somehow translate image tags. Right now I have a page which outputs all images related to one tag in a single container (as there are many tags this results in various containers). Every container has a title (and id) with the tag string, but currently only in the language of the entered tags. Using the PW format inside the code like this does, of course, not work.. _x($variable,'translated Tag') Is there a way to achieve this, without using workarounds (like extra fields)? Cheers, Andreas
  24. Thank you both, Robin S and wbmnfktr! I managed to achieve the desired behaviour by setting a GET Variable in the redirect URL and adjusted the code. I already did prepend the "_init.php" file, but was probably overwriting the session variable.. Here's the code I use in my "_init.php": if(!$user->isLoggedin()) { //'returnID' is my GET variable and page id 1055 is my start page (not log-in page). if(isset($_GET['returnID']) && $page->id!=1055 ){ $session->set('returnPage', $_GET['returnID']); } } Thanks again, you helped me a lot.
×
×
  • Create New...