Embedded Related Entries

Posted in Expression Engine on September 16th, 2009 by Jason – 2 Comments

I came across the problem the other day of how to show a related entry of a reverse related entry of my entry. Confused? Imagine the following scenerio:

You have two separate weblogs, A and B. Each has several entries and are related to each other through a third weblog C. The weblog C holds all the relations and weblog A and B do not have any relations. This means that there can be many entries in C which point to A, and many entries in C that point to B. Still confused? Here is a real world example.

You have several lawyers who practice in a variety of practice areas but not necessarily all areas. The same relation is true for practice areas, where on area can have several attorneys but maybe not all. Each attorney has a statement about his expertise in the practice areas they serve in. In this example, the Lawyer is held in weblog A, the practice area in B and the statement of expertise in weblog C.

Now, lets say you would like to have an Lawyer page for a specific lawyer in weblog A, and you would like to list out all the practice areas (B) on the lawyers page. Because there is no direct relation between A and B you must use the relation between A – C and then the relation from C – B to get the final relation of A – B. To do this you must use a nested related entry in a reverse related entry for the entry of the Lawyer.

Unfortunately, expression engine does not allow nested related items on a page directly. So to make this work, you must use an embed to make the nesting work. Here is the code for the lawyer page:

{reverse_related_entries orderby=”title”}
<div class=”entry”>
{embed=”site/attorney_link” entry_id=”{entry_id}”}
<h3>{title} – {attorney}</h3>
<p>{about_bio}</p>
</div>
{/reverse_related_entries}

All of the above code would be held inside the {weblog:entries} tag for the specific lawyer. Now the code for the embedded file:

{exp:weblog:entries dynamic=”off” entry_id=”{embed:entry_id}”}
{related_entries id=”attorney”}<h4><a href=”{url_title_path=”attorney”}”>{title}</a></h4>{/related_entries} {/exp:weblog:entries}

The key to making the nested related entry work, is to use the embed method. This allows you to send the entry id of the outer reverse related into a separate page. On the new page, you can do a normal exp:weblog call searching for only that id that was passed through. This will then give you access to the post in the intermediary blog (C) and allow you to call a related entry for either A or B.

If you are still confused after reading this, send me a comment and maybe I can clarify a little further. While this may not be something you use everyday, it definitely can come in handy.

Modern Warfare 2: 360 Exclusive Maps

Posted in Playstation on September 13th, 2009 by Jason – Be the first to comment

First things first, the rumor is False. I received in my inbox the other day a message from a friend stating that on Sept. 12 and 13th that people should not play cod4 in protest to infinity ward for making exclusive map content available only on the xbox 360. While looking around for more information about it today I was glad to see that Infinity Ward has commented on this as being false. Now the only question is whether or not to buy the prestige mode game box for the night vision goggles…

iTunes 9: Two Great Features

Posted in Apple on September 13th, 2009 by Jason – Be the first to comment

Today I had my first chance to look a little further into iTunes 9. There were two new features that seemed to draw my attention and so far have been a great addition to itunes.

First, the Home Space addition. Since my wife and I both have separate iTunes accounts and separate laptops, the Home Space feature has been a welcomed addition. To use this feature, just choose one of your itunes accounts and use it to create the home share on your computers. It is important to note that each computer you put on the home share, will use the same itunes account no matter which computer you are adding it on. So once you choose one, you will use it for all.

Auto Fill Free SpaceSecond, the “fill free space with songs” on your ipod. This new option is found when you connect your ipod on the music page and will do as it says and fill up any remaining space on your ipod with additional songs from your library. This is very helpful in my case where I have over 30GB of music and only a 16GB iPod Touch. It is hard to create just enough playlists to fill up the space.

There are still other options that I am looking at, such as the genius for the app store but so far I have not had a chance to use it. Overall iTunes 9 is a welcomed update. It is taking a step that I hope all programs will start to make, which is bringing better sync between multiple machines.

Lair for $14.99, Is it worth it?

Posted in Playstation on September 12th, 2009 by Jason – Be the first to comment

