Current location: Hot Scripts Forums » Programming Languages » PHP » best way for this to be translated


best way for this to be translated

Reply
  #1 (permalink)  
Old 10-04-06, 02:42 PM
pkcidstudio's Avatar
pkcidstudio pkcidstudio is offline
Coding Addict
 
Join Date: Nov 2005
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
best way for this to be translated

this might be a database question, if it is please move it.
here is what i have
Code:
<enclosure url="http://www.myfreetrainer.com/ipod/male/barbellbenchpress.m4v" length="5350034" type="audio/x-m4a" />
this is what i want
PHP Code:

echo "\r\n\t<enclosure url='"$myfreetrainerInfo['ecloseurl'] .""$myfreetrainerInfo['id'] ." length="$myfreetrainerInfo['length'] ."  type="$myfreetrainerInfo['type'] ."' />\r\n"
but for some reason the length and type are not being displayed properly.
the length is set up as a "mediumint(7)"
and the type is set up as a "text"
any thoughts on how i can get it display like the CODE VERSION in PHP would be great. i feel that am missing one small rule or something like that.
__________________
learning like everyone else
Reply With Quote
  #2 (permalink)  
Old 10-04-06, 03:08 PM
Ghezus's Avatar
Ghezus Ghezus is offline
Newbie Coder
 
Join Date: Jul 2006
Location: Netherlands
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Try this:

PHP Code:

echo'\r\n\t<enclosure url="'$myfreetrainerInfo['ecloseurl'] .""$myfreetrainerInfo['id'] .'" length="'$myfreetrainerInfo['length'] .'" type="'$myfreetrainerInfo['type'] .'" />\r\n'
Your quoting was a bit wired, get a good editor with propper highlighting...
Reply With Quote
  #3 (permalink)  
Old 10-04-06, 03:32 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Note that \r\n\t between single quotes won't be parsed as might expected.
Reply With Quote
  #4 (permalink)  
Old 10-04-06, 03:33 PM
pkcidstudio's Avatar
pkcidstudio pkcidstudio is offline
Coding Addict
 
Join Date: Nov 2005
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
thankx Ghezus-
PHP Code:

   echo "\r\n\t<enclosure url='"$myfreetrainerInfo['ecloseurl'] .""$myfreetrainerInfo['id'] ."' length="$myfreetrainerInfo['length'] ."  type="$myfreetrainerInfo['type'] ." />\r\n"
yep thankx i was right behind you.
only thing is i am getting this error any thoughts
does not seem to be a valid podcast url.
i am guessing because the file ends in php. i know the rss feed works cause i can see it when i view it on the browsers. but i am wondering if anyone knows a trick to confusing itunes to thinking this is a valid podcast url.
once this is solved ill post it on this site and then everyone can save 25 bucks when wanting to make a automatic pod casting service for your sites.
similar to what these dudes are selling.
http://www.feedforall.com/
99% there
__________________
learning like everyone else

Last edited by pkcidstudio; 10-04-06 at 03:42 PM.
Reply With Quote
  #5 (permalink)  
Old 10-04-06, 05:56 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by nico_swd
Note that \r\n\t between single quotes won't be parsed as might expected.
Yep. For the life of me I don't understand why more people don't use the HEREDOC syntax:
PHP Code:

print <<<EOM


anything goes here, 
$variables etc somearray[5], etc

EOM; 
It solves all those odd quoting problems and is easier to read.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
  #6 (permalink)  
Old 10-05-06, 09:40 AM
pkcidstudio's Avatar
pkcidstudio pkcidstudio is offline
Coding Addict
 
Join Date: Nov 2005
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
if print <<<EOM
was used would there be no need for other echo's through out the page?

o' i also figured out how to get the server to read a xml file as php. but now it only reads part of it. so i am thinking ill give the EOM thing try.
this is how you get it to read xml as php in case any one was curious.
find the (vhost.conf file) and inside of it place this
AddType application/x-httpd-php .xml
carefull to put in the correct place or all your files tha tare .xml will be read as php.
__________________
learning like everyone else
Reply With Quote
  #7 (permalink)  
Old 10-06-06, 07:30 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by pkcidstudio
if print <<<EOM
was used would there be no need for other echo's through out the page?
In a word, yes. Take a look here:

http://us3.php.net/types.string
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 05:41 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.