MassiveFPS
Welcome, Guest
Please Login or Register.    Lost Password?
PHP, anyone? (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: PHP, anyone?
#1945
Taiko! (Admin)
Can you break this wood?
Admin
Posts: 567
graph
User Online Now Click here to see the profile of this user
Gender: Male MassiveFPS! Location: Abilene, TX Birthdate: 1982-04-29
PHP, anyone? 9 Months ago  
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*
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/01/10 20:41 By Taiko!.
  The administrator has disabled public write access.
#1946
Taiko! (Admin)
Can you break this wood?
Admin
Posts: 567
graph
User Online Now Click here to see the profile of this user
Gender: Male MassiveFPS! Location: Abilene, TX Birthdate: 1982-04-29
Re:PHP, anyone? 9 Months ago  
oh yeah, here's the file
File Attachment:
File Name: mod_sobi2featured.txt
File Size: 21550
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#1948
Taiko! (Admin)
Can you break this wood?
Admin
Posts: 567
graph
User Online Now Click here to see the profile of this user
Gender: Male MassiveFPS! Location: Abilene, TX Birthdate: 1982-04-29
Re:PHP, anyone? 9 Months ago  
TEST LIST: http://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
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#1964
Taiko! (Admin)
Can you break this wood?
Admin
Posts: 567
graph
User Online Now Click here to see the profile of this user
Gender: Male MassiveFPS! Location: Abilene, TX Birthdate: 1982-04-29
Re:PHP, anyone? 9 Months ago  
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.
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/01/12 09:48 By Taiko!.
  The administrator has disabled public write access.
#1969
Uriel (Moderator)
Moderator
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? 9 Months ago  
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.
 
Report to moderator   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? 8 Months, 4 Weeks ago  
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'; } }
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/01/18 01:28 By SilentX.
  The administrator has disabled public write access.
#2044
Taiko! (Admin)
Can you break this wood?
Admin
Posts: 567
graph
User Online Now Click here to see the profile of this user
Gender: Male MassiveFPS! Location: Abilene, TX Birthdate: 1982-04-29
Re:PHP, anyone? 8 Months, 4 Weeks ago  
Sorry if I confused you Silent. Do you have any idea which line in "mod_sobi2featured.php" (attached in post above) I would place it?

The file controls the display of: http://www.massivefps.com/Test-List.html

If you need me to email you the SQL files for the game directory let me know.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#2045
DrDysdy (User)
FNG
Posts: 19
graphgraph
User Offline Click here to see the profile of this user
Re:PHP, anyone? 8 Months, 3 Weeks ago  
sorry Taiko! I completely forgot about this. I'll take a look tonight after I get back from going to a movie.
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/01/18 20:10 By DrDysdy.
 
  The administrator has disabled public write access.
#2046
Taiko! (Admin)
Can you break this wood?
Admin
Posts: 567
graph
User Online Now Click here to see the profile of this user
Gender: Male MassiveFPS! Location: Abilene, TX Birthdate: 1982-04-29
Re:PHP, anyone? 8 Months, 3 Weeks ago  
Take your time! It's somewhere on the to-do list but definitely not top priority!
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#2058
SilentX (User)
FNG
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Re:PHP, anyone? 8 Months, 3 Weeks ago  
PM me, and or reply to message.
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/01/21 01:51 By SilentX.
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop
© 2007 MassiveFPS.com - All Rights Reserved | Link Exchange | Contact Us | Advertise on this site