Recent Topics

1 Jan 19, 2009 23:24    

My b2evolution Version: 2.x

I upgraded from 2.3 to 2.4 then 2.46. Something is wrong because I now get Unhandled disp type errors when I click on http://www.championshipsubdivisionnews.com/index.php?blog=5&disp=fanzone and the like, plus

Not Found
The requested URL http://www.championshipsubdivisionnews.com/c30/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
--------------------------------------------------------------------------------
Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7a mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at www.championshipsubdivisionnews.com Port 80

errors all over the place. Everything worked before.

2 Jan 20, 2009 01:38

I think your server can't handle "pretty" urls. Try on one of your blog settings -> URLs subtabs changing all the options that have a cool looking thing to the option that uses parameters. Typically it'll be the first option and will always have the non-pretty "domain.com/filename.php?foo=bar&ti=ny" type of stuff.

6 Jan 20, 2009 04:16

what would fubar disp=...... ?

7 Jan 20, 2009 04:35

I don't think anyone mentioned "fubar disp=..."! First I was trying to fix the problem you have / had with all your pages - selecting params instead of pretty URLs. The custom disp thing is totally unrelated.

What you've done is, somewhere along the line, created a custom value for the variable known as disp: your "disp=teams" thing. b2evolution can not, for obvious reasons, automagically respond to that. So you have to make b2evolution understand what "teams" means when it is what the variable called "disp" holds. I *think* you can do that in your skins/yourskin/index.main.php file by finding

		skin_include( '$disp$', array(
				'disp_posts'  => '',		// We already handled this case above
				'disp_single' => '',		// We already handled this case above
				'disp_page'   => '',		// We already handled this case above
			) );

and replacing it with

		skin_include( '$disp$', array(
				'disp_posts'  => '',		// We already handled this case above
				'disp_single' => '',		// We already handled this case above
				'disp_page'   => '',		// We already handled this case above
				'disp_teams'   => 'teams.main.php',		// We made up this case because we're really cool
			) );


You then put "teams.main.php" into your /skins/yourskin/ folder ... or maybe in your /skins/ folder.

Note that I over-hacked a 2.4.5 installation a week ago to accomplish this. I'm pretty sure that this is all you need, but since I haven't actually done it (the right way!) this is pure conjecture on my part. Hopefully this solves this issue for you. Otherwise please respond with what you hack and how it works ... and hope someone really smart comes along. Tween now and then let's all be thankful that the girl scouts are selling girl scout cookies again :D

8 Jan 20, 2009 04:44

Wow, it all worked without issue in 2.3 RC1. Wha' happened? Something changed in 2.4x.

Thanks for your reply! I'll muck around.

9 Jan 20, 2009 04:52

Yeah I reckon stuff did change. Else why a new release eh? Whatever you did to 2.3RC1, try to replicate is all I can say. And yeah there is no way 2.3.* automagically knew what "disp=teams" meant. You must have taught it "if the link says disp is teams then do this file", which seems to be your mission of the moment.

I truly do hope you succeed and share how as I have to include a special-purpose form that will send an email to a non-member of the blog. A custom 'disp' page feels like the answer to me. Thus if you succeed then there is a glimmer of hope that I can 'steal with pride' your answer. Oh and yeah once I make the form I'll try what I recommend you try. So sooner or later maybe one of us will get lucky eh?

10 Jan 20, 2009 05:03

This will be resolved tomorrow. Another person did it and I await his explanation.

I looked at index.main.php and it is the same as before for andreas_01 skin.

<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr>
<td class="background1">
<table cellpadding=0 cellspacing=0 border=0>
<tr>
<td><a href="http://www.championshipsubdivisionnews.com/index.php?blog=5"><img src="img/banner3.GIF" border=0 id="chicklet"></a><br></td>
<td>
<table cellpadding=5 cellspacing=0 border=0>
<tr>
<td class="globalnav1" align=center><a href="http://www.championshipsubdivisionnews.com/index.php?blog=5&cat=198" class="background1link" ><b>*FCS NEWS*</b></a><br></td>
<td class="globalnav1" align=center><a href="http://www.collegesportingnews.com/stats/writer/GPI/" class="background1link" ><b>GPI</b></a><br></td>
<td class="globalnav1" align=center><a href="http://www.championshipsubdivisionnews.com/index.php?blog=5&title=college-sporting-news-announces-the-2007&more=1&c=1&tb=1&pb=1" class="background1link" ><b>ALL-STARS</b></a><br></td>
<td class="background1" align=center><span class="mediumtext"><b><A HREF="http://www.championshipsubdivisionnews.com/index.php?blog=5&disp=teams">TEAMS</A></b></span><br></td>
<td class="globalnav1" align=center><a href="http://www.championshipsubdivisionnews.com/index.php?blog=5&disp=fanzone" class="background1link" ><b>FAN ZONE</b></a>
<br></td>
</tr>
</table>

So I wait how he did it and then I will post it here. Members are screaming already!

11 Jan 20, 2009 06:14

Adding a link to "disp=whatever" will NOT be enough to make b2evolution understand what that value of $disp means!

You must tell b2evolution what it means, but if you're not in a hurry then I won't worry about it either.

12 Jan 20, 2009 06:35

EdB wrote:

Adding a link to "disp=whatever" will NOT be enough to make b2evolution understand what that value of $disp means!
You must tell b2evolution what it means, but if you're not in a hurry then I won't worry about it either.

I was just showing you WHAT WORKED before in b2evolution 2.3 and what is NOT WORKING now in 2.4.6. I think I mentioned I am in a GIGANTIC hurry. :'(

Why tell b2evolution now when before it knew what to do? Something must have been done or else I switched something. Any ideas?

13 Jan 20, 2009 06:41

No. A value of $disp is and always has been either defined of simply did not work. To try to tell me "this version magically knew" is simply wrong.

14 Jan 20, 2009 06:45

EdB wrote:

No. A value of $disp is and always has been either defined of simply did not work. To try to tell me "this version magically knew" is simply wrong.

I posted what was in the file you mentioned. Is there another file that would define it, that I did not update when changing versions (this is where the person that made the change could help)?

I swear, it worked before. I have backups.

15 Jan 20, 2009 07:16

A few posts up I shared what I understand to be the method to teach b2evolution what a random value of "disp" means. Did you do that?

Come on man think about it a bit! HOW could b2evolution possibly know that "if $disp is 'whatever' then access this file"? For you, the value 'teams' might mean something different than for me or for someone else. football.php to you, Terminate_Existing_Aggressive_Monsters_Simultaneously.php to someone else. grab_team_data.php to another person. See what I mean?

I have a disp value of 'sites' in one of my applications. What does that mean to you? What does it mean to b2evo! hint: nothing until I teach b2evo what I *want* that sequence of characters to mean.

Heck what does "single" mean? And if "page" is an understood value (it is but once upon a time it wasn't) then what would "pages" mean?

The thing is that if b2evolution doesn't know what you want then you have to teach it. So a few posts up I showed you how to teach it a new meaning of "disp". Your reply was to say "but this link is what I want!". ... eh?

You must teach this stupid software exactly what you mean by "when you look at the variable called disp and find that it holds the value of 'teams' then execute this exact file". All software is stupid at some level. b2evo is pretty danged smart, but it can't read your mind. OTOH it can learn, so teach it a new trick THEN use that new trick.

Sorry friend, but I have a hack I need to do for an installation I own. Someone said "I need a form like you did for that other thing". Unfortunately this new form is nothing like that other thing, so now I need a completely new hack ... even though I said to my user "okay that will be no problem". Might as well have said to me "just make it be like disp is teams" eh?

Hack the file to define what 'teams' means before linking to it. Or wait for your friend to take care of business. Either way, I've got a hack I need to do and a class to go to in about 8 hours. The hack, of course, needs to be done a few minutes before it was asked for :(

16 Jan 20, 2009 08:29

EdB wrote:

... Come on man think about it a bit! HOW could b2evolution possibly know that "if $disp is 'whatever' then access this file"?

Sorry my friend, but b2 did indeed know how to access the file but maybe I missed uploading the directions it needed that were written before. I am a web programmer (asp/perl/php/sql etc.) so I know what you are talking about. But I have so much on my plate that I thought it would be easier posing the question here. I have not implemented the fix you proposed but I will tomorrow because this WILL be fixed.

Strange that this worked in a previous version and not now but no one else has an idea why.

I think it is a setting in the admin like the 404 stuff.

FYI, disc=teams seems to call skins/_teams.php

<?php

//Check page isn't being accessed directly
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
{
//Show Custom page
?>
<div id="bPosts">
<table>blah blah
</table>
</div>
<?php
}
?>

17 Jan 20, 2009 17:34

It's not often EdB's bollocks wrong

And I'm pretty sure that this time is only going to reinforce that statistic.

Search your old file for $disp, bet you find an answer ;)

¥

18 Jan 20, 2009 19:33

¥åßßå wrote:

It's not often EdB's bollocks wrong
And I'm pretty sure that this time is only going to reinforce that statistic.
Search your old file for $disp, bet you find an answer ;)
¥

Yes, I meant no disrespect and do not doubt EdB for a second. I'll post the answer here when it is found.

19 Jan 20, 2009 20:01

romputer wrote:

¥åßßå wrote:

It's not often EdB's bollocks wrong
And I'm pretty sure that this time is only going to reinforce that statistic.
Search your old file for $disp, bet you find an answer ;)
¥

Yes, I meant no disrespect and do not doubt EdB for a second. I'll post the answer here when it is found.

I'm pretty sure he's to thick skinned to take offence, so calm your beating heart ;)

He's still right though ;)

¥

20 Jan 20, 2009 20:08

¥åßßå wrote:

He's still right though

Maybe I wasn't clear, I do indeed know that there was some definition in our old files but I can't find it. Waiting for the person that did the defining to tell me where it is so I can restore it, rather than writing a new one. Just wanted to make sure it wasn't a b2 change.

21 Jan 20, 2009 20:20

¥åßßå wrote:

Search your old file for $disp, bet you find an answer ;)

¥

22 Jan 20, 2009 20:29

¥åßßå wrote:

¥åßßå wrote:

Search your old file for $disp, bet you find an answer ;)

Sorry, I forgot to tell you I did that and found nothing I could recognize. But that's just me. :(

23 Jan 20, 2009 20:41

copy paste the results lines here, or just paste the whole page ( use [php][/php] tags if you do )

¥

24 Jan 20, 2009 23:42

¥åßßå wrote:

copy paste the results lines here, or just paste the whole page ( use [php][/php] tags if you do )
¥

AHA!!!!!!!!!!!!

AHAHAHAHAHAHA!!!!

The answer was in inc/skins/_skin.funcs.php

just three lines added to the function:

'disp_fcsmap' => '_custom.php',
'disp_fanzone' => '_fanzone.php',
'disp_teams' => '_teams.php',

/**
 * Template tag. Include a sub-template at the current position
 *
 * @todo plugin hook to handle a special disp
 */
function skin_include( $template_name, $params = array() )
{
	global $skins_path, $ads_current_skin_path, $disp;

	// Globals that may be needed by the template:
	global $Blog, $MainList, $Item;
	global $Plugins, $Skin;
	global $current_User, $Hit, $Session, $Settings;
	global $skin_url, $htsrv_url, $htsrv_url_sensitive;
	global $credit_links, $skin_links, $francois_links, $fplanque_links, $skinfaktory_links;

	if( $template_name == '$disp$' )
	{ // This is a special case.
		// We are going to include a template based on $disp:

		// Default display handlers:
		$disp_handlers = array_merge( array(
				'disp_arcdir'         => '_arcdir.disp.php',
				'disp_catdir'         => '_catdir.disp.php',
				'disp_comments'       => '_comments.disp.php',
				'disp_feedback-popup' => '_feedback_popup.disp.php',
				'disp_mediaidx'       => '_mediaidx.disp.php',
				'disp_msgform'        => '_msgform.disp.php',
				'disp_page'           => '_page.disp.php',
				'disp_posts'          => '_posts.disp.php',
				'disp_profile'        => '_profile.disp.php',
				'disp_single'         => '_single.disp.php',
				'disp_subs'           => '_subs.disp.php',
                                'disp_fcsmap'         => '_custom.php',
                                'disp_fanzone'        => '_fanzone.php',
                                'disp_teams'          => '_teams.php',
			), $params );

		if( !isset( $disp_handlers['disp_'.$disp] ) )
		{
			printf( '<div class="skin_error">Unhandled disp type [%s]</div>', $disp );
			return;
		}

		$template_name = $disp_handlers['disp_'.$disp];

		if( empty( $template_name ) )
		{	// The caller asked not to display this handler
			return;
		}
	}

	if( file_exists( $ads_current_skin_path.$template_name ) )
	{	// The skin has a customized handler, use that one instead:
		require $ads_current_skin_path.$template_name;
	}
	elseif( file_exists( $skins_path.$template_name ) )
	{	// Use the default template:
		require $skins_path.$template_name;
	}
	else
	{
		printf( '<div class="skin_error">Sub template [%s] not found.</div>', $template_name );
		if( !empty($current_User) && $current_User->level == 10 )
		{
			printf( '<div class="skin_error">User level 10 help info: [%s]</div>', $ads_current_skin_path.$template_name );
		}
	}
}

:lalala:

Thanks everybody!

25 Jan 21, 2009 03:47

Today at work I was thinking "could 23rcwhatever have somehow magically figured out what to do with an unknown disp" because romputer seemed so sure that it did but couldn't for the life of me understand how such a feature might have been lost.

Oh and I just found my 245 hack that does what CAN be done in the skin folder now. I hacked inc/_blog_main.inc.php to add a new type of disp value to the $disp_handlers array. I did that so that it wouldn't be skin-specific BUT the file it points to does 'skin specific' stuff so ... yeah ... I'm a noob :)

Okay Cool! We got resolution on this issue. Whew!


Form is loading...