Recent Topics

1 Nov 12, 2009 22:00    

My b2evolution Version: 3.3.2 stable

When I upload a file(s) it does not display the

The file «xxx.xxx» has been successfully uploaded.

* Here's the code to display it:
* Add the code to your post !

I thought this function had been removed from the current release, but when I check the code I see that it is still implemented. Therefore, it is something about the current setup, or configuration, that is preventing the "Add the code" from being displayed. I am setting up a new site for someone using 3.3.2 and I am not as familiar with the changes from 2.4.7. I like the feature of the "Add the code to your post!" because it lists the uploaded files so the user will not have to hunt for the ones just uploaded to insert them in the post.

If someone can help point me to a solution for this problem, I would be very thankful.

Additional information:

In upload.ctrl.php in version 3.3.2 starting at line 368:

		$success_msg = sprintf( T_('The file «%s» has been successfully uploaded.'), $newFile->dget('name') );
		if( $mode == 'upload' )
		{
			// TODO: Add plugin hook to allow generating JS insert code(s)
			$img_tag = format_to_output( $newFile->get_tag(), 'formvalue' );
			$success_msg .=
				'<ul>'
					.'<li>'.T_("Here's the code to display it:").' <input type="text" value="'.$img_tag.'" size="60" /></li>'
					.'<li><a href="#" onclick="if( window.focus && window.opener ){ window.opener.focus(); textarea_wrap_selection( window.opener.document.getElementById(\'itemform_post_content\'), \''.format_to_output( $newFile->get_tag(), 'formvalue' ).'\', \'\', 1, window.opener.document ); } return false;">'.T_('Add the code to your post !').'</a></li>'
				.'</ul>';
		}

		$Messages->add( $success_msg, 'success' );

After the file(s) are uploaded I am not seeing $Messages displayed above the file manager as in version 2.4.2. Is this implemented in version 3.3.2? If not, where and what do I need to insert to return this function?

-Kimberly

2 Nov 15, 2009 04:54

OK, since I did not get any help with this, I have been hacking away at code. It took me a while using search in files and trying different things, but I found where I needed to look. What I found was that the _adminUI_general.class.php is where I needed to focus on. I have been hacking the version in 2.4.7 with the version in 3.3.2 and I have managed to get it working like I want the files thing to work. I still have one bug to work out and that is when I click on users, it lists out the users OK, but where the action icons should be, it displays "Parse error: syntax error, unexpected T_DNUMBER in /blogs/inc/_core/ui/results/_results.class.php(996) : eval()'d code on line 1" That is no real problem at the moment as there won't be different users and clicking on the name brings up that user's info.

I noticed that the linked files thing was present in 2.4.7, but I never used it and did not really know what it was for. I write my blog posts with HTML and I understand how to use an image tag. All I want is to simply upload a file to my server, and have an easy, "add the code to the post" link and that is what I have now. My hacking was not elegant as I am not a php programmer.

I have no idea if any of the developers read this post. I am sure the problem with the missing "add code to post" could have been a lot more simple than my hacking, my messy hacking. However, the developers decided that we could not have the choice of using the old way of inserting images into our posts, or their new way. It was their way or no way (or is that, their way or the highway).

To be fair, I actually did try their new way, but it didn't work. I attached an image to my post, and when to preview and did not see an image. I have no idea what they mean by attaching an image as it does not insert an image into the blog post.

I also hacked the views to remove that "save & attach" thing and added back to the menu below the edit window the old "files" link.

3 Nov 15, 2009 05:18

I replied to your email. Perhaps it got marked as spam?

Attaching an image is actually kinda neat, but I'm surprised you didn't see it in a preview. Or maybe I never previewed one? Or maybe in v3.* it doesn't preview an attached image.

ANYWAY if you upload something at (for example) 1024 pixels wide and 'attach' it to a post it will be resized according to a parameter in one of the skin files. That means it can be (for example) 400 wide on a multi-post page and 720 wide on a permalink page. This assumes your server can do the image work required, but if you see thumbnails in your file manager then your server can do the deed. If OTOH you see a black square with some cryptic text in it then your server is not up to the task and you won't get the image resizing.

You can also edit the image properties to have a title and long description and caption that will be used in a groovy way when you make the image be a post. That would be sorta like attaching the image to a post with no text. http://alandaveymusic.com/pics.php takes full advantage of attaching images. Actually 'create post' from an image, which is basically what photoblogging is all about in b2evo. I dialed up the performance a bit, and that is a 247+ installation, but it shows what attaching is all about.

