-
Posts
1,336 -
Joined
-
Last visited
-
Days Won
62
Everything posted by BitPoet
-
So now things are getting really wierd, as I'm sure when I tested it at work, I could reproduce the problem. Now at home and on a different server, I can't. The thumbnail comes out rotated correctly (without Exif information, of course).
-
GD doesn't really deal with Exif (it can read the information, but that's it), so any image created through GD is going to end up without Exif information. From what I saw in the code of ImageResizer, IPTC (semantic information) is copied over to the new image but not Exif. All freeware PHP projects with Exif write support I know of are either dead or gone.
-
how to echo message before direction in the right way?
BitPoet replied to adrianmak's topic in General Support
In web development, never use PHP's sleep function (the few exceptions to this rule are not worth mentioning). $session->redirect sets a location header and according status code. By its nature, the header is processed by the user agent before any content is displayed to the user. So you either redirect with a header or present content to the user. You have two possibilities: 1. Do your form processing early in the page and either set a meta http-equiv="refresh" header with timeout and destination or let javascript redirect to the page like Fokke suggested 2. Use an intermediate confirmation page that uses a meta refresh header and to which you pass the success message and the final target (not much different from the first, but it's often easier to work around the problem of already included HTML headers this way) -
userAuthSalt is for PW's login system, but the error in the OP comes from MySQL. A few ideas to check: there might be another line further down in config.php where dbUser is set; something fishy may have gone on with the config file during the upload and it contains invalid characters; the entry for $dbUser in the mysql.user table may be limitied to 127.0.0.1 or % instead of localhost.
- 7 replies
-
- site moving
- error 1045
-
(and 1 more)
Tagged with:
-
Regarding (ii) and after a cursory glance at the JS: Store the page numbers in an attribute in the pager's spans in paginateTable In the marker's click event, calculate the row position through row.prevAll('tr').length Calculate the matching page number from the position and limit Find the matching pager item through the attribute in the first step and fire a click event on it
-
Output formatting before page render
BitPoet replied to bits-please's topic in Module/Plugin Development
The html entity encoding happens through the Textformatter assigned to the title field. That's something output formatting does, so you need to turn output formatting off to get the raw value with quotes from the field. There's an in-depth article in the wiki on that topic that explains the behaviour quite well. -
Okay, I think I've tracked it down. The problem vanished as soon as set PHP's user_agent, which was empty in all configurations. So either setting that in php.ini, in the .htaccess or somewhere early in the PHP code should get things running again.
-
fopen()ing that URL also fails on my local host using both PHP 5.6 and 7, so I'd tentatively point my finger towards github (allow_url_fopen is enabled and requests from the browser return the expected JSON content).
-
Okay, so I've done it. Two sets of modules, one for the server side, the other for the client side. There are still a lot of ToDos, like adding dedicated endpoints on server and client (I'm currently hooking indiscriminately into ProcessPageView::execute, but I'd like to go the route of only loading the listeners for this template) or adding some kind of challenge-response mechanism to keep nosy third parties out. The modules are up on github: Server component Client component There's also a screen cap in the readmes. Both module sets have lots of hooks, so component modules should be easily able to extend the basic functionality. Currently, the online functions arealdy built-in are the setup of the management connection on both sides and getting basic client information. I haven't really looked at the upgrade or db backup modules, so I've got no idea how complicated remoting them would be. But the sky's the limit. Comments, critiques and pull requests welcome!
- 23 replies
-
- 14
-
-
magic function name in PW Process module development
BitPoet replied to adrianmak's topic in Module/Plugin Development
These are automagically called by ProcessController when an URL segment is appended to the path of an admin page. If an admin page url is http://server/processwire/adminpage/ and that page is called, the execute method is called. But if you open, for example, http://server/processwire/adminpage/edit, the first letter of the URL segement (edit) is uppercased and it is appended to the process method, resulting in executeEdit. Process methods with multiple uppercase letters (camel case) are called by passing URL segments with hyphens. The hyphens are stripped, but each letter after a hyphen is uppercased, so http://server/processwire/adminpage/point-me-to-crocodiles will look for a method executePointMeToCrocodiles in adminpage's process module. This way, one doesn't have to set up another process module for a subtasks and create a page for it or parse even more form values in execute. For a new subtask XXX, it's sufficient to add links/form targets with an URL segment of xxx and define a matching executeXxx method. A perfect starting point to learn more about creating process modules is the source code of Ryan's ProcessHello module, which can be found at github and in the module repository. -
Yes, all these points would mean creating a monster. In terms of database backups or malware scans, those are highly platform specific and not something easily implemented in a module. A centralized overview actually makes sense to me. Showing.PW and module versions and outputting some statistical information is also quite doable. Displaying a momentary status can be done, but continuous monitoring is not something that you can build on top of PW - for this, you'd need to add some layers under or next to it. I've started tweaking together a set of modules that could serve as a base. I'll try to add the necessary hooks to allow extending it tomorrow and put an alpha release on github. If nothing else, it's an interesting conceptual challenge
-
How to use pw to create a guestbook like functionality ?
BitPoet replied to adrianmak's topic in General Support
Do file and class names match up? -
How to use pw to create a guestbook like functionality ?
BitPoet replied to adrianmak's topic in General Support
Your module is missing public static function getModuleInfo() { return array( /* title, version, summary and autoload values*/ ) }; -
any build-in function to, return a string by first number of words
BitPoet replied to adrianmak's topic in Getting Started
/* Using regular expression */ $firstTwenty = trim(preg_replace('/^\s*((?:\S+\s+){20}).*/', '$1', $inputText)); /* Using split and combine */ $firstTwenty = implode(' ', array_slice(explode(' ', $inputText), 0, 20)); -
how do u manage existing website hyperlinks?
BitPoet replied to adrianmak's topic in General Support
That depends if the new content structure matches the old one at least to some extent. If it's rather similar, it would be an option to import the old id into a field and replace the old php files with small scripts that bootstrap PW, look for a page matching the given id and redirect there with a moved permanently, or to the homepage if the id wasn't found. The same thing may work if you can identify a set of landing pages for the old pages, but you'd have to manually assign multiple old ids to some of the new pages (e.g. with a repeater). It really depends on whether you can match up old and new content. Wherever you can't, redirect to home. -
I might be misinterpreting the requirements, but at the first read, they screamed "Repeater Matrix" at me, a 3.0.5 alpha feature which would let you set up a repeater with a set of fields for external links like you already have and alternatively allow a page field in that same repeater as well. It would even be a perfect playground for the new field templates (as explained at the end of the linked blog entry) to make the code as concise as it can get. No idea if pro fields or PW 3 are valid options for this project, but I thought it worth mentioning.
-
Using $page->render() on unpublished pages return 500 Error
BitPoet replied to Lars282's topic in General Support
$page->render checks Page::viewable() for unpublished pages, so you'll likely have to hook into viewable and override the return value for your use case. -
Yay! This update has me rather excited, and I can already see an overhaul of our course booking system coming up in the near future. Nested repeaters and field templating are just the things to streamline this quite spectacularly. Dynamic Ajax loading is going to be such a treat too! Ryan, if you keep up PW's innovation speed like this, I'm sooner or later going step on my tongue while I race to make us of all these new possibilities!
-
We're using CKEdtior quite heavily in our intranet (used to be TinyMCE in the previous CMS, but that had all kinds of issues with new browsers). The tech departments write their internal data sheets and part compatibility lists with it, using nested tables (now way around that, unfortunately) and a concise set of CSS classes. Most departments also have a bunch of CKEditor-only pages for their department presentations, useful information for everyone and for anything and everything in their internal department areas. Alltogether, that's a few thousand of these pages. Not everything is as homogenous as we'd need a public-facing homepage to be, but it's not as far off as one would fear either. My experience regarding Hanna Code (or any other placeholder system) is much like teppo's, most users can't wrap their heads around the question why they should use these "magic thingies" when everything else is wysiwyg, and they keep forgetting which is which.
-
I've recently switched to IIS for development. Still a little bit of manual work (once you know what you're doing, you're up-and-running in less than an hour, though) but once it's up, it's really fast.
-
Just use PW's $db object and pass the call statement to query() or (prepare()/execute() if you want to reuse the call or use bound parameters). PW's database object is just a wrapper around PHP's PDO class.
-
The error says that $rss is not an object, so the call $modules->get doesn't return a module instance. Did you install the module after downloading it?
-
In Setup -> Languages click your default language. Click "Translate File", then select InputfieldDatetime in the "Translatable files in Wire" select - unless the language pack already contains a translation for it, then you only need to click on the title of the translation in the language itself.
-
InputfieldDatetime allows you to translate the paths for the datepicker and timepicker language files if LanguageSupport is installed. /wire/modules/Jquery/JqueryUI/i18n/jquery.ui.datepicker-xx.js => /wire/modules/Jquery/JqueryUI/i18n/jquery.ui.datepicker-nl.js timepicker/i18n/jquery-ui-timepicker-xx.js => timepicker/i18n/jquery-ui-timepicker-nl.js This might be easier than toying around with custom JS.