modifiedcontent
Members-
Posts
286 -
Joined
-
Last visited
Everything posted by modifiedcontent
-
Is there a way to change the input options for the images field? I am trying to figure out if it would make sense to use an external script like Zenphoto as a central media library/manager. How could I connect that with Processwire? 'Choose File' in the images field would have to be able to open that 3rd party media library or a directory on the server or some cloud service instead of (only) the client file manager. Could justb3a's field type module Image Extra be part of the solution? I will try that and report back. Other field types/modules? I know there is a pro module Media Manager that does look very slick, but would prefer to make this work with a mature, tested 3rd party script if a central media gallery is never going to be a core Processwire feature.
- 6 replies
-
- media library
- media
- (and 9 more)
-
Field type for a text-based array?
modifiedcontent replied to modifiedcontent's topic in General Support
Either or both! A JSON field would probably be most useful. I am watching some of those other threads. Simplepie takes input as a list of comma-separated links, not key => value - does that type of array have a name? I managed to make it work with a repeater field. -
Another dumb question: Is there a field type for a text-based array? In my case I need to store an array of RSS feeds for SimplePie. Storing that list of links in a textarea - text formatted to look like an array - doesn't work with the script. It works with one link. The images field is an array. I assumed there would be an equivalent for URLs or text in general. Or is there another approach for these cases? Edit: I guess using the optional (module) Repeater field type is the best solution in this case? I have now a working solution based on that. Still curious about other ideas.
-
How could I assign specific admin page for user role?
modifiedcontent replied to adrianmak's topic in General Support
Is this all still valid? Setting permission in the ProcessModule for the custom admin seems to be the cleanest way to make that admin available to a specific role. But yes, how do you then hide the main page tree for that role? My custom admin will be an alternative to the main page tree edit interface. Is AdminRestrictPageTree still the (only) way to achieve that? That module is still alpha, getting kinda old, not explicitly compatible with 3.0 Here is another thread about the same issue; how to hide the tree when there is a custom admin for a specific role. That thread fizzled out in 2015. If you want to create an admin that looks completely different from the standard admin, is it a better approach to use a custom myadmin template? -
Yes, of course it is. Unfortunately I actually have a client who thinks Processwire's admin area is confusing and wants an admin area that looks exactly like the horrible system he is trying to replace. I have to restructure/reorder all the standard admin functionality/edit screens into something he recognizes to gradually lure him over to the PW dark side. But apart from that, I am looking for the most basic proof of concept. Basic stuff that the default admin already does, stuff that everybody understands; how would you replicate that in a custom admin area? I am looking for a guide for the basic principles. Most modules seem to come in a folder/dir with other file types like js and css, not a single text file. How that works is basic module writing of course, but I was hoping to see some pointers in your tutorial how to structure that for a custom admin area. Your hello-page2 example still goes in the same single text file? Edit: Let's say you want to create a wizard style interface for adding/editing content, that starts with a title + body + images form, followed by steps or dropdowns to put the content in the right page. Instead of the page tree. More content-centric instead of structure-centric. I prefer the Processwire approach, but my client is used to that content-centric approach. But it doesn't matter what exactly I am trying to achieve in this case. I am looking for a general basic recipe how to create an alternative custom admin area or how to completely restructure the admin. Bernhard's tutorial is more about adding advanced features to the existing admin.
-
bernhard, I appreciate the effort and enthusiasm that has gone into this tutorial, but for me it goes too deep into the weeds too quick after the basic 'hello world' example. If I want to add a custom admin page to post/edit basic content - title, body, image - how would I do that? Would I add the code for that form to the ProcessSimple.module file or somewhere else? The stuff about panels, tables and charts is very confusing to me. If I want to create a custom admin with several pages/functions, would I need several *.module files for each or would there be a *.module folder/directory where I can add different files/processes? Can I start my custom admin area simple and build it out later, add stuff to it? Or should I build it all at once as one module? I am trying to figure this out on a "concierge job", so my brain/concentration operates at below 50%.
-
Latest version of PW, PHP 5.6.30, Both MyISAM and InnoDB tables - is that normal/acceptable? Not sure how that happened. How do I do that 'debug a few line above where that error is being reported'?
- 21 replies
-
adrian, with '... *=@ ...' I get 'Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 syntax error, unexpected '@' (in /home/.../wire/core/PageFinder.php line 410)' *=@ does work as expected with other fields, like 'name', so I'll ignore this issue for now...
- 21 replies
-
Thanks flydev. email*=@mail.ru was the first option I had tried, but it didn't work and the '@' produced a syntax error. ~= didn't work either. email%=mail.ru worked.- 'using slower SQL LIKE' according to the docs.
- 21 replies
-
Using the API you can also search on users instead of via pages with user template: $users = $users->find('email=crap.hacker@mail.ru'); foreach($users as $u) { // don't use $user $u->delete(); } Still figuring out how to get wildcard like *@mail.ru to work...
- 21 replies
-
Thanks bernhard and Juergen. I have implemented a very basic version of a honeypot. It has so far cut the dumb "hack" attacks to zero. There are plenty of ways to make the honeypots more difficult to pass. Great approach. Happy I don't have to resort to captchas etc. Turned autofill off as follows, also prevented tabbing to the hidden field: <input name=some_name class=some_class value='' tabindex='-1' autocomplete=off> Hidden via css; dozens of options to do that, make it harder for bots to figure out. Then in the process: if($input->post->some_name) { ... foad ...} I couldn't figure out Juergen's "Honeypot class" - still confused about composer, should I use it? - but see it also checks for minFormCompletionTime. Bots fill out forms inhumanly fast. That is another way to recognize them and block them.
- 10 replies
-
- no subscription detected
- not recognized
-
(and 4 more)
Tagged with:
-
I have my own register-login-profile/account page system. I know that Ryan recently released an official module for this, but there may be an advantage to having my own custom solution. Anyway, it seems to work well. But, I have been getting annoying Russian hack attempt accounts, mostly as 'guests' that don't bother to use the activation link. Most if not all of these accounts have this in the name field: No Subscription Detected Not Recognized ...which makes them relatively easy to filter out from real name accounts. Where do these "strings" come from? I can't find them in Processwire's source. Are the hackers using some kind of tool that inserts these for some reason? Or is it a PHP thing? Does anyone recognize them? Does it mean they are using some kind of backdoor instead of the registration form? In general, what are the best practices to secure my registration form, prevent spam accounts, etc.? I'll start with adding a check to block IP addresses that try to register with 'Not Recognized' etc. in the name field I guess.
- 10 replies
-
- no subscription detected
- not recognized
-
(and 4 more)
Tagged with:
-
Thanks adrian. Your module has been very effective in deleting users; I wouldn't mess with it too much. The spam/hack accounts usually have some string in a name field in common that allows me to select them as batch. It would be nice if some kind of batch delete was built in to Lister. And I am curious how 'using the API' would work for something like this; write a function and somehow add it to admin? Thanks for the code suggestion fbg13. I am mostly confused about where you would put this. In a template file? A setting page in the admin area? Would it have to be a module? And I have to figure out how to prevent bogus guest accounts. Could you make unverified guest accounts self-delete after 3 days?
- 21 replies
-
Thanks dragan. But how would you use the API for something like this? Write a function? And add it to the admin area somehow?
- 21 replies
-
Thanks! Where could I find user creation date? Lister only gives very imprecise 'three months ago' etc. It would help if you could delete by role, like delete all 'guests' who are not 'member' or 'superuser'. Are there any plans to build batch management of users into the core? Or make it easier? How would batch deleting users by 'using the API' work?
- 21 replies
-
I was looking for this for this use case: home - news (news template) - - local (news template) - - - news item 1 (post template) - - - news item 2 (post template) - - - news item 3 (post template) Posts under 'local' should use the 'post' template; 'news' template should not be allowed as an option. kixe's solution looked promising, but disables any new child page creation. Is there a way to limit the number of page levels by template - still allowing new pages with another template? Or is there a way to set a default child template at the page level? Edit: Or is the way to do this to temporarily allow 'news' to be used as child template, create those subsections, then lock those pages and allow only 'post' template to be used for next levels? Changing the allowed template settings doesn't seem to affect previously created pages, which would be good. They stay on the selected template. Correct? Is that how it works? And/or you create the sections and subsections on the 'news' template and then set 'Can this template be used for new pages' to 'no'? Or can you control the template options via access control? What is the difference between 'create pages' and 'add children' in access settings on the template?
-
I have 100+ spam/Russian user accounts on a semi-test site. Is deleting them one by one the only option? Is there no way to select a whole page of spam user accounts and batch delete them?
- 21 replies
-
I am trying to install Processwire + an exported custom profile and keep getting this error: Does anyone recognize this? What could cause this? I have installed Processwire + exported profiles many times before, never had problems. I have reuploaded fresh downloads for this, both regular master and dev, but keep getting the same thing. I am probably doing something dumb. Probably not a structural PW issue. I am out of ideas, so any feedback appreciated. Edit: Finally got something to install using the standard blank profile, instead of an exported profile. I am now manually reconstructing my custom site, using the new import/export functions - hit or miss so far. Did those break the ProcessProfileExport module?
-
- install.php
- exception
- (and 4 more)
-
Something inserts "/processwire/" in my form label
modifiedcontent replied to modifiedcontent's topic in General Support
rick, yeah, well, you know, that's just, like, your opinion, man. Leaving out quotes where they are not necessary is following the html specs by the letter and makes the html a lot cleaner and easier to read than the common quotes within double-quotes within single quotes mess - my text editor gives the classes and ids their own fun colors. So I guess something in PW somehow interpreted 'new password (confirm)' as code that it has to do something with, instead of plain placeholder text? That bit was inside quotes btw. -
Something inserts "/processwire/" in my form label
modifiedcontent replied to modifiedcontent's topic in General Support
fbg13, nothing wrong with the missing quotes. That is valid html and does not explain where the "/processwire/" insert comes from. -
Something inserts "/processwire/" in my form label
modifiedcontent posted a topic in General Support
I have a simple front-end password update form like this: In the browser the label of the second field shows up as follows: WTH?! I can't figure out what is changing the label, what is inserting /processwire/ and reformatting the thing. Is this something in PW? A "helpful" thing that browsers do? Edit: The problem disappears if I simply rename the second field to 'Confirm Password'. So my problem is solved, but I'll leave this here in case this is some kind of bug. -
Thanks Alxndre' This seems to work: If anyone can spot mistakes or knows a better way, let me know.
-
I am trying to rewrite Soma's suggestion here to export fields from the users database to a cvs file, with variations like this: $array = $users->explode(function($item){ ...etc. And $array = $users->find('start=0')->explode(function($item){ ... But keep getting 'Call to a member function ... on a non-object' errors. I guess $users is the non-object? I am trying to use this within a function, that is called with a button click. Is $users not available within a function? I see there are new export/import features coming up - great! - but it is all about $pages. Should $users work the exact same way? This works as demo starting point. Now I just have to replace the $list with something from $users:
-
How do you get the same 'set password' form/input fields on the front-end as in the admin area? I have a working front-end version, but the admin version has some nifty stuff around it. Should be easy to get the same on the front-end, right?