4 Nov 15, 2009 05:42

Yes, I suppose the attaching of images can have it uses. I may even play with it at some future time. I have been blogging with b2evolution for almost three years now and I liked the way I inserted images into my blog posts. I edit my images and change the dimensions physically to fit my skin before I upload them. My post width is 600 pixels wide, and so I edit my photos to fit that dimension. It is why I think it would be a good idea, if I was setting up a blog for a person with no real understanding; which I am doing, to have an image manager that would tie into say ImageMagick and allow for the image to be physically resized and not just htmled resized.

Yes, I got the email and I was going to tell you what I found so you could take a look at it. If you are still interested in looking at this, perhaps you could see what they left out a lot better than me, as I did a really messy hack, and the result is the parse error for the user view.

The file that needs to be examined is the _adminUI_general.class.php between version 2.4.7 and 3.3.2. I spent some time on it, but I am not a php programmer. I may have broken more things that just the User view action thing.

5 Nov 15, 2009 05:46

Oh, I also broke something in the footer and got an error about $mode not be declared or something in _html_footer.inc.php. I ended up setting $mode = NULL in _html_footer.inc.php and it went away.

6 Nov 15, 2009 06:02

EdB wrote:

ANYWAY if you upload something at (for example) 1024 pixels wide and 'attach' it to a post it will be resized according to a parameter in one of the skin files. That means it can be (for example) 400 wide on a multi-post page and 720 wide on a permalink page. This assumes your server can do the image work required, but if you see thumbnails in your file manager then your server can do the deed. If OTOH you see a black square with some cryptic text in it then your server is not up to the task and you won't get the image resizing.

But doesn't the full data of the 1024 X come from the server to the viewer's browser? This is important because a lot of people are still on dial-up.

7 Nov 15, 2009 06:40

Kimberly wrote:

But doesn't the full data of the 1024 X come from the server to the viewer's browser? This is important because a lot of people are still on dial-up.

Nope. Check out the link I provided. The image you see is delivered in the size you see. Click on a title and you get a larger version of the image. What you don't get is height and width attributes forcing a big image into a tiny space. The server has to be able to do image stuff is the thing, which is why seeing thumbnails on the Files tab is a good thing.

Yeah zip up what you got and send it on over. I called in sick tonight. It rained today and I left my umbrella a few states back ;) So I'm playing with files in preparation for radically upgrading v332.

8 Nov 15, 2009 12:52

Kimberly wrote:

OK, since I did not get any help with this

Francois at least said something about it: http://forums.b2evolution.net//viewtopic.php?p=97850&highlight=#97850

I would backport the feature to the 3.x series (according to Francois, that feature alone would justify a new release -- 3.3.3), but unfortunately, I have a real life, which mostly consists of school work.

That means that I don't have time now to do the backporting, but it will be done someday. Please be patient. Thank you.

9 Nov 15, 2009 21:17

One more thing, now a link is added around the image tag when you insert the code into your post. This is handled in _file.class.php. The only time I would need a link is if I am including a smaller version and want to provide a link to the full size. I have noticed on a lot of sites on the net that links are wrapped around images that only lead to the same size image.

I simply removed the code that added the link, reverting it back to as in version 2.4.7. I guess the changes had to do with linking images?

What would be nice is to have some options, user selectable, for the way we handle images in our post, directly inserting image tags, or linking.

EdB, I will zip up what I have done, although it is not the best, outlining what I did to bring things back to the way I have been doing them for the last three years.

10 Nov 15, 2009 22:32

I haven't looked at it in detail much yet, but I'll guess the "link image to original even if it is the same size" is PROBABLY controllable with a parameter fed through the proper function. If not it needs to be else all it does is crap up a web. Images that link to just the image is lame.

11 Nov 16, 2009 07:45

I still have one bug to work out and that is when I click on users, it lists out the users OK, but where the action icons should be, it displays "Parse error: syntax error, unexpected T_DNUMBER in /blogs/inc/_core/ui/results/_results.class.php(996) : eval()'d code on line 1"

I uploaded the files I had changed to a working blog I created for a friend, a separate installation of version 3.3.2 and the above error, which I attributed to a change in the _adminUI_general.class.php since it showed up after editing that file, did not occur. So, there must be something else that is causing that error to appear outside of the changes made to the file since the error only shows on my site, and not on his site.

-Kimberly.


Form is loading...