1 edb Nov 23, 2006 00:55
3 topanga Nov 23, 2006 12:45
balupton wrote:
Can you give us a quick summary of what it does and why we would want to apply it ;)
Exactly my idea ;)
4 john Nov 23, 2006 14:02
I can see what EdB is on about.
It's just a simple way to generate a page within your blog that could contan anything you might deliver via a normal HTML page.
Photogallery, Code examples, etc etc
I posted a version of this a while ago as a way to display an ABOUT page
http://forums.b2evolution.net/viewtopic.php?t=9140
5 edb Nov 23, 2006 17:59
Exactly, only I wasn't aware that a hack for this was already out there.
6 giast Dec 04, 2006 18:08
i've b2evo 1.8.1, you know if this hack work also with this version?
7 john Dec 04, 2006 23:15
Giast wrote:
i've b2evo 1.8.1, you know if this hack work also with this version?
I have had no problems with any upgrades from 1.8.0 up to the current 1.9.1
Just remember to double check the effected files if you do an upgrade..
Files to Edit:
inc/misc/_template.funcs.php
inc/MODEL/collections/_blog.class.php
skins/your_skin/_main.php
8 edb Dec 05, 2006 01:15
John is on the money here. The hack SHOULD be able to work with 1.8.1, but keep an eye out for things that don't seem the same between the hack instructions and your actual files.
9 daniel Mar 12, 2007 22:37
What about 1.9.2? I doesn´t get this to work with the current version of b2evolution... :(
10 john Mar 12, 2007 23:52
@Daniel
My version of this hack, [url=http://forums.b2evolution.net/viewtopic.php?p=47215#47215]linked in my previous post[/url] in this thread, has worked with every version from 1.8 to the current 1.9.3.
I would check your files again.
Files to Edit:
inc/misc/_template.funcs.php
inc/MODEL/collections/_blog.class.php
skins/your_skin/_main.php
11 edb Mar 13, 2007 00:42
Actually neither of these hacks will work with 1.9.* straight out of the box because the switch(disp) bit no longer exists in skins/skinname/_main.php file. Someone wrote in a thread here that this version can be used pretty much as-is except you put the "something" file in the skins/ folder instead of skins/skinname/. I haven't done it yet to be sure because I haven't upgraded my 1.8.7 installation yet. That'll happen Wednesday morning so that's when I'll know how it goes.
12 xxxxusky Mar 13, 2007 05:58
I found how to make this work with 1.9.*
just open _dispatch.inc.php in \blogs\skins\
and find
$disp_handlers = array(
'arcdir' => '_arcdir.php',
'comments' => '_lastcomments.php',
'msgform' => '_msgform.php',
'profile' => '_profile.php',
'subs' => '_subscriptions.php',
);
add
'something' =>'something.php'
into array()
that is all
13 john Mar 13, 2007 06:52
Thanks xxxxusky
That must a new file... I didn't even know it existed :)
Sure makes life easier
14 edb Mar 13, 2007 14:50
xxxxusky wrote:
I found how to make this work with 1.9.*
Cool - thanks. Hey now everyone knows!
15 daniel Mar 13, 2007 22:17
Thanks... :D
16 haracz Mar 14, 2007 11:31
It seems not work for me :(
EDIT: i've got 404 error
Here is my custom file: in this case _ab.php
http://haracz.freshsite.pl/ab.jpg
_blog.class.php
http://haracz.freshsite.pl/bc.jpg
_dispatch.inc.php
http://haracz.freshsite.pl/dis.jpg
_template.funcs.php
http://haracz.freshsite.pl/tf.jpg
and finally _main.php from my skin
http://haracz.freshsite.pl/main.jpg
_ab.php is in my skin folder if it's any meaning
17 yabba Mar 14, 2007 11:56
You need to change the link in your sidebar to your full blog url ( ie/ http://domain.com/index.php )
¥
18 edb Mar 14, 2007 17:14
I don't think that's the answer. I did this hack with the 1.9.* corrective action and it failed. It gave me the "undefined disp" page using FireFox. So I tinkered. This makes no sense at all, but my skins/_dispatch.inc.php had this in it:
if( $disp != 'posts' && $disp != 'single' )
{ // We must display a sub template:
$disp_handlers = array(
'arcdir' => '_arcdir.php',
'comments' => '_lastcomments.php',
'msgform' => '_msgform.php',
'profile' => '_profile.php',
'subs' => '_subscriptions.php',
'something' => '_something.php',
);
if( empty( $disp_handlers[$disp] ) )
{
debug_die( 'Unhandled disp type ['.$disp.']' );
}
That failed, but it worked worked when I changed it to this:
if( $disp != 'posts' && $disp != 'single' )
{ // We must display a sub template:
$disp_handlers = array(
'arcdir' => '_arcdir.php',
'comments' => '_lastcomments.php',
'msgform' => '_msgform.php',
'profile' => '_profile.php',
'something' => '_something.php',
'subs' => '_subscriptions.php',
);
if( empty( $disp_handlers[$disp] ) )
{
debug_die( 'Unhandled disp type ['.$disp.']' );
}
All I did was copy the line for 'subs' and changed it to 'something' (plus removed the extra spaces before the => thing), but it failed. I then moved the 'something' line to above the 'subs' line and it worked. Hmmm...
By the way I edited the initial post to correct 2 errors: first I noticed I commented out the ending ?> in one of the hacked in bits. I also just noticed my sample _something.php page will not display as-is because I use < to identify a div in the page, but it gets interpreted that way, so I replaced it with <
Also, the hack originally worked with _something.php in your skins/yourskin/ folder, the corrective action said it needed to be in skins/ but I've found that it does not: it works with it in the actual skin, but only after tinkering with the _dispatch.inc.php file.
19 yabba Mar 14, 2007 18:24
They link to "index.php?disp=foo" which will be interpreted as domain.com/skins/<skin>/index.php?disp=foo which is what is producing their 404 error ;)
¥
20 edb Mar 14, 2007 21:32
Yes you're right. I didn't catch that detail. haRacz has the hack done incorrectly. The right way to do that bit is either with a full URL or with <li><a href="<?php $Blog->disp( 'something', 'raw' ) ?>"><strong><?php echo T_('Something') ?></strong></a></li>.
21 adriscoll Jul 18, 2007 01:15
john and edb,
once this piece is added, how would i integrate it with the admin so a user could enter the info without going through and editing files directly.
i have multiple bloggers and want them to be able to update it without it going through me :-)
22 edb Jul 18, 2007 01:25
adriscoll that would be an awesome feature. I think I read something about how non-blog pages are part of the future, but for right now I don't think it's possible. Something about not having hooks where you would need them for a plugin to make it happen. Therefore it would be a creative hack on top of a minor hack.
23 adriscoll Jul 18, 2007 02:33
edb,
is their a way to flag a posting so that i could have my bloggers just put some info in a posting and have it reside in a single spot on the site.
i am posting this on the main forum as well.
cheers
24 edb Jul 18, 2007 16:52
Please don't double post stuff.
25 adriscoll Jul 31, 2007 18:31
is there a way to incorporate the editing of the "something" page in the admin? if so, what files need to be effected?
26 edb Aug 06, 2007 17:25
It is possible to hack it in, but it would not be easy. I also think it will not carry forward to the 2.0 release.
Basically this is where you should look. The "templates" tab allows you to edit files in the skins/custom folder, so if you could make that edit files in the skins folder you would be able to edit the something page via the templates tab. It would not be pretty or friendly, but it would be "doable".
I think when 2.0 comes out I will revisit this hack as I have quite a few applications for this. Assuming I need to, meaning assuming 2.0 does not have "non blog post page" support, I will focus on a method to make easy and friendly access to this type of thing via the back office. AFAIK it would still be a hack, but the hack would be to add hooks that support a plugin for this purpose.
Can you give us a quick summary of what it does and why we would want to apply it ;)