functions_cute_url.php
Re: functions_cute_url.php
Read the hooks_system.html in the docs folder of phpBB. All you have to do is name the file accordingly (hook_something.php?) and put it into includes/hooks. And you need to make sure cute_urls are available globally.
Donate to phpBBModders.net - we're poor!
-
- Supporter
- Posts: 32
- Joined: 12 Aug 2009, 16:16
- Real name: David
- Contact:
Re: functions_cute_url.php
eviL<3 wrote:Read the hooks_system.html in the docs folder of phpBB. All you have to do is name the file accordingly (hook_something.php?) and put it into includes/hooks. And you need to make sure cute_urls are available globally.
Alright, cool. I'm sorta new to hooks, so this will be a good opportunity to learn.
EDIT: Sweet, I figured it out! Thanks for the work you put into making those functions/hooks!
phpBB.com Development Team Member | View My MODs | View My Website
Please do NOT contact for support via PM or email.
Please do NOT contact for support via PM or email.
-
- Supporter
- Posts: 27
- Joined: 21 Aug 2006, 19:23
- Real name: Derk
- Location: The Netherlands
- Contact:
Re: functions_cute_url.php
This hook was messing up stuff regarding email files:
With some testing together with Igor, this is the solution:
Open: includes/template.php
Find:
Replace with:
Open: includes/hooks/hook_fix_url.php
Find:
Replace with:
Code: Select all
General Error
template->_tpl_load(): No file specified for handle body
With some testing together with Igor, this is the solution:
Open: includes/template.php
Find:
Code: Select all
if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once))
Replace with:
Code: Select all
if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once, $this))
Open: includes/hooks/hook_fix_url.php
Find:
Code: Select all
function template_display_fix_url(&$hook, $handle, $include_once = true)
{
global $template;
Replace with:
Code: Select all
function template_display_fix_url(&$hook, $handle, $include_once = true, $template)
{ Â
- tumba25
- Supporter
- Posts: 1052
- Joined: 24 Oct 2007, 13:10
- Real name: Jari Kanerva
- Location: Kokkola, Finland.
- Contact:
Re: functions_cute_url.php
Thanks for the fix, Derky and Igor.
Re: functions_cute_url.php
FWIW, the OpenFlame dev team has developed something inspired by the cute_urls code, with some improvements.
http://github.com/OpenFlame/OpenFlame-F ... andler.php
With OfUrlHandler->checkExtra() you can also check if there is any other parts to the path specified left
i.e. if you are expecting http://yoursite/page/somepage/ but not http://yoursite/page/somepage/someextra ... should404/ then you can use the checkExtra() call to detect that there is another entry for 'someextrastuff' and 'pageshould404' and be able to properly react to it (like, 404'ing because the page specified is invalid)
At the moment, cute_urls does not provide this functionality at all.
There are a few other improvements as well, but I can't think of them off the top of my head.
Also, to note, this is an entirely standalone library file; it is not dependent on the framework it resides in, nor any other system.
http://github.com/OpenFlame/OpenFlame-F ... andler.php
With OfUrlHandler->checkExtra() you can also check if there is any other parts to the path specified left
i.e. if you are expecting http://yoursite/page/somepage/ but not http://yoursite/page/somepage/someextra ... should404/ then you can use the checkExtra() call to detect that there is another entry for 'someextrastuff' and 'pageshould404' and be able to properly react to it (like, 404'ing because the page specified is invalid)
At the moment, cute_urls does not provide this functionality at all.
There are a few other improvements as well, but I can't think of them off the top of my head.
Also, to note, this is an entirely standalone library file; it is not dependent on the framework it resides in, nor any other system.
-
- New member
- Posts: 49
- Joined: 12 Nov 2008, 01:26
- Real name: Daniel
- Location: Belgique
Re: functions_cute_url.php
Hello,
This code works with index.php but if I'm creating others pages this code doesn't work.
I've got : index.php / about.php / etc.
How fix it?
Best regards.
This code works with index.php but if I'm creating others pages this code doesn't work.
I've got : index.php / about.php / etc.
How fix it?
Best regards.
- tumba25
- Supporter
- Posts: 1052
- Joined: 24 Oct 2007, 13:10
- Real name: Jari Kanerva
- Location: Kokkola, Finland.
- Contact:
Re: functions_cute_url.php
Did you follow [url=http://phpbbmodders.net/board/viewtopic.php?p=16186#p16186]these instructions[/url]?
-
- New member
- Posts: 49
- Joined: 12 Nov 2008, 01:26
- Real name: Daniel
- Location: Belgique
Re: functions_cute_url.php
Yes. But this code doesn't work outside index.php... :s
I'd like this: http://phpbbmodders.net/about/rules/
But I'd like create a separate page for each thing.
I'd like this: http://phpbbmodders.net/about/rules/
But I'd like create a separate page for each thing.
-
- New member
- Posts: 49
- Joined: 12 Nov 2008, 01:26
- Real name: Daniel
- Location: Belgique
Re: functions_cute_url.php
It's solved.
In htaccess file:
In htaccess file:
Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
Rewriterule ^about?/([^/]+)?/?([^/]+)?$ ./about.php?mode=$1 [NC]
-
- New member
- Posts: 1
- Joined: 23 Jan 2012, 01:46
Re: functions_cute_url.php
Thanks for the codes!