Wordpress plug-in not working in WordPress 2.8.4?

I just set up a blog for myself last night and I installed the Unity WP plugin that HiggyB made. The issue I’m running into is that when I embed my unity file into a post, a space shows where the game window should be but nothing loads. I’ve tried relative and absolute paths:

[WP_UnityObject src=“/unity/F1.unity3d” /]

[WP_UnityObject src=“http://internetspacepimp.com/unity/F1.unity3d” /]

with the same results. You can see what I mean at my blog: www.internetspacepimp.com the current post.

Any ideas on what I’m doing wrong? I followed the instructions, uploaded the folder into my plug-ins directory and enabled it in my Dashboard.

Ok, I was playing around and I attempted a few extra arguments in my tag. When I tried:

[WP_UnityObject altimage=“http://www.internetspacepimp.com/unity/img.jpg” src=“http://www.internetspacepimp.com/unity/F1.unity3d”/]

All I saw was a broken image and underneath it said: “This content will require the Unity Web Player”

If I click the picture, it just goes blank again.

This post I’m talking about went up as “This is a test”

I have HiggyB’s plugin running on my blog, e.g. this article:

http://www.fugutalk.com/?p=1783

using this source:

[WP_UnityObject width="480" height="320" src="http://www.hyperbowl3d.com/HyperLogo.unity3d" altimage="http://www.hyperbowl3d.com/hyperlogo.png" logoimage="http://www.fugugames.com/logos/fugusidebanner.png"/]

Comparing it to what you have, maybe you just need to specify the width and height (I think I also had trouble when I didn’t specify an altimate). Once you have it running, one thing to keep in mind is that, last time I checked, it uses global SESSION variables in PHP so it supports only one use of this tag on a Wordpress page. If you have two blog postings showing on a page each with the Unity tag, they will both show the same .unity3d file based on the last WP_UnityObject tag that was read.

I’ve tried setting the size and alt image before but I tried copying yours just changing the URLs (I don’t have a loading image so I left that out)

[WP_UnityObject width="480" height="320" src="http://www.internetspacepimp.com/unity/F1.html" altimage="http://www.internetspacepimp.com/unity/img.jpg" /]

Still no dice. The current post reflects the latest tags. Well it looks like it’s some compatibility issue and I’m not sure how to debug it. I didn’t realize there was a restriction of one instance per page. Even then I thought it would have been slick to include it inline with my posts.

Typo? You have the src attribute pointing to an html file - should be a .unity3d file.

Yea, typo this time but the results are the same if I change it to .unity3d

[WP_UnityObject width="480" height="320" src="http://www.internetspacepimp.com/unity/F1.unity3d" altimage="http://www.internetspacepimp.com/unity/img.jpg" /]

I don’t recall having any limitations about one content piece per page in particular but I could easily just be forgetting something. In any case I’ll give this all a look, although a bit later as I’m crammed with work at the moment. I thought I’d at least poke my head up and make sure you knew I saw this thread and your blog comments post. I’ll be back…

HyJinx, I took the liberty of copy-and-pasting your plugin tag into my blog and it looks fine to me:

http://www.fugutalk.com/?p=2628

You might try doing the same with my tag - if it shows up fine when viewed in my blog but not yours, maybe there’s a setup problem with your plugin.

Also, to demonstrate the multiple player problem, I added another blog post with the HyperBowl scene again:

http://www.fugutalk.com/?p=2631

If you look at the above to posts individually, the look fine and different, but if you go to http://www.fugutalk.com/ to see both on the same page, you’ll see the same one (the second one loaded) in both players.

HiggyB, thanks for touching on the thread. I appreciate it.

technicat, that’s a brilliant test. Ok so it works on your blog. So it has to be my set up. Which version of WordPress are you using? I’m using 2.8.4
I installed according to the ReadMe file but just to double check I didn’t do anything stupid, here’s an image of my file structure after uploading the plug-in.

http://www.internetspacepimp.com points to /isp_blog since I’m hosting several domains on my host. It pointed to that directory when I installed Wordpress already so I have no issue there. After I uploaded I went to plug-ins and activated WP_UnityObject and that screen looks like this now:

I’m assuming it’s one of two things, either I installed and activated it incorrectly or the current version of Wordpress is causing an issue.

You have the same wordpress and plugin versions I do, and the files look like I remember them, but if I do a View Source from the browser on your blog post and click on the .php files, eventually I get to a WP_Content.php file which seems to expand to nothing, whereas when I do the same on one of my posts, it expands to a reference of a javascript file.

My install was quite a while ago, but I seem to remember seeing all the PHP work is done by the top-level WP_UnityObject.php file which sets up the player parameters in session variables and the WP_Content.php which is under the php subdirectory and actually uses those variables for the final expansion. You might want to just recopy those files over and make sure you have everything under the js and php subdirectories of the plugin, and it’s worth taking a browse through the files (it’s a good way to learn PHP!)

Ok, I deactivated and deleted the files and re-downloaded the plug-in from the resources page, uploaded it and then re-enabled it. Still no go so I’m assuming something is broken in the installation or in the set up of my site. I see what you’re talking about in looking at the page source. I’m going to investigate a little but I’m not familiar with php.

Ok, just looking at the page source for the blog page I see one key difference

Yours:

<iframe id="Unity" name="Unity" src="http://www.fugutalk.com/wp-content/plugins/WP_UnityObject/php/WP_Image.php" marginheight="0" frameborder="0" height="335" width="480" scrolling="no"></iframe></p>

Mine:

<iframe id="" name="" src="http://internetspacepimp.com/wp-content/plugins/WP_UnityObject/php/WP_Image.php" marginheight="0" frameborder="0" height="335" width="480" scrolling="no"></iframe></p>

So immediately I see that id and name are blank on mine. That’s the first difference. Any ideas?

I see from a freshly downloaded copy from the the Unity web site, in WP_UnityObject.php where the iframe tag is output and the the name and id variables default to “Unity”. If that’s what you see, too, I don’t know what’s going on.

Well it still doesn’t work and I’m sure it’s something simple that I don’t understand but I’ve spent quite a bit of time on it already. I’ve searched for solutions but all I found were a few posts claiming the same problems I’m having. Although I did find alternate solutions and if I have time tonight I may try them out.

http://pennymo.com/2009/09/04/putting-unity-3d-into-wordpress-a-nice-solution/

Well done Tom. I just installed this plugin and was up and running with my embedded game in wordpress in under 10 minutes. This is very straight-forward and easy to use. Thank you!

I am working on revamping a year old Unity project and built a blog to allow for easy online promotion of the game development. You can see it at: Tactics Game Online.

Any news with posting of multiple webplayers with different content on one wordpress blog page?

I have the same issue, the last posting will override all other tags in different posts. So this will display the newst added unity file :(.

I had the same problem as everybody else, it wouldn’t load.

Then I tried using a picture first. That worked, and now even the normal without a picture first works.

Perhaps the code just needed a kick-start? :wink:

We have an updated version in hand and are giving it a look and some testing to get it posted soon. My apologies for having this drag on so long…

Hey guys,
Just installed a clean version of Wordpress 3.0 on my website, installed the unity3d plugin and ran into what sounds like the same problem Hyjinx and Saihtam had. So after adding a few echo’s to the code I realised that I had accidentally added a couple of double spaces in between the variables for the WP_UnityObject in my post. At the moment this isn’t handled by the plugin and for me it just caused an oddly shaped div to appear containing the altimage (if I specified one). After some testing I came up with the following solution:

Edit the block at WP_Unity/WP_UnityObject.php:61 as follows:

// Pull the current parameter string
$tParamString = $tUOParams[$i];
$tParamChunks = explode(“=”, $tParamString);
$tParamName = trim($tParamChunks[0]);
$tParamName = preg_replace(‘/\W\W+/’, ‘’, $tParamName); //Removes non-alphanumeric characters
$tParamValue = trim($tParamChunks[1]);
$tParamValue = str_replace(“"”, “”, tParamValue); _SESSION[“uoparams”][$tParamName] = $tParamValue;

Hope this helps.