One game that has always called my attention has been Lair. It was an early release for the ps3 and got a lot of criticism for the controls and it really hurt the overall sales of the game. I heard that they eventually came out with a patch for the game that allowed players to use the analog sticks instead of using the 6 axis for flying. While I could not bring myself to pay the full price for the game; now years after the release it is pretty easy to pick up for less than $20 at any major game trading store. So finally I decided to pick up the game at Gamestop for only $15.

My first impressions of the game were good. Once I got my Y-Axis inverted and got used to the basic controls it seemed pretty simple. For one of the first games to come out on the ps3, the graphics of the game are pretty good too. Overall the game has a lot of potential. Although I only about half way done with the game, you can still see how the control structure is a major downfall to the game. You almost need someone who has played the game to sit beside you and tell you how and what to do. There have been a few times where I have spent all my lives playing a level, and only right before my last death, I finally figure out what it is I am supposed to do. The game will tend to be very detailed about what you should do, and then later say nothing at all. So you think, if its not obvious, they will tell me like they did before, so you wait and die, until you eventually find out they are not going to tell you.

It reminds me of playing some of the original tekken games against my older brothers. They knew all the combos and would always beat me, so my only chance was to pound the control and hit every button as hard and fast as I could and hope that one of them would work. With Lair, I find myself doing that a lot as well. My character will give me encouraging signs, confirming what I am doing is right (pounding all the buttons). I will say that with time I have begun to notice certain patterns to how to defeat enemies, and it is getting easier. But at the same time, I die a lot still and think that there are certain things that I am missing about the game, and that if only I knew what it was, I could do much better.

When I am not totally frustrated at the game, I do enjoy it. It still is fun to land in the midst of a large group of enemy infantry (R2 and L2) and burn, swipe and eat your occasional enemy. For $14.99, it is a pretty good game. Just take into account that it can be extremely frustrating at times, and you may not have a single clue as to what you are doing. I found it useful to watch some online videos and read up about the controls of the game. If your just starting the game and you cant figure out how to beat your enemy when you are flying along side him… just make a quick movement of the controller in the left or right direction… seems simple but it took me a while to figure out. If you can get the game for $10, I would say give it a try.

Problems with Migration from 10.4 to 10.5

Posted in Apple on September 12th, 2009 by Jason – Be the first to comment

When trying to run the migration I would get the following error/message on the new macbook pro (10.5)

There was an error connecting to the network, and the information on the other Mac couldn’t be accessed.

At the same time I would not be able to find the macbookpro from my current machine, and the only message I could find was in the log files stating “rtmsg: error writing to routing socket”

I worked on this issue for a couple hours and finally gave up. While the transfer works great if you have a firewire cable, I was not able to get the transfer to work over wifi. I have an airport extreme router as well, so you would think there wouldn’t be a problem with the network. I never got this issue resolved.

Call of Duty 4 Patch 1.40

Posted in Playstation on September 1st, 2009 by Jason – Be the first to comment

After a long wait and feeling like those still playing cod4 were forgot about, Infinity Ward has released patch 1.40 but with very little information. From what I have read in forums, this should be fixing some of the hacks that have plagued the game for a while now. As a person who doesnt use any hacks, I am glad to see this patch come out.

Although the next Call of Duty is just about to come out, cod4 will continue to be played for a long time and will benefit from this patch. I was hoping for them to add trophies as well, but again with the new game coming out soon, it was highly unlikely.

PS3 System Update 3.0

Posted in Playstation on August 31st, 2009 by Jason – Be the first to comment

I just finished a quick look around with the new system update to version 3.0. As always, I think it is easier to see what’s wrong and the bugs than to see the benfits. One item that I immediatly love is that the battery indicator no longer covers the clock. One thing I hate is the “what’s new” news ticker that shows up below the clock. They have moved where you go to disable it, it’s now under the system settings but apparently they forgot to make it work. You can set it to on or off and it makes no difference. Hopefully they will patch it soon.

The only other change I was not thrilled about was how clunky the buddy list seems now. I have yet to find a way to slim it down. It seems like the older version seemed a little cleaner. The new one seems more cluttered although I didn’t see any major updates to that area.

