2 balupton Nov 23, 2006 12:29

balupton wrote:
Can you give us a quick summary of what it does and why we would want to apply it ;)
Exactly my idea ;)
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
Exactly, only I wasn't aware that a hack for this was already out there.
i've b2evo 1.8.1, you know if this hack work also with this version?
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
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.
What about 1.9.2? I doesn´t get this to work with the current version of b2evolution... :(
@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
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.
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
Thanks xxxxusky
That must a new file... I didn't even know it existed :)
Sure makes life easier
xxxxusky wrote:
I found how to make this work with 1.9.*
Cool - thanks. Hey now everyone knows!
Thanks... :D
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
You need to change the link in your sidebar to your full blog url ( ie/ http://domain.com/index.php )
¥
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.
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 ;)
¥
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>.
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 :-)
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.
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
Please don't double post stuff.
is there a way to incorporate the editing of the "something" page in the admin? if so, what files need to be effected?
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 ;)