Hi, I am getting a use of undefined constant error on items like title, description, pubdate, etc. is the fix to this just to encapsulate everything in ' ' ?
Does this work?
I use Sublime Text 3, is there some syntax checker I could run my code through for stuff like this to make sure I get it all?
PHP:
} else if ($fileName == 'video') {
for($i = 0; $i < count($items); $i++) {
if ($items[$i][description] != '') {
$feed .= '<item>';
$feed .= '<title><![CDATA['.$items[$i][title].']]></title>';
$feed .= '<description><![CDATA['.$items[$i][description].']]></description>';
$feed .= '<pubDate>'.convertPubDate($items[$i][pubDate], 'l, M. dS, g:iA').'</pubDate>';
$feed .= '<link><![CDATA['.$items[$i][link].']]></link>';
if ($items[$i][mediacast.':'.thumbii] != '') {
$feed .= '<thumb>'.$items[$i][mediacast.':'.thumbii].'</thumb>';
} else {
$feed .= '<thumb>https://mydomain.com/wp-content/themes/mytheme/assets/images/video.jpg</thumb>';
}
$feed .= '</item>';
}
}
}
Does this work?
PHP:
} else if ($fileName == 'video') {
for($i = 0; $i < count($items); $i++) {
if ($items[$i][description] != '') {
$feed .= '<item>';
$feed .= '<title><![CDATA['.$items[$i]['title'].']]></title>';
$feed .= '<description><![CDATA['.$items[$i]['description'].']]></description>';
$feed .= '<pubDate>'.convertPubDate($items[$i]['pubDate'], 'l, M. dS, g:iA').'</pubDate>';
$feed .= '<link><![CDATA['.$items[$i]['link'].']]></link>';
if ($items[$i][mediacast.':'.thumbii] != '') {
$feed .= '<thumb>'.$items[$i][mediacast.':'.thumbii].'</thumb>';
} else {
$feed .= '<thumb>https://mydomain.com/wp-content/themes/mytheme/assets/images/video.jpg</thumb>';
}
$feed .= '</item>';
}
}
}
I use Sublime Text 3, is there some syntax checker I could run my code through for stuff like this to make sure I get it all?