This blog has moved to a new location! http://iqandreas.github.com/
Showing posts with label faq. Show all posts
Showing posts with label faq. 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

Thursday, September 17, 2009

Most common Flash Questions (AS3 FAQ)

When you help out beginners as much as possible each day, you tend to hear the same questions again and again (and again, and again).

Ignoring the fact that when I was little, I used to think FAQ was a bad word (not joking), I have here compiled a few links for threads with the most frequently asked questions in the Kirupa.com ActionScript 3.0 Forums.


TypeError: Error #1009: Cannot access a property or method of a null object reference.
Hands down, with no doubt possible in anyone's mind the absolute #1 error. There are 2 possible causes:


Duplicating a MovieClip (or at least creating a new version of whatever you pass in)
http://www.kirupa.com/forum/showpost...80&postcount=3
http://www.kirupa.com/forum/showthread.php?t=333120
http://www.kirupa.com/forum/showthread.php?t=334933 - Didn't realize the "constructor" property was so vulnerable. Nice discussion.


The difference between instance name and library name
http://www.kirupa.com/forum/showthread.php?t=333041


The Dictionary Class (Passing in custom variables to Events)
Personally, I really like using it since it allows you to pass in other variables to events such as telling which URLs go to which buttons, so you can use one function for the onClick event.
http://www.kirupa.com/forum/showthread.php?p=2484903
http://www.kirupa.com/forum/showthread.php?t=331118
http://www.kirupa.com/forum/showthread.php?p=2501990 - Some sample usage


Wow! How can I learn to be a great coder like you?
First of all, I'm good with Logic, but sadly I often use Flash instead, which is often similar, just uglier and meaner.
http://www.kirupa.com/forum/showpost...51&postcount=6 - Some great reading
http://www.kirupa.com/forum/showpost...85&postcount=2 - The Flash and PHP Bible


The advantage of using static properties and functions
I need to dig out an old MSN messenger discussion on this as well. It's on my rediculously long todo list.
http://www.kirupa.com/forum/showthread.php?t=334492


The strange way frames work in Flash
http://www.kirupa.com/forum/showthread.php?t=325891 - How frames really work. Might need some updating as this was posted early on when I was first learning Flash.
http://www.kirupa.com/forum/showthread.php?t=325884 - This guy still owes me a beer


There are plenty more, I just want to avoid digging through all 600+ of my forum posts for the gold nuggets. If anyone finds any more (by me, or anyone else for that matter) comment.