1 laibcoms May 01, 2007 06:25
3 edb May 01, 2007 16:55
Nice! Much easier than my version, and doesn't require core file hacks. OTOH it doesn't give any custom love to the page title, if that matters.
In addition to Afwas' info I'll state that it's much better in the skins/yourskin folder because, like it or not, skins don't follow a standard pattern. A majority will align with the 'custom' skin, but enough don't that if you offer skin switching to your visitors (or randomly change skins just because), you're probably better off making a unique copy for each skin. My opinion only eh?
Well done!
4 john May 01, 2007 17:16
Thanks Liabcoms
I'll post a link in that old post of mine to refer to this one..
I didn't even know about _dispatch.inc.php back then :)
5 yabba May 01, 2007 21:05
you really don't need to hack _dispatch.inc.php huh?
if( $disp == 'foo' )
{
// take "foo" action or require foo.php or ../foo.php whatever
}
else
{
require $skins_path.'_dispatch.inc.php';
}
You can also do it via a plugin but you need to change $disp to something valid, like "single", otherwise you get an error.
¥
6 john May 02, 2007 03:12
@ ¥åßßå
Could you please expand a little on your snippet of code in the context of the _about.php in the first post.
I'm not sure of what goes where in this attempt to not hack _dispatch.inc.php
if( $disp == 'foo' )
{
// take "foo" action or require foo.php or ../foo.php whatever
}
else
{
require $skins_path.'_dispatch.inc.php';
}
7 laibcoms May 02, 2007 03:29
John wrote:
@ ¥åßßå
Could you please expand a little on your snippet of code in the context of the _about.php in the first post.
I'm not sure of what goes where in this attempt to not hack _dispatch.inc.phpif( $disp == 'foo' ) { // take "foo" action or require foo.php or ../foo.php whatever } else { require $skins_path.'_dispatch.inc.php'; }
yah same... though what I'm thinking, but might be wrong is something like this?
if( $disp == 'about' OR $disp != 'feeds' )
{ // We must display a sub template:
$disp_handlers = array(
'about' => '_about.php',
'feeds' => '_feeds.php',
);
$disp_handler = $disp_handlers[$disp];
if( file_exists( $current_skin_includes_path.$disp_handler ) )
{ // The skin has a customized handler for this display:
require $current_skin_includes_path.$disp_handler;
}
else
{ // Use the default handler from the skins dir:
require $skins_path.$disp_handler;
}
}
else
{
require $skins_path.'_dispatch.inc.php';
}
something like that ¥?
EdB wrote:
Nice! Much easier than my version, and doesn't require core file hacks. OTOH it doesn't give any custom love to the page title, if that matters.
In addition to Afwas' info I'll state that it's much better in the skins/yourskin folder because, like it or not, skins don't follow a standard pattern. A majority will align with the 'custom' skin, but enough don't that if you offer skin switching to your visitors (or randomly change skins just because), you're probably better off making a unique copy for each skin. My opinion only eh?
Well done!
Hmm... page title.. good point ^^
It's true, making a unique copy for each skin is the better choice, though I think it is for those who rely on downloadable skins ^^
I tried using one central file, if I use the default class and id names of b2e, it's doable but it'll take a lot of time to edit existing skins.
Dunno, I think the default b2e class and id names are there for a reason ^^ but theme/skin makers tend to ignore them (myself included), for one, it's so time-consuming to convert your names to b2e's.
8 yabba May 02, 2007 11:25
Sorry, I was a tad consise huh? :P
It was more in answer to EdB's "you're probably better off making a unique copy for each skin", in which case you might as well just handle the disp stuff inside the skin similar to how I posted.
I approached this in a tad of a different way with a plugin that allows you to include a page in it's content. That way you could just use your linkblog as a custom pages blog. You can see a demo post [url=http://www.waffleson.co.uk/2006/11/29/playing_with_custom_pages]here[/url]
¥
9 john May 02, 2007 11:52
mmm... thanks for the explanation Killer
I'll stick with current methods until you release your Swiss Army Knife linkblog plugin :)
10 yabba May 02, 2007 12:35
You might be in for a tad of a wait, I started my linkblog plugin in 1.6 :p
¥
11 waltercruz May 05, 2007 17:38
With a bit of mod_rewrite and hacking on blog_main.php, you can get pretty urls :)
Nice one, Laibcoms. Keep up the good works.
If you copy/paste this code mind the following: there should be no spaces or New Lines before the first <?php or after the last ?>.