I'm having a little difficulty with some PHP coding of the gamelist's "List" view that I'm working on. I'll post what I'm trying to accomplish and the issue I'm running into, maybe I'll get lucky and someone will chime in.
Here's a quick summary of the gamelist.
Everything in the Gamelist is database driven. Fill in an entry form (for this sake, we'll say entry.php), it goes to the SQL table and shoots back into the gamedetails.php (what you see when you click on a game, with all of the gallery pictures, description, and reviews). It also selects certain values from the entry.php and inputs what I want shown in the card view (ex: view.php)
All of the forms above were created by the same author, so they cooperate nicely together. Except now I have the "list view" (list.php) that I'm trying to make, which is a seperate addon. I've attached the PHP file to this post, as well as the custom CSS I've made.
What I'm trying to accomplish is the option to have images in the list from a value in entry.php. The software I have gives the option to make a "select list"l. I can choose a number of things for a user to choose, and the value that it equals (plain text, no HTML or PHP- that's what it tricky).
For instance, I want to have certain buttons to appear on the list that decribe the genre of the game so it would look something like this.
Choose the appropriate genre traits:
OPTIONS
1) MMO
2) FPS
3) RPG
4) RTS
5) OA
OUTPUT VALUES
1) massive_multiplayer
2) first_person_shooter
3) role_playing
4) real_time_strategy
5) online_action
So let's say they select FPS. The output will show as first_person_shooter in both the details view and the card view. Luckily for me, the output value also shows in the module I have that displays the list.
So I think this PHP code is a matter of manipulating the DATA that is displayed by inserting custom PHP code into the list.php file.
Here's another problem. I know CSS and HTML, but have a primitive understanding of PHP. I guess, that I would write something like:
| Code: |
<?php
if (isset($fieldsObjects['field_selectlist']->data) && if($fieldsObjects['field_selectlist']->data == 'first_person_shooter')){ echo 'myimage.png' };
?>
|
This code is just from gathering bits and peices from support forums and what not. Another big question is where I would place this in the list.php.
If you've finished reading this and actually understood it, and think you need to see the other forms to actually understand how to put in the right code just let me know and I will attach it.
Try not to bust your noggin like I have.
*crossing fingers*