Jump to content

PWaddict

Members
  • Posts

    908
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by PWaddict

  1. I removed the "new" button not the edit one. Clients edit what they see in front of them so I doubt they will try to find that specific "new" url and enter it manually instead of just going to the PageTable page. I will also use your Restrict Tab View module to hide the children tab to avoid adding pages from there too. Do you know if it's possible to also prevent loading the children pages on the page tree from that specific parent? The client should be able to see the total number of children pages next to it's parent but when they click on that parent it will NOT load the children pages.
  2. So I guess the only option is this but unfortunately I don't have the knowledge to do that hooking. Can you help if it's easy for you? All I want is to remove the "New" button from a specific page id.
  3. But if it moved under the Admin branch the urls of the pages created via PageTable will include the /admin/ or no?
  4. I would like the site editor to be able to add children pages on specific page ONLY through Page Table instead of using the "New" button next to the parent page. Is this possible?
  5. How can I display on the backend the pages created with this module as titles instead of names? For example I'm currently see the pages as: test-30-jan-2017. How can I see them as: Test 30 Jan 2017? Sorry that was my mistake.
  6. I display a button ONLY if there are more than 3 children on a specific template. So, I'm doing this: $posts = $pages->find('template=posts-content'); if(count($posts) > 3) { echo "Button"; } On some point that template will have hundreds of children. Is the above method ok or should I use findMany? $posts = $pages->findMany('template=posts-content'); if(count($posts) > 3) { echo "Button"; } or is it better to just use a limit on the selector? $posts = $pages->find('template=posts-content, limit=4'); if(count($posts) > 3) { echo "Button"; }
  7. How can I re-initiate it via AJAX?
  8. 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.
  9. 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?
  10. The checkbox value is broken. Checked or Unchecked it always echo "1". Please fix it. Thanks.
  11. 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
  12. 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'>"; } } } ?>
  13. Do you think it's safer if I store the pass on the php file instead of db?
  14. Thank you so much both of you Is there a way to encrypt the password?
  15. 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>'; ?>
  16. Hello Ryan, you forgot to update the htaccess on 2.8 version.
  17. 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.
  18. 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?
  19. Should I replace the _getCacheName function with the one from here?
  20. It has nothing to do with the HTTP2 server. Just some css / js files are getting the same filename.
  21. Yes, I'm asking for the Ryan's premium modules. Antti's sale for Padloper was great Sorry for posting to the wrong forum.
  22. 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
  23. 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
  24. I didn't noticed your PS above. I will check it out. Thanks for the suggestion.
×
×
  • Create New...