• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP make_slug函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中make_slug函数的典型用法代码示例。如果您正苦于以下问题:PHP make_slug函数的具体用法?PHP make_slug怎么用?PHP make_slug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了make_slug函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: edit_note

function edit_note($id)
{
    if ((string) (int) $id != $id) {
        _die("Invalid ID");
    }
    include "lib/tags.php";
    $post_data =& $_POST;
    foreach (array('ID', 'title', 'contents', 'tags', 'time', 'slug') as $key) {
        $post_data[$key] = pg_escape_string(@$post_data[$key]);
    }
    $post_data['tags'] = clean_tags($post_data['tags']);
    if (trim($post_data['slug']) == '') {
        $post_data['slug'] = make_slug($post_data['title']);
    }
    if (!($time = strtotime(@$post_data['time']))) {
        $time = date("Y-m-d H:i:s O", time());
    } else {
        $time = date("Y-m-d H:i:s O", $time);
    }
    $result = db("UPDATE public.\"notes\" SET \"title\" = '{$post_data['title']}',\n\t\t\t\"contents\" ='{$post_data['contents']}', \"tags\" = '{$post_data['tags']}',\n\t\t\t\"slug\" ='{$post_data['slug']}'\n\t\t\tWHERE \"ID\" = " . pg_escape_string($id));
    if ($result) {
        if (!rebuild_tags()) {
            _die("There was an error rebuilding the tag cloud data.\n\t\t\t\t<a href=\"" . _l("/edit/{$id}") . "\">Go back &rarr;");
        }
        _die("Edit successfull. <a href=\"" . _l("/edit/{$id}") . "\">continue editing &rarr;");
    } else {
        _die("There was an unexpected error.");
    }
}
开发者ID:shashi,项目名称:octavo,代码行数:29,代码来源:edit.php


示例2: jsonlist_url

function jsonlist_url($item, $module, $prefix = null)
{
    return absolute_link(url_for("@document_by_id_lang_slug?module={$module}&id=" . $item['id'] . '&lang=' . $item['culture'] . '&slug=' . make_slug(isset($prefix) ? $prefix . '-' . $item['name'] : $item['name'])));
}
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:4,代码来源:GeoJsonHelper.php


示例3: array_keys

        ?>
<div class="one_kind_association">
<div class="association_content">
<?php 
        $area_type_list = array_keys(sfConfig::get('app_areas_area_types'));
        array_shift($area_type_list);
        echo '<div class="assoc_img picto_' . $module . '" title="' . ucfirst(__($module)) . '"><span>' . ucfirst(__($module)) . __('&nbsp;:') . '</span></div>';
        foreach ($area_type_list as $area_type) {
            $element = array();
            foreach ($associated_docs as $doc) {
                if ($doc['area_type'] != $area_type) {
                    continue;
                }
                $doc_id = $doc['id'];
                $name = ucfirst($doc['name']);
                $url = "@document_by_id_lang_slug?module={$module}&id={$doc_id}" . '&lang=' . $doc['culture'] . '&slug=' . make_slug($doc['name']);
                $element[] = link_to($name, $url);
            }
            if (!empty($element)) {
                echo '<div class="linked_elt">' . implode(', ', $element) . '</div>';
            }
        }
        ?>
</div>
</div>
<?php 
    }
    $has_box = isset($box) && $box;
    $has_weather = isset($weather) && $weather;
    $has_avalanche_bulletin = isset($avalanche_bulletin) && count($avalanche_bulletin);
    $has_date = isset($date) && $date;
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:31,代码来源:_association.php


示例4: redirectToView

 /**
  * overrides function from parent in order to correctly display slug
  * with summit name
  */
 protected function redirectToView()
 {
     sfLoader::loadHelpers(array('General'));
     $prefered_cultures = $this->getUser()->getCulturesForDocuments();
     $summits = Association::findAllWithBestName($this->document->get('id'), $prefered_cultures, 'sr');
     $summit_name = c2cTools::extractHighestName($summits);
     $this->redirect('@document_by_id_lang_slug?module=' . $this->getModuleName() . '&id=' . $this->document->get('id') . '&lang=' . $this->document->getCulture() . '&slug=' . make_slug($summit_name) . '-' . get_slug($this->document));
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:12,代码来源:actions.class.php


示例5: setSlugAttribute

 public function setSlugAttribute($title)
 {
     if (!isset($this->attributes['slug']) || $this->attributes['slug'] != str_slug($title)) {
         $this->attributes['slug'] = make_slug('contents', $title);
     }
 }
开发者ID:jeremytubbs,项目名称:vue-admin,代码行数:6,代码来源:Content.php


示例6: executeFeed

 /**
  * Executes Feed action
  * NB: cannot be cached ...
  */
 public function executeFeed()
 {
     $feed = new sfGeoRssFeed();
     $lang = $this->getRequestParameter('lang');
     $model = $this->model_class;
     $module = $this->getModuleName();
     $id = $this->getRequestParameter('id');
     $mode = $this->getRequestParameter('mode');
     if ($lang) {
         $languages = sfConfig::get('app_languages_c2c');
     }
     switch ($mode) {
         case 'editions':
             $description = $this->__($lang ? "Latest %1% editions in %2%" : "Latest %1% editions", array('%1%' => $this->__($module), '%2%' => $lang ? $this->__($languages[$lang]) : null));
             $title = $description;
             // TODO Provide better description, different from title
             $link = "@module_whatsnew?module={$module}";
             // TODO maybe we should propose lang filters for whatsnew url?
             $self_link = $lang ? "@feed_lang?module={$module}&lang={$lang}" : "@feed?module={$module}";
             break;
         case 'creations':
             $description = $this->__($lang ? "Latest %1% creations in %2%" : "Latest %1% creations", array('%1%' => $this->__($module), '%2%' => $lang ? $this->__($languages[$lang]) : null));
             $title = $description;
             // TODO Provide better description, different from title
             $link = "@default_index?module={$module}";
             // TODO can we redirect to list with lang filter once it is done?
             $self_link = $lang ? "@creations_feed_lang?module={$module}&lang={$lang}" : "@creations_feed?module={$module}";
             break;
         default:
             // editions of a specific document
             // check that document $id exists in lang $lang, and retrieve its name.
             if (!($document = DocumentI18n::findName($id, $lang, $this->model_class))) {
                 $this->setNotFoundAndRedirect();
             }
             $name = $document->get('name');
             $description = $this->__("Latest editions for \"%1%\" - %2%", array('%1%' => $name, '%2%' => $this->__($languages[$lang])));
             $title = $description;
             // TODO Provide better description, different from title
             $link = "@document_history?module={$module}&id={$id}&lang={$lang}";
             $self_link = "@document_feed?module={$module}&id={$id}&lang={$lang}";
             break;
     }
     $feed->setTitle($title);
     $feed->setLink($link);
     $feed->setFeedUrl($self_link);
     $feed->setDescription($description);
     $feed->setLanguage($lang);
     $feed->setAuthorName('Camptocamp.org');
     $max_number = sfConfig::get('app_feeds_items_limit');
     if ($module != 'documents' || !empty($id)) {
         //usage: listRecent($model, $limit, $user_id = null, $lang = null, $doc_id = null, $mode = 'editions')
         $items = Document::listRecent($this->model_class, $max_number, null, $lang, $id, $mode);
         sfLoader::loadHelpers(array('General', 'SmartFormat'));
         $model_i18n = $model . 'I18n';
         // Add best summit name for routes
         foreach ($items as $key => $item) {
             $items[$key]['module'] = $item[$model]['module'];
             $items[$key]['id'] = $item['document_id'];
             $items[$key]['name'] = $item[$model_i18n]['name'];
             $items[$key]['search_name'] = $item[$model_i18n]['search_name'];
         }
         $routes = Route::addBestSummitName(array_filter($items, array('c2cTools', 'is_route')), $this->__(' :') . ' ');
         foreach ($routes as $key => $route) {
             $items[$key] = $route;
         }
         foreach ($items as $item) {
             $item_id = $item['document_id'];
             $new = $item['version'];
             $module_name = $item[$model]['module'];
             $name = $item['name'];
             $doc_lang = $item['culture'];
             $feedItemTitle = $name . ($mode != 'creations' ? " - r{$new}" . ($lang ? '' : "/{$doc_lang}") : '');
             $feedItem = new sfGeoFeedItem();
             $feedItem->setTitle($feedItemTitle);
             if ($mode == 'creations') {
                 if ($module_name == 'users') {
                     $feedItem->setLink("@document_by_id_lang?module={$module_name}&id={$item_id}&lang={$doc_lang}");
                 } else {
                     $feedItem->setLink("@document_by_id_lang_slug?module={$module_name}&id={$item_id}&lang={$doc_lang}&slug=" . make_slug($item['name']));
                 }
             } else {
                 $feedItem->setLink("@document_by_id_lang_version?module={$module_name}&id={$item_id}&lang={$doc_lang}&version={$new}");
             }
             $feedItem->setAuthorName($item['history_metadata']['user_private_data']['topo_name']);
             //$feedItem->setAuthorEmail($item['history_metadata']['user_private_data']['email']);
             $feedItem->setPubdate(strtotime($item['created_at']));
             $feedItem->setUniqueId("{$item_id}-{$doc_lang}-{$new}");
             $feedItem->setLongitude($item[$model]['lon']);
             $feedItem->setLatitude($item[$model]['lat']);
             $comment = smart_format($item['history_metadata']['comment']);
             $feedItem->setDescription($comment);
             if ($mode != 'creations') {
                 $link = $new > 1 ? ' - ' . link_to(__('View difference between version %1% and %2%', array('%1%' => $new - 1, '%2%' => $new)), "@document_diff?module={$module_name}&id={$item_id}&lang={$doc_lang}&new={$new}&old=" . ($new - 1), array('absolute' => true)) : '';
                 $feedItem->setContent($comment . $link);
             }
             $feed->addItem($feedItem);
//.........这里部分代码省略.........
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:101,代码来源:actions.class.php


示例7: __

$use_camo = (bool) sfConfig::get('app_camo_use');
$camo_url = sfConfig::get('app_camo_url');
$camo_key = sfConfig::get('app_camo_key');
// load needed strings from PunBB
@(include PUN_ROOT . 'lang/' . __('meta_language_forum') . '/common.php');
$module = $sf_context->getModuleName();
$lang = $sf_params->get('lang');
$id = $sf_params->get('id');
$mobile_version = c2cTools::mobileVersion();
require_once PUN_ROOT . 'include/parser.php';
$nb_comments = $comments->count();
$document_name = isset($title_prefix) ? $title_prefix . __('&nbsp;:') . ' ' . $document_name : $document_name;
echo display_title($document_name, $module);
if (!$mobile_version) {
    echo '<div id="nav_space">&nbsp;</div>';
    echo tabs_list_tag($id, $lang, $exists_in_lang, 'comments', NULL, $module != 'users' ? make_slug($document_name) : '', $nb_comments);
}
echo display_content_top('doc_content');
echo start_content_tag($module . '_content');
if ($nb_comments > 0) {
    $topic_id = $comments->getFirst()->topic_id;
    $uri_anchor = explode('#', $_SERVER['REQUEST_URI'], 2);
    $post_id = 0;
    if (count($uri_anchor) > 1) {
        $post_anchor = $uri_anchor[1];
        if (strpos($post_anchor, 'p') === 0) {
            if (preg_match('#p([0-9]+)#si', $post_anchor, $post_id_match)) {
                $post_id = intval($post_id_match[1]);
            }
        }
    }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:31,代码来源:commentSuccess.php


示例8: foreach

        </tr>
    </thead>
    <tbody>
    <?php 
$table_list_even_odd = 0;
foreach ($items as $item) {
    $table_class = $table_list_even_odd++ % 2 == 0 ? 'table_list_even' : 'table_list_odd';
    $user_link = '@document_by_id?module=users&id=' . $item['user_private_data']['id'];
    $models = c2cTools::Type2Models($item['type']);
    $main_module = c2cTools::model2module($models['main']);
    $linked_module = c2cTools::model2module($models['linked']);
    $main_item = count($item['mainI18n']) ? $item['mainI18n'][0] : null;
    $linked_item = count($item['linkedI18n']) ? $item['linkedI18n'][0] : null;
    // FIXME: routes slugs
    $main_link = '@document_by_id_lang_slug?module=' . $main_module . '&id=' . $item['main_id'] . '&lang=' . $main_item['culture'] . '&slug=' . make_slug($main_item['name']);
    $linked_link = '@document_by_id_lang_slug?module=' . $linked_module . '&id=' . $item['linked_id'] . '&lang=' . $linked_item['culture'] . '&slug=' . make_slug($linked_item['name']);
    ?>
        <tr class="<?php 
    echo $table_class;
    if ($item['is_creation']) {
        echo ' creation';
    } else {
        echo ' deletion';
    }
    ?>
">
            <td> <?php 
    echo $item['is_creation'] ? $added_pic : $deleted_pic;
    ?>
 </td>
            <td> <?php 
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:31,代码来源:latestassociationsSuccess.php


示例9: use_helper

<?php

use_helper('General');
$feed = new sfGeoRssFeed();
$feed->setTitle('Camptocamp.org ');
$feed->setLink('http://www.camptocamp.org');
$feed->setAuthorName('Camptocamp.org');
//$feed->setLanguage($lang);
foreach ($documents as $doc) {
    $feedItem = new sfGeoFeedItem();
    $feedItem->setTitle($doc['name']);
    $id = $doc['id'];
    $module = $doc['module'];
    $lang = $doc['culture'];
    $slug = make_slug($doc['name']);
    $feedItem->setLink("@document_by_id_lang_slug?module={$module}&id={$id}&lang={$lang}&slug={$slug}");
    $feedItem->setDescription($module);
    $feed->addItem($feedItem);
}
echo $feed->asXml(ESC_RAW);
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:20,代码来源:latestSuccess.php


示例10: _die

<?php

/* Adds a post to the database */
if (!(isset($_POST) && @$_POST['title'] != '')) {
    _die("tpl/post_form.html");
}
include "lib/post.php";
include "lib/tags.php";
$post_data =& $_POST;
foreach (array('title', 'contents', 'tags', 'time', 'slug') as $key) {
    $post_data[$key] = pg_escape_string(@$post_data[$key]);
}
$post_data['tags'] = clean_tags($post_data['tags']);
if (trim($post_data['slug']) == '') {
    $post_data['slug'] = make_slug($post_data['title']);
}
if (!($time = strtotime(@$post_data['time']))) {
    $time = date("Y-m-d H:i:s O", time());
} else {
    $time = date("Y-m-d H:i:s O", $time);
}
if (db('INSERT INTO "public"."notes" ("title", "contents", "slug", "tags", "time") VALUES (' . "\n\t'{$post_data['title']}','{$post_data['contents']}','{$post_data['slug']}','{$post_data['tags']}','{$time}' )")) {
    add_tags($post_data['tags']);
    header('Location: ' . _l("/archive/{$_POST['slug']}"));
} else {
    _die("Some error occoured. Try again.");
}
开发者ID:shashi,项目名称:octavo,代码行数:27,代码来源:add.php


示例11: list_link

function list_link($item, $module, $prefix = null)
{
    return link_to(isset($prefix) ? $prefix . __('&nbsp;:') . ' ' . $item['name'] : $item['name'], "@document_by_id_lang_slug?module={$module}&id=" . $item['id'] . '&lang=' . $item['culture'] . '&slug=' . make_slug(isset($prefix) ? $prefix . '-' . $item['name'] : $item['name']), array('hreflang' => $item['culture']));
}
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:4,代码来源:LinkHelper.php


示例12: format_date

 } else {
     ?>
         <li class="even">
     <?php 
 }
 $list_item++;
 $timedate = $item['date'];
 if ($timedate != $date) {
     echo '<span class="date">' . format_date($timedate, $item_date_format) . '</span>';
     $date = $timedate;
 }
 echo get_paginated_activities($item['activities']) . ' ';
 $i18n = $item['OutingI18n'][0];
 $id = $item['id'];
 $lang = $i18n['culture'];
 echo link_to($i18n['name'], "@document_by_id_lang_slug?module=outings&id={$id}&lang={$lang}&slug=" . make_slug($i18n['name']), array('hreflang' => $lang));
 $outing_data = array();
 $max_elevation = displayWithSuffix($item['max_elevation'], 'meters');
 if (!empty($max_elevation)) {
     $outing_data[] = $max_elevation;
 }
 $area_name = Area::getBestRegionDescription($item['geoassociations'], true);
 if (!empty($area_name)) {
     $outing_data[] = $area_name;
 }
 if (count($outing_data) > 0) {
     echo ' <span class="meta">(' . implode(' - ', $outing_data) . ')</span>';
 }
 if (isset($item['nb_images'])) {
     $images = picto_tag('picto_images_light', format_number_choice('[1]1 image|(1,+Inf]%1% images', array('%1%' => $item['nb_images']), $item['nb_images'])) . ' ';
     echo $images;
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:31,代码来源:_latest.php


示例13: trim

        $price = $child->find($price_xpath, 0)->innertext;
        $sku = $child->find($sku_xpath, 0)->innertext;
        echo $sku . '<br>';
        $img = $child->find($img_xpath, 0)->src;
        $content = '';
        $content = $child->find($content_xpath, 0)->innertext;
        //
        $title = trim($title);
        $price = str_replace(',', '', trim($price));
        $price = str_replace(' VND', '', $price);
        $sku = trim($sku);
        $img = 'http://haicaubeo.com' . str_replace(' ', '%20', trim($img));
        $content = trim($content);
        $store_url = '/img/uploads/2015/06/' . strtolower(str_replace('%20', '-', basename($img)));
        //
        $sql = "INSERT INTO `products`(\n        `sku`, `provider_id`,\n        `name`, `slug`, `price`,\n        `retail_price`, `source_price`, `excert`,\n        `descriptions`,\n        `category_id`, `type`)\n        VALUES (\n        " . $sku . ",1,\n        '" . $title . "', '" . make_slug($title) . "'," . ($price + 20000) . ",\n        " . $price . "," . $price . ",'',\n        '" . $content . "',\n        " . $l['cat'] . ",1)";
        $sql2 = "INSERT INTO `medias`(`ref`, `ref_id`, `file`, `position`) VALUES ('Product','[p_id]','{$store_url}',0)";
        $sql3 = "UPDATE `products` SET `media_id` = [media_id] WHERE `id` = [p_id] ";
        $buildQuery[$sku] = array('product' => $sql, 'media' => $sql2, 'update' => $sql3);
        $imgSavePath = getcwd() . '\\img\\uploads\\2015\\06\\' . strtolower(str_replace('%20', '-', basename($img)));
        file_put_contents($imgSavePath, file_get_contents($img));
    }
}
krsort($buildQuery);
foreach ($buildQuery as $query) {
    if (mysqli_query($conn, $query['product'])) {
        $product_id = $conn->insert_id;
        $query['media'] = str_replace('[p_id]', $product_id, $query['media']);
        if (mysqli_query($conn, $query['media'])) {
            $media_id = $conn->insert_id;
            $query['update'] = str_replace('[p_id]', $product_id, $query['update']);
开发者ID:CaoLP,项目名称:cwr_web,代码行数:31,代码来源:index_.php


示例14: foreach

<?php

if (!isset($use_keys)) {
    $use_keys = false;
}
foreach ($parkings as $parking) {
    $i18n = $parking['ParkingI18n'][0];
    $url = $use_keys ? array() : array('url' => absolute_link(url_for('@document_by_id_lang_slug?module=parkings&id=' . $parking['id'] . '&lang=' . $i18n['culture'] . '&slug=' . make_slug($i18n['name']))));
    $a[] = array_merge(array('id' => $parking['id'], 'name' => $i18n->getRaw('name')), $url);
}
if (isset($a)) {
    krsort($a);
    echo json_encode(array_values($a));
} else {
    echo '[]';
}
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:16,代码来源:_parkings4jsonlist.php


示例15: use_helper

<?php

use_helper('Date', 'History', 'MyForm', 'Language', 'Viewer', 'WikiTabs', 'SmartFormat', 'sfBBCode');
use_javascript('/static/js/diff.js', 'last');
use_javascript('/static/js/history_tools.js', 'last');
$is_moderator = $sf_user->hasCredential(sfConfig::get('app_credentials_moderator'));
$module = $sf_context->getModuleName();
$model = c2cTools::module2model($module);
$i18n_archive = $model . 'I18nArchive';
$lang = $sf_params->get('lang');
$id = $sf_params->get('id');
$table_list_even_odd = 0;
$slug = make_slug($document[$i18n_archive]['name']);
echo display_title(isset($title_prefix) ? $title_prefix . __('&nbsp;:') . ' ' . $document_name : $document_name, $module);
echo '<div id="nav_space">&nbsp;</div>';
echo tabs_list_tag($id, $lang, $exists_in_lang, 'history', null, $slug, $nb_comments);
echo display_content_top('doc_content');
echo start_content_tag($module . '_content');
?>
<p><?php 
echo __('Viewing history from %1% in %2%', array('%1%' => $document_name, '%2%' => format_language_c2c($lang)));
?>
</p>

<p><?php 
echo __('Legend:') . ' * = ' . __('current version') . ', <strong>' . __('minor_tag') . '</strong> = ' . __('minor modification');
?>
</p>

<?php 
echo form_tag("@document_diff_post?module={$module}&id={$id}&lang={$lang}", array('method' => 'post'));
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:31,代码来源:historySuccess.php


示例16: show_single

function show_single()
{
    global $s, $m, $x, $mtitle, $site_url, $comments, $page_display_name, $site_name, $comment_ok, $date_format, $lang, $error, $scream, $sname, $semail, $scomment, $sweb, $timezone;
    $rs = safe_row('*', 'pixie_dynamic_posts', "post_slug = '{$x}' and public = 'yes' limit 0,1");
    if ($rs) {
        extract($rs);
        safe_update('pixie_dynamic_posts', "post_views  = {$post_views} + 1", "post_id = '{$post_id}'");
        $logunix = returnUnixtimestamp($posted);
        $date = safe_strftime($date_format, $logunix);
        $timeunix = returnUnixtimestamp($last_modified);
        $xdate = safe_strftime($date_format, $timeunix);
        $microformat = safe_strftime('%Y-%m-%dT%T%z', $logunix);
        $slug = $post_slug;
        $fullname = safe_field('realname', 'pixie_users', "user_name='{$author}'");
        if (public_page_exists('profiles')) {
            $mauthor = "<a href=\"" . createURL("profiles", $author) . "\" class=\"url fn\" title=\"" . $lang['view'] . " {$fullname}'s " . $lang['profile'] . "\">{$fullname}</a>";
        } else {
            $mauthor = "<a href=\"{$site_url}\" class=\"url fn\" title=\"{$site_url}\">{$fullname}</a>";
        }
        if (isset($tags) && $tags) {
            $all_tags = strip_tags($tags);
            $all_tags = str_replace('&quot;', "", $tags);
            $tags_array_temp = explode(" ", $all_tags);
            for ($count = 0; $count < count($tags_array_temp); $count++) {
                $current = $tags_array_temp[$count];
                $first = $current[strlen($current) - strlen($current)];
                if ($first == " ") {
                    $current = substr($current, 1, strlen($current) - 1);
                }
                $ncurrent = make_slug($current);
                if (isset($s) && isset($ncurrent)) {
                    if (isset($tag_list)) {
                    } else {
                        $tag_list = NULL;
                    }
                    $tag_list .= "<a href=\"" . createURL($s, 'tag', $ncurrent) . "\" title=\"" . $lang['view'] . " " . $lang['all_posts_tagged'] . ": " . $current . "\"  rel=\"tag\" >" . $current . "</a>, ";
                }
                if ($ncurrent != "") {
                    if (isset($class_list)) {
                    } else {
                        $class_list = NULL;
                    }
                    $class_list .= "tag_{$ncurrent} ";
                }
            }
            $tag_list = substr($tag_list, 0, strlen($tag_list) - 2) . "";
        }
        if (isset($s)) {
            $permalink = createURL($s, 'permalink', $slug);
        }
        $authorclass = strtolower($author);
        $timeclass = safe_strftime('y%Y m%m d%d h%H', $logunix);
        echo "\n\t\t\t\t\t<div class=\"section hentry author_{$authorclass} {$class_list}{$timeclass} single\" id=\"post_{$post_id}\">\n\t\t\t\t\t\t<h4 class=\"entry-title\"><a href=\"{$permalink}\" rel=\"bookmark\">{$title}</a></h4>\n\t\t\t\t\t\t<ul class=\"post_links\">\n\t\t\t\t\t\t\t<li class=\"post_date\"><abbr class=\"published\" title=\"{$microformat}\">{$date}</abbr></li>";
        if (isset($_COOKIE['pixie_login'])) {
            list($username, $cookie_hash) = explode(',', $_COOKIE['pixie_login']);
            $nonce = safe_field('nonce', 'pixie_users', "user_name='{$username}'");
            if (md5($username . $nonce) == $cookie_hash) {
                $privs = safe_field('privs', 'pixie_users', "user_name='{$username}'");
                if ($privs >= 1) {
                    echo "\n\t\t\t\t\t\t\t<li class=\"post_edit\"><a href=\"" . $site_url . "admin/?s=publish&amp;m=dynamic";
                    if (isset($s)) {
                        echo '&amp;x=' . $s;
                    }
                    echo "&amp;edit={$post_id}\" title=\"" . $lang['edit_post'] . "\">" . $lang['edit_post'] . "</a></li>";
                }
            }
        }
        echo "\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<div class=\"post entry-content\">\n";
        //<!--more-->
        $post = get_extended($content);
        echo "\t\t\t\t\t\t\t" . $post['main'];
        if ($post['extended']) {
            echo $post['extended'];
        }
        echo "\n\t\t\t\t\t\t</div>\t\t\n\t\t\t\t\t\t<div class=\"post_credits\">\n\t\t\t\t\t\t \t<span class=\"vcard author\">" . $lang['by'] . " {$mauthor}</span>\n\t\t\t\t\t\t \t<span class=\"post_tags\">" . $lang['tagged'] . ": {$tag_list}</span>\n\t\t\t\t\t\t \t<span class=\"post_updated\">" . $lang['last_updated'] . ": {$xdate} </span>\n\t\t\t\t\t\t</div>\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<div id=\"nav_posts\" class=\"dynamic_bottom_nav\">\n";
        // previous and next posts
        if (isset($s)) {
            $thisid = get_page_id($s);
        }
        // what post is next?
        $searchnext = safe_field('post_id', 'pixie_dynamic_posts', "page_id = '{$thisid}' and public = 'yes' and posted > '{$posted}' limit 0,1");
        if ($searchnext) {
            $ntitle = safe_field('title', 'pixie_dynamic_posts', "post_id ='{$searchnext}'");
            $nslug = safe_field('post_slug', 'pixie_dynamic_posts', "post_id ='{$searchnext}'");
            echo "\t\t\t\t\t\t<div id=\"post_next\" class=\"link_next\"><a class=\"link_next_a\" href=\"";
            if (isset($s)) {
                echo createURL($s, 'permalink', $nslug);
            }
            echo "\" title=\"" . $lang['next_post'] . ": {$ntitle}\">" . $lang['next_post'] . " &raquo;</a></div>\n";
        }
        // what post is previous?
        $searchprev = safe_field('post_id', 'pixie_dynamic_posts', "page_id = '{$thisid}' and public = 'yes' and posted < '{$posted}' order by posted desc limit 0,1");
        if ($searchprev) {
            $ptitle = safe_field('title', 'pixie_dynamic_posts', "post_id ='{$searchprev}'");
            $pslug = safe_field('post_slug', 'pixie_dynamic_posts', "post_id ='{$searchprev}'");
            echo "\t\t\t\t\t\t<div id=\"post_previous\" class=\"link_previous\"><a class=\"link_prev_a\" href=\"";
            if (isset($s)) {
                echo createURL($s, 'permalink', $pslug);
            }
            echo "\" title=\"" . $lang['previous_post'] . ": ";
//.........这里部分代码省略.........
开发者ID:joseph-mudloff,项目名称:pixie-cms,代码行数:101,代码来源:dynamic.php


示例17: link_to

        if ($list_item % 2 == 1) {
            ?>
                <li class="odd">
            <?php 
        } else {
            ?>
                <li class="even">
            <?php 
        }
        $list_item++;
        $id = $item['id'];
        $lang = $item['ArticleI18n'][0]['culture'];
        ?>
            <span class="home_article_title">
            <?php 
        echo link_to($item['ArticleI18n'][0]['name'], "@document_by_id_lang_slug?module=articles&id={$id}&lang={$lang}&slug=" . make_slug($item['ArticleI18n'][0]['name']), array('hreflang' => $lang));
        ?>
            </span>
            <?php 
        echo truncate_article_abstract(parse_links(parse_bbcode_abstract($item['ArticleI18n'][0]['abstract'])), sfConfig::get('app_recent_documents_articles_abstract_characters_limit'));
        ?>
            </li>
    <?php 
    }
    ?>
    </ul>
<?php 
}
?>
<div class="home_link_list">
<?php 
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:31,代码来源:_latest.php


示例18: pager_navigation

    echo '</p>';
    $pager_navigation = pager_navigation($pager);
    echo $pager_navigation;
    echo '<div class="clearer"></div>';
    $items = Language::parseListItems($items, 'Image');
    echo form_tag("@user_manage_images?module=users", array('onsubmit' => 'C2C.submitonce(this)', 'id' => 'editform'));
    foreach ($items as $item) {
        ?>
    <div class="thumb_data manageimages_list">
    <?php 
        $i18n_item = $item['ImageI18n'][0];
        $title = $i18n_item['name'];
        $image_type = $item['image_type'];
        $filename = $item['filename'];
        $thumb_url = image_url($filename, 'small');
        $slug = make_slug($i18n_item['name']);
        $image_id = $item['id'];
        $image_route = '@document_by_id_lang_slug?module=images&id=' . $image_id . '&lang=' . $i18n_item['culture'] . '&slug=' . $slug;
        echo link_to(image_tag($thumb_url, array('class' => 'img', 'alt' => $title)), absolute_link(image_url($filename, 'big', true), true), array('title' => $title, 'data-lightbox' => 'document_images', 'class' => 'view_big', 'id' => 'lightbox_' . $image_id . '_' . $image_type));
        ?>
    <div class="manageimages_info">
        <?php 
        echo input_tag('switch[]', null, array('type' => 'checkbox', 'value' => "{$image_id}", 'id' => 'switch_' . $image_id)) . link_to(__('Details'), $image_route, array('class' => 'toto'));
        ?>
        </div>
    </div>
<?php 
    }
    ?>
<div style="clear:both"><?php 
    echo input_hidden_tag('page', $page);
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:31,代码来源:manageimagesSuccess.php


示例19: pager_navigation

    echo '</p>';
    $pager_navigation = pager_navigation($pager);
    echo $pager_navigation;
    echo pager_nb_results($pager);
    echo '<div class="clearer"></div>';
    foreach ($items as $item) {
        ?>
    <div class="thumb_data">
    <div class="thumb_data_img">
    <?php 
        $i18n_item = $item['ImageI18n'][0];
        $title = $i18n_item['name'];
        $filename = $item['filename'];
        $image_type = $item['image_type'];
        $thumb_url = image_url($filename, 'small');
        $image_route = '@document_by_id_lang_slug?module=images&id=' . $item['id'] . '&lang=' . $i18n_item['culture'] . '&slug=' . make_slug($i18n_item['name']);
        echo link_to(image_tag($thumb_url, array('class' => 'img', 'alt' => $title)), $mobile_version ? $image_route : absolute_link(image_url($filename, 'big', true), true), array('title' => $title, 'data-lightbox' => 'document_images', 'class' => 'view_big', 'id' => 'lightbox_' . $item['id'] . '_' . $image_type));
        ?>
    <div class="image_license <?php 
        echo 'license_' . $image_type;
        ?>
"></div>
    </div>
    <?php 
        echo $title . '<br />';
        echo link_to(__('Details'), $image_route);
        if (!empty($item['nb_comments'])) {
            echo ' - ' . picto_tag('action_comment', __('nb_comments'), array('style' => 'margin-bottom:-4px')) . ' (' . link_to($item['nb_comments'], '@document_comment?module=images&id=' . $item['id'] . '&lang=' . $i18n_item['culture']) . ')';
        }
        ?>
    </div>
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:31,代码来源:listSuccess.php


示例20: use_helper

<?php

use_helper('Field');
$html = array();
foreach ($parkings as $parking) {
    $name = ucfirst($parking['ParkingI18n'][0]['name']);
    $culture = $parking['ParkingI18n'][0]['culture'];
    $url = '@document_by_id_lang_slug?module=parkings&id=' . $parking['id'] . '&lang=' . $culture . '&slug=' . make_slug($parking['ParkingI18n'][0]['name']);
    $link = link_to($name, $url, array('hreflang' => $culture));
    if (isset($parking['lowest_elevation']) && is_scalar($parking['lowest_elevation']) && $parking['lowest_elevation'] != $parking['elevation']) {
        $link .= '&nbsp; ' . $parking['lowest_elevation'] . __('meters') . __('range separator') . $parking['elevation'] . __('meters');
    } else {
        if (isset($parking['elevation']) && is_scalar($parking['elevation'])) {
            $link .= '&nbsp; ' . $parking['elevation'] . __('meters');
        }
    }
    if (isset($parking['public_transportation_types'])) {
        $link .= field_pt_picto_if_set($parking, true, ' - ');
    }
    $html[] = $link;
}
echo implode('<br />', $html);
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:22,代码来源:_parkings4list.php



注:本文中的make_slug函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP make_sorting_header函数代码示例发布时间:2022-05-15
下一篇:
PHP make_site_theme函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap