/** * Function used to replace content * of email template with variables * it can either be email subject or message content * @param : Content STRING * @param : array ARRAY => array({somevar}=>$isvar) */ function replace($content, $array) { //Common Varialbs $com_array = array('{website_title}' => TITLE, '{baseurl}' => BASEURL, '{website_url}' => BASEURL, '{date_format}' => cbdate(DATE_FORMAT), '{date}' => cbdate(), '{username}' => username(), '{userid}' => userid(), '{date_year}' => cbdate("Y"), '{date_month}' => cbdate("m"), '{date_day}' => cbdate("d"), '{signup_link}' => cblink(array('name' => 'signup')), '{login_link}' => cblink(array('name' => 'login'))); if (is_array($array) && count($array) > 0) { $array = array_merge($com_array, $array); } else { $array = $com_array; } foreach ($array as $key => $val) { $var_array[] = '/' . $key . '/'; $val_array[] = $val; } return preg_replace($var_array, $val_array, $content); }
$vrating = $video['rating'] / 2; $findcond = strpos($vrating, '.'); if ($findcond == "1") { $firstrating = str_replace(',', '.', $vrating); echo $firstrating; } else { echo $vrating . '.0'; } ?> </video:rating> <video:view_count><?php echo $video['views']; ?> </video:view_count> <video:publication_date><?php echo cbdate("Y-m-d H:i:s", strtotime($video['date_added'])); ?> </video:publication_date> <?php $vtags = strip_tags(tags($video['tags'], 'video')); $vtableau = explode(",", $vtags); for ($i = 0; $i < sizeof($vtableau); $i++) { echo '<video:tag><![CDATA[' . trim($vtableau[$i]) . ']]></video:tag>'; } ?> <video:category><?php echo strip_tags(categories($video['category'], 'video')); ?> </video:category> <video:family_friendly>yes</video:family_friendly> <video:duration><?php
/** * Function used to create value array for email templates * @param video_details ARRAY */ function set_share_email($details) { $this->email_template_vars = array('{video_title}' => $details['title'], '{video_description}' => $details['description'], '{video_tags}' => $details['tags'], '{video_date}' => cbdate(DATE_FORMAT, strtotime($details['date_added'])), '{video_link}' => video_link($details), '{video_thumb}' => GetThumb($details)); $this->action->share_template_name = 'share_video_template'; $this->action->val_array = $this->email_template_vars; }
$vrating = $video['rating'] / 2; $findcond = strpos($vrating, '.'); if ($findcond == "1") { $firstrating = str_replace(',', '.', $vrating); echo $firstrating; } else { echo $vrating . '.0'; } ?> </video:rating> <video:view_count><?php echo $video['views']; ?> </video:view_count> <video:publication_date><?php echo cbdate("Y-m-d\\TH:i:s", strtotime($video['date_added'])) . '+00:00'; ?> </video:publication_date> <?php $vtags = strip_tags(tags($video['tags'], 'video')); $vtableau = explode(",", $vtags); for ($i = 0; $i < sizeof($vtableau); $i++) { echo '<video:tag><![CDATA[' . trim($vtableau[$i]) . ']]></video:tag>'; } ?> <video:category><?php echo strip_tags(categories($video['category'], 'video')); ?> </video:category> <video:family_friendly>yes</video:family_friendly> <video:duration><?php