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

PHP tpl_img函数代码示例

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

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



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

示例1: hsc

?>

        <?php 
if ($ERROR) {
    print $ERROR;
} else {
    ?>

            <h1><?php 
    echo hsc(tpl_img_getTag('IPTC.Headline', $IMG));
    ?>
</h1>

            <div class="content">
                <?php 
    tpl_img(900, 700);
    /* parameters: maximum width, maximum height (and more) */
    ?>

                <div class="img_detail">
                    <h2><?php 
    print nl2br(hsc(tpl_img_getTag('simple.title')));
    ?>
</h2>

                    <dl>
                        <?php 
    $config_files = getConfigFiles('mediameta');
    foreach ($config_files as $config_file) {
        if (@file_exists($config_file)) {
            include $config_file;
开发者ID:cpolzer,项目名称:dokutwitterbootstrap,代码行数:31,代码来源:detail.php


示例2: tpl_draw_cell

function tpl_draw_cell($task, $colname, $format = "<td class='%s'>%s</td>")
{
    global $fs, $proj, $page;
    $indexes = array('id' => 'task_id', 'project' => 'project_title', 'tasktype' => 'task_type', 'category' => 'category_name', 'severity' => '', 'priority' => '', 'summary' => 'item_summary', 'dateopened' => 'date_opened', 'status' => 'status_name', 'openedby' => 'opened_by_name', 'assignedto' => 'assigned_to_name', 'lastedit' => 'max_date', 'reportedin' => 'product_version', 'dueversion' => 'closedby_version', 'duedate' => 'due_date', 'comments' => 'num_comments', 'votes' => 'num_votes', 'attachments' => 'num_attachments', 'dateclosed' => 'date_closed', 'progress' => '', 'os' => 'os_name', 'private' => 'mark_private', 'supertask' => 'supertask_id');
    //must be an array , must contain elements and be alphanumeric (permitted  "_")
    if (!is_array($task) || empty($task) || preg_match('![^A-Za-z0-9_]!', $colname)) {
        //run away..
        return '';
    }
    switch ($colname) {
        case 'id':
            $value = tpl_tasklink($task, $task['task_id']);
            break;
        case 'summary':
            $value = tpl_tasklink($task, utf8_substr($task['item_summary'], 0, 55));
            if (utf8_strlen($task['item_summary']) > 55) {
                $value .= '...';
            }
            break;
        case 'severity':
            $value = $fs->severities[$task['task_severity']];
            break;
        case 'priority':
            $value = $fs->priorities[$task['task_priority']];
            break;
        case 'lastedit':
        case 'duedate':
        case 'dateopened':
        case 'dateclosed':
            $value = formatDate($task[$indexes[$colname]]);
            break;
        case 'status':
            if ($task['is_closed']) {
                $value = eL('closed');
            } else {
                $value = htmlspecialchars($task[$indexes[$colname]], ENT_QUOTES, 'utf-8');
            }
            break;
        case 'progress':
            $value = tpl_img($page->get_image('percent-' . $task['percent_complete'], false), $task['percent_complete'] . '%');
            break;
        case 'assignedto':
            $value = htmlspecialchars($task[$indexes[$colname]], ENT_QUOTES, 'utf-8');
            if ($task['num_assigned'] > 1) {
                $value .= ', +' . ($task['num_assigned'] - 1);
            }
            break;
        case 'private':
            $value = $task[$indexes[$colname]] ? L('yes') : L('no');
            break;
        case 'supertask':
            $value = tpl_tasklink($task, $task['supertask_id']);
            break;
        default:
            $value = htmlspecialchars($task[$indexes[$colname]], ENT_QUOTES, 'utf-8');
            break;
    }
    return sprintf($format, 'task_' . $colname, $value);
}
开发者ID:xcdam,项目名称:flyspray,代码行数:59,代码来源:index.php


示例3: tpl_draw_cell

function tpl_draw_cell($task, $colname, $format = "<td class='%s'>%s</td>")
{
    global $fs, $proj, $page, $user;
    $indexes = array('id' => 'task_id', 'project' => 'project_title', 'tasktype' => 'task_type', 'tasktypename' => 'tasktype_name', 'category' => 'category_name', 'severity' => '', 'priority' => '', 'summary' => 'item_summary', 'dateopened' => 'date_opened', 'status' => 'status_name', 'openedby' => 'opened_by_name', 'assignedto' => 'assigned_to_name', 'lastedit' => 'max_date', 'reportedin' => 'product_version_name', 'dueversion' => 'closedby_version_name', 'duedate' => 'due_date', 'comments' => 'num_comments', 'votes' => 'num_votes', 'attachments' => 'num_attachments', 'dateclosed' => 'date_closed', 'progress' => '', 'os' => 'os_name', 'private' => 'mark_private', 'parent' => 'supertask_id', 'estimatedeffort' => 'estimated_effort');
    //must be an array , must contain elements and be alphanumeric (permitted  "_")
    if (!is_array($task) || empty($task) || preg_match('![^A-Za-z0-9_]!', $colname)) {
        //run away..
        return '';
    }
    $class = 'task_' . $colname;
    switch ($colname) {
        case 'id':
            $value = tpl_tasklink($task, $task['task_id']);
            break;
        case 'summary':
            $value = tpl_tasklink($task, utf8_substr($task['item_summary'], 0, 55));
            if (utf8_strlen($task['item_summary']) > 55) {
                $value .= '...';
            }
            break;
        case 'tasktype':
            $value = $task['tasktype_name'];
            $class .= ' typ' . $task['task_type'];
            break;
        case 'severity':
            $value = $task['task_severity'] == 0 ? '' : $fs->severities[$task['task_severity']];
            $class .= ' sev' . $task['task_severity'];
            break;
        case 'priority':
            $value = $task['task_priority'] == 0 ? '' : $fs->priorities[$task['task_priority']];
            $class .= ' pri' . $task['task_priority'];
            break;
        case 'lastedit':
        case 'duedate':
        case 'dateopened':
        case 'dateclosed':
            $value = formatDate($task[$indexes[$colname]]);
            break;
        case 'status':
            if ($task['is_closed']) {
                $value = eL('closed');
            } else {
                $value = htmlspecialchars($task[$indexes[$colname]], ENT_QUOTES, 'utf-8');
            }
            break;
        case 'progress':
            $value = tpl_img($page->get_image('percent-' . $task['percent_complete'], false), $task['percent_complete'] . '%');
            break;
        case 'assignedto':
            $value = htmlspecialchars($task[$indexes[$colname]], ENT_QUOTES, 'utf-8');
            if ($task['num_assigned'] > 1) {
                $value .= ', +' . ($task['num_assigned'] - 1);
            }
            break;
        case 'private':
            $value = $task[$indexes[$colname]] ? L('yes') : L('no');
            break;
        case 'parent':
            $value = '';
            if ($task['supertask_id'] > 0) {
                $value = tpl_tasklink($task, $task['supertask_id']);
            }
            break;
        case 'estimatedeffort':
            $value = '';
            if ($user->perms('view_estimated_effort')) {
                if ($task['estimated_effort'] > 0) {
                    $value = effort::SecondsToString($task['estimated_effort'], $proj->prefs['hours_per_manday'], $proj->prefs['estimated_effort_format']);
                }
            }
            break;
        case 'effort':
            $value = '';
            if ($user->perms('view_current_effort_done')) {
                if ($task['effort'] > 0) {
                    $value = effort::SecondsToString($task['effort'], $proj->prefs['hours_per_manday'], $proj->prefs['current_effort_done_format']);
                }
            }
            break;
        default:
            $value = '';
            // $colname here is NOT column name in database but a name that can appear
            // both in a projects visible fields and as a key in language translation
            // file, which is also used to draw a localized heading. Column names in
            // database customarily use _ t to separate words, translation file entries
            // instead do not and can be also be quite different. If you do see an empty
            // value when you expected something, check your usage, what visible fields
            // in database actually constains, and maybe add a mapping from $colname to
            // to the database column name to array $indexes at the beginning of this
            // function. Note that inconsistencies between $colname, database column
            // name, translation entry key and name in visible fields do occur sometimes
            // during development phase.
            if (array_key_exists($colname, $indexes)) {
                $value = htmlspecialchars($task[$indexes[$colname]], ENT_QUOTES, 'utf-8');
            }
            break;
    }
    return sprintf($format, $class, $value);
}
开发者ID:peklov,项目名称:flyspray,代码行数:99,代码来源:index.php


示例4: if

                <?php if(!$ERROR): ?>
                    <div class="pageId"><span><?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG)); ?></span></div>
                <?php endif; ?>

                <div class="page group">
                    <?php tpl_flush() ?>
                    <?php tpl_includeFile('pageheader.html') ?>
                    <!-- detail start -->
                    <?php
                    if($ERROR):
                        echo '<h1>'.$ERROR.'</h1>';
                    else: ?>

                        <h1><?php echo nl2br(hsc(tpl_img_getTag('simple.title'))); ?></h1>

                        <?php tpl_img(900,700); /* parameters: maximum width, maximum height (and more) */ ?>

                        <div class="img_detail">
                            <dl>
                                <?php
                                    // @todo: logic should be transferred to backend
                                    $config_files = getConfigFiles('mediameta');
                                    foreach ($config_files as $config_file) {
                                        if(@file_exists($config_file)) {
                                            include($config_file);
                                        }
                                    }

                                    foreach($fields as $key => $tag){
                                        $t = array();
                                        if (!empty($tag[0])) {
开发者ID:neutrinog,项目名称:Door43,代码行数:31,代码来源:detail.php


示例5: tpl_draw_cell

function tpl_draw_cell($task, $colname, $format = "<td class='%s'>%s</td>")
{
    global $fs, $db, $proj, $page, $user;
    $indexes = array('id' => 'task_id', 'project' => 'project_title', 'tasktype' => 'task_type', 'tasktypename' => 'tasktype_name', 'category' => 'category_name', 'severity' => '', 'priority' => '', 'summary' => 'item_summary', 'dateopened' => 'date_opened', 'status' => 'status_name', 'openedby' => 'opened_by', 'openedbyname' => 'opened_by_name', 'assignedto' => 'assigned_to_name', 'lastedit' => 'max_date', 'editedby' => 'last_edited_by', 'reportedin' => 'product_version_name', 'dueversion' => 'closedby_version_name', 'duedate' => 'due_date', 'comments' => 'num_comments', 'votes' => 'num_votes', 'attachments' => 'num_attachments', 'dateclosed' => 'date_closed', 'closedby' => 'closed_by', 'commentedby' => 'commented_by', 'progress' => '', 'os' => 'os_name', 'private' => 'mark_private', 'parent' => 'supertask_id', 'estimatedeffort' => 'estimated_effort');
    //must be an array , must contain elements and be alphanumeric (permitted  "_")
    if (!is_array($task) || empty($task) || preg_match('![^A-Za-z0-9_]!', $colname)) {
        //run away..
        return '';
    }
    $class = 'task_' . $colname;
    switch ($colname) {
        case 'id':
            $value = tpl_tasklink($task, $task['task_id']);
            break;
        case 'summary':
            $value = tpl_tasklink($task, utf8_substr($task['item_summary'], 0, 55));
            if (utf8_strlen($task['item_summary']) > 55) {
                $value .= '...';
            }
            # <i> instead of <span> in future for smaller size
            # we need also some bytes for classes like <i class="tag t123">tagname</i>
            if ($task['tags'] != '') {
                $tags = explode(',', $task['tags']);
                $tagids = explode(',', $task['tagids']);
                $tagclass = explode(',', $task['tagclass']);
                $tgs = '';
                for ($i = 0; $i < count($tags); $i++) {
                    $tgs .= '<i class="tag t' . $tagids[$i] . ($tagclass[$i] ? ' ' . $tagclass[$i] : '') . '" title="' . $tags[$i] . '"></i>';
                }
                $value .= $tgs;
            }
            break;
        case 'tasktype':
            $value = $task['tasktype_name'];
            $class .= ' typ' . $task['task_type'];
            break;
        case 'severity':
            $value = $task['task_severity'] == 0 ? '' : $fs->severities[$task['task_severity']];
            $class .= ' sev' . $task['task_severity'];
            break;
        case 'priority':
            $value = $task['task_priority'] == 0 ? '' : $fs->priorities[$task['task_priority']];
            $class .= ' pri' . $task['task_priority'];
            break;
        case 'lastedit':
        case 'duedate':
        case 'dateopened':
        case 'dateclosed':
            $value = formatDate($task[$indexes[$colname]]);
            break;
        case 'status':
            if ($task['is_closed']) {
                $value = eL('closed');
            } else {
                $value = htmlspecialchars($task[$indexes[$colname]], ENT_QUOTES, 'utf-8');
            }
            break;
        case 'progress':
            $value = tpl_img($page->get_image('percent-' . $task['percent_complete'], false), $task['percent_complete'] . '%');
            break;
        case 'assignedto':
            # group_concat-ed for mysql/pgsql
            #$value = htmlspecialchars($task[$indexes[$colname]], ENT_QUOTES, 'utf-8');
            $value = '';
            $anames = explode(',', $task[$indexes[$colname]]);
            $aids = explode(',', $task['assignedids']);
            $aimages = explode(',', $task['assigned_image']);
            for ($a = 0; $a < count($anames); $a++) {
                if ($aids[$a]) {
                    if ($fs->prefs['enable_avatars'] == 1 && $aimages[$a]) {
                        $value .= tpl_userlinkavatar($aids[$a], 30);
                    } else {
                        $value .= tpl_userlink($aids[$a]);
                    }
                    #$value.='<a href="'.$aids[$a].'">'.htmlspecialchars($anames[$a], ENT_QUOTES, 'utf-8').'</a>';
                }
            }
            # fallback for DBs we haven't written sql string aggregation yet (currently with group_concat() mysql and array_agg() postgresql)
            if ('postgres' != $db->dblink->dataProvider && 'mysql' != $db->dblink->dataProvider && $task['num_assigned'] > 1) {
                $value .= ', +' . ($task['num_assigned'] - 1);
            }
            break;
        case 'private':
            $value = $task[$indexes[$colname]] ? L('yes') : L('no');
            break;
        case 'commentedby':
        case 'openedby':
        case 'editedby':
        case 'closedby':
            $value = '';
            # a bit expensive! tpl_userlinkavatar()  an additional sql query for each new user in the output table
            # at least tpl_userlink() uses a $cache array so query for repeated users
            if ($task[$indexes[$colname]] > 0) {
                if ($fs->prefs['enable_avatars'] == 1) {
                    $value = tpl_userlinkavatar($task[$indexes[$colname]], 30);
                } else {
                    $value = tpl_userlink($task[$indexes[$colname]]);
                }
            }
            break;
//.........这里部分代码省略.........
开发者ID:korbeljak,项目名称:flyspray,代码行数:101,代码来源:index.php


示例6: html_msgarea

</head>
<body>
<div class="dokuwiki">
';
html_msgarea();
echo '
  <div class="page" style="margin-left: 1em;">
';
if ($ERROR) {
    print $ERROR;
} else {
    echo '
    <h1>', hsc(tpl_img_getTag('IPTC.Headline', $IMG)), '</h1>
    <div class="img_big">
';
    tpl_img(900, 500);
    echo '    <p class="img_caption">';
    print nl2br(hsc(tpl_img_getTag('simple.title')));
    echo '</p>
';
    echo '    </div>
    <div class="img_detail">
      <dl class="img_tags">
';
    $config_files = getConfigFiles('mediameta');
    foreach ($config_files as $config_file) {
        if (@file_exists($config_file)) {
            include $config_file;
        }
    }
    foreach ($fields as $key => $tag) {
开发者ID:particleKIT,项目名称:dokuKIT,代码行数:31,代码来源:detail.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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