Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-21-2013, 01:56 PM   PM User | #1
adytt
New to the CF scene

 
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
adytt is an unknown quantity at this point
Help me to add embed function to my script

Hello I'm quite a beginner when talking about PHP coding and I would need a little help from the master here.

So here is my problem I run an arcade gaming website based on wordpress platform and I use a script which only have the posibility to display games in custoim play game area stored only on server. I can't add embed code to display games.

I think I found a way but I'n not good at coding so here it:

I have found this in the functions.php file of the script

// Edit this data structure to change the form in WordPress:

$sp_boxes = array (
'Game Info' => array (
array( 'thumb', 'Thumbnail URL:' ),
array( 'game', 'Game File URL(swf file):' ),
array( 'howto', 'How to Play:', 'textarea' ),

),
);


If I add here the line : array( 'embed', 'Enter the embed URL :' , 'textarea' ), it will look like below and in my admin panel I can see a text box to add the embeded code however the problem comes when needing to call the function and use the embedded code

$sp_boxes = array (
'Game Info' => array (
array( 'thumb', 'Thumbnail URL:' ),
array( 'game', 'Game File URL(swf file):' ),

array( 'embed', 'Enter the embed URL :' , 'textarea' ),
array( 'howto', 'How to Play:', 'textarea' ),

),
);

I think here is the part where I would need to make the changes but I'm not familiar with PHP so please help me to do it.

<div class="game">
<object type="application/x-shockwave-flash" width="590" height="430" data="<?php $values = get_post_custom_values("game"); echo $values[0]; ?>"><param name="movie" value="<?php $values = get_post_custom_values("game"); echo $values[0]; ?>" /></object>
</div>


How can I add the condition that if the swf file field is empty to use embedded URL
adytt is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:34 PM.


Advertisement
Log in to turn off these ads.