Jump to content

horst

PW-Moderators
  • Posts

    4,064
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. Normaly there should be no conflict: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/Session.php#L9 But how have you done it? Included PW at the first line, - or somewhere in between? Have you logged a var_dump of $_SESSION and wire('session') or have you tried to use the global var $session what is not available in bootstraped scripts? Have you logged it before and after bootstrapping PW, if you do not include it at first? It depends on the code of the hybridauth-script where to look for potential conflicts. Have you turned debug on? Any errors? Have you outputted / logged errors from the hybridauth script? What does not work, what is different running it without pw? A few details surely could help people to help you ;-) --------------------------------------------------------------------------------------------------------------------------------------- EDIT: After reading a bit of that stuff it seams to me that the way to go should be: forget about calling a external script write a module that hooks into Session::authenticate use a few lines of code from the hybridauth-API to authenticate through a provider Additional to the above basics you have to build a layer where you list the providers you want to use for authentication. The user first need to select one. Maybe you need to hook into Session::login instead of Session::authenticate, but you will find out if you start testing
  2. Hi Charles, the site is looking great. At first I like the colors, don't really know why! (just kidding) The screen of the information portal is suuuuper. While one can only guess what is behind it, it is not much imagination required to come to the conclusion that certainly it makes fun to work with it. Impressive work.
  3. Hi Helmut, you may create a new template with its own template file. Create a blank textfile and call it myform.php, copy it into the site/templates/ folder of pw. Go into the pw admin and under setup templates and create a new template. There should be a list with template filenames from your site/templates/ folder (without the .php extension). Check the one you have newly created and save it. Now create a new page under homepage and assign your form-template to it. Lets say the url of it is "/contactform/". Go to your Editor and write into your template file some code like that: <?php if($input->post->aFormFieldName) { // a user has send the form, proceed the data and display a thank you message ... echo "<h4>Thank you for contacting us. We will get back to you soon."; return; // stop with template code here } // if we have no post data, lets display a html form $myForm1 = " <form action='{$page->url}' method='post'> // your inputfields and buttons here </form> "; echo $myForm1; Now go to the browser and call: example.com/contactform/ and try it out. If you use a profile with header.inc and footer.inc, add it to the template file like it is within the other template files: <?php include("./head.inc"); if($input->post->aFormFieldName) { // a user has send the form, proceed the data and display a thank you message ... echo "<h4>Thank you for contacting us. We will get back to you soon."; include("./foot.inc"); // load the footer here, because we stop template execution in the next line! return; // stop with template code here } // if we have no post data, lets display a html form $myForm1 = " <form action='{$page->url}' method='post'> // your inputfields and buttons here </form> "; echo $myForm1; include("./foot.inc"); Have fun!
  4. I really like all the minify and less support. Actually I use the Spex-Module from Jonathan. With the next project I want to use AIOM+. Only one question for me is if it is an improvement to use domain sharding today. Before 2010, max 2 simultaneous connections was allowed. Today 6-8 are allowed/used. Without images you may need 1 html + 1 css + 1 js + 1 optional for Fonts = 4 related article: http://www.mobify.com/blog/domain-sharding-bad-news-mobile-performance/
  5. horst

    Satu

    Thank you for the explanation and link to sequence-js. But I think sequence.js would be to much overhead for a little Ken-Burns effect. To write a own small script is a much better way
  6. horst

    Satu

    Hi Fokke, really great site. Very good presentation and modern design. Most I like the moving of the slideshow images on the homepage. Is this realized with a jQuery-Plugin only, or is this mainly a CSS3-animation/transition thing? (I'm not very familiar with this stuff)
  7. http://processwire.com/talk/topic/3543-register-users-and-add-page-same-as-username/#entry34854
  8. also worth a look: http://processwire.com/talk/topic/3812-htaccess/?p=37295
  9. @adrian: if the actual page isn't in $pids, there is no need to load page 1114 into memory $pids = array(1010, 1011, 1022); if(in_array($page->id, $pids)) { $downloads = $pages->get("1114"); echo "$downloads->body"; }
  10. This thread also covers a part of that: http://processwire.com/talk/topic/5573-hook-for-sending-mail/
  11. Yes, that's right. I use a 404 log with file: public function init() { $this->addHookBefore('ProcessPageView::pageNotFound', $this, 'hookLog404Errors'); } public function hookLog404Errors() { // determine the URL that wasn't found $url = $_SERVER['REQUEST_URI']; // if installed in a subdirectory, make $url relative to the directory ProcessWire is installed in if($this->config->urls->root != '/') { $url = substr($url, strlen($this->config->urls->root)-1); } $ua = isset($_SERVER['HTTP_USER_AGENT']) ? substr(trim(strip_tags($_SERVER['HTTP_USER_AGENT'])),0,240) : ''; $this->log->save('404-errors', "{$url} \t :: \t {$ua}"); } The API variable $log was introduced with 2.3.1-dev and is available in 2.4 stable now: http://processwire.com/talk/topic/3768-processwire-231-dev-branch/
  12. I haven't read your code of the project. Just want point out that: If you have to call PHP scripts directly (not include them), with it's URL, you cannot store them into the sites/... folder. If it is only one script, you may place it into the root besides the index.php of pw. Also if you want / have to collect some output from that script within pw, you can bootstrap PW within that script, store a result into a $session->var and also use $session->redirect according to that output, if you need that.
  13. You may do this by a module like that: public function init() { $this->addHookAfter('ProcessPageListRender::getPageLabel', $this, 'addPageListLabelItems'); } public function addPageListLabelItems($event) { $page = $event->arguments('page'); // then you do your conditionals and your styling, like for example: if($page->myField >= $myMinValue && $page->myField <= $myMaxValue) { // add your styling here } // or like that: if('architekt'==$page->template) { // add the styling here $styleItem = $page->ortarchitekt == '' ? ' <span class="jhpPageListItemEmpty"><strong style="color:white">kein Ort eingetragen</strong></span> ' : ''; // now add the new style item to the existing output $event->return = $event->return . $styleItem; } } This way I get outputs like that: EDIT: Ah, have found it: here is a module from Soma: http://modules.processwire.com/modules/page-list-image-label/ that adds a Thumbnail to the list. That was the startingpoint for my customized PagetreeList. If you are not (yet) familiar with modules please have a look to the HelloWorld-Module or ask here for further assistance
  14. but seems that Ryan need to increase it. When trying to send a PM to Ryan I get this errors:
  15. Oh, really? Please, can you show me a example? (original | GD | and maybe one with imageMagick)
  16. I would use ProCache. It is highly configurable and lightning fast. In fact it serves static html pages. No DB and no PHP-interpreter are involved in serving this pages.
  17. Hi, I use a search with MySQL like operator: $matches = $pages->find("{$suchFelder}%=$q, limit=$limit"); My $suchFelder are: 'body|headline|pagefield.title' When searching for a phrase like schmidt+meier the result contains matches with the phrase if it is in body or headline, but not if it is in pagefield.title. Why isn't it consistent? Why doesn't it find them in pagefield.title? If I do a search only for schmidt it returns all matches, including that from pagefield.title. If this is a bug, I'm also interested in a (quick) workaround. I need this to work properly for a live site!
  18. I'm not sure if I understand right, but may be you can use PageImageManipulator for that? $img = $images->first(); $url = $img->pimLoad('myprefix')->canvas(150, 150, array(255,255,255,1), 'c', 0)->pimSave()->url;
  19. No, in the module folder only modules should be. You can store them outside of PW: webroot |-customscripts |-site |-wire and you can include them with include_once() or require_once() in the site/config.php if you like. This way your functions are available in PW where ever you need them. You can access all of PWs API variables and methods in your custom functions through the wire() function: $pagearray = wire('pages')->find('mySuperDuperSelectorValue'); $homepage = wire('pages')->get(1); $homepage = wire('pages')->get('/'); $session = wire('session'); if( ! isset($session->myCustomArray['myCustomKey']) ) { $session->redirect('/'); } Please refer to the API: http://processwire.com/api/include/ for more info
  20. @Soma: I use same approach in site/config.php but use it like that: $config->dbHost = 'MyComputersName'==getenv('COMPUTERNAME') ? 'example.com' : 'localhost'; The systems environment variable "COMPUTERNAME" is set on (every) Windows, but if it is set on a *nix system it will have a different value. This way it works in terminal too.
  21. @Radek: on windows one can check if virtualhosts are configured right with calling httpd.exe -S directly, (not restarting the service). This gives a screen like: VirtualHost configuration: 10.10.30.50:80 is a NameVirtualHost default server kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:49) port 80 namevhost kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:49) port 80 namevhost pw1.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:70) port 80 namevhost pw2.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:87) port 80 namevhost pw3.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:104) port 80 namevhost pw4.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:189) port 80 namevhost pw5.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:206) port 80 namevhost pw6.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:223) port 80 namevhost pw7.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:240) port 80 namevhost pw8.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:257) port 80 namevhost pw9.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:274) Syntax OK Maybe it helps troubleshooting to go step by step. Also @BFD: have you updated your hosts file??
  22. I find this useful. And I have searched the core code (wire) and found only three function calls: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/shutdown.php#L73 https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Process/ProcessForgotPassword.module#L166 https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Fieldtype/FieldtypeComments/FieldtypeComments.module#L290 It could be replaced by a hookable function called pwMail() or something like that. public function ___pwMail($to, $subject, $message, $additional_headers=null, $additional_parameters=null) { return @mail($to, $subject, $message, $additional_headers, $additional_parameters); }
  23. The reason could be that, at the point when you use $session->login() (in your template-file ?) the variable $user already is populated. And it can't be changed automagically when you do a call to $session->login(). You may use something like: $u = $session->login($username,$pass); // try to login a user if($u) { // if login was successful $u holds a user object $user = $u; // repopuplate the $user variable with the new user } // .. and then the rest of your code : if( $user->isLoggedIn() ) {
×
×
  • Create New...