Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/08/2015 in all areas

  1. Guys, here's a small trick to test things out on your sites: foreach($page->children as $p) { echo "<script>console.log('" . $p->title . "')</script>"; } Now open the console and enjoy For more power make sure to check Soma's Chrome PHP Logger --- Edit: Or put this simple function or your _init.php function JSlog($str) { echo "<script>console.log('" . $str . "')</script>"; } and on your templates JSlog($page->title);
    6 points
  2. Hi matjazp, this is possible with the Pages Web Sevice. You can do anything with this web service that you would do with a $pages->find() call. This module essentially provides a safe front-end to the AJAX API provided in the ProcessPageSearch module, enabling that capability to be used outside of the admin.
    3 points
  3. But Opauth is abandoned and now PHP-people are using HybridAuth. There is already a module, Social Login, which makes use of it.
    2 points
  4. In my case, cache problem occured because my hosting plan had "Run PHP as: FastCGI application". After they changed to "Apache module" problems are gone.
    2 points
  5. Hi mrkhan, Ok I was digging this for a while and now have it working It didn't work for me also in the beginning because I was testing it for the body field but overlooked the file config-body.js Please first read \site\modules\InputfieldCKEditor\README.txt So, if you want to add/edit your <i class="fa fa-check-circle-o"></i> in your ckeditor body field then you have to configure the file config-body.js To make this work: open in your editor \site\modules\InputfieldCKEditor\config-body.js and make sure at the bottom it looks like this: CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.uiColor = '#AADC6E'; config.enterMode = 2; config.allowedContent = 'i[*]{*}(*)'; }; The line config.enterMode = 2; prevents your <i> tag from being wrapped in a <p> tag wich is default behaviour of ckeditor. The line config.allowedContent = 'i[*]{*}(*)'; allows the <i> tag with wild cards for attributes, styles and classes. I tested this with processwire version 2.6.1 with a body field and all is working. Disclaimer: Tags and classes should stay in css outside ckeditor but when dealing with a client who is already used to edit with a few html tags, adding only a few of them would be ok. I don't see any security issues here. Installing the Hanna code module makes all this obsolete and is recommended by many people here. But for only allowing a single html tag I think the powerful hanna code module is a bit overkill here.
    2 points
  6. This isn't a solution to your problem, however why not use hanna-code? [[icon i=check-circle-o]] <- something like that? Look at the module hanna code https://processwire.com/talk/topic/3745-hanna-code/
    2 points
  7. http://www.adminer.org/ is a small php file to manage SQL databases I received this on Smashing Magazine newsletter and decided to try it because of all those PhpMyadmin securiy concerns. It's very easy to use, so i decided to install it on the server, inside my PW install. I droped the PHP file on the templates folder, created a new template, and a page with this template without Guest access. Works great! And I have two layers of security, the PW admin login, and the DB login. Just wanted to share
    1 point
  8. I don't always want to bother registering users, I just want them to be able to log in. I'm not alone because there are a number of other threads about OAuth, none of which mentions Opauth. Opauth is a lean, non-opinionated, modular PHP thingy. It has 18 providers listed on their page, some of which are built-in, some are 3rd-party. Their website itself is an example, and it's on github as well. It's lean: it doesn't need the provider SDKs, it implements only what it needs in the auth modules. It's non-opinionated: you give your user a link to /auth/facebook, and then you are waiting for the results on /auth/callback; what you do with the returned array is your choice (the urls are of course customizable). I could put together Twitter / Google / Facebook auth for a (non-processwire) site really quick. I stored the API auth params for the modules in a table as json-encoded hashes (just 2 keys and 2 values, but the keys vary by API, so that was the easiest), and I did the same with the returned credentials. Besides provider, uid, and credentials (what we really need), Opauth also returns a somewhat variable set of details about the profiles in the info key, stuff like name, gender, urls, and the like; the Processwire module could opt to mine and store in fields whatever it deems useful, then store the rest as json, or just throw it away. An example for what you get in your callback: Array ( [auth] => Array ( [provider] => Facebook [uid] => 1480000000008166 [info] => Array ( [name] => Tibs [image] => https://graph.facebook.com/1480000000008166/picture?type=square [first_name] => Tibs [urls] => Array ( [facebook] => https://www.facebook.com/app_scoped_user_id/1480000000008166/ ) ) [credentials] => Array ( [token] => CAAEajKBojCkBAHj6cy0mM4EZBPvs082t5Vkm3PGa44jsfrfzCS1SwV09qOaZBQYnfxLnCacb7Wkr536wDzusIh4mkMmvwoC5VdZBKFRAGyLpqcVJYdWCIFv0iwfkjpiLpDsGVBChj1ac1Lq6ZBFjuCdrtfpcQtgWbonDVCzwGwZB0A37vLaQbCuh8OnbdRY1U1dPE2ZBU2PmgNGNP1ghzNo [expires] => 2016-01-06T10:29:53+00:00 ) [raw] => Array ( [id] => 1480000000008166 [first_name] => Tibs [gender] => male [link] => https://www.facebook.com/app_scoped_user_id/148000000000166/ [locale] => en_US [name] => Tibs [timezone] => 1 [updated_time] => 2015-01-25T19:54:12+0000 [verified] => 1 ) ) [timestamp] => 2015-11-07T11:20:56+00:00 [signature] => hmcuwumqat4w84g1gkw0cgokloogg4w ) To be honest, I'm not even working on anything in Processwire at the moment, but I wanted to post about Opauth since I discovered it. If someone decides to implement OAuth before I get around it myself, Opauth is the perfect candidate to do the heavy lifting
    1 point
  9. @kongondo $dateStr might be confusing, as it's NOT a string anymore
    1 point
  10. Thanks guys. In the end I went with Horst's suggestion, HeidiSQL. This is installed on my PC and I'm connected securely to my remote server via an SSH tunnel. OK, next, how to mount my server locally with write access so I can edit my files locally using my favourite text editor
    1 point
  11. I (client) might want to display news posts from remote site on his site. I could connect to remote mysql and use db queries (hmm...no). I could parse rss feed (then you have it all and not just what client needs). I know PW 3 runs in its own namespace, but believed something similar might be possible with current PW. Pages Web Service will do the job, will use it if client expresses a wish. Thanks to really smart friendly people here ;-)
    1 point
  12. Adminer is a nifty small tool, still use it every now and then. It is so small in size that you can simply drag and drop it on your server when you need it and delete it after your database session.
    1 point
  13. Ok Folks, the provider sent me this solution: Redirecting the www and non-www version to the "pw" - folder. Redirect the non-www version to the www-version via processwire - .htaccess.
    1 point
  14. Oh my god, thank you Ivan! I can't believe I was only one dot away from my solution XD like I said I tried many of the $content = variations... what would I just do without this forum!
    1 point
  15. I'd love to see the next Pro module provide an easy way for front end visitors to register an account and edit their profile.
    1 point
  16. There is a setting in the Input Tab, named Extra Allowed Content, where you can define what shouldn't be stripped by CKEditor. On the other hand, if it is your side and you are the maintainer, just swicth off the use of ACF !
    1 point
  17. Weighing in a bit late. We're running things on DigitalOcean as well, with Ajenti and Ajenti-V as VPS manager. We run Processwire on Nginx.
    1 point
  18. A vm workflow is really nice especially cross platform. If you take a look at vagrant I'd suggest trying out ansible as provisioner. It's a damn nice and modular system, which can be used on almost any system you've ssh or console access.
    1 point
  19. Ok here we are - fixed version number. Thanks cstevensjr, done. @BernhardB - don't worry APP ID/Secret are fakes
    1 point
  20. Thanks dudes. I've fixed the version number. Now a couple of informations: in the providers config file can be specified all providers supported by HybridAuth. For now we have enabled and tested just Facebook and Twitter, and enabled Google but not tested yet (but if it works for "i" and i+1 it should work also for i+N). Each provider will be shown as collapsed fieldset, if not enabled, to save space. Attached, there is a picture of this. This configuration file is used for: create the module edit section (as shown in the above picture) show enabled providers in the login form (see) retrieve info to be processed when the user is doing a login with a certain provider (see) Naturally more providers can be added, following the structure of the returned array.
    1 point
  21. Hi taqtaq, you could use Ryans sitemap-template. it works pretty good in different languages. No need to install LanguageLocalizedURL. For your different languages you should just add something like: <url> <loc>http://yoursite.fi/</loc> <xhtml:link rel="alternate" hreflang="en" href="http://yoursite.fi/en" /> <xhtml:link rel="alternate" hreflang="it" href="http://yoursite.fi/it" /> </url> http://processwire.com/talk/topic/3846-how-do-i-create-a-sitemapxml/ I will check if I could write a small function to implement this for every language in the system. EDIT: Here comes Ryans template with added language alternate-links like recommended by google for multilanguage support. more information here: https://support.google.com/webmasters/answer/2620865?hl=en important: name of language should be same like international language-code (name your pages en for english, de for german, es for spain etc. Just Follow Ryans instructions to use the template, everything else is done by the template. Update 29.02.16 This update is made for PW 3.0. To prevent endless redirects in 2.7 and lower please read instructions (comments). You need to comment out the line with the redirect. multilang-sitemap-xml.php.zip
    1 point
  22. Just a note to all MODx'ers - I think this is a nice way to transfer some snippets/chunks to ProcessWire as well if people want to go down that route and have some they used to use in body text. Obviously it's not quite the same thing (potentially more powerful depending on your needs), but anything that helps make a transition easier is good in my book Very useful, powerful module ryan!
    1 point
  23. Ah yes, that's what I needed! It turns out $image->width() and $image->height() are actually rendering functions, so I was able to just do this: $mainimage = $page->image; if($mainimage->width >= $mainimage->height) { echo '<img src="' . $page->image->width(768)->url . '" alt="' . $page->title . '" id="displayimg" />'; } else { echo '<img src="' . $page->image->height(575)->url . '" alt="' . $page->title . '" id="displayimg" />'; };
    1 point
×
×
  • Create New...