Saturday, June 25, 2016

Salazar Games Remastered- Now Online!

Just posted the new version of the Salazar Games website to I'm very pleased with the way both the games auto-layout and the media presentation developed:

Main Page:

Excerpt from Media Page:

 Excerpt from About Page:

Some interesting hurdles:
1. Auto-loading of games:
In some extremely old versions of the SG website, I would add a separate page and custom box for each game available in our games list- a tedious hour-long process for what should have been essentially a single row in a SQL table. Eventually turning to this method, I modeled a template that pulls the game info from the SQL database with php, then fills three columns in a feed style with game tabs with some greedy column-height based javascript. However, I wanted the ability to test this code locally, with relying on the Fatcow-hosted SQL database. To keep myself from working with a blank game sheet, I decided to change the route of database, and type of information pulled, based on the pages observed URL- thus from localhost we hit the local repo, and from we hit the Fatcow repo. This ended up being an incredible boon, as I could much more quickly edit the local repo, to add option buy buttons, etc.

2. Making custom Paypal buttons (without using images):
Paypal has system built into their button creation that allows users to customize the button by adding their own images- sounds great, right? Problem is, this keeps the buttons from having any interaction-defined image changes, leaving your button static on mouseover, click, and focus- not great for user interaction.
The solution? The forms that paypal uses for their button only depend on the post request to paypals server, with the proper button ID (held in the images "value" field in their copyable embed code). If you grab this code, you can swap out paypals button of a submit button of your own choosing and styling- in fact, you can use the same form they give you, just with the replacement submit button as follows:
As long as the ID matches, Paypal doesn't care! In fact, this makes for rather easy storage of paypal links in the SQL database. Woot!

No comments:

Post a Comment