breezer
Members-
Posts
30 -
Joined
-
Last visited
Everything posted by breezer
-
I saw this in a recent post by @cwsoft, it may be helpful in the future:
-
@bernhard yes sir it is the same software but I did a bit more work on it before my computer was lost/stolen. I recently recovered the hard drive and got it up and running again, and hated to scrap the project. As stated earlier by @dynweb, unfortunately I agree and I don't really see much use for a forum anymore. I appreciate everyones time that posted ?
-
Hello folks, I was working on a forum module which is about 65% done and was wondering if there would be enough interest to continue development. This would be a paid module of course due to the amount of time involved. I should have my workspace set back up in a few weeks, but later today I'll get a feature list and some screenshots of what I have so far and add them to this thread. Thanks for your time ?
-
Although I only do website coding as a hobby, I've always used wampserver. By far it's the easiest to set up and use in my opinion ?
-
add possibility to prepend or append scripts and stylesheets in admin
breezer replied to dotnetic's topic in General Support
I use the following method with success, in your module: public function init() { // add a hook after each page is rendered and modify the output $this->addHookAfter('Page::render', $this, 'page_after_render'); } public function page_after_render($event) { /** @var Page $page */ $page = $event->object; if( $page->template =='admin' ){ $head_include ='<link rel="stylesheet" type="text/css" href="PATH/TO/YOUR/CSS" /> '; $replace = array( '</head>' => $head_include .'</head>' ); $event->return = str_replace( array_keys( $replace ), array_values( $replace ), $event->return ); } } Pretty simple and $replace array can be extended as needed. -
Hello all, just an quick update on progress and a question or two. Although rewrite is going slow, I'm pretty happy with the results so far. The forum admin is working in front end and back end (both areas use the same file but with different tpls and stylesheet). User account on front end is working, I made it so new features can be easily added when needed. Front end forum is working, still have to finish the create and edit post functionality and straighten up alot of inline styles in the tpls. I decided to use the built in ckeditor for creation/editing and integrated roxy fileman to insert/manage attachments. Still a ways to go but I'm plugging along so hopefully there will be a test version out within the next couple weeks ?
-
-
EDIT: This has nothing to do with Tracy, I'm getting the same message with PW debug enabled so the issue is elsewhere. Thanks for your time. Is this a new issue for you in 4.16.8? To be honest I'm not sure, I didn't have it turned on lately and I upgraded this morning and noticed the message. Do you have any serialize() calls in your code anywhere? No I can't think of any but I'm going through all the files to check. Could you check in the Tracy logs directory: No files at all in the Tracy log directory. I also made the getExceptionFile() method only return true ( in module file and also checked filecompiler ) and still the message shows, so please don't waste any time on this as I have to assume it's something in my code somewhere. I'll look in all the files and see if I can figure it out. Again Happy New Year and thanks for a super tool ?
-
Hello all, hope everyone has a happy new year ? I'm using the newest version of Tracy ( 4.16.8 ) and after enabling Tracy this is showing at the bottom of all pages, front and back end: Fatal error: Uncaught Exception: Serialization of 'Closure' is not allowed in [no active file] on line 0 Googling the message tells me this is something to do with unit testing? Is this Tracy or something in my code? PW: 30118 Apache Version: 2.4.23 - Documentation PHP Version: 7.0.10 - Documentation Server Software: Apache/2.4.23 (Win64) PHP/7.0.10 - Port defined for Apache: 80
-
htaccess - how to allow access to specific file from site/modules
breezer replied to breezer's topic in General Support
Yes sir I already tried to use a dedicated pw page but without rewriting the all the code it just wont work. After a little more thought I decided not to modify the htaccess since what I'm wanting to do is just for looks basically. Thanks and I believe this is resolved. ? -
Hello all, hope everyone's holiday season has been delightful ? Is there a way to allow a specific .php file to be accessed from site/modules ( which is protected via htaccess )? I have an ajax file manager which integrates into a ckeditor front end instance which works fine as a .html file, but if accessed through url or in the ckeditor and user has no permission it still shows the user interface ( although all buttons are disabled ). If I rename it to .php I can kill the process and output an informational message. As a .php file the following directive in htaccess forbids it due to it residing in my module folder. # Block access to any PHP files in /site/modules/ RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/modules/.*\.(php|inc|tpl|module|info\.json)$ [OR] This is the current url: /pwire30118/site/modules/Xforum/assets/fileman/dev.html This preferred: /pwire30118/site/modules/Xforum/assets/fileman/dev.php If anyone can help it is greatly appreciated, my eyes are bleeding from reading htaccess articles...
-
This is the way I found that works: 1. Create a new folder in your site Modules folder named Injector ( site/modules/Injector ). 2. Copy / paste the following code into a file named Injector.module.php and put it in your module folder. <?php namespace ProcessWire; class Injector extends Process { public static function getModuleinfo() { return [ 'title' => 'Injector', 'summary' => 'Add content before </head> and before </body>', 'href' => '', 'author' => '', 'version' => '1.0.0', 'singular' => true, 'autoload' => true, ]; } public function init() { // add a hook after each page is rendered and modify the output $this->addHookAfter('Page::render', $this, 'after_render'); } public function after_render($event) { /** @var Page $page */ $page = $event->object; // ignore templates $ignore = array( 'admin' ); if( !in_array( $page->template, $ignore ) ){ $replace =array( '<!--[+head.include+]-->' => ( defined( 'HEAD_INCLUDE' ) ? HEAD_INCLUDE : '' ), '<!--[+body.include+]-->' => ( defined( 'BODY_INCLUDE' ) ? BODY_INCLUDE : '' ) ); $event->return = str_replace( array_keys( $replace ), array_values( $replace ),$event->return ); } } } 4. In your admin, refresh Modules and then install Injector. 5. In your template before the </head> tag, add <!--[+head.include+]-->, also optional add the <!--[+body.include+]--> before the </body> tag. 6. In your script(s) define HEAD_INCLUDE and BODY_INCLUDE ( optional ), ex: $head_include ='<link rel="canonical" href="http://example.com/tags/" />'; define( 'HEAD_INCLUDE', $head_include ); Do the same thing for BODY_INCLUDE if needed. Hope this helps.
-
Sorry I just started with PW and am using the newer 3.0xx series but I doubt upgrading would break anything.
-
I had a problem similar to this, and it was a css conflict. It turned out I had installed the LoginRegister module and it's stylesheet was injected into the <head> on the admin page. Check your page source maybe it's something like that.
-
I had some trouble with FileCompiler when I first started, which pretty much match your issues. Perhaps that is something to look into if this isn't yet solved. Go to the main Processwire site and search in the blog posts for more information on FileCompiler. You can also try going to Admin/Modules, then at the very bottom of the modules list there is a button "Clear Compiled Files"
-
You were exactly right. It turned out to be the LoginRegister css putting the kabosh on me. Again thanks for a great module, works perfectly.
-
This new plugin module is a great helper for setting up fields widths for layout:
-
I'll uninstall and see what happens, thanks for looking into it.
-
You should download the LoginRegister module, it has all the code you need. I also just found these members gist which has a huge amount of samples you might find useful. https://gist.github.com/kongondo https://gist.github.com/somatonic
-
My setup is non modified PW dev and uikit admin theme. I basically just edited the existing user template, and moved the role tab last in the sort since it doesn't show during profile edit. Then go to edit my profile to check the fields. All the items are pushed far left and there is a space on the right of the column: | [ Field One ] [Field Two] | | [ Field One ] [ Field Two ] [ Field Three ] | What am I looking for when I use the dev tools, css issues are pretty much out of my realm lol
-
Thanks for this helper module, it works great. The only issue I see in my case is that the total percentage width of the rows only equals: 2 items per row - 92%. 3 items per row - 86% Any more than that and the field falls back down. Other than that its awesome, many thanks. Running v0.1.5 , Processwire 3.0.1.1.8, Firefox browser, wamp on windows 7
-
I'm new to PW and just learning hooks myself but this is how I got the loginSuccess hook to work in site/_init.php. Note this only sets a session variable but it is proof that the hook is there and working. wire()->addHook('LoginRegister::loginSuccess', function($event) { // outside a class $session = wire('session'); $session->set('Login_Register_hook', 'success'); }); output: [Login_Register_hook] => success wire()->addHook('LoginRegister::loginFail', function($event) { $session = wire('session'); $session->set('Login_Register_hook', 'failure'); }); output: [Login_Register_hook] => failure
-
This is what the final working template file looks like: <?php namespace ProcessWire; /*FileCompiler=0*/ defined( 'XFORUM_MODE' ) or die( '<b>UNAUTHORIZED_ACCESS_ERROR</b>' ); // check for valid_key and compare to users id if( wire('input')->get->text('valid_key') == wire('session')->user('id') ){ echo xforum_process_page( $pname='ajax', $return='echo', $options, $xarray = $xforum); }else{ echo "error"; } // Call halt() to prevent further loading $this->halt();
-
Thanks Robin S, your reply was exactly what I needed in this particular use case ? And to everyone else who replied many thanks as well. I now realize my question was kinda vague, next time I'll try and be a bit more descriptive.