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


PHP getpath函数代码示例

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


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

示例1: gallery_pages

function gallery_pages($id)
{
    global $set, $db, $apx, $user;
    $id = (int) $id;
    //Order by
    if ($set['gallery']['orderpics'] == 2) {
        $sortby = 'id ASC';
    } else {
        $sortby = 'id DESC';
    }
    $query = "SELECT id,caption,thumbnail FROM " . PRE . "_gallery_pics WHERE ( galid='" . $id . "' ";
    if (!$user->is_team_member()) {
        $query .= " AND active='1' ";
    }
    $query .= " ) ORDER BY " . $sortby;
    $data = $db->fetch($query);
    $pages = count($data);
    foreach ($data as $res) {
        ++$i;
        //Seitenzahlen
        $pagedata[$i]['NUMBER'] = $i;
        $pagedata[$i]['LINK'] = mklink('gallery.php?pic=' . $res['id'], 'gallery,pic' . $res['id'] . urlformat($res['caption']) . '.html');
        //Nächste Seite
        if ($current['next'] === false) {
            $current['next'] = array('link' => mklink('gallery.php?pic=' . $res['id'], 'gallery,pic' . $res['id'] . urlformat($res['caption']) . '.html'), 'preview' => HTTPDIR . getpath('uploads') . $res['thumbnail']);
        }
        //Vorherige Seite
        if ($_REQUEST['pic'] == $res['id']) {
            $selected = $i;
            $current['next'] = false;
            if ($last) {
                $current['prev'] = array('link' => mklink('gallery.php?pic=' . $last['id'], 'gallery,pic' . $last['id'] . urlformat($last['caption']) . '.html'), 'preview' => HTTPDIR . getpath('uploads') . $last['thumbnail']);
            }
        }
        //Erste Seite
        if ($i == 1) {
            $link_first = mklink('gallery.php?pic=' . $res['id'], 'gallery,pic' . $res['id'] . urlformat($res['caption']) . '.html');
        }
        //Letzte Seite
        if ($i == $pages) {
            $link_last = mklink('gallery.php?pic=' . $res['id'], 'gallery,pic' . $res['id'] . urlformat($res['caption']) . '.html');
        }
        $last = $res;
    }
    $apx->tmpl->assign('PICTURE', $pagedata);
    $apx->tmpl->assign('PICTURE_COUNT', $pages);
    $apx->tmpl->assign('PICTURE_SELECTED', $selected);
    //Vorherige Seite
    if ($current['prev']) {
        $apx->tmpl->assign('PICTURE_PREVIOUS', $current['prev']['link']);
        $apx->tmpl->assign('PICTURE_PREVIOUS_PREVIEW', $current['prev']['preview']);
    }
    //Nächste Seite
    if ($current['next']) {
        $apx->tmpl->assign('PICTURE_NEXT', $current['next']['link']);
        $apx->tmpl->assign('PICTURE_NEXT_PREVIEW', $current['next']['preview']);
    }
    $apx->tmpl->assign('PICTURE_FIRST', $link_first);
    $apx->tmpl->assign('PICTURE_LAST', $link_last);
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:60,代码来源:functions.php

示例2: mediamanager_inline_code

function mediamanager_inline_code($ids)
{
    global $set, $db, $apx;
    $tmpl = new tengine();
    $data = $db->fetch("SELECT id,picture,popup,text,align FROM " . PRE . "_inlinescreens WHERE id IN (" . implode(',', $ids) . ")");
    if (!count($data)) {
        array();
    }
    //Codes generieren
    ob_start();
    $code = array();
    foreach ($data as $res) {
        if ($res['popup']) {
            $size = getimagesize(BASEDIR . getpath('uploads') . $res['popup']);
            $tmpl->assign('POPUP', "javascript:popuppic('misc.php?action=picture&pic=" . $res['popup'] . "','" . $size[0] . "','" . $size[1] . "',0);");
        }
        $tmpl->assign('ID', $res['id']);
        $tmpl->assign('PICTURE', HTTPDIR . getpath('uploads') . $res['picture']);
        $tmpl->assign('FULLSIZE', HTTPDIR . getpath('uploads') . $res['popup']);
        $tmpl->assign('TEXT', $res['text']);
        $tmpl->assign('ALIGN', $res['align']);
        $tmpl->parse('inlinepic', 'main');
        $imagecode = ob_get_contents();
        ob_clean();
        $code[$res['id']] = $imagecode;
    }
    ob_end_clean();
    //Replacement
    $replace = array();
    foreach ($ids as $id) {
        $replace['{IMAGE(' . $id . ')}'] = $code[intval($id)];
    }
    return $replace;
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:34,代码来源:system.php

示例3: langpath

 function langpath($module)
 {
     global $apx;
     if ($module == '/') {
         $this->langdir = getpath('lang_base', array('MODULE' => $module, 'LANGID' => $this->langid()));
     } else {
         $this->langdir = getpath('lang_modules', array('MODULE' => $module, 'LANGID' => $this->langid()));
     }
 }
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:9,代码来源:class.language.php

示例4: misc_picture

function misc_picture()
{
    global $set, $db, $apx;
    if (!$_REQUEST['pic']) {
        die('missing PIC!');
    }
    $apx->tmpl->loaddesign('blank');
    $apx->tmpl->assign('IMAGE', getpath('uploads') . $_REQUEST['pic']);
    $apx->tmpl->parse('showpic', 'main');
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:10,代码来源:misc.php

示例5: misc_videofile

function misc_videofile()
{
    global $set, $db, $apx, $user;
    $_REQUEST['id'] = (int) $_REQUEST['id'];
    if (!$_REQUEST['id']) {
        die('missing ID!');
    }
    if ($set['videos']['regonly'] && !$user->info['userid']) {
        die('video only for registered users!');
    }
    $apx->lang->drop('detail', 'videos');
    //Secure Check
    $res = $db->first("SELECT id,title,file,regonly,`limit`,password,source FROM " . PRE . "_videos WHERE ( id='" . $_REQUEST['id'] . "' " . iif(!$user->is_team_member(), "AND ( '" . time() . "' BETWEEN starttime AND endtime )") . " " . section_filter() . " ) LIMIT 1");
    if (!$res['id']) {
        die('file not found!');
    }
    if ($res['regonly'] && !$user->info['userid']) {
        die('video only for registered users!');
    }
    if (videos_limit_is_reached($res['id'], $res['limit'])) {
        message($apx->lang->get('MSG_LIMITREACHED'), 'back');
    }
    if ($res['password'] && $_POST['password'] != $res['password']) {
        tmessage('pwdrequired', array('ID' => $_REQUEST['id'], 'SECHASH' => $_REQUEST['sechash']), 'videos');
    }
    $checkhash = md5($_SERVER['HTTP_HOST'] . $res['file'] . date('Y/m/d', time() - TIMEDIFF));
    if ($checkhash != $_REQUEST['sechash']) {
        header("HTTP/1.1 301 Moved Permanently");
        header('location:' . str_replace('&', '&', mklink('videos.php?id=' . $_REQUEST['id'], 'videos,id' . $_REQUEST['id'] . urlformat($res['title']) . '.html')));
        exit;
    }
    //Datei downloadbar?
    if (!in_array($res['source'], array('apexx', 'external'))) {
        header("HTTP/1.1 404 Not Found");
        exit;
    }
    //Statistik
    $thefsize = videos_filesize($res);
    videos_insert_stats($res['id'], $thefsize, $res['source'] == 'apexx');
    //Datei senden
    if ($res['source'] == 'external') {
        header("HTTP/1.1 301 Moved Permanently");
        header('location:' . $res['file']);
        exit;
    } else {
        header("HTTP/1.1 301 Moved Permanently");
        header('location:' . HTTPDIR . getpath('uploads') . $res['file']);
        exit;
    }
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:50,代码来源:misc.php

示例6: readout_dir

 function readout_dir($dirname)
 {
     $dirs = array();
     $handle = opendir(BASEDIR . getpath('uploads') . $dirname);
     while ($file = readdir($handle)) {
         if ($file == '.' || $file == '..') {
             continue;
         }
         if (is_dir(BASEDIR . getpath('uploads') . iif($dirname, $dirname . '/') . $file)) {
             $dirs[] = $file;
         }
     }
     closedir($handle);
     return $dirs;
 }
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:15,代码来源:explorer.php

示例7: teaser_show

function teaser_show($count = 0, $start = 0, $group = 0, $template = 'teaser')
{
    global $set, $db, $apx;
    $count = (int) $count;
    $start = (int) $start;
    $group = (int) $group;
    $tmpl = new tengine();
    $groupfilter = '';
    if ($group) {
        $groupfilter = " AND `group`='" . $group . "'";
    }
    if ($set['teaser']['orderby'] == 1) {
        $data = $db->fetch("SELECT id,title,text,link,image,hits FROM " . PRE . "_teaser WHERE '" . time() . "' BETWEEN starttime AND endtime " . $groupfilter . section_filter() . " ORDER BY ord ASC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count));
    } elseif ($set['teaser']['orderby'] == 2) {
        $data = $db->fetch("SELECT id,title,text,link,image,hits FROM " . PRE . "_teaser WHERE '" . time() . "' BETWEEN starttime AND endtime " . $groupfilter . section_filter() . " ORDER BY addtime DESC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count));
    } else {
        $data = $db->fetch("SELECT id,title,text,link,image,hits FROM " . PRE . "_teaser WHERE '" . time() . "' BETWEEN starttime AND endtime" . $groupfilter . section_filter());
        if (count($data)) {
            srand((double) microtime() * 1000000);
            shuffle($data);
            if ($count) {
                foreach ($data as $res) {
                    ++$ii;
                    $newdata[] = $res;
                    if ($ii == $count) {
                        break;
                    }
                }
                $data = $newdata;
                unset($newdata);
            }
        }
    }
    if (count($data)) {
        $apx->lang->drop('teaser', 'teaser');
        foreach ($data as $res) {
            ++$i;
            $affdata[$i]['TITLE'] = $res['title'];
            $affdata[$i]['TEXT'] = $res['text'];
            $affdata[$i]['URL'] = $res['link'];
            $affdata[$i]['IMAGE'] = iif($res['image'], HTTPDIR . getpath('uploads') . $res['image']);
            $affdata[$i]['HITS'] = number_format($res['hits'], 0, '', '.');
            $affdata[$i]['LINK'] = HTTPDIR . 'misc.php?action=teaserlink&id=' . $res['id'];
        }
    }
    $tmpl->assign('TEASER', $affdata);
    $tmpl->parse($template, 'teaser');
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:48,代码来源:tfunctions.php

示例8: products_pic

function products_pic($pic)
{
    global $set, $db, $apx, $user;
    if (!$pic) {
        return array();
    }
    $picture = getpath('uploads') . $pic;
    $poppic = str_replace('-thumb.', '.', $pic);
    if (strpos($pic, '-thumb.') !== false && file_exists(BASEDIR . getpath('uploads') . $poppic)) {
        $size = getimagesize(BASEDIR . getpath('uploads') . $poppic);
        $picture_popup = "javascript:popupwin('misc.php?action=picture&pic=" . $poppic . "','" . $size[0] . "','" . $size[1] . "')";
    } else {
        $poppic = '';
    }
    return array($picture, $picture_popup, iif($poppic, HTTPDIR . getpath('uploads') . $poppic));
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:16,代码来源:functions.php

示例9: upload

 public function upload($name = 'file')
 {
     $this->name = $name;
     if (!is_array($_FILES) || empty($_FILES) || !isset($_FILES[$this->name])) {
         return json_encode(array('code' => '-1', 'msg' => 'no upload file find'));
     }
     $code = 0;
     $msg = 'upload success';
     if ($_FILES[$name]['error'] != 0) {
         $code = $_FILES[$name]['error'];
         switch ($_FILES[$name]['error']) {
             case 1:
             case 2:
                 $msg = 'upload file size not allow';
                 break;
             case 3:
                 $msg = 'File upload only partially';
                 break;
             case 4:
                 $msg = 'No file was uploaded';
                 break;
             case 5:
                 $msg = 'Upload file size is 0';
                 break;
             default:
                 $msg = 'Unknown error';
                 break;
         }
     }
     if ($code != 0) {
         return json_encode(array('code' => $code, 'msg' => $msg));
     }
     if (!is_uploaded_file($_FILES[$name]['tmp_name'])) {
         return json_encode(array('code' => -2, 'msg' => 'this file not uploaded file'));
     }
     if (!in_array(substr($_FILES[$name]['name'], strrpos($_FILES[$name]['name'], '.') + 1), $this->ext)) {
         return json_encode(array('code' => -2, 'msg' => 'this file extension not allow'));
     }
     $file = $this->file_path . md5(microtime()) . substr($_FILES[$name]['name'], strrpos($_FILES[$name]['name'], '.'));
     $ret = move_uploaded_file($_FILES[$name]['tmp_name'], $file);
     if (!$ret) {
         return json_encode(array('code' => -3, 'msg' => 'move uploaded file failed'));
     } else {
         return json_encode(array('code' => 0, 'msg' => 'upload success', 'file' => getpath($file)));
     }
 }
开发者ID:koycloud,项目名称:rain-php-framework,代码行数:46,代码来源:Upload.php

示例10: affiliates_show

function affiliates_show($count = 0, $start = 0, $template = 'affiliates')
{
    global $set, $db, $apx;
    $count = (int) $count;
    $start = (int) $start;
    $tmpl = new tengine();
    if ($set['affiliates']['orderby'] == 1) {
        $data = $db->fetch("SELECT id,title,image,link,hits FROM " . PRE . "_affiliates WHERE active='1' ORDER BY ord ASC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count));
    } elseif ($set['affiliates']['orderby'] == 2) {
        $data = $db->fetch("SELECT id,title,image,link,hits FROM " . PRE . "_affiliates WHERE active='1' ORDER BY hits DESC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count));
    } elseif ($set['affiliates']['orderby'] == 3) {
        $data = $db->fetch("SELECT id,title,image,link,hits FROM " . PRE . "_affiliates WHERE active='1' ORDER BY hits ASC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count));
    } else {
        $data = $db->fetch("SELECT id,title,image,hits FROM " . PRE . "_affiliates WHERE active='1'");
        if (count($data)) {
            srand((double) microtime() * 1000000);
            shuffle($data);
            if ($count) {
                foreach ($data as $res) {
                    ++$ii;
                    $newdata[] = $res;
                    if ($ii == $count) {
                        break;
                    }
                }
                $data = $newdata;
                unset($newdata);
            }
        }
    }
    if (count($data)) {
        $apx->lang->drop('affiliates', 'affiliates');
        foreach ($data as $res) {
            ++$i;
            $affdata[$i]['TITLE'] = $res['title'];
            $affdata[$i]['IMAGE'] = iif($res['image'], getpath('uploads') . $res['image']);
            $affdata[$i]['HITS'] = number_format($res['hits'], 0, '', '.');
            $affdata[$i]['LINK'] = HTTPDIR . 'misc.php?action=afflink&id=' . $res['id'];
            $affdata[$i]['URL'] = $res['link'];
        }
    }
    $tmpl->assign('AFFILIATE', $affdata);
    $tmpl->parse($template, 'affiliates');
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:44,代码来源:tfunctions.php

示例11: cron_clean

function cron_clean($lastexec)
{
    global $set, $db, $apx;
    $now = time();
    $db->query("DELETE FROM " . PRE . "_forum_activity WHERE time<='" . ($now - 3600) . "'");
    //1 Stunde
    $db->query("DELETE FROM " . PRE . "_forum_search WHERE time<='" . ($now - 24 * 3600) . "'");
    //24 Stunden
    //Anhänge löschen
    $data = $db->fetch("SELECT file FROM " . PRE . "_forum_attachments WHERE postid=0 AND time<='" . ($now - 24 * 3600) . "'");
    if (count($data)) {
        foreach ($data as $res) {
            if (file_exists(BASEDIR . getpath('uploads') . $res['file'])) {
                @unlink(BASEDIR . getpath('uploads') . $res['file']);
            }
        }
    }
    $db->query("DELETE FROM " . PRE . "_forum_attachments WHERE postid=0 AND time<='" . ($now - 24 * 3600) . "'");
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:19,代码来源:cron.php

示例12: cron_clear_cache

function cron_clear_cache($lastexec)
{
    global $db, $set;
    $handle = opendir(BASEDIR . getpath('cache'));
    while ($file = readdir($handle)) {
        if ($file == '.' || $file == '..') {
            continue;
        }
        //Datei löschen, wenn älter als 7 Tage
        $lastchange = filemtime(BASEDIR . getpath('cache') . $file);
        if ($lastchange + 7 * 24 * 3600 + 3600 < time()) {
            //7 Tage + 1 Std.
            unlink(BASEDIR . getpath('cache') . $file);
        }
    }
    closedir($handle);
    //Captchas löschen
    $now = time();
    $data = $db->fetch("SELECT hash FROM " . PRE . "_captcha WHERE time<=" . ($now - 3600));
    $db->fetch("DELETE FROM " . PRE . "_captcha WHERE time<=" . ($now - 3600));
    foreach ($data as $res) {
        @unlink(BASEDIR . getpath('uploads') . 'temp/captcha_' . $res['hash'] . '.png');
    }
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:24,代码来源:cron.php

示例13: elseif

     $file = '';
     $flvfile = '';
     $dllink = '';
 } elseif ($res['source'] == 'external') {
     $embedcode = '';
     $flvfile = $res['flvfile'];
     if ($res['file']) {
         $file = $res['file'];
     } else {
         $dllink = '';
     }
 } else {
     $embedcode = '';
     $flvfile = HTTPDIR . getpath('uploads') . $res['flvfile'];
     if ($res['file']) {
         $file = HTTP_HOST . HTTPDIR . getpath('uploads') . $res['file'];
     } else {
         $dllink = '';
     }
 }
 $tabledata[$i]['ID'] = $res['id'];
 $tabledata[$i]['SECID'] = $res['secid'];
 $tabledata[$i]['USERID'] = $res['userid'];
 $tabledata[$i]['USERNAME'] = replace($uploader);
 $tabledata[$i]['EMAIL'] = replace($uploader_email);
 $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($uploader_email));
 $tabledata[$i]['TITLE'] = $res['title'];
 $tabledata[$i]['TEXT'] = $text;
 $tabledata[$i]['LINK'] = $link;
 $tabledata[$i]['PICTURE'] = $picture;
 $tabledata[$i]['PICTURE_POPUP'] = $picture_popup;
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:31,代码来源:videos.php

示例14: define

|                 ============================                  |
|           (c) Copyright 2005-2009, Christian Scheb            |
|                  http://www.stylemotion.de                    |
|                                                               |
|---------------------------------------------------------------|
| THIS SOFTWARE IS NOT FREE! MAKE SURE YOU OWN A VALID LICENSE! |
| DO NOT REMOVE ANY COPYRIGHTS WITHOUT PERMISSION!              |
| SOFTWARE BELONGS TO ITS AUTHORS!                              |
\***************************************************************/
define('APXRUN', true);
////////////////////////////////////////////////////////////////////////////////////////////////////////
require 'includes/_start.php';
/////////////////////////////////////////////////////// SYSTEMSTART ///
////////////////////////////////////////////////////////////////////////////////////////////////////////
$apx->tmpl->loaddesign('blank');
list($module, $func) = explode('.', $_REQUEST['action'], 2);
if (file_exists(BASEDIR . getpath('module', array('MODULE' => $module)) . 'admin_ajax.php')) {
    include_once BASEDIR . getpath('module', array('MODULE' => $module)) . 'admin_ajax.php';
    $call = $func;
    if (function_exists($call)) {
        $call();
    } else {
        echo 'function does not exist!';
    }
} else {
    echo 'ajax-file does not exist!';
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
require 'includes/_end.php';
////////////////////////////////////////////////////// SCRIPT BEENDEN ///
////////////////////////////////////////////////////////////////////////////////////////////////////////
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:31,代码来源:ajax.php

示例15: copy_with_thumbnail

function copy_with_thumbnail($oldImage, $newImage)
{
    $oldPoppic = str_replace('-thumb.', '.', $oldImage);
    $newPoppic = str_replace('-thumb.', '.', $newImage);
    if ($oldImage && file_exists(BASEDIR . getpath('uploads') . $oldImage)) {
        copy(BASEDIR . getpath('uploads') . $oldImage, BASEDIR . getpath('uploads') . $newImage);
        if ($oldPoppic && file_exists(BASEDIR . getpath('uploads') . $oldPoppic)) {
            copy(BASEDIR . getpath('uploads') . $oldPoppic, BASEDIR . getpath('uploads') . $newPoppic);
        }
        return true;
    }
    return false;
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:13,代码来源:functions.admin.php


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