Example #1
0
function xt_row_share($share, $count)
{
    $terms = xt_get_catalog_terms_cache($share->id, 'share');
    $as = array();
    $cids = array();
    if (!empty($terms)) {
        $as = array();
        foreach ($terms as $term) {
            $_url = add_query_arg(array('cid' => $term->id, 'paged' => 1, 's' => ''), $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
            $as[] = '<a href="http://' . $_url . '">' . $term->title . '</a>';
            $cids[] = $term->id;
        }
    }
    ?>
    <tr id="share-<?php 
    echo $share->id;
    ?>
" <?php 
    echo $count % 2 == 0 ? 'class="alternate"' : '';
    ?>
>
        <td scope="row"><span><?php 
    echo $share->id;
    ?>
</span></td>
        <td class="name column-name"><strong><a class="row-title" href="<?php 
    the_share_url($share->id);
    ?>
" target="_blank"><?php 
    echo $share->title;
    ?>
</a></strong><br>
            <div class="row-actions">
                    <!--<span class="edit"><a href="">编辑</a> | </span>-->
                <span class="inline hide-if-no-js"><a href="#" class="editinline">编辑</a> | </span>
                <span class="delete"><a class="delete-share" href="javascript:;" data-value="<?php 
    echo $share->id;
    ?>
">删除</a></span>
            </div>
            <div class="hidden" id="inline_<?php 
    echo $share->id;
    ?>
">
                <div class="title"><?php 
    echo $share->title;
    ?>
</div>
                <div class="cids"><?php 
    echo implode(',', $cids);
    ?>
</div>
            </div>
        </td>
        <td><?php 
    echo implode('&nbsp;,&nbsp;', $as);
    ?>
</td>
        <td><?php 
    echo $share->price;
    ?>
</td>
        <td><?php 
    echo $share->user_name;
    ?>
</td>
        <td><?php 
    echo $share->fav_count;
    ?>
</td>
        <td><?php 
    echo $share->comment_count;
    ?>
</td>
    </tr>
    <?php 
}
Example #2
0
function xt_row_tag($tag, $count, $cid = 0)
{
    $_tagUrl = xt_get_shares_search_url(array('s' => $tag->title, 'cid' => $cid));
    $terms = xt_get_catalog_terms_cache($tag->id);
    $as = array();
    $cids = array();
    if (!empty($terms)) {
        foreach ($terms as $term) {
            $_url = add_query_arg(array('cid' => $term->id, 'paged' => 1, 's' => ''), $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
            $as[] = '<a href="http://' . $_url . '">' . $term->title . '</a>';
            $cids[] = $term->id;
        }
    }
    ?>
    <tr id="tag-<?php 
    echo $tag->id;
    ?>
" <?php 
    echo $count % 2 == 0 ? 'class="alternate"' : '';
    ?>
>
        <td scope="row"><span><?php 
    echo $tag->id;
    ?>
</span></td>
        <td class="name column-name"><strong><a class="row-title" href="<?php 
    echo $_tagUrl;
    ?>
" target="_blank"><?php 
    echo $tag->title;
    ?>
</a></strong><br>
            <div class="row-actions">
                    <!--<span class="edit"><a href="">编辑</a> | </span>-->
                <span class="inline hide-if-no-js"><a href="#" class="editinline">快速编辑</a> | </span>
                <span class="delete"><a class="delete-tag" href="javascript:;" data-value="<?php 
    echo $tag->id;
    ?>
">删除</a></span>
            </div>
            <div class="hidden" id="inline_<?php 
    echo $tag->id;
    ?>
">
                <div class="title"><?php 
    echo $tag->title;
    ?>
</div>
                <div class="sort"><?php 
    echo $tag->sort;
    ?>
</div>
                <div class="cids"><?php 
    echo implode(',', $cids);
    ?>
</div>
                <div class="cid"><?php 
    echo isset($tag->cid) ? $tag->cid : 0;
    ?>
</div>
            </div>
        </td>
        <td><?php 
    echo implode('&nbsp;,&nbsp;', $as);
    ?>
</td>
        <td><?php 
    echo $tag->sort;
    ?>
</td>
        <td><?php 
    echo $tag->count;
    ?>
</td>
    </tr>
    <?php 
}