-
Posts
1,554 -
Joined
-
Last visited
-
Days Won
48
Everything posted by gebeer
-
Integrating a member / visitor login form
gebeer replied to thetuningspoon's topic in General Support
When you create a user through the admin or through the API, it always gets assigned the guest role along with the custom roles that you assign. So if you assign a custom role "user", your user will have 2 roles: guest and user. Now you can check if a user has the role "user" and a total of 2 roles assigned. In PHP: if (count($user->roles) == 2 && $user->hasRole("user")) { //do stuff here } -
My profile is based on Ryan's Foundation 4 profile. So I already did all the hard work of updating classes etc. to fit Foundation 5. If you are going to use my profile, please be aware that it uses SASS/SCSS. If you are not familiar with that it might take a little more effort to understand how things are working in the beginning.
-
Notice: Undefined index: searchFields after update to 2.5 dev
gebeer replied to gebeer's topic in General Support
My post about that might be a little confusing. I do not get any error messages when I set debug to false. I was referring to the system messages from my screenshot in post #3 that are persistent. Sorry if this has caused you additional work.- 12 replies
-
- Undefined index
- searchFields
-
(and 2 more)
Tagged with:
-
Notice: Undefined index: searchFields after update to 2.5 dev
gebeer replied to gebeer's topic in General Support
So this is overwriting the php.ini settings then, I guess. Good to know I don't have to fiddle with php.ini settings- 12 replies
-
- Undefined index
- searchFields
-
(and 2 more)
Tagged with:
-
Notice: Undefined index: searchFields after update to 2.5 dev
gebeer replied to gebeer's topic in General Support
OK, I see. But what worries me more is the system messages (screenshot in post #3) that are persistent no matter whether I set debug to true or false.- 12 replies
-
- Undefined index
- searchFields
-
(and 2 more)
Tagged with:
-
Notice: Undefined index: searchFields after update to 2.5 dev
gebeer replied to gebeer's topic in General Support
Thank you Raymond. Will update soon to the latest dev branch and try again. About those SysUp messages, they are even there when I switch $config->debug to false.- 12 replies
-
- Undefined index
- searchFields
-
(and 2 more)
Tagged with:
-
If I understand you right, you are looking for a field type that can store values in multiple rows. Have a look at the Inputfieldtype Events. This stores multiple values as rows in it's own DB table which makes searching really fast. I'm using an altered version to store thousands of timestamps with a page and searching them is really performant.
-
Notice: Undefined index: searchFields after update to 2.5 dev
gebeer replied to gebeer's topic in General Support
Thank you. This helped partially. But it is only a temporary fix because with the next upgrade it will be overridden. I would consider this a bug. Now when I login, I can see the admin but all update messages are persistent When I click them away, they always reappear on the next page load. When I try and edit a page I get a notice but can edit the page. That line says $limit = $pageListConfig['limit']; So things seem a bit messy overall after the upgrade and I would really like to be able to fix this.- 12 replies
-
- Undefined index
- searchFields
-
(and 2 more)
Tagged with:
-
Hi, I upgraded a site in development from 2.5 stable to 2.5.7 dev by copying /wire/, index.php and .htaccess over. After the upgrade, I get a notice on frontend and before login to the admin, when $config->debug = true After login there is no admin page visible, only debug info. I can see in the Variables on local scope that $admin returns a nullpage. When I switch debug to false, I can see and use the admin. Couldn't find anything related here in the forum. Any pointers how I can fix this? Thank you.
- 12 replies
-
- Undefined index
- searchFields
-
(and 2 more)
Tagged with:
-
Does anyone know when OR condition s will be available?I' be willing to donate towards developmentin near future.
-
Doing it server side has the advantage that only the code you need for mobile clients will be served which can save quite some kB. If I understand response.js right, first the whole DOM needs to be loaded before response.js can swap things around or deactivate them. If you do things server side, on mobile devices you don't output elements you need for the desktop and vice versa. There is a module for minimizing images. Or you can use image compression tools. A good overview here. I have used ImageOptim on the Mac and Trimage on Linux. Both work well and can help saving bandwidth. Don't know about Windows tools. But some of them use the same libraries, I think.
-
First tests on a shared host (uberspace.de) reveal nothing good for only 1000 requests and 100 at a time and searching only through 10 pages. Running ApacheBench on the same server that my app is on. Concurrency Level: 100 Time taken for tests: 10.772 seconds Complete requests: 1000 Failed requests: 20 (Connect: 0, Receive: 0, Length: 20, Exceptions: 0) Write errors: 0 Total transferred: 1321560 bytes HTML transferred: 1144560 bytes Requests per second: 92.84 [#/sec] (mean) Time per request: 1077.164 [ms] (mean) Time per request: 10.772 [ms] (mean, across all concurrent requests) Transfer rate: 119.81 [Kbytes/sec] received Now comes the hard part: improving my code
- 4 replies
-
- Performance
- test
-
(and 1 more)
Tagged with:
-
Thanks for the tip with ApacheBench. This works pretty straight forward.
- 4 replies
-
- Performance
- test
-
(and 1 more)
Tagged with:
-
There is this fairly new module for mobile detection. It might come in handy for your situation because you can output just the code you need for the mobile clients. Doing this with response.js is putting additional load to the mobile client which might have an impact on overall performance. Plus you need to load response.js. Might be worth taking a look at doing this server side.
-
Hello, I'm in the process of building a web application with PW that delivers data to mobile clients. There will be up to 1000 requests per minute to my webapp (later maybe more). Every request triggers a search through up to 1000 pages and compares timestamps that are sent by the mobile clients with the request to timestamps that are saved with each page that is being searched. The timestamps are saved in PW in their own table in the DB together with a page reference id which makes searching pretty fast. For my search I use: $ads = $pages->find("template=advertisement, ad_server=$serverID, ad_publish_at.date<$tsHigh, ad_publish_at.date>$tsLow"); I want to do some load testing for my webapp to ensure it can handle that many requests per minute and further optimize it. What I need is a testing framework that lets me simulate hundreds of requests/minute. Have you ever done this and what testing framework would you use? Here are some apps that I briefly took a look at: http://jmeter.apache.org/ http://www.pylot.org/ https://code.google.com/p/httperf/ https://github.com/JoeDog/siege
- 4 replies
-
- Performance
- test
-
(and 1 more)
Tagged with:
-
ProcessPageEditImageSelect - hook and change default $page
gebeer replied to mr-fan's topic in Modules/Plugins
@adrian I was able to solve my problem without the need for a module. See also my post in the other thread. Cheers Gerhard -
Bingo My assumption from my previous post was right. The PWimage plugin needs a hidden text input field with the value set to the page id of the page that you want to grab images from. I added a hidden input field to my form with $imgPageID = $pages->get("template=media, created_users_id=$uID")->id; $field = $modules->get("InputfieldText"); $field->label = " "; $field->attr("id+name","Inputfield_id"); $field->attr("value",$imgPageID); $field->attr("type","hidden"); $adform->append($field); Now I can choose images from the user's images page And there is no custom module with hook to ProcessPageEditImageSelect required. EDIT: This only works for PW 2.5. For 2.6.x some adjustments are needed. You'll find more info here
- 5 replies
-
- 7
-
-
- PWimage plugin
- frontend
-
(and 2 more)
Tagged with:
-
ProcessPageEditImageSelect - hook and change default $page
gebeer replied to mr-fan's topic in Modules/Plugins
Thanks a ton, adrian! I meanwhile discovered why I get an error with PWimage plugin in a frontend form and am currently looking into solving it. It looks like I might be able solve 2 problems together. I'll report back in my other thread. Cheers Gerhard -
OK talking to myself again - but at least I'm in good company I'm looking through the code that builds the PWimage plugin and gets the pages to choose images from. Namely wire/modules/Inputfield/InputfieldCKEditor/plugins/pwimage/plugin.js and wire/modules/Process/ProcessPageImageSelect/ProcessPageImageSelect.module In the former file the page_id is retrieved through var page_id = $("#Inputfield_id").val(); var edit_page_id = page_id; Since my form is living on the frontend, I don't have $("#Inputfield_id").val() because $("#Inputfield_id") is not there. Looking at the source code of the backend form, I can find this element: <input id="Inputfield_id" name="id" value="11551" type="hidden" /> Where value 11551 is the id of the page I'm on. For my frontend form I'm rendering the form with code from Soma's gist. And that doesn't render the hidden input field with the value for the page I'm on. Hence the error. Now I will go and add that input myself to the frontend form and report back here what the outcome will be EDIT: sometimes a good glass of port wine can make you see things that you hadn't seen before
- 5 replies
-
- 1
-
-
- PWimage plugin
- frontend
-
(and 2 more)
Tagged with:
-
ProcessPageEditImageSelect - hook and change default $page
gebeer replied to mr-fan's topic in Modules/Plugins
The page I want to choose images from is the one I get with $rootPage = wire("pages")->get("template=media, title={$user->name}"); In the 1st screenshot that page title and ID are echoed right on top in the second line: rootPage Title:gbr ID:11582 But then it says: "Images on Page: now (/advertisements/ad-now-1035)". This is the page where the CKeditor field is on. Here is where I need my rootPage. So it should read: "Images on Page: gbr" and show me the images on that page. That page contains only an images field with images in it (and the title field). -
ProcessPageEditImageSelect - hook and change default $page
gebeer replied to mr-fan's topic in Modules/Plugins
OK, done testing in backend. With this code public function init() { $this->addHookAfter('ProcessPageEditImageSelect::execute', $this, 'changeParent'); } public function changeParent(HookEvent $event) { $user = wire("user"); echo "User:".$user->name." ID:".$user->id."<br>"; //if ($user->role == "frontend") { $rootPage = wire("pages")->get("template=media, title={$user->name}"); $rootPageID = $rootPage->id; echo "rootPage Title:".$rootPage->title." ID:".$rootPageID; $event->replace = true; $event->return = str_replace("rootPageID: 0", "rootPageID: ".$rootPageID, $event->return); //} } I get and after click on "change" I get So it is working But that is not what I need :-( I'd like to choose images from the rootPage itself and not it's children. And I'd like to have the rootPage chosen by default instead of the page I'm on when I click on the insert image button. Would this be possible to achieve with adding other hooks to the ProcessPageEditImageSelect.module? -
ProcessPageEditImageSelect - hook and change default $page
gebeer replied to mr-fan's topic in Modules/Plugins
Will do that -
ProcessPageEditImageSelect - hook and change default $page
gebeer replied to mr-fan's topic in Modules/Plugins
Thank you, adrian, for looking into this. I think I need to get the user with $userID = $this->wire("user")->id; Am I right here? But I can't really check if it is working because I get an error when clicking the PWimage button in the editor on my frontend form. I opened an extra thread for that problem. Sorry for cross posting here, but I thought I better check here for the validity of my module code. Cheers Gerhard