Jump to content

PWaddict

Members
  • Posts

    926
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by PWaddict

  1. How can I re-initiate it via AJAX?
  2. I've just upgrade from 3.0.45 to 3.0.46 and I'm getting the following error on both front-end and back-end: Warning: Declaration of ProcessWire\User::editUrl() should be compatible with ProcessWire\Page::editUrl($options = Array) in C:\xampp\htdocs\mysite.com\wire\core\User.php on line 479.
  3. Thanks for the quick fix. I'm trying to update the module via ProcessWireUpgrade but when I check if there is a new version it still says that the latest is the one I'm currently using the 1.1.2. Any idea why it doesn't show me the 1.1.3 version to update?
  4. The checkbox value is broken. Checked or Unchecked it always echo "1". Please fix it. Thanks.
  5. Thanks for the replies. LostKobrakai's solution is perfect. So, no need to have a module for that. Maybe this topic should be moved to another category. @teppo Already tried to do it but without any success. It's very confusing for me, that's why I asked for help. I wanted the class for ajax loading not to style it. @LostKobrakai Thanks for helping me once again
  6. Hello, I would like to automatically add a class to every internal link. The below module adds a class to every external link. Can someone modify it to do the same thing for internal links only? Thanks in advance. <?php /** * ProcessWire Mark External Links * * ProcessWire 2.x * Copyright (C) 2010 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ class TextformatterMarkExternalLinks extends Textformatter { public static function getModuleInfo() { return array( 'title' => 'Mark External Links', 'version' => 102, 'summary' => "Adds a class='external' and a rel='nofollow' to every external link." ); } public function format(&$str) { $str = preg_replace_callback('%<(a\s[^>]+)>%isU', array($this,"mark_external"), $str); } function mark_external($match) { list($original, $tag) = $match; $blog_url = 'http://'.$this->config->httpHost.$this->config->urls->root; if(strpos($tag, "nofollow")) { return $original; } elseif(!strpos($tag, 'http')) { return $original; } elseif(strpos($tag, $blog_url)) { return $original; } else { return "<$tag rel='nofollow' class='external'>"; } } } ?>
  7. Do you think it's safer if I store the pass on the php file instead of db?
  8. Thank you so much both of you Is there a way to encrypt the password?
  9. Here is the code to show disk usage. I have no idea how to convert it to PW module. Can someone do that? <?php // SETTINGS - START // PUT YOUR CPANEL HOSTING USERNAME HERE: $username = "username"; // PUT YOUR CPANEL HOSTING PASSWORD HERE: $password = "password"; // MODIFY THIS PATH TO REFLECT YOUR DOMAIN, REPLACING "DOMAIN-NAME" AND "YOUR-CPANEL-USERNAME": $query ="http://cpanel.yoursite.com:2082/xml-api/cpanel?user=USERNAME&cpanel_xmlapi_module=StatsBar&cpanel_xmlapi_func=stat&display=diskusage"; // SETTINGS - END $curl = curl_init(); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0); curl_setopt($curl, CURLOPT_HEADER,0); curl_setopt($curl, CURLOPT_RETURNTRANSFER,1); curl_setopt($curl, CURLOPT_USERPWD, $username.":".$password); curl_setopt($curl, CURLOPT_URL, $query); $result = curl_exec($curl); curl_close($curl); $xml = simpleXML_load_string($result); $df = $xml->data[0]->_count; // used MB $ds = $xml->data[0]->_max; // max MB $du = $ds - $df; // free MB if ($ds > 0) $perc = number_format(100 * $du / $ds, 2); else $perc = 0; $color = '#e87d7d'; if ($perc > 50) $color = '#e8cf7d'; if ($perc > 70) $color = '#ace97c'; echo '<li style="font-weight:bold;padding:5px 15px;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;background-color:#182227;margin-left:13px;color:#afc5cf;">' .'Free disk space' .'<div style="border:1px solid #ccc;width:100%;margin:2px 5px 2px 0;padding:1px">' .'<div style="width:'.$perc.'%;background-color:'.$color.';height:6px"></div></div>' .$du.' of '.$ds.' MB free'.'</li>'; ?>
  10. Hello Ryan, you forgot to update the htaccess on 2.8 version.
  11. Hello, Can someone PLEASE create a small module that is about the Hosting Usage? It will only have to display the Disk Space Usage and the Bandwidth Usage. For example: Disk Space: 500MB Used / 5GB Total Bandwidth: 5GB Used / 50GB Total That info must be grabbed directly from cPanel so the module's backend should have the ability for the user to add the cPanel username and password. The page "Hosting Usage" should be next to Page, Setup tabs or in the mini menu of View Site, Profile, Log out. Thanks in advance.
  12. Thank you so much Ryan for your amazing work. I'm wondering if you could tell us an ETA for the stable release of 2.8. Will it be this month, August or next year?
  13. Should I replace the _getCacheName function with the one from here?
  14. It has nothing to do with the HTTP2 server. Just some css / js files are getting the same filename.
  15. Yes, I'm asking for the Ryan's premium modules. Antti's sale for Padloper was great Sorry for posting to the wrong forum.
  16. Hello, I'm into the PW world for about a year and I haven't notice any sale for the Premium modules. Was there any sale in the past? Should I expect a new one soon? Thanks
  17. Hello, I'm using an HTTP/2 server so the recommended way is to have separate CSS/JS without merging them but when I try for example to minimize 5 files, at least 1 file is getting duplicated. This is issue doesn't happen when I merge them. Can you please fix it? Thanks
  18. I didn't noticed your PS above. I will check it out. Thanks for the suggestion.
  19. Thank you horst for the answer. I already read that from Wikipedia but I'm looking for something more practically than theory. I did a test to check the difference on TTFB between a PW & HTML page. On a PW page (template cache) I'm getting 600-650ms and on the HTML version of that same page I'm getting ~550ms. So I guess if I buy ProCache I will get ~550ms but do you know if it's possible to get better results? Or the ~550ms is the best I can get since that was done with an HTML page?
  20. Hello, I'm thinking to buy ProCache very soon but before I do that I have one question. Can ProCache improve the "Time To First Byte" (TTFB) ? Thanks!
  21. Hello, If I upgrade from 2.5.3 and 2.6.1 to 2.7.2 will the user permissions get affected? Thanks!
  22. Yeah, I know about it. I was just wondering if there is any difference.
  23. Hello, I would like to force the entire site to https. Should I do it on htaccess or on templates. Is there any difference? Thanks!
  24. On the .htaccess of PW there is already the mod_headers module with this code: <IfModule mod_headers.c> # prevent site from being loaded in an iframe on another site # you will need to remove this one if you want to allow external iframes Header always append X-Frame-Options SAMEORIGIN # to prevent cross site scripting (IE8+ proprietary) Header set X-XSS-Protection "1; mode=block" # prevent mime-based attacks via content sniffing (IE+Chrome) # Header set X-Content-Type-Options "nosniff" </IfModule> If I add your suggested code for mod_headers on the top of .htaccess will there be any issues by having 2 times the mod_headers?
  25. Hello, Here is a small contribution from me for the PW community I converted the Greek characters to ASCII ones so when a user writes a title in Greek language it will be auto validated. To do this you have to copy and paste the below values on Modules > Core > Page Name. α=a ά=a β=v γ=g δ=d ε=e έ=e ζ=z η=h ή=h θ=th ι=i ί=i κ=k λ=l μ=m ν=n ξ=ks ο=o ό=o π=p ρ=r σ=s ς=s τ=t υ=y ύ=y φ=f χ=x ψ=ps ω=w ώ=w It would be great if Ryan include this on the next PW release.
×
×
  • Create New...