public function set($plugin, $keyword, $replace = array(), $pageTitle = true) { if (!($data = $this->cache->item('core_meta_tags_' . $plugin . '_' . session::item('language')))) { $data = array(); $result = $this->db->query("SELECT * FROM `:prefix:core_meta_tags` WHERE `plugin`=?", array($plugin))->result(); foreach ($result as $tags) { $data[$tags['keyword']]['title'] = $tags['meta_title_' . session::item('language')]; $data[$tags['keyword']]['description'] = $tags['meta_description_' . session::item('language')]; $data[$tags['keyword']]['keywords'] = $tags['meta_keywords_' . session::item('language')]; } $this->cache->set('core_meta_tags_' . $plugin . '_' . session::item('language'), $data, 60 * 60 * 24 * 30); } foreach ($replace as $section => $array) { foreach ($array as $k => $v) { $k = '[' . $section . '.' . $k . ']'; if (is_array($v)) { $v = count($v) == 1 ? current($v) : implode(',', $v); } $data[$keyword]['title'] = utf8::str_replace($k, $v, $data[$keyword]['title']); $data[$keyword]['description'] = utf8::str_replace($k, $v, $data[$keyword]['description']); $data[$keyword]['keywords'] = utf8::str_replace($k, $v, $data[$keyword]['keywords']); } } if (isset($data[$keyword])) { if ($pageTitle) { view::setTitle($data[$keyword]['title']); } else { view::setMetaTitle($data[$keyword]['title']); } view::setMetaDescription($data[$keyword]['description']); view::setMetaKeywords($data[$keyword]['keywords']); } }
public function sendEmail($email, $subject, $messageText, $messageHTML = '', $tags = array()) { foreach ($tags as $tag => $value) { if (is_array($value)) { $value = implode(', ', $value); } $subject = utf8::str_replace('[' . $tag . ']', $value, $subject); $messageHTML = utf8::str_replace('[' . $tag . ']', $value, $messageHTML); $messageText = utf8::str_replace('[' . $tag . ']', $value, $messageText); } $this->to($email); $this->subject($subject); $this->message($messageText, $messageHTML); return $this->send(); }
public function saveLanguage($languageID, $name, $keyword) { $path = DOCPATH . 'languages/' . $keyword; $filename = 'manifest' . EXT; // Does language path exist? if (!@is_dir($path)) { if (!@mkdir($path, octdec(config::item('folder_chmod')), true)) { $this->setError(__('path_not_created', 'uploader')); return false; } } $content = "<?php\n" . "\$params = array(\n" . "\t'name' => '" . utf8::str_replace("'", "\\'", $name) . "'\n" . ");"; if (!@file_put_contents($path . '/' . $filename, $content)) { error::show('Could not save the file: ' . $filename . ' Make sure the "' . $path . '" folder exists and is writable.'); } @chmod($path . '/' . $filename, octdec(config::item('file_chmod'))); // Is this language pack installed? if ($languageID) { $this->db->update('core_languages', array('name' => $name, 'keyword' => $keyword), array('keyword' => $languageID), 1); } $this->cache->cleanup(); return true; }
<li class="<?php echo text_helper::alternate('one', 'two', 'three'); ?> " id="row-helper-<?php echo $user['user_id']; ?> "> <figure class="image users-image"> <?php view::load('users/profile/elements/picture', array_merge($user, array('picture_file_suffix' => 'l'))); ?> <figcaption class="image-caption"> <span class="nowrap nooverflow"><?php $user['name'] = utf8::str_replace(' ', '<br/>', $user['name']); echo users_helper::anchor($user, array('title' => $user['name'])); ?> </span> </figcaption> </figure> </li> <?php } ?> </ul>