This blog has moved to a new location! http://iqandreas.github.com/
Showing posts with label help. Show all posts
Showing posts with label help. Show all posts

Monday, June 7, 2010

[K2Fave] Joomla K2Fave - Frequently Asked Questions

This article relates to the Joomla K2 modification "K2Fave"
http://iqandreas.blogspot.com/2010/06/joomla-k2-favorite-item-manager.html


To my surprise and amazement, a lot of responses already and so very quickly. Here are a few questions that have arisen so far. I will keep adding to this list over time, so check back if you run into any issues.


How can I view all my favorites?

There are three ways. Sadly, you are going to need access to the raw PHP code in all instances. If anyone is better with the Joomla framework, perhaps they can help bridge this in a way so you can put in a "favorites" table in any page from inside the "page editor".

Just plain import
You can just plain and simple import a basic page which already has all the imports and everything you need.
include(JPATH_BASE.DS.'components'.DS.'com_k2'.DS.'k2fave'.DS.'viewfaves.html.php');

I noticed one small flaw on that page you might have to fix unless you downloaded the release fixed a few minutes ago. Inside of "viewfaves.html.php"
//Replace the following line
ForetagFave::listUserFavorites($user);

//With this
K2Fave::listUserFavorites($user);

Access the "K2Fave" class directly
Wherever you want the table of favorites to appear, place the following code:
//Get current user - you can do this any way you please
$user =& JFactory::getUser();
K2Fave::listUserFavorites($user);
Access raw data from the database
This might take some PHP experience to get done, but if you want the actual array filled with all favorites, try this code:
include(JPATH_BASE.DS.'components'.DS.'com_k2'.DS.'k2fave'.DS.'k2fave.db.php');
$user =& JFactory::getUser();
$favoritesArray = K2FaveDatabase::getFaves($user->);
The returned array is a list of objects, all with integers named "user_id" and "item_id". See the "K2Fave::listUserFavorites()" function (located in k2fave.php) for an example of how to parse the array into a usable table.

The K2Fave class has a few more functions which may assist in creating a good table; such as makeRemoveURL() and makeK2ItemLink(). See the class definition for more details.


How can I format the favorites table?

The table is formatted as a plain, old <table>, so wrap whatever code you are using to make the table show up in CSS span or div tags, and set whatever formatting you need either in side of those, or in a separate CSS file.

For free tutorials on CSS and how to use it properly, I would recommend W3Schools, along with a good old fashioned Google search.
http://www.w3schools.com/css/default.asp
http://www.google.com/#q=css+tutorial

Otherwise, the table should take on the default formatting for tables set in your global style sheet.


The favorites are able to be added more than once, causing duplicates

This means that the rows were not both set to "PRIMARY_KEY". This can be a bit tricky, and not really common in most cases, but the following guide should help with both creating the table, or modifying the table in case it was already created.

IN PROGRESS: I'm working on a post which describes how to set up the database properly. Should be done tomorrow morning.


I'm getting an error message!

Great! Tell me about it! See the answer to the question below for contact details.

It would be easier if you copy and paste the EXACT error message, which makes it a lot easier for me to track down the bugs.

If a completely blank page is showing up rather than an error, try turning on global error reporting in the Joomla! settings.


But that's not enough! I want my favorites manager to also do this and that, and then do si and so...

Great! I would be happy to implement any ideas you may have into future versions of K2Fave.

If you want very specific modifications made to K2Fave for any part of Joomla or K2, (such as playing a Fanfare when they add an item to favorites, and Taps when they remove the item from favorites - anything really) send me a message using the contact details below.


All this PHP and MySQL is quite confusing. I just want the favorites thing to work; I don't want to worry about it.

I would be more than happy to implement those changes for you, as well as any other reasonable modifications you may want to the existing system for a flat rate of $30 USD. This includes not only installation, but also any text, customization, styling, and custom implementation.

If you have low income or a low traffic site, we might be able to work out special arrangements, so don't give up even if you may be 15 and trying to make it on a $10 per week allowance. ;)


This is fantastic! Your modifications saved me hundreds of dollars! Thank you!

