Jump to content

Raymond Geerts

Members
  • Posts

    365
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Raymond Geerts

  1. Basicly you have one folder for templates by default. This is configured to be in "site root" + templates/ You are able to overrule this setting from the site/config.php as follow $config->urls->templates = $config->urls->site . 'mytemplates/'; $config->paths->templates = $config->paths->site . 'mytemplates/'; A trick i use a lot when developing in a live site is to duplicate the template folder and rename the copy to templates-dev. Then make sure i have an other domain (or subdomain) pointing to the hosting, for example dev.domain.ext and for the live site on www.domain.ext With the following code i can access the development templates while normal visitors keep getting the default templates. /** * Development: Alias for template-dev access * */ if($_SERVER['HTTP_HOST'] == 'dev.domain.ext') { $config->urls->templates = $config->urls->site . 'templates-dev/'; $config->paths->templates = $config->paths->site . 'templates-dev/'; $config->debug = true; } You can make up all kind of 'rules' to go by when overruling the templates folder with php from the config.php file. For example serving the same site with different layout and code for mobile on m.domain.ext /** * Mobile: Alias for template-mobile access * */ if($_SERVER['HTTP_HOST'] == 'm.domain.ext') { $config->urls->templates = $config->urls->site . 'templates-mobile/'; $config->paths->templates = $config->paths->site . 'templates-mobile/'; }
  2. No problem, i understand that u need to do this manual and is not something with high priority among other work. Isnt this possible to automate with the github automatic page generator and some grunt / nodejs script. https://help.github.com/articles/creating-pages-with-the-automatic-generator/ I'm not familiar with owzim bash script. What automatic services can run on github so that it will be completely automatic?
  3. Any chance you could update this to the latest dev version? http://somatonic.github.io/Captain-Hook/
  4. Hi Kogondo, Thanks for the quick reply. Adding the permission 'blog' to the role 'blog-author' look likes its sufficient for my needs. (havent tested it all yet) Now i only need to do is redirect a logged in user with blog-author role to the blog page after loggin in.
  5. When i create a user with roles guest and blog-author, as soon they log in to the manager the only thing shown is a continue link, redirecting them to the home page of the site. How can they create a new blog entry? I do not want to give them superuser privileges. I'm running PW 2.5.10 dev with ProcessBlog 2.3.0
  6. Have this in my bookmarks, never used it, but looks like it might come in handy for your needs. http://fontello.com/ It lets you pick the icons you need and export it as a web-font, you can even upload your or other icon fonts and use those
  7. This is possible straight from the API. Ryan posted an example of this on the following topic. https://processwire.com/talk/topic/296-programmed-page-creation-import-image-from-url/?p=2016
  8. I have added the ability to set the assigned datetime manually. This can be done by setting the assigned value to the page you going to add. For example: $friend = $users->get('johndoe'); $friend->assigned = "2012-01-01 12:12:12"; $page->myfriends->add($friend); $page->of(false); $page->save(); When you want to modify the value of an already assigned page you will have to remove it first and then add it again with a new assigned datetime value. $friend = $users->get('johndoe'); $page->myfriends->remove($friend); $page->of(false); $page->save(); $friend->assigned = "2012-01-01 12:12:12"; $page->myfriends->add($friend); $page->of(false); $page->save();
  9. The homepage loads fine. But clicking on any of the menu items in the main nav i get a "Not Found" error. Site homepage looks great by the way
  10. kogondo was a little faster, anyway also not tested, just grabbed from a module i was working on. This also includes the creation of the page containing the template. $fieldgroup_category = new Fieldgroup(); $fieldgroup_category->name = 'template_category'; $fieldgroup_category->add($this->fields->get('title')); $fieldgroup_category->save(); $template_category = new Template(); $template_category->name = 'template_category'; $template_category->fieldgroup = $fieldgroup_category; $template_category->noChildren = 0; $template_category->noParents = 0; $template_category->slashUrls = 1; $template_category->urlSegments = 0; $template_category->pageLabelField = 'title'; $template_category->save(); $page_category = new Page(); $page_category->template = $template_category; $page_category->parent = 1; $page_category->title = 'Category'; $page_category->name = 'category'; $page_category->process = $this; $page_category->save();
  11. I like how the grey background makes the active tab realy pop out
  12. This is something i havent tried yet, so at the moment i think its not possible. I will take a look at it and if it can be build in i will add it and update the module(s) You are right about that, somehow i messed it up, looking at my code i tested with i see i turned output filtering off so thats must be where it went wrong I have edited the instructions here and on github. Thanks for noticing
  13. Not all servers let you set error_reporting from inside a php script. Gebeer mentioned that he saw notices even with $config->debug = false; So i presumed that on his server this is the case.
  14. Most likely your php.ini file has set error_reporting to some value that contains E_NOTICE Setting $config->debug = true; will do the same and show E_NOTICE. In a devlopment environment this can be desirable. On a live server i would change this to something like E_ALL & ~E_NOTICE See the following page for more information on error reporting. http://php.net/manual/en/function.error-reporting.php If you want to hide the notices when $config->debug = false; you should change error_reporting to E_ALL & ~E_NOTICE if you have access to the php.ini file.
  15. The first issue was fixed and will be available in the dev branch. You mention that you see the System Updater messages on each page load in the admin section, this is something Ryan might have to take a look at since it actualy has to run only once, so it seems its not applying the system updates in the database. On PW 2.5.6 and 2.5.7 i do not see these notifications when $config->debug = true; edit: forgot the not in "i do not see"
  16. You could fix this by modifying the given line from if($data['searchFields'] == 'title body') { to if(isset($data['searchFields']) && $data['searchFields'] == 'title body') { Seems that $data['searchFields'] is undefined, thats causing it to throw a notification. In general notifications are not much of a problem, altough if it occurs a lot the error.log file can grow tremendously large. I remember having to look at a site suffering from undefined variables in a loop, causing it to write 5 lines to the log file for every visitor to the page, by the time the problem was noted the log file was over 2 GB. Not that the specific notification you mention will do that, as far i know that SystemUpdate script is only run once.
  17. FieldtypePageWithDate & InputfieldPageWithDate Module for ProcessWire - Page Reference with Date Field - Field that stores one or more references to ProcessWire pages Modified version of the FieldtypePage module in ProcessWire with extra datetime field containing the date a page was added to the inputfield. Github URL Link: FieldtypePageWithDate To install Copy to /site/modules/ and go to Admin > Modules > Check for new modules. Requirement Requires: InputfieldPageWithDate (will be installed automaticly) Tested on ProcessWire 2.5.6 dev Setup in back-end install both modules:FieldtypePageWithDate InputfieldPageWithDate create a new field in ProcessWire and give it a nameeg. myfriends as type choose PageWithDate choose the right dereference for your needs (all 3 modes work fine with this field)Multiple pages (PageArray) (in this example we are using this) Single page (Page) or boolean false when none selected Single page (Page) or empty page (NullPage) when none selected assign a selector to the field, in this example we will use users Template of selectable page(s) (select the user template) choose a label field, since we are using users set it to name Label Field name set an input field type, depending if you are using dereference of multiple or a single pagefor this example we are using AsmSelect save the field and assign it to a template of choice Add some users/friends to the field by editing a page with this template Usage in front-end In you template you can acces the field as you usualy do with any FieldtypePage. In addition to this the new parameter "assigned" is available Multiple pages if (count($page->myfriends)) { foreach($page->myfriends as $friend) { echo "id: ".$friend->id."<br>"; echo "name: ".$friend->name."<br>"; echo "assigned on: ".$friend->assigned."<br><br>"; } } This will output something like: id: 1031 name: johndoe assigned on: 2014-10-31 14:22:02 id: 1032 name: janedoe assigned on: 2013-04-15 23:16:38 Note: To use your own data/time formatting set $friend->of(false); to get a unix timestamp from the database Single page echo "id: ".$page->myfriends->id."<br>"; echo "name: ".$page->myfriends->name."<br>"; echo "assigned on: ".$page->myfriends->assigned."<br>";This will output something like: id: 1031 name: johndoe assigned on: 2014-10-31 14:22:02 Note: To use your own data/time formatting set $page->myfriends->of(false); to get a unix timestamp from the database Edited: removed extra date() formatting since value is formatted by default. Set assigned datetime manuallyYou can set datetime manually by assigning it to the page you add $friend = $users->get('johndoe'); $friend->assigned = "2012-01-01 12:12:12"; $page->myfriends->add($friend); $page->of(false); $page->save(); Edited: Added information on manually setting the assigned to a datetime value. (if you previously installed this module you need to update atleast the FieldtypePageWithDate.module file)
  18. I wouldnt recommend using my code as it was merely to demonstrate how i did it inside a module. SInce the module isnt standalone and still in development its no use to give the full code. Besides that using a scope (like public, private, protected) for a function/methods can only be used inside a class. When you define a function outside a class leave away the scope. function actionHybridAuth() { // rest of the code } But again using my code without the rest of the modules that belong with it will not work. Sorry i cant be much of a help there. Anyway i would recommend to read some into using classes, methods and such, since the HybridAuth is a class by itself. Implementing it in to your ProcessWire project will require some basic understanding of how to use PHP classes and methods.
  19. On the google developer page the whole procedure is described. In fact its nothing more than placing a piece of javascript inside your HTML. Once you have a finished site, create an adsense account, follow the instructions and wait for google to approve your website. http://www.google.com/adsense/start/how-it-works.html
  20. When you implement it yourself you dont need the processwire module. It will work fine integrating it into template(s).
  21. You could make a template that initializes the Hybrid Auth class, assign it to a page and use that as endpoint URL. For example: /** * Provides HybridAuth actions * */ public function ___actionHybridAuth() { if (!$this->isHybridAuth) return; if ($this->page !== self::$fup['hybridauth']) return; if ($this->sanitizer->name($this->input->urlSegment1)) { $this->initializeHybridAuth(); } else $this->endpointHybridAuth(); } /** * Initializes HybridAuth endpoint * */ public function ___endpointHybridAuth() { if (!$this->isHybridAuth) return; if ($this->page !== self::$fup['hybridauth']) return; @require_once (dirname(__FILE__) . '/Hybrid/Auth.php'); @require_once (dirname(__FILE__) . '/Hybrid/Endpoint.php'); Hybrid_Endpoint::process(); } (note: above example is part of a module i'm working on, the code is just for illustrating a way of using hybridauth class inside a module, the code itself wont do much without the rest of the module)
  22. Hybrid Auth will look for a path or array that you pass as $ha_config in to new Hybrid_Auth( $ha_config ); So if you have a config file somewhere assign its path to $ha_config before you assign an instance of the class. Altough in the project i'm working on i'm passing an array with all the config values into it. /** * Gets HybridAuth config data from module configuration settings * */ public function ___getHybridAuthConfig() { if ($this->page->template == "admin") return; if (in_array('active', $this->get('hybridauth'))) { $this->isHybridAuth = true; $this->hybridAuthConfig = array( 'base_url' => $this->getHybridAuthBaseUrl(), 'providers' => array( "AOL" => array( "enabled" => $this->get('hybridauth_aol_status') == 'enabled' ? true : false ), "Facebook" => array( "enabled" => $this->get('hybridauth_facebook_status') == 'enabled' ? true : false, "keys" => array( "id" => $this->get('hybridauth_facebook_app_id'), "secret" => $this->get('hybridauth_facebook_app_secret') ), "trustForwarded" => in_array('trust_forwarded', $this->get('hybridauth_facebook_trust_forwarded')) ? true : false ), "Foursquare" => array( "enabled" => $this->get('hybridauth_foursquare_status') == 'enabled' ? true : false, "keys" => array( "id" => $this->get('hybridauth_foursquare_app_id'), "secret" => $this->get('hybridauth_foursquare_app_secret') ) ), "Google" => array( "enabled" => $this->get('hybridauth_google_status') == 'enabled' ? true : false, "keys" => array( "id" => $this->get('hybridauth_google_app_id'), "secret" => $this->get('hybridauth_google_app_secret') ) ), "LinkedIn" => array( "enabled" => $this->get('hybridauth_linkedin_status') == 'enabled' ? true : false, "keys" => array( "key" => $this->get('hybridauth_linkedin_app_id'), "secret" => $this->get('hybridauth_linkedin_app_secret') ) ), "OpenID" => array( "enabled" => $this->get('hybridauth_openid_status') == 'enabled' ? true : false ), "Twitter" => array( "enabled" => $this->get('hybridauth_twitter_status') == 'enabled' ? true : false, "keys" => array( "key" => $this->get('hybridauth_twitter_app_id'), "secret" => $this->get('hybridauth_twitter_app_secret') ) ), // Windows Live "Live" => array( "enabled" => $this->get('hybridauth_windowslive_status') == 'enabled' ? true : false, "keys" => array( "id" => $this->get('hybridauth_windowslive_app_id'), "secret" => $this->get('hybridauth_windowslive_app_secret') ) ), "Yahoo" => array( "enabled" => $this->get('hybridauth_yahoo_status') == 'enabled' ? true : false, "keys" => array( "key" => $this->get('hybridauth_yahoo_app_id'), "secret" => $this->get('hybridauth_yahoo_app_secret') ) ) ), // If you want to enable logging, set 'debug_mode' to true. // You can also set it to // - "error" To log only error messages. Useful in production // - "info" To log info and error messages (ignore debug messages) "debug_mode" => "", // Path to file writable by the web server. Required if 'debug_mode' is not false "debug_file" => $this->config->paths->logs . "hybridauth.txt", ); } }
  23. By adding the following to the stylesheet i got it centered (with the default template) #ProcessLoginForm { text-align: center; } #ProcessLoginForm > .Inputfields { display: inline-block; } #ProcessLoginForm .Inputfield { text-align: left; }
  24. I havent tested but you could try: 'autoload'=> function() { return wire('modules')->isInstalled('UserFrontendRegister'); }, Edit: changed wire('module') to wire('modules')... my bad
×
×
  • Create New...