示例#1
0
 public function Select($post_id)
 {
     $t = "SELECT * FROM {$this->postmeta} WHERE `post_id` = '%d'";
     $query = spintf($t, $post_id);
     $result = $this->m_mysql->Select($query);
     return $result;
 }
示例#2
0
function kopa_the_archive_title()
{
    if (is_home()) {
        echo '<h1 class="entry-cat-title">' . esc_attr__('Blog', 'fastnews-light') . '</h1>';
    } elseif (is_tag()) {
        printf('<h1 class="entry-cat-title">%1$s: %2$s</h1>', esc_attr__('Tag Archives', 'fastnews-light'), single_tag_title('', false));
    } elseif (is_category()) {
        if (1 == get_theme_mod('blog_category_name_status', '1')) {
            echo '<h1 class="entry-cat-title">' . esc_attr(single_cat_title('', false)) . '</h1>';
        }
    } elseif (is_archive()) {
        if (is_day()) {
            printf('<h1 class="entry-cat-title">%s: %s </h1>', esc_attr__('Daily Archives', 'fastnews-light'), get_the_date());
        } elseif (is_month()) {
            printf('<h1 class="entry-cat-title">%s: %s</h1>', esc_attr__('Monthly Archives', 'fastnews-light'), get_the_date(_x('F Y', 'monthly archives date format', 'fastnews-light')));
        } elseif (is_year()) {
            printf('<h1 class="entry-cat-title">%s: %s</h1>', esc_attr__('Yearly Archives', 'fastnews-light'), get_the_date(_x('Y', 'yearly archives date format', 'fastnews-light')));
        } else {
            echo spintf('<h1 class="entry-cat-title">%s</h1>', esc_attr__('Archives', 'fastnews-light'));
        }
    }
}
示例#3
0
 /**
  * Return Id by values
  *
  * @param  $values
  * @return int
  */
 public function getIdByValues($values)
 {
     $adapter = $this->_getReadAdapter()->select();
     $select = $adapter->select()->from(array($this->getMainTable()), array($this->getIdFieldName()))->join(array($this->_localeTable), spintf('%s.%s = %s.%s', $this->getMainTable(), $this->getIdFieldName(), $this->_localeTable, $this->getIdFieldName()), array());
     foreach ($values as $field => $value) {
         $select->where(sprintf('% = ?', $field), $value);
     }
     return $adapter->fetchOne($select);
 }