I do like that you can now access your recieved messages by buddy instead of having to view them all throught the recieved folder. There are a couple more features that have been included as well, such as a greater integration of the playstation store into the XMB, but I am still not sure how I feel about that. I can already see my XMB becoming the next ad space for Sony, and it is starting with 3.0. Overall I have mixed feelings about this update with some features I love and others I will have to live with and hope they address at a future date.

Setting A default image with PHPThumb

Posted in Programming, Websites on August 7th, 2009 by Jason – Be the first to comment

For one of the larger projects that I work on, I use phpThumb, which will create a thumbnail of the requested image and cache it for fast downloads. This is great when you have a large number of images that will be viewed at various sizes and you dont want to export all the various sizes.

One of the problems I ran into recently is setting a default image that will appear if for some reason your source file cannot be located. When you are pulling images from a separate provider, this can become a concern.

PhpThumb has made this easy as their is a setting in the config file as shown below.

phpthumbconfig

All you have to do is add the local path to the file you want as a default into the config and then to test it you can set phpThumb to attempt to load a bad source file and it should display your image. If you are having issues seeing the file, make sure that the names match up, and that you have a forward slash before the path. You can also try doing an absolute path with the entire url to the image.

Success! All downloads working

Posted in Playstation on August 6th, 2009 by Jason – Be the first to comment

This post is a continuation of a previous post about the (8002AB0B) error that I received when trying to install almost any game downloaded over the PSN.

Last night I think I finnaly found the source of the error code that has plagued me the past few months. It came down to an Ethernet cable, once replaced everything worked great. The playstation website along with there customer service had never mentioned this as a possible issue, but if you are having this same error message I would suggest trying the following.

  • Change the way you connect, if you are using a wireless connection, try hooking up through a direct connection.
  • If you are wired through a router, bypass it by plugging directly into the cable modem.
  • Try switching your ethernet cable for a different one.

For me, I hooked up the ps3 directly into the cable modem first and used a different ethernet cable. I was able to download five games and install without issues. I noticed that the games that gave me the errors were the larger 1GB + games. Once I saw it worked hooked directly to the modem, I reconnected to through the router but with the new ethernet and downloaded a couple more games. So far all are working great now. The interesting thing is I could still connect and play online games fine with the bad cable, but it must have been corrupting the download data to cause the error.

Unfortunately the main reason to get this fixed was to play the new Uncharted 2 multiplayer beta which I had a key for. I got it installed only to see that the time period had expired.

Another Playstation Error (8002AB0B)

Posted in Programming on June 3rd, 2009 by Jason – Be the first to comment

Yet another error message today, this time when trying to send a message to a friend. I first received the message when I tried to reply to a message received. So I canceled out of the message, repeated the process and got the same error message, repeated and got it again for a third time. So I changed what I typed and it went through without a problem. So I tried one last time with the original message and the error came up once more. Maybe it was something I was writing? “what u doing ?” hardly seems like a message to cause problems. The message that did work: “hi”.

After a quick look online I found that some other people were having the same error. They recommended removing the punctuation from the end of the message, and sure enough it worked. To further test this I tried to send another message, “what u playing ?” and once again I got the error message.

To narrow the problem down this is what I think causes the issue. It is not the fact that there is a punctuation at the end of the message. But it is due to there being a space and then the punctuation by itself. “_?” When I remove the space the same message sends without a problem. So you might ask, why is there a space in the first place? When using the prediction that is to the right of the keyboard it will always put a space after the word to prepare for the next. So if your whole message is predicted… what u doing… then it will put a space after “doing”. If you don’t remove the space [square on the controller] before you put the punctuation then it will cause an error.

Update: So I have refined the problem a little further, it is not the fact that there is a space between the last word and a punctuation, but it is due to there being a space between the last work and a punctuation when the space was created due to the word predictor. If you put in a space your self, then it does not trigger the error. But if you use the word predictor and then a punctuation without removing the space, like clock work the error comes up.