Sunday, September 18, 2011

Extra Fields

0 comments
You need to edit few files.

1. in the language files you use enter definitions
in my case it would be

PHP Code:
define('TABLE_HEADING_EDITION', 'Edition');
define('TABLE_HEADING_COLOR', 'Color');
define('TABLE_HEADING_TYPEMTG', 'Type');
define('TABLE_HEADING_CASTINGCOST', 'Casting Cost');
define('TABLE_HEADING_RARITY', 'Rarity');

2. in /main_template_vars.php find the part that adds a column and add it

PHP Code:
'TABLE_HEADING_EDITION' => TABLE_HEADING_EDITION,
in the switch section:

PHP Code:
case 'PRODUCT_LIST_EDITION':
$select_column_list .= 'p.products_edition, ';
break;

3. in the product listing you use... add this

PHP Code:
case 'PRODUCT_LIST_EDITION':
$lc_text = TABLE_HEADING_EDITION;
$lc_align = 'left';
$zc_col_count_description++;
break;

and then finally under...

PHP Code:
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
$lc_align = '';
switch ($column_list[$col]) {
PHP Code:
case 'PRODUCT_LIST_EDITION':
$lc_align = 'left';
$lc_text = '  '.$listing->fields['products_edition'];
break;

4. Run SQL to add values to configuration table!!:

PHP Code:
insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description,
configuration_group_id, sort_order, date_added ) values (
'Display Product Edition', 'PRODUCT_LIST_EDITION, '4', 'Do you want to display the Product Edition?', 8, 5, now());

after all this you should have a new column created and the new field data loaded.

I had everything set up but forgot about the configuration *double facepalm*.

Tuesday, September 13, 2011

Final Show

0 comments


So officially few months later after my Final Show I received my Higher National Diploma! Now I'm going to move on to a Bachelor's degree programme in Fine Arts(Experimental Media).

If you click the image above, you'll get to a photo album containing few photos from my Final Show exhibition

L5r.cz - Spoiler

0 comments

I've spent a lot of time adding single cards to the shop's database and I decided to use it for more than just the shop. In each Trading Card Game you usually have new sets printed and usually certain sites post spoilers.

As a new set is out in Legend of the Five Rings I decided to compile the spoiler. Most sites just post text spoilers or just the images but none bother doing both. Mostly it's on forums so you have to go through many posts to actually find a card you are looking for. The biggest L5R databse site does have a complete listing but only after the set is out. But if you want to see a bigger image you have to actually click on the image and be redirected to a different page that shows all the card's info and many people find this really annoying.

That's why I took the database data and listed it on a page. I needed to join few tables and figure out how to list the fields in two kinds of columns but well it works. Finally I implemented Highslide javascript that shows the full size image after you click on the thumbnail and you are still on the page. Big THANKS to Highslide Software. I might well buy this for my shop because I like it. I spent about six hours figuring out a Javascript script but I gave up as it never did what I wanted and when it started to do something it was SLOOOW and it also reminded me that I hate JavaScript and should never try to do something in it! Never again.

What to do now?
  • I want to create a search engine or at least something that let's you choose a set. I won't do that now, because the database does not contain all the cards I need nor their game text. But it will eventually come down to this and I might continue creating something like a deck builder for this game and store the decks.


The script is stored on Outcast.cz server but is accessible from http://l5r.cz which is the Czech L5R site.

Hernaoutpost.cz

0 comments


The website of our um how to call it - the place you go to play card games and board games - had a simple website with some information about tournaments, about us, contact info etc. We decided to make it more appealing for the players and decided to turn it into something dark as there is an upcoming Magic: The Gathering set full of Vampirea and Werewolves.

The original site was done only in html and consisted of few files that I was updating manually.

My collegue told me that it would be nice to have a calendar and some other stuff that could come handy (registration). For that I knew that I would need to do the page in php.

So what did I do?

  • The first step was to have the site in php. I divided structure of each file so I could be including this later. I might do another subdivision on the tournaments page as there is too many things already.
  • I added a calender. Now it looks terrible but I was too lazy to be figuring out how it should look
  • I created background (based on Liliana picture from Innistrad box) and figured out how to do transparent elements - oh I discovered CSS3 a novelty to me!
    (yeah of course all those nice thingies and such DON'T work in Internet Explorer so don't expect my site to look good in it. But well everything is discarded and does not show so that's ok...)
  • I created a database and registration form for the tournaments.
  • I added a line of code that tells me what week is - either odd or even so the players know what FNM it is. The output actually says just Standard or Boosterdraft. Good thing!
  • I have RSS feed there as well, it feeds Facebook from time to time, but with a huge delay. I have no idea what causes this. Anyone has an idea?
That's about it. The site is life at http://hernaoutpost.cz. It seems that people like it. At least they go to the tournament page and check what is going on! That's what we needed.

Outcast.cz

0 comments

I started to seriously work my eshop. The shop is based on Zen-Cart but making it work the way I want is quiet a lot of work. I haven't seen php in ages so the first day of staring into php code was a torture. At the end of the day I figured out how GET works and could start working on what I needed ^_^. Double face palm wouldn't help during the that night. But when I woke up in the morning and looked at some random php code I started to remember how it works.

Making changes in Zen-Cart can be tricky. If you want to change something you need to find all the files that have a certain code and definitions in them and change them accordingly and you can't forget about the configuration database either.

For the time being the changes I made are following.

  • I changed the layout, styles, translated what I needed etc. CSS knowledge is enough for this...
  • changed the layout to grid keeping row layout for singles(cPath variable solved my issue)
  • added extra fields to my products table
  • listed extra fields on category listing page (see image above) and on the single product listing page (after I told the configuration table about all the changes I made it started to work, a problem arose though. It inserted breaks in the column code and I can't get rid of them right now)
  • created a search that can filter singles by color, type, edition and rarity. (it does not work well jet as I have problem with javascript that removes the initial string - for some reason I can't get it to work O_O. This is step one though as the search engine should be based on multiple choice checkboxes and I have no idea how zencart works with that. Gotta figure that out later)

There is still a lot of work to do and when I will launch the shop much more work will be upon my head. I have bunch of other scripts that help me with the administration of the web. I later got Apsona Shop Admin and I have to admit that it is good and powerful tool. I no longer need to use the administration in Zen-Cart.

Anyway by trying all this and browsing many files I came to understand how some things work in Zen-Cart.

The shop can be found at http://outcast.cz but is still in showcase mode.