Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-16-2013, 10:40 AM   #1
Manfap
Confirmed User
 
Manfap's Avatar
 
Industry Role:
Join Date: Jan 2013
Posts: 2,624
PHP and wp custom fields ahhhhhhhhhhhhhh help

I´m fucking about in wp with custom fields calling the video url for the flowplayer plugin and I´m getting Parse error: syntax error, unexpected T_STRING on.....

Code:
<?php
 flowplayer('[flowplayer src=<?php echo get_post_meta($post->ID, '_wpb_video', true); ?>]');
 ?>
but
Code:
<?php flowplayer('[flowplayer src=/videos/example.flv]'); ?>
works

so I assumed its because I´m calling php again on the echo..
I tried
Code:
<?php flowplayer('[flowplayer src=echo get_post_meta($post->ID, '_wpb_video', true)]'); ?>
but get Parse error: syntax error, unexpected T_STRING on..... again

it´s not pulling the echo so I tried $string

This doesn´t break anything I actually get the page but it pulls echo as the filename
Code:
<?php
$string= " <?php echo get_post_meta($post->ID, '_wpb_video', true); ?> ";

 flowplayer('[flowplayer src=echo $string;]'); ?>
so I tried
Code:
 <?php
$string= "flowplayer('[flowplayer src=";
$string .="echo get_post_meta($post->ID, '_wpb_video', true)";
$string .="]')";
echo $string;
 ?>

which gives me
Code:
flowplayer('[flowplayer src=echo get_post_meta(142, '_wpb_video', true)]')
which seems to work codewise, but its posting it as text with "" surrounding it, rather than php.

so do I need to include <?php and ?> in the string? and it so how?
or how do make it so it s doesnt post the code within ""

if I do something like
Code:
 <?php
$string= "<?php flowplayer('[flowplayer src=";
$string .="echo get_post_meta($post->ID, '_wpb_video', true)";
$string .="]')" ?>;
echo $string;
 ?>
it doesnt complete the code due to the first ?>;

But because of my limited php knowledge thats me stuck.. anyone got any ideas.

Last edited by Manfap; 03-16-2013 at 10:43 AM..
Manfap is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-16-2013, 10:45 AM   #2
Naughty
Confirmed User
 
Industry Role:
Join Date: Jul 2001
Location: Utopia
Posts: 6,484
Code:
 flowplayer('[flowplayer src=<?php echo get_post_meta($post->ID, \'_wpb_video\', true); ?>]');
?
__________________
seks.ai for sale - ping me
Naughty is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-16-2013, 10:51 AM   #3
EddyTheDog
Just Doing My Own Thing
 
EddyTheDog's Avatar
 
Industry Role:
Join Date: Jan 2011
Location: London, Spain, New Zealand, GFY - Not Croydon...
Posts: 25,365
Quote:
Originally Posted by Naughty View Post
Code:
 flowplayer('[flowplayer src=<?php echo get_post_meta($post->ID, \'_wpb_video\', true); ?>]');
?
Its quotes - but not those ones - Maybe I can do it in the morning...
EddyTheDog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-16-2013, 10:59 AM   #4
Naughty
Confirmed User
 
Industry Role:
Join Date: Jul 2001
Location: Utopia
Posts: 6,484
Did you actually echo the function??
__________________
seks.ai for sale - ping me
Naughty is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-16-2013, 11:16 AM   #5
Manfap
Confirmed User
 
Manfap's Avatar
 
Industry Role:
Join Date: Jan 2013
Posts: 2,624
wow that was quick.. thx for the replies.
Quote:
Originally Posted by Naughty View Post
Did you actually echo the function??
The flowplayer is pulled as
Code:
<?php flowplayer('[flowplayer src=videos/example.flv]'); ?>
which is how they tell you to on their site
foliovision. com/seo-tools/wordpress/plugins/fv-wordpress-flowplayer

and works, it´s when I start messing with the content, switching it to pulling from a custom field it all goes pear-shaped and that is getting pulled on an echo.
Code:
<?php flowplayer('[flowplayer src=<?php echo get_post_meta($post->ID, '_wpb_video', true); ?>]'); ?>
or did you mean something else?

I tried
Code:
]<?php flowplayer('[flowplayer src=<?php echo get_post_meta($post->ID, \'_wpb_video\', true); ?>]'); ?>
the player parses now but pulls the vid url as sitename.com/<?php

Quote:
Originally Posted by EddyTheDog View Post
Its quotes - but not those ones - Maybe I can do it in the morning...
thx.

Last edited by Manfap; 03-16-2013 at 11:21 AM..
Manfap is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-16-2013, 11:27 AM   #6
hulker
Registered User
 
Industry Role:
Join Date: Mar 2013
Posts: 26
Something like this should work php wise :



<?php
$postMeta = get_post_meta($post->ID, '_wpb_video', true);
?>

flowplayer('[flowplayer src=<?php echo $postMeta ?>]');
__________________
pervypig.com
hulker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-16-2013, 11:31 AM   #7
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,225
<?php
flowplayer('[flowplayer src=<?php echo get_post_meta($post->ID, '_wpb_video', true); ?>]');
?>

You're getting the parse error because you are trying to php echo inside an already open php call.. Try to concatenate the strings instead.
__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.
I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-16-2013, 11:44 AM   #8
Manfap
Confirmed User
 
Manfap's Avatar
 
Industry Role:
Join Date: Jan 2013
Posts: 2,624
Quote:
Originally Posted by hulker View Post
Something like this should work php wise :



<?php
$postMeta = get_post_meta($post->ID, '_wpb_video', true);
?>

flowplayer('[flowplayer src=<?php echo $postMeta ?>]');
that returns the correct code



Code:
flowplayer('[flowplayer src=/2/2E/2EBBC2H3H0/8/0/7/1/c11708/fb43ba21e2/11708_01/01/11708_01_120sec_00.mp4]');
but as text if I php this flowplayer('[flowplayer src=<?php echo $postMeta ?>]'); it shows the player but doesnt pull the correct url for the vid it returns sitename.com/<?php... as the video


Quote:
Originally Posted by Colmike7 View Post
<?php
flowplayer('[flowplayer src=<?php echo get_post_meta($post->ID, '_wpb_video', true); ?>]');
?>

You're getting the parse error because you are trying to php echo inside an already open php call.. Try to concatenate the strings instead.
Seems when I try and return the string I can get the code.. but then it doesnt treat the flowplayer as php it shows as text.



Serves me right for trying to be clever.. hehe.
Manfap is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-16-2013, 01:02 PM   #9
Manfap
Confirmed User
 
Manfap's Avatar
 
Industry Role:
Join Date: Jan 2013
Posts: 2,624
Solved it

Code:
<?php
	$vid = get_post_meta($post->ID, '_wpb_video', true);
	$splash = get_post_meta($post->ID, '_wpb_poster', true);
{ echo flowplayer( '[flowplayer src="' . $vid . '" width=580 height=326 splashend=show splash="' . $splash . '" autoplay=true]'); } ?>
Incase anyone ever needs to pull a vid from a custom field using flowplayer in wp.
this works.

Last edited by Manfap; 03-16-2013 at 01:07 PM..
Manfap is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.