本文整理汇总了PHP中getpath函数的典型用法代码示例。如果您正苦于以下问题:PHP getpath函数的具体用法?PHP getpath怎么用?PHP getpath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getpath函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: clear_cache
function clear_cache()
{
global $db;
$data = $db->fetch("SELECT id,hash FROM " . PRE . "_captcha WHERE time<='" . (time() - 3600) . "'");
if (count($data)) {
$idlist = array();
foreach ($data as $res) {
@unlink(BASEDIR . getpath('uploads') . 'temp/captcha_' . $res['hash'] . '.png');
if (!file_exists(BASEDIR . getpath('uploads') . 'temp/captcha_' . $res['hash'] . '.png')) {
$idlist[] = $res['id'];
}
}
$db->query("DELETE FROM " . PRE . "_captcha WHERE id IN (" . implode(',', $idlist) . ")");
}
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:15,代码来源:class.captcha.v2.php
示例17: sendmail
sendmail($_POST['email'], 'REG', $input);
message($apx->lang->get('MSG_OK'), mklink('user.php', 'user.html'));
}
}
} elseif (!$set['user']['acceptrules'] || $_POST['accept']) {
//Sprachen
$langlist = '<option value="">' . $apx->lang->get('USEDEFAULT') . '</option>';
foreach ($apx->languages as $id => $name) {
$langlist .= '<option value="' . $id . '"' . iif($user->info['pub_lang'] == $id, ' selected="selected"') . '>' . replace($name) . '</option>';
++$i;
$langdata[$i] = array('ID' => $id, 'TITLE' => $name);
}
//Themes
$handle = opendir(BASEDIR . getpath('tmpldir'));
while ($file = readdir($handle)) {
if ($file == '.' || $file == '..' || !is_dir(BASEDIR . getpath('tmpldir') . $file)) {
continue;
}
$themes[] = $file;
}
closedir($handle);
sort($themes);
$themelist = '<option value="">' . $apx->lang->get('USEDEFAULT') . '</option>';
foreach ($themes as $themeid) {
$themelist .= '<option value="' . $themeid . '"' . iif($themeid == $user->info['pub_theme'], ' selected="selected"') . '>' . $themeid . '</option>';
++$i;
$themedata[$i] = array('ID' => $themeid, 'TITLE' => $themeid);
}
//Custom-Felder
for ($i = 1; $i <= 10; $i++) {
$apx->tmpl->assign('CUSTOM' . $i . '_NAME', $set['user']['cusfield_names'][$i - 1]);
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:31,代码来源:register.php
示例18: clean
function clean()
{
global $set, $db, $apx;
$_REQUEST['id'] = (int) $_REQUEST['id'];
if (!$_REQUEST['id']) {
die('missing ID!');
}
$_POST['moveto'] = (int) $_POST['moveto'];
$finfo = $this->cat->getNode($_REQUEST['id'], explode(',', 'threads,posts,lastposter,lastposter_userid,lastposttime'));
if ($_POST['send'] == 1 && $_POST['moveto'] >= 0) {
if (!checkToken()) {
printInvalidToken();
} else {
//Nur was machen, wenn das Zielforum ein anderes ist
if (intval($_POST['moveto']) && $_POST['moveto'] != $_REQUEST['id']) {
//Lastpost überschreiben oder nicht?
$setvalues = "threads=threads+" . $finfo['threads'] . ",posts=posts+" . $finfo['posts'] . ",";
$setvalues .= "lastposter=IF(lastposttime<'" . $finfo['lastposttime'] . "','" . $finfo['lastposter'] . "',lastposter),lastposter_userid=IF(lastposttime<'" . $finfo['lastposttime'] . "','" . $finfo['lastposter_userid'] . "',lastposter_userid),lastposttime=IF(lastposttime<'" . $finfo['lastposttime'] . "','" . $finfo['lastposttime'] . "',lastposttime)";
//Postings und Threads aktualisieren
$db->query("UPDATE " . PRE . "_forums SET " . $setvalues . " WHERE forumid='" . $_POST['moveto'] . "' LIMIT 1");
$db->query("UPDATE " . PRE . "_forums SET threads=0,posts=0,lastposter='',lastposter_userid='',lastposttime=0 WHERE forumid='" . $_REQUEST['id'] . "' LIMIT 1");
$db->query("UPDATE " . PRE . "_forum_threads SET forumid='" . $_POST['moveto'] . "' WHERE forumid='" . $_REQUEST['id'] . "'");
logit('FORUM_CLEAN', 'ID #' . $_REQUEST['id']);
//Forum löschen
if ($_POST['delforum'] && !$finfo['children']) {
$this->cat->deleteNode($_REQUEST['id']);
logit('FORUM_DEL', "ID #" . $_REQUEST['id']);
}
} elseif (!intval($_POST['moveto'])) {
//Themen und unwiderruflich Beiträge löschen
$threaddata = $db->fetch("SELECT threadid FROM " . PRE . "_forum_threads WHERE forumid='" . $_REQUEST['id'] . "'");
$threadIds = get_ids($threaddata, 'threadid');
if ($threadIds) {
//Anhänge löschen
$data = $db->fetch("\n\t\t\t\t\t\tSELECT a.id, a.file\n\t\t\t\t\t\tFROM " . PRE . "_forum_attachments AS a\n\t\t\t\t\t\tLEFT JOIN " . PRE . "_forum_posts AS p USING(postid)\n\t\t\t\t\t\tWHERE p.threadid IN (" . implode(',', $threadIds) . ")\n\t\t\t\t\t");
$attIds = get_ids($data, 'id');
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 id IN (" . implode(',', $attIds) . ")");
}
$db->query("DELETE FROM " . PRE . "_forum_threads WHERE threadid IN (" . implode(',', $threadIds) . ")");
$db->query("DELETE FROM " . PRE . "_forum_posts WHERE threadid IN (" . implode(',', $threadIds) . ")");
$db->query("DELETE FROM " . PRE . "_forum_index WHERE threadid IN (" . implode(',', $threadIds) . ")");
}
//Forum aktualisieren
$db->query("UPDATE " . PRE . "_forums SET threads=0,posts=0,lastposter='',lastposter_userid='',lastposttime=0 WHERE forumid='" . $_REQUEST['id'] . "' LIMIT 1");
//Forum löschen
if ($_POST['delforum']) {
$this->cat->deleteNode($_REQUEST['id']);
logit('FORUM_DEL', "ID #" . $_REQUEST['id']);
}
}
logit('FORUM_CLEAN', "ID #" . $_REQUEST['id']);
printJSRedirect(get_index('forum.show'));
}
} else {
//Foren auflisten
$data = $this->cat->getTree(array('title', 'iscat', 'link'));
if (count($data)) {
foreach ($data as $res) {
if ($res['level'] > 1) {
$space = str_repeat(' ', $res['level'] - 1);
} else {
$space = '';
}
if ($res['iscat']) {
$style = ' style="background:#EAEAEA;color:#2B2B2B;" disabled="disabled"';
} else {
$style = '';
}
$forumlist .= '<option value="' . iif(!$res['iscat'] && !$res['link'], $res['forumid'], '-1') . '"' . $style . '' . iif($_POST['moveto'] == $res['forumid'], ' selected="selected"') . '>' . $space . replace($res['title']) . '</option>';
}
}
list($title) = $db->first("SELECT title FROM " . PRE . "_forums WHERE forumid='" . $_REQUEST['id'] . "' LIMIT 1");
$apx->tmpl->assign('ID', $_REQUEST['id']);
$apx->tmpl->assign('TITLE', compatible_hsc($title));
$apx->tmpl->assign('DELFORUM', (int) $_POST['delforum']);
$apx->tmpl->assign('DELABLE', $finfo['children'] == '|');
$apx->tmpl->assign('FORUMLIST', $forumlist);
tmessageOverlay('clean');
}
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:86,代码来源:admin.php
示例19: count
/* Postingzahlen der Benutzer nicht verringern => Postings wurden vielleicht gar nicht gezählt
$data=$db->fetch("SELECT count(postid) AS posts,userid FROM ".PRE."_forum_posts WHERE ( threadid='".$threadinfo['threadid']."' AND userid!=0 AND del=0 )");
if ( count($data) ) {
foreach ( $data AS $res ) {
$db->query("UPDATE ".PRE."_user SET forum_posts=forum_posts-".$res['posts']." WHERE userid='".$res['userid']."' LIMIT 1");
}
}*/
//Thema und Beiträge löschen
if ($_POST['realdel'] && $user->info['userid'] && ($user->is_admin() || in_array($user->info['userid'], $foruminfo['moderator']))) {
//Anhänge löschen
$data = $db->fetch("\n\t\t\t\tSELECT a.id, a.file\n\t\t\t\tFROM " . PRE . "_forum_attachments AS a\n\t\t\t\tLEFT JOIN " . PRE . "_forum_posts AS p USING(postid)\n\t\t\t\tWHERE p.threadid='" . $threadinfo['threadid'] . "'\n\t\t\t");
$attIds = get_ids($data, 'id');
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 id IN (" . implode(',', $attIds) . ")");
}
//SQL löschen
$db->query("DELETE FROM " . PRE . "_forum_threads WHERE threadid='" . $threadinfo['threadid'] . "' LIMIT 1");
$db->query("DELETE FROM " . PRE . "_forum_threads WHERE moved='" . $threadinfo['threadid'] . "' LIMIT 1");
$db->query("DELETE FROM " . PRE . "_forum_posts WHERE threadid='" . $threadinfo['threadid'] . "'");
} else {
$db->query("UPDATE " . PRE . "_forum_threads SET del=1 WHERE threadid='" . $threadinfo['threadid'] . "' LIMIT 1");
$db->query("DELETE FROM " . PRE . "_forum_threads WHERE moved='" . $threadinfo['threadid'] . "' LIMIT 1");
//Beiträge werden nicht explizit als gelöscht markiert
//So ist Wiederherstellung im Ursprungszustand möglich!
//$db->query("UPDATE ".PRE."_forum_posts SET del=1 WHERE threadid='".$threadinfo['threadid']."'");
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:31,代码来源:admin.php
示例20: str_replace
$template = $_REQUEST['show'];
$template = str_replace('/', '', $template);
$template = str_replace('\\', '', $template);
$template = str_replace('.', '/', $template);
if (file_exists(BASEDIR . getpath('tmpl_modules_public', array('MODULE' => 'content', 'THEME' => $apx->tmpl->theme)) . $template . '.html')) {
$apx->tmpl->parse($template);
} else {
filenotfound();
}
} elseif ($_REQUEST['inc']) {
$template = $_REQUEST['inc'];
$template = str_replace('/', '', $template);
$template = str_replace('\\', '', $template);
$filepath = str_replace('.', '/', $template) . '.php';
if (file_exists(BASEDIR . getpath('content') . $filepath)) {
include BASEDIR . getpath('content') . $filepath;
} else {
filenotfound();
}
} elseif ($apx->is_module('comments') && $_REQUEST['id'] && $_REQUEST['comments']) {
$res = $db->first("SELECT title FROM " . PRE . "_content AS a WHERE ( id='" . $_REQUEST['id'] . "' AND active='1' " . section_filter() . " ) LIMIT 1");
//Titel
$tt = explode('->', $res['title']);
$number = count($tt);
foreach ($tt as $one) {
++$hi;
if ($number == $hi) {
headline(trim($one), str_replace('&', '&', $_SERVER['REQUEST_URI']));
} else {
headline(trim($one));
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:31,代码来源:content.php
注:本文中的getpath函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论