First of all, I would love to hear about your experiences, as well as any live examples of the modification in use. Please leave a comment. :)

Second, I am releasing these modifications for for free, and although it's not required, if you do make money from the project, or have saved money thanks to this project, I would really appreciate a donation so I can keep my programming work alive and keep these modifications and extensions coming for free.
I might even name my firstborn after you out of joy and appreciation.


How can I get ahold of you?

In the README.txt file there is an email address. I would prefer you not release it publicly for fear that it gets picked up by spambots. I hate having to switch to a new email address due to too much spam.

That email address is also used as my MSN Messenger account, in case you prefer instant replies to questions. I'm usually logged in most of the time.

I also have a contact form which will always forward all your messages to the newest email address
http://iqandreas.isbetterthanyou.org/contact.htm

Tuesday, June 2, 2009

Flash 9+ for the Wii? [And more links + praise for FireFox]

FireFox, and its glorious offline tabs

Since I have a 45 minute commute to and from work (and luckily, I'm rarely the one driving), and at work I have no time to read up on blogs and sites, when I get to work and during my breaks, I find something interesting or try to find the solution to some problem that has been bugging me.

Then, instead of reading the post or blog (which usually ends up being pretty long and not worth spending my precious break time on) I open it in a tab in FireFox. Often, I'll notice an interesting title in the sidebar, which leads to another post, so I open it in another tab to read later. This process repeats several times during the day.

Finally, when I leave work, I have 40 different tabs containing all sorts of interesting information. The problem is, when I get home from work, I am to tired to stare at a screen, trying to comprehend with a blurry mind what some see as a clear solution to one of my problems. So the next day I go to work, still holding those 40 tabs, ready to be read. But during break, I accumulate even more!

So then you get to the point I am at now; 6 windows and 87 tabs (exactly, according to FireFox). And when you think you are all set to go, Windows XP decides to restart the computer and apply all those updates he thinks is so very important. [Tears hair from head, wanting to explode]

Thank goodness for the built in Session Restore feature. I don't know what I would do without FireFox, even though I believe that the programmers at Microsoft put in some sort of bug system that targets FireFox, hoping that internet users will switch over to the new and improved Internet Explorer [plays fanfare] .... not happening. FireFox is my friend, and I will never be unfaithful.

Enough about FireFox, on with the links!



Math.getProbability(Nintendo.Wii + Adobe.Flash));

I was Googling around, searching for any hope that Wii's built in browser might support might some day support Flash 9 or 10 (more specifically, AS3). That way, I wouldn't have to find an oldschool coder to convert my complex and likely sloppy code to slow, inefficient AS2.

I stumbled across this link, which brings a little hope to my heart, but sadly I can't verfiy the aucenticity of the information. I really hope so, but I wouldn't guarantee anything. It doesn't say anything about adding support for the browser, but it will allow Flash Developers to create games for WiiWare without having to learn a new language. :D

http://nintendo.joystiq.com/2009/03/13/cave-story-dev-nintendo-opens-wii-to-flash-development/

Now the big question is, will WiiWare development be open to anyone, or just people who pay an outrageous price for the WiiSDK and have a full fledged corporation where the proprietary information can be stored securely?

If anyone can verify this information with hard, cold evidence, please leave a comment or email me.



An important announcement from Developers woldwide:
Do you see the ads at the bottom of the page? Click them.

Most developers work for free, and the only money they earn is from advertisement income. It doesn't cost you a penny to click the link, and usually, you might find some pretty good deals or learn about a new neat site.

So give those developers a chance! Help keep free software... FREE!

CLICK THE ADS! (of other developers)

-- A message from your local department of coders.


So I encourage everyone, right now. Put down what you are doing. Stop thinking about how tired you are getting off this site. Next time you are on someone's site, show some appreciation, and click. Enjoy the great deals you find from clicking the ads, and deep inward satisfaction that you are putting food in my belly and getting me (legal people, read: others) through college. :)

Ads can actually be quite beneficial. For example, I recently clicked a link for an RTS game, and I'm actually enjoying it. (No, I won't give out the site address unless I get paid to advertise it)




More links to come once I get some sleep... Work tomorrow as well... Ugh...