Recent Topics

1 Sep 26, 2009 13:10    

My b2evolution Version: 2.x

Dear sirs at b2evolution Support,

Often news and articles that we attempt to post fail and we get this message when we go to the posted page: 'Sorry there is nothing to display' This problem has filled our data base with errors and causes articles to not be listed by browsers.

The only way to get things to upload is to change the title- sometimes four times.

The old b2 never did this, but this new version- b2evolution 2.4.5, has done it constantly since the day we started using it.

We are taking every possible precaution, not uploading while other site pages are opened and pressing the write button multiple times, but nothing works, it seems to corrupt arbitrarily.

Have you any ideas or suggestions?

Sky,
One of the editors at http://www.thepeoplesvoice.org

2 Sep 26, 2009 13:37

Well let's see. I don't believe it is, but IF it is related to the title then what titles won't post? Never mind: let's just fix it.

Is an entire blog showing this, or ONLY a new post's permalink (single entry) page? I'm guessing it is not an entire blog; rather it is a single post's permalink page. With that in mind I'll guess it is related to timestamp on the post. Assuming it is the permalink page that shows the problem, next time you have one of these happen edit the post and scroll all the way down until you see the date and time (most importantly the time) of the entry. If I'm right you'll notice that the date and time of record hasn't happened yet. Thus, the blog engine won't show you a future post.

The solution is fairly easy if you are the only blogger, or if all bloggers are in the same time zone. It would be to go to Global settings -> Regional and set 'Time difference' to whatever it takes to make your server time match your local time. For me on my primary domain, my server is 3 hours east of me so I set it to -3 in order to subtract 3 hours from it (thus matching my local time). For multiple bloggers in multiple time zones it is much harder. Each blogger not in the time zone that matches the compensated server time has to suck eggs until the entry actually posts. Or edit the time stamp on the post. Or both! One could suck eggs while editing the time stamp :)

Each item is stored with local time. Your installation's server time is compensated with the time diff value to see if it will be posted in the future, right now, or in the past. Technically "right now" can't really happen but whatever.

Example: server is at 13:00, blog home time is 12:00, time diff is -1
MATCHED ZONES: item time is 12:00, blog home time is equal to or greater than so it works.
EAST OF BLOG HOME: item time is 11:00, blog home time is equal to or greater than so it works.
WEST OF BLOG HOME: item time is 13:00, blog home is time less than so it says "nothing to display".

I'll bet you are in the "west of" situation

3 Sep 26, 2009 13:54

Edit those posts and remove the - from the end of the url title, it screws evo into thinking it's a non-existent tag ;)

I think there may be a setting in one of teh conf files to automate it ... but don't quote me ;)

¥

4 Sep 26, 2009 13:57

conf/_advanced.php

/**
 * Enable a workaround to allow accessing posts with URL titles ending with
 * a dash (workaround for old bug).
 *
 * In b2evolution v2.4.5 new tag URLs were introduced: You could choose
 * to have tag URLs ending with a dash. This lead to problems with post
 * URL titles accidentially ending with a dash (today, URL titles cannot
 * end with a dash anymore): Instead of displaying the post, the post
 * title was handled as a tag name. When this setting is enabled, all tag
 * names which are exactly 40 chars long and end with a dash are handled
 * in the following way:
 * Try to find a post with the given tag name as the URL title. If there
 * is a matching post, display it; otherwise, display the normal tag page.
 *
 * Note: If you use a 39 chars-long tag name, have an URL title which is
 * the same as the tag *but* additionally has a dash at the end and you
 * use the dash as a tag URL "marker", you won't be able to access either
 * the post or the tag page, depending on the value of this setting.
 *
 * @global boolean $tags_dash_fix
 *
 * @internal Tblue> We perhaps should notify the user if we detect bogus
 *                  post URLs (check on upgrade?) and recommend enabling
 *                  this setting.
 */
$tags_dash_fix = 0;

¥

5 Sep 26, 2009 14:38

EdB

Thank you very much for your answer! I went to Global settings/regional. Under regional settings where I had my time difference set to -1.

Next to the time difference box a note says "[in hours, e.g. "1", "1:30" or "1.5"] If you're not on the time zone of your server. Current server time is: 08:02:59 am. Calculate time difference."

I clicked the link to calculate the difference, and my time difference was changed to 0. I went to the write page and discovered that the time listed under the main editing field was now 08:02, one hour ahead of my location, so on my computer clock it was 7:02.

I then created a post with multiple pages to the site opened, switched back and fourth between blogs and didn’t bother to press the write button and made this title FGTYN / 2y49fkgf, usually slashes cause problems, and it worked, it posted without the dreaded 'Sorry there is nothing to display' message.

Although posts now appear on the site with a time stamp that is one hour ahead of my time, I don't care, I’m just very, very glad it worked. I’m hoping the problem is solved.

I will let you know.

Sky

6 Sep 26, 2009 14:46

¥åßßå

Thank you for that information. What you describe with the dashes is probably also happening, but it is so overshadowed by the other problem that I was not able to discern it. Now that you have told me about it I will be watching for it, and I have your solution

Sky

7 Sep 26, 2009 15:35

sky1 wrote:

Sky,
One of the editors at http://www.thepeoplesvoice.org

sky1 wrote:

I clicked the link to calculate the difference, and my time difference was changed to 0.

In a way this could be seen as a bug because what you've done is made it work well for your timezone, but I'm guessing there are other editors at suchandsuch. So if they are not in your timezone then they will have the problem next.

So IF it is a bug then the description is "users in different timezones might get 'nothing to display' based on server time plus 'time difference' versus each bloggers actual time". The solution would be to move the 'time difference' bit to each blogger's profile, with a default value equal to whatever the installation's value is.

8 Oct 27, 2009 17:50

¥åßßå,

You are right. Posts that have url’s that end with a dash fail, causing this message “Sorry there is nothing to display” to appear in place of the post.

Here is an example of a post that failed because the address ended in a dash, causing a semicolon to appear in place of the dash for some reason. And under the failed post is the url with a space removed from the address which caused the url to end with the letter m, which works.

http://www.thepeoplesvoice.org/TPV3/Voices.php/2009/10/27/exposing-lies-about-the-fed-the-cia-the:

http://www.thepeoplesvoice.org/TPV3/Voices.php/2009/10/27/exposinglies-about-the-fed-the-cia-the-m

Does anyone know how to write the code that can correct this problem? I and other users of b2 would be grateful for a solution.

Sky

9 Oct 27, 2009 20:39

Change the zero to a one in the code I posted ;)

¥

10 Oct 28, 2009 05:36

¥åßßå
Thank you very much for the code to enable the workaround. I installed it, but don’t I need the actual code for the workaround itself? I mean isn’t it just a switch to nothing without that? I apologize for asking these questions but I am no expert in coding.

11 Oct 28, 2009 12:01

After installing $tags_dash_fix = 1; on the advanced.php page I tried posting an address that ends with a dash and it still gave me the “sorry there is nothing to display” error message.

I found some code in the _blog_main.php page that mentions path information that ends with a dash and other characters, but I didn’t see anything that is directly associated with the $tags_dash_fix = 1 command.

// Does the pathinfo end with a / or a ; ?
$last_char = substr( $path_string, -1 );
if( $last_char == '-' || $last_char == ':'|| $last_char == ';' )
{ // - : or ; -> We'll consider this to be a tag page
$last_part = $path_elements[count($path_elements)-1];
$tag = substr( $last_part, 0, strlen($last_part)-1 );
$tag = urldecode($tag);
$tag = strip_tags($tag); // security
// pre_dump( $tag );

Is there a modification out there for the blog_main.php that works with the $tags_dash_fix = 1 on the advanced.php page?

12 Oct 28, 2009 17:43

This code that was on _blog_main.php version 2.4.5 was lacking the $tags_dash_fix info. that works in conjunction with the $tags_dash_fix = 1; command that I added to the advanced.php page.


			// Does the pathinfo end with a / or a ; ?
			$last_char = substr( $path_string, -1 );
			if( $last_char == '-' || $last_char == ':'|| $last_char == ';' )
			{	// - : or ; -> We'll consider this to be a tag page
				$last_part = $path_elements[count($path_elements)-1];
				$tag = substr( $last_part, 0, strlen($last_part)-1 );
				$tag = urldecode($tag);
				$tag = strip_tags($tag);	// security
				// pre_dump( $tag );

				// # of posts per page:
 				if( ! $posts = $Blog->get_setting( 'tag_posts_per_page' ) )
				{ // use blog default
					$posts = $Blog->get_setting( 'posts_per_page' );

I found this other version of the _blog_main.php page here: http://doc.b2evo.net/HEAD/__filesource/fsource_main__blogsinc_blog_main.inc.php.html. It may have been from a later version of b2. It contained the code which made reference to $tags_dash_fix. I inserted it in place of the code above, on _blog_main.php version 2.4.5, and I tested it with an address that ends with a dash, and it worked. I did not get the error message "sorry there is nothing to display". The url now shows the dash at the end of the address in the browser and tho post openes correctly.

// Does the pathinfo end with a / or a ; ?
                $last_char = substr( $path_string, -1 );
                $last_part = $path_elements[count( $path_elements )-1];
                $last_len  = strlen( $last_part );
                if( ( $last_char == '-' && ( ! $tags_dash_fix || $last_len != 40 ) ) || $last_char == ':'|| $last_char == ';' )
                {    // - : or ; -> We'll consider this to be a tag page
                    $tag = substr( $last_part, 0, -1 );
                    $tag = urldecode($tag);
                    $tag = strip_tags($tag);    // security
                    // pre_dump( $tag );
 
                    // # of posts per page:
                    if( ! $posts = $Blog->get_setting( 'tag_posts_per_page' ) )
                    { // use blog default
                        $posts = $Blog->get_setting( 'posts_per_page' );

It would appear that my problem with titles ending with a dash in b2 2.4.5 has been solved. I will continue to monitor this situation and if I am premature in stating that the problem has been solved I will make another post here to let people know. So if you don't see anything else posted by me about this, rest assured its working.

13 Oct 28, 2009 18:38

Glad to hear you solved it ;)

¥

14 Oct 29, 2009 07:35

If I solved it, I solved it with you help friend.
Thank you.


Form is loading...