当前位置: 首页>>代码示例>>PHP>>正文


PHP feed::updateTrack方法代码示例

本文整理汇总了PHP中feed::updateTrack方法的典型用法代码示例。如果您正苦于以下问题:PHP feed::updateTrack方法的具体用法?PHP feed::updateTrack怎么用?PHP feed::updateTrack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在feed的用法示例。


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

示例1: PageMain

function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
    }
    // Start displaying the Feed
    $feed = new feed();
    $feed->db = $db;
    $feed->url = $CONF['url'];
    $feed->user = $verify;
    $feed->id = $verify['idu'];
    $feed->username = $verify['username'];
    $feed->per_page = $settings['perpage'];
    $feed->categories = $feed->getCategories();
    $feed->time = $settings['time'];
    $feed->c_per_page = $settings['cperpage'];
    $feed->c_start = 0;
    $feed->l_per_post = $settings['lperpost'];
    $feed->paypalapp = $settings['paypalapp'];
    if (isset($_SESSION['usernameAdmin']) && isset($_SESSION['passwordAdmin'])) {
        $loggedInAdmin = new loggedInAdmin();
        $loggedInAdmin->db = $db;
        $loggedInAdmin->url = $CONF['url'];
        $loggedInAdmin->username = $_SESSION['usernameAdmin'];
        $loggedInAdmin->password = $_SESSION['passwordAdmin'];
        $loggedIn = $loggedInAdmin->verify();
        if ($loggedIn['username']) {
            // Set admin level
            $feed->is_admin = 1;
        }
    }
    $TMPL_old = $TMPL;
    $TMPL = array();
    // Get the track
    $track = $feed->getTrack($_GET['id']);
    $trackInfo = $feed->getTrackInfo($_GET['id'], 0);
    // Verify the track owner for certain pages
    if (!$trackInfo[1] && ($_GET['type'] == 'stats' || $_GET['type'] == 'edit')) {
        header("Location: " . $CONF['url']);
    }
    // Match the content from the song-title class in order to set it for the title tag
    preg_match_all('/<div.*(class="song-title").*>([\\d\\D]*)<\\/div>/iU', $track[0], $title);
    if (empty($title[2][0])) {
        preg_match_all('/<div.*(class="page-header").*>([\\d\\D]*)<\\/div>/iU', $track[0], $title);
    }
    $TMPL['id'] = $_GET['id'];
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = strip_tags($title[2][0]);
    $TMPL['url_title'] = $trackInfo[0];
    // If the user can view the track, and the report is set
    if (!$track[1] && $_GET['type'] == 'report') {
        if (!$feed->id) {
            header("Location: " . $CONF['url']);
        }
        $skin = new skin('track/report');
        $rows = '';
        if (isset($_POST['copyright'])) {
            $TMPL['message'] = $feed->report($_GET['id'], 1);
        }
    } elseif (!$track[1] && $_GET['type'] == 'stats') {
        $skin = new skin('track/stats');
        $rows = '';
        $stats = $feed->getTrackStats($_GET['id'], $_GET['filter'], 0);
        $most = $feed->getTrackStats($_GET['id'], $_GET['filter'], 1, 10);
        $TMPL['plays'] = $stats['plays'];
        $TMPL['likes'] = $stats['likes'];
        $TMPL['comments'] = $stats['comments'];
        $TMPL['downloads'] = $stats['downloads'];
        $TMPL['played_most'] = $most['played'];
        $TMPL['downloaded_most'] = $most['downloaded'];
        $TMPL['top_countries'] = $most['countries'];
        $TMPL['top_cities'] = $most['cities'];
        $TMPL['go_pro'] = $most['gopro'];
    } elseif (!$track[1] && $_GET['type'] == 'likes') {
        $skin = new skin('track/likes');
        $rows = '';
        $feed->per_page = $settings['qperpage'];
        $TMPL['likes'] = $feed->getLikes(0, 2, $_GET['id']);
    } elseif (!$track[1] && $_GET['type'] == 'edit') {
        $skin = new skin('track/edit');
        $rows = '';
        $TMPL['page_title'] = $LNG['edit'] . ' -';
        $TMPL['form_url'] = $CONF['url'] . '/index.php?a=track&id=' . $_GET['id'] . '&type=edit';
        $feed->art_size = $settings['artsize'];
        $feed->art_format = $settings['artformat'];
        if (!empty($_POST['save'])) {
            $update = $feed->updateTrack($_POST, 0);
            $TMPL['message'] = $update;
        }
        $currentTrack = $feed->getTrackInfo($_GET['id'], 1);
        foreach ($currentTrack as $key => $info) {
            $TMPL[$key] = $info;
        }
        $date = explode('-', $TMPL['release']);
        $TMPL['years'] = generateDateForm(0, $date[0]);
        $TMPL['months'] = generateDateForm(1, $date[1]);
        $TMPL['days'] = generateDateForm(2, $date[2]);
        if ($TMPL['download'] == 0) {
            $TMPL['doff'] = ' selected="selected"';
//.........这里部分代码省略.........
开发者ID:aminesig,项目名称:QSWebApp,代码行数:101,代码来源:track.php

示例2:

            $feed->db = $db;
            $feed->url = $CONF['url'];
            $feed->user = $verify;
            $feed->id = $verify['idu'];
            $feed->username = $verify['username'];
            $feed->per_page = $settings['perpage'];
            $feed->art_size = $settings['artsize'];
            $feed->art_format = $settings['artformat'];
            $feed->paypalapp = $settings['paypalapp'];
            $feed->track_size_total = $feed->getProStatus($feed->id, 1) ? $settings['protracktotal'] : $settings['tracksizetotal'];
            $feed->track_size = $feed->getProStatus($feed->id, 1) ? $settings['protracksize'] : $settings['tracksize'];
            $feed->track_format = $settings['trackformat'];
            $feed->time = $settings['time'];
            // Set the $x to output the value via JS
            $x = 1;
            $update = $feed->updateTrack($_POST, 1);
        }
    }
}
if ($x == 1) {
    ?>
<script language="javascript" type="text/javascript">
window.top.window.stopUpload('<?php 
    echo str_replace(array("\r", "\n"), "", $update[0]);
    ?>
', '<?php 
    echo $update[1];
    ?>
');
</script>
<?php 
开发者ID:Jeg72,项目名称:php_sound,代码行数:31,代码来源:post_track.php


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