Need some help with my libraries |
[eluser]Techie-Micheal[/eluser]
I could use some help, per the subject. Being new to CI, I would appreciate some help testing my two new libraries and making sure I did things the "CI way." Right now all I've done is rip out phpBB3's templating engine and modify it a bit for CI for general use without needing phpBB installed. I plan to do the same with phpBB3's DBAL, sessions, and ACL. As well as write a helper or two to tie it all in and tie a phpBB install to your app. At any rate, here's the tarball of the two files: http://www.michealcottingham.com/ci_phpb...ate.tar.gz I know there are some things that need to be fixed and cleaned up (right now it is rather messy), but at least it seems to work. Here's the code I put in my controller, using autoload.php to setup the templating. Code: $this->phpbb3_template->set_custom_template('./templates', 'home'); Create a templates directory in the root of your app and create a cache folder in your application folder. For example: index.php - front controller system/ - the system folder application/ - the controllers et al templates/ - where you'll store the template files, css, whatever else Or: ../system/ - the system folder ../application/ - the controllers et al index.php - front controller templates/ - where you'll store the template files, css, whatever else You get the idea. So, feedback please!
[eluser]BoltClock[/eluser]
OK, I got it up and running as you instructed without error. The problem is, though the library is able to detect my template file, nothing is being output. Here's my file layout: index.php system/ - application/ - - cache/ - other folders templates/ - test.html Here's my testing controller: Code: <?php Here's my template file (test.html): Code: <html> I've never used phpBB3's template system before so it may be a problem on my part. <b>EDIT:</b> While CI was able to find the library, I believe the user guide says to capitalize the class name, so <strong>Phpbb3_template</strong> (though there's no need for phpbb3_template_compile since it's loaded internally by the former). [quote author="Techie-Micheal" date="1196585463"]I plan to do the same with phpBB3’s DBAL, sessions, and ACL. As well as write a helper or two to tie it all in and tie a phpBB install to your app.[/quote] That sounds awesome, I can't wait till it's ready! Though in the meantime I may have to put up with other means because I want to get my site up within a month :/ <b>EDIT 2:</b> I forgot to make a cache folder, so I did, but it still isn't working.
[eluser]Techie-Micheal[/eluser]
Edit: On second thought, try this, just to see: Code: $this->phpbb3_template->set_filenames(array( And of course changing test to body in the display call. Otherwise, you are correct.
[eluser]Techie-Micheal[/eluser]
It shouldn't make any difference, and it didn't for me. Did you make sure cache was writable? I forgot to add that in to the above. Other than that, I can't think of anything. It is working just fine for me. Oh, PHP5, right? It shouldn't matter, but just checking.
[eluser]BoltClock[/eluser]
Nope, still not working. It <b>seems</b> like include() could be the problem. I don't think CodeIgniter will be happy include()ing directly into the controller. Just to hunt around for the problem I added die() to phpbb3_template::display() just after the include() command and sure enough it dies right there, with the output being shown. It could have something to do with include(). I'm not entirely certain though. <b>EDIT:</b> Didn't see your reply. Anyway, cache is definitely writable because the compiled template file appears there. Yes, PHP 5.
[eluser]Techie-Micheal[/eluser]
Odd. I wonder why it works fine for me. And actually, I found a bug in the compiling, but it doesn't affect display for me. It just recompiles the template every page load, which is a no-no. ![]() ![]()
[eluser]darkera13[/eluser]
Open file : phpbb3_template_compile.php FIND : Code: global $phpEx; REPLACE WITH : Code: $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.php';
[eluser]BoltClock[/eluser]
I found the problem: it was with the server's compression :|
[eluser]Techie-Micheal[/eluser]
[quote author="darkera13" date="1197629537"]Open file : phpbb3_template_compile.php FIND : Code: global $phpEx; REPLACE WITH : Code: $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.php'; Quote:I found the problem: it was with the server’s compression :|How so? I'm going to go ahead and start working on pulling out the phpBB3 DBAL so that sessions and such will work when I do those. ![]() I still have the compile problem, but it isn't showstopping, so I'll continue. Just trying to get a rough set of libraries, then I'll clean them up. |
Welcome Guest, Not a member yet? Register Sign In |