MMOFPS Boards
Welcome, Guest
Please Login or Register.    Lost Password?
Re:PHP, anyone? (1 viewing) (1) Guest
Go to bottom Favoured: 0
TOPIC: Re:PHP, anyone?
#1945
Taiko! (Admin)
Can you break this wood?
Site Administration
Posts: 571
graph
User Offline Click here to see the profile of this user
Gender: Male MassiveFPS! Location: Abilene, TX Birthdate: 1982-04-29
PHP, anyone? 10 Months, 4 Weeks ago Karma: 16  
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*
 
Logged Logged  
 
Last Edit: 2008/01/10 22:41 By Taiko!.
  The administrator has disabled public write access.
#1946
Taiko! (Admin)
Can you break this wood?
Site Administration
Posts: 571
graph
User Offline Click here to see the profile of this user
Gender: Male MassiveFPS! Location: Abilene, TX Birthdate: 1982-04-29
Re:PHP, anyone? 10 Months, 4 Weeks ago Karma: 16  
oh yeah, here's the file
File Attachment:
File Name: mod_sobi2featured.txt
File Size: 21550
 
Logged Logged  
  The administrator has disabled public write access.
#1948
Taiko! (Admin)
Can you break this wood?
Site Administration
Posts: 571
graph
User Offline Click here to see the profile of this user
Gender: Male MassiveFPS! Location: Abilene, TX Birthdate: 1982-04-29
Re:PHP, anyone? 10 Months, 4 Weeks ago Karma: 16  
TEST LIST: www.massivefps.com/Test-List.html

Also, here's the CSS. I can make any type of custom feild and define it in CSS.
File Attachment:
File Name: listCSS.txt
File Size: 986
 
Logged Logged  
  The administrator has disabled public write access.
#1964
Taiko! (Admin)
Can you break this wood?
Site Administration
Posts: 571
graph
User Offline Click here to see the profile of this user
Gender: Male MassiveFPS! Location: Abilene, TX Birthdate: 1982-04-29
Re:PHP, anyone? 10 Months, 3 Weeks ago Karma: 16  
I may have also found a cheap work-around. I can attach an image to the field in CSS and have a member select from a checkbox instead of select list. If "no" is selected than no data will be displayed. By default, the list will not show fields without data.

EDIT

oooo... looks like that method won't work in IE. disregard.
 
Logged Logged  
 
Last Edit: 2008/01/12 11:48 By Taiko!.
  The administrator has disabled public write access.
#1969
Uriel (Moderator)
Moderation Team
Posts: 161
graphgraph
User Offline Click here to see the profile of this user
Gender: Male FabolousASA Location: Michigan Birthdate: 1982-03-11
Re:PHP, anyone? 10 Months, 3 Weeks ago Karma: 2  
A site that depends on CSS hacks. (IE this one) For some reason IE7 renders it differentially.
They both essentially have the same readout of CSS, But both render it differentially.

It's apparent that, that's the reason that it's not reading it correctly.
 
Logged Logged  
 
  The administrator has disabled public write access.
#2034
SilentX (User)
FNG
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Re:PHP, anyone? 10 Months, 3 Weeks ago Karma: 0  
Try one of those, cause I'm a little lost on what your asking for. Hope one of those works.








Updated-Simple quick fix, not sure if you looked at it yet.
Code:

if (isset($fieldsObjects['field_selectlist']->data)) {

if($fieldsObjects['field_selectlist']->data=='first_person_shooter'){


echo '<img src="myimage.png">'; 

}
}


I put it both ways, not sure if just echo'ing the image would work. Never tried it that way, but I put both. And if that does work, I just learned something new about echo'ing images. haha
Code:

if (isset($fieldsObjects['field_selectlist']->data)) {

if($fieldsObjects['field_selectlist']->data=='first_person_shooter'){


echo 'myimage.png'; 

}
}

 
Logged Logged  
 
Last Edit: 2008/01/18 03:28 By SilentX.
  The administrator has disabled public write access.
Go to top
© 2006-2008 MassiveFPS.com - All Rights Reserved | Site Map