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

PHP XoopsLogger类代码示例

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

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



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

示例1: ucfirst

 /**
  * Get a reference to the only instance of database class and connects to DB
  * 
  * if the class has not been instantiated yet, this will also take 
  * care of that
  * 
  * @static
  * @staticvar   object  The only instance of database class
  * @return      object  Reference to the only instance of database class
  */
 function &getDatabaseConnection()
 {
     static $instance;
     if (!isset($instance)) {
         $file = XOOPS_ROOT_PATH . '/class/database/' . XOOPS_DB_TYPE . 'database.php';
         require_once $file;
         /* patch from */
         if (defined('XOOPS_DB_ALTERNATIVE') && class_exists(XOOPS_DB_ALTERNATIVE)) {
             $class = XOOPS_DB_ALTERNATIVE;
         } else {
             /* patch to */
             if (!defined('XOOPS_DB_PROXY')) {
                 $class = 'Xoops' . ucfirst(XOOPS_DB_TYPE) . 'DatabaseSafe';
             } else {
                 $class = 'Xoops' . ucfirst(XOOPS_DB_TYPE) . 'DatabaseProxy';
             }
         }
         $instance =& new $class();
         $instance->setLogger(XoopsLogger::instance());
         $instance->setPrefix(XOOPS_DB_PREFIX);
         if (!$instance->connect()) {
             trigger_error("notrace:Unable to connect to database", E_USER_ERROR);
         }
     }
     return $instance;
 }
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:36,代码来源:databasefactory.php


示例2: test___class

 public function test___class()
 {
     $instance = XoopsLogger::getInstance();
     $this->assertInstanceOf($this->myclass, $instance);
     $value = $instance->tutu('tutu');
     $this->assertSame(null, $value);
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:7,代码来源:xoopsloggerTest.php


示例3: ucfirst

 /**
  * Get a reference to the only instance of database class and connects to DB
  *
  * if the class has not been instantiated yet, this will also take
  * care of that
  *
  * @static
  * @staticvar object  The only instance of database class
  * @return object Reference to the only instance of database class
  */
 static function &getDatabaseConnection()
 {
     static $instance;
     if (!isset($instance)) {
         if (file_exists($file = XOOPS_ROOT_PATH . '/class/database/' . XOOPS_DB_TYPE . 'database.php')) {
             require_once $file;
             if (!defined('XOOPS_DB_PROXY')) {
                 $class = 'Xoops' . ucfirst(XOOPS_DB_TYPE) . 'DatabaseSafe';
             } else {
                 $class = 'Xoops' . ucfirst(XOOPS_DB_TYPE) . 'DatabaseProxy';
             }
             $xoopsPreload =& XoopsPreload::getInstance();
             $xoopsPreload->triggerEvent('core.class.database.databasefactory.connection', array(&$class));
             $instance = new $class();
             $instance->setLogger(XoopsLogger::getInstance());
             $instance->setPrefix(XOOPS_DB_PREFIX);
             if (!$instance->connect()) {
                 trigger_error('notrace:Unable to connect to database', E_USER_ERROR);
             }
         } else {
             trigger_error('notrace:Failed to load database of type: ' . XOOPS_DB_TYPE . ' in file: ' . __FILE__ . ' at line ' . __LINE__, E_USER_WARNING);
         }
     }
     return $instance;
 }
开发者ID:RanLee,项目名称:Xoops_demo,代码行数:35,代码来源:databasefactory.php


示例4: _setupLogger

 function _setupLogger()
 {
     require_once XOOPS_ROOT_PATH . '/class/logger.php';
     $this->mLogger =& XoopsLogger::instance();
     $this->mLogger->startTime();
     $GLOBALS['xoopsLogger'] =& $this->mLogger;
 }
开发者ID:nouphet,项目名称:rata,代码行数:7,代码来源:Legacy_Controller.class.php


示例5: get_modules_ajax

function get_modules_ajax()
{
    XoopsLogger::getInstance()->activated = false;
    XoopsLogger::getInstance()->renderingEnabled = false;
    $db = Database::getInstance();
    $sql = "SELECT COUNT(*) FROM " . $db->prefix("modules");
    $page = rmc_server_var($_POST, 'page', 1);
    $limit = RMFunctions::configs('mods_number');
    list($num) = $db->fetchRow($db->query($sql));
    $tpages = ceil($num / $limit);
    $page = $page > $tpages ? $tpages : $page;
    $start = $num <= 0 ? 0 : ($page - 1) * $limit;
    $nav = new RMPageNav($num, $limit, $page, 5);
    $nav->target_url('javascript:;" onclick="get_mods_page({PAGE_NUM})');
    $sql = 'SELECT * FROM ' . $db->prefix('modules') . " ORDER BY mid, weight LIMIT {$start},{$limit}";
    $result = $db->query($sql);
    $installed_mods = array();
    while ($row = $db->fetchArray($result)) {
        $mod = new XoopsModule();
        $mod->assignVars($row);
        $installed_mods[] = $mod;
    }
    include RMTemplate::get()->get_template('rmc_mods_installed.php', 'module', 'rmcommon');
    die;
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:25,代码来源:index.php


示例6: footer

 public function footer()
 {
     global $xoopsConfig, $xoopsOption, $xoopsTpl, $xoTheme, $rmc_config, $xoopsModule;
     $xoopsLogger =& XoopsLogger::getInstance();
     $xoopsLogger->stopTime('Module display');
     if (!headers_sent()) {
         header('Content-Type:text/html; charset=' . _CHARSET);
         header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
         header('Cache-Control: private, no-cache');
         header("Cache-Control: post-check=0, pre-check=0", false);
         header('Pragma: no-cache');
     }
     //@internal: using global $xoTheme dereferences the variable in old versions, this does not
     //if (!isset($xoTheme)) $xoTheme =& $GLOBALS['xoTheme'];
     if (!isset($xoTheme)) {
         $xoTheme =& $GLOBALS['xoTheme'];
     }
     if (isset($xoopsOption['template_main']) && $xoopsOption['template_main'] != $xoTheme->contentTemplate) {
         trigger_error("xoopsOption[template_main] should be defined before call xoops_cp_header function", E_USER_WARNING);
         if (false === strpos($xoopsOption['template_main'], ':')) {
             $xoTheme->contentTemplate = 'db:' . $xoopsOption['template_main'];
         } else {
             $xoTheme->contentTemplate = $xoopsOption['template_main'];
         }
     }
     $metas = $xoTheme->metas['script'];
     $xoTheme->metas['script'] = array();
     foreach ($metas as $id => $meta) {
         if (strpos($id, 'jquery/jquery.js') === FALSE && strpos($id, 'jquery/plugins/jquery.ui.js') === FALSE) {
             $xoTheme->metas['script'][$id] = $meta;
         }
     }
     // Check if current theme have a replacement for template
     if (preg_match("/^db:(.*)/i", $xoTheme->contentTemplate, $match)) {
         $file = RMCPATH . '/themes/' . $rmc_config['theme'] . '/modules/' . $xoopsModule->dirname() . '/' . $match[1];
         if (is_file($file)) {
             $xoTheme->contentTemplate = $file;
         }
     }
     $xoTheme->render();
     $xoopsLogger->stopTime();
     // RMCommon Templates
     RMTemplate::get()->footer();
     die;
 }
开发者ID:txmodxoops,项目名称:rmcommon,代码行数:45,代码来源:redmexico.php


示例7: footer

 function footer()
 {
     global $xoopsConfig, $xoopsOption, $xoopsTpl, $xoTheme;
     $xoopsLogger =& XoopsLogger::getInstance();
     $xoopsLogger->stopTime('Module display');
     if (!headers_sent()) {
         header('Content-Type:text/html; charset=' . _CHARSET);
         header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
         header('Cache-Control: private, no-cache');
         header('Pragma: no-cache');
     }
     //@internal: using global $xoTheme dereferences the variable in old versions, this does not
     if (!isset($xoTheme)) {
         $xoTheme =& $GLOBALS['xoTheme'];
     }
     $xoTheme->render();
     $xoopsLogger->stopTime();
     ob_end_flush();
 }
开发者ID:gauravsaxena21,项目名称:simantz,代码行数:19,代码来源:gui.php


示例8: smarty_block_freeBlkTpl

/**
 * @package     smarty xoopsplugin
 * 
 * @author	    Hu Zhenghui <[email protected]>
 *  
 * how to use
 * The following code inserted in the template
 *  
 * @param module string module dirname
 * @param file  string block funciton file
 * @param show_func string show block function
 * @param options= string show block function's option
 * @param cachetime int  cachetime Unit for seconds 
 * @param user mix Generate cache solution

<{freeBlkTpl id=1}>
    <link rel="stylesheet" href="<{$xoops_url}>/modules/tag/templates/style.css" />
    <div class="tag-cloud" style="line-height: 150%; padding: 5px;">
    <{foreach item=tag from=$block.tags}>
    	<span class="tag-level-<{$tag.level}>" style="font-size: <{$tag.font}>%; display: inline; padding-right: 5px;">
    		<a href="<{$xoops_url}>/modules/<{$block.tag_dirname}>/view.tag.php<{$smarty.const.URL_DELIMITER}><{$tag.id}>/" title="<{$tag.term}>"><{$tag.term}></a>
    	</span>
    <{/foreach}>
    </div>
<{/freeBlkTpl}>
*/
function smarty_block_freeBlkTpl($params, $content, &$smarty, &$repeat)
{
    static $old_block;
    if (empty($content)) {
        $old_block = $smarty->get_template_vars('block');
        if (!isset($params['id'])) {
            return;
        }
        $block_id = intval($params['id']);
        static $block_objs;
        $blockObj = $GLOBALS['xoopsTpl']->_tpl_vars['ezblocks'][$block_id];
        // ezsky hack
        if (empty($blockObj)) {
            return false;
        }
        $xoopsLogger =& XoopsLogger::instance();
        $template =& $GLOBALS['xoopsTpl'];
        xoops_load("cache");
        $cache_key = 'xoBlkTpl_' . md5(var_export($params, true));
        $bcachetime = intval($blockObj->getVar('bcachetime'));
        if (!$bcachetime || !($bresult = XoopsCache::read($cache_key))) {
            $xoopsLogger->addBlock($blockObj->getVar('name'));
            if (!($bresult = $blockObj->buildBlock())) {
                return;
            }
            if (isset($bcachetime)) {
                XoopsCache::write($cache_key, $bresult, $bcachetime);
            }
        } else {
            $xoopsLogger->addBlock($blockObj->getVar('name'), true, $bcachetime);
        }
        $old_block = $smarty->get_template_vars('block');
        $smarty->assign('block', $bresult);
    } else {
        echo $content;
        $smarty->assign('block', $old_block);
    }
}
开发者ID:yunsite,项目名称:xoopsdc,代码行数:64,代码来源:block.freeBlkTpl.php


示例9: smarty_function_freeBlock

/**
 * XOOPS Block management
 * 
 * @copyright   The XOOPS project http://www.xoops.org/
 * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package     smarty xoopsplugin
 * @since       2.3.3 ezsky hack
 * @author      ezsky <[email protected]> 
 * @version     $Id: function.block.php $
 * @package     smarty xoops plugin
 *  Examples:
 *  <{freeBlock id=1}>                   displays just the block content 
 */
function smarty_function_freeBlock($params, &$smarty)
{
    if (!isset($params['id'])) {
        return;
    }
    $block_id = intval($params['id']);
    static $block_objs;
    $blockObjs = $smarty->get_template_vars('ezblocks');
    // ezsky hack
    $blockObj = $blockObjs[$block_id];
    if (empty($blockObj)) {
        return false;
    }
    $xoopsLogger =& XoopsLogger::instance();
    $template =& $GLOBALS['xoopsTpl'];
    $bcachetime = intval($blockObj->getVar('bcachetime'));
    if (empty($bcachetime)) {
        $template->caching = 0;
    } else {
        $template->caching = 2;
        $template->cache_lifetime = $bcachetime;
    }
    $template->setCompileId($blockObj->getVar('dirname', 'n'));
    $tplName = ($tplName = $blockObj->getVar('template')) ? "db:{$tplName}" : "db:system_block_dummy.html";
    $cacheid = 'blk_' . $block_id;
    if (!$bcachetime || !$template->is_cached($tplName, $cacheid)) {
        $xoopsLogger->addBlock($blockObj->getVar('name'));
        if (!($bresult = $blockObj->buildBlock())) {
            return;
        }
        $template->assign('block', $bresult);
        $template->display($tplName, $cacheid);
    } else {
        $xoopsLogger->addBlock($blockObj->getVar('name'), true, $bcachetime);
        $template->display($tplName, $cacheid);
    }
    $template->setCompileId($blockObj->getVar('dirname', 'n'));
}
开发者ID:yunsite,项目名称:xoopsdc,代码行数:51,代码来源:function.freeBlock.php


示例10: instance

 /**
  * Deprecated, use getInstance() instead
  */
 public function instance()
 {
     return XoopsLogger::getInstance();
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:7,代码来源:xoopslogger.php


示例11: footer

 public function footer()
 {
     global $xoopsConfig, $xoopsOption, $xoopsTpl, $xoTheme;
     $xoopsLogger = XoopsLogger::getInstance();
     $xoopsLogger->stopTime('Module display');
     if (!headers_sent()) {
         header('Content-Type:text/html; charset=' . _CHARSET);
         header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
         header('Cache-Control: private, no-cache');
         header('Pragma: no-cache');
     }
     //@internal: using global $xoTheme dereferences the variable in old versions, this does not
     if (!isset($xoTheme)) {
         $xoTheme = $GLOBALS['xoTheme'];
     }
     if (isset($GLOBALS['xoopsOption']['template_main']) && $GLOBALS['xoopsOption']['template_main'] != $xoTheme->contentTemplate) {
         trigger_error('xoopsOption[template_main] should be defined before call xoops_cp_header function', E_USER_WARNING);
         if (false === strpos($GLOBALS['xoopsOption']['template_main'], ':')) {
             $xoTheme->contentTemplate = 'db:' . $GLOBALS['xoopsOption']['template_main'];
         } else {
             $xoTheme->contentTemplate = $GLOBALS['xoopsOption']['template_main'];
         }
     }
     $xoTheme->render();
     $xoopsLogger->stopTime();
     ob_end_flush();
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:27,代码来源:gui.php


示例12: buildBlock

 /**
  * xos_logos_PageBuilder::buildBlock()
  *
  * @param mixed $xobject
  * @param mixed $template
  * @return
  */
 function buildBlock($xobject, &$template)
 {
     // The lame type workaround will change
     // bid is added temporarily as workaround for specific block manipulation
     $block = array('id' => $xobject->getVar('bid'), 'module' => $xobject->getVar('dirname'), 'title' => $xobject->getVar('title'), 'weight' => $xobject->getVar('weight'), 'lastmod' => $xobject->getVar('last_modified'));
     $bcachetime = intval($xobject->getVar('bcachetime'));
     if (empty($bcachetime)) {
         $template->caching = 0;
     } else {
         $template->caching = 2;
         $template->cache_lifetime = $bcachetime;
     }
     $template->setCompileId($xobject->getVar('dirname', 'n'));
     $tplName = ($tplName = $xobject->getVar('template')) ? "db:{$tplName}" : 'db:system_block_dummy.html';
     $cacheid = $this->generateCacheId('blk_' . $xobject->getVar('bid'));
     $xoopsLogger =& XoopsLogger::getInstance();
     if (!$bcachetime || !$template->is_cached($tplName, $cacheid)) {
         //Get theme metas
         if ($this->theme && $bcachetime) {
             foreach ($this->theme->metas as $type => $value) {
                 $old[$type] = $this->theme->metas[$type];
             }
         }
         //build block
         $xoopsLogger->addBlock($xobject->getVar('name'));
         if ($bresult = $xobject->buildBlock()) {
             $template->assign('block', $bresult);
             $block['content'] = $template->fetch($tplName, $cacheid);
         } else {
             $block = false;
         }
         //check if theme added new metas
         if ($this->theme && $bcachetime) {
             $metas = array();
             foreach ($this->theme->metas as $type => $value) {
                 $dif = array_diff_assoc($this->theme->metas[$type], $old[$type]);
                 if (count($dif)) {
                     $metas[$type] = $dif;
                 }
             }
             if (count($metas)) {
                 xoops_load('xoopscache');
                 $cache =& XoopsCache::getInstance();
                 $cache->write($cacheid, $metas);
             }
         }
     } else {
         $xoopsLogger->addBlock($xobject->getVar('name'), true, $bcachetime);
         $block['content'] = $template->fetch($tplName, $cacheid);
     }
     //add block cached metas
     if ($this->theme && $bcachetime) {
         xoops_load('xoopscache');
         $cache =& XoopsCache::getInstance();
         if ($metas = $cache->read($cacheid)) {
             foreach ($metas as $type => $value) {
                 $this->theme->metas[$type] = array_merge($this->theme->metas[$type], $metas[$type]);
             }
         }
     }
     $template->setCompileId();
     return $block;
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:70,代码来源:theme_blocks.php


示例13: make_cblock

function make_cblock()
{
    global $xoopsUser, $xoopsOption;
    $xoopsblock = new XoopsBlock();
    $cc_block = $cl_block = $cr_block = "";
    $arr = array();
    if ($xoopsOption['theme_use_smarty'] == 0) {
        if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) {
            include_once XOOPS_ROOT_PATH . '/class/template.php';
            $xoopsTpl = new XoopsTpl();
        } else {
            $xoopsTpl =& $GLOBALS['xoopsTpl'];
        }
        if (is_object($xoopsUser)) {
            $block_arr = $xoopsblock->getAllBlocksByGroup($xoopsUser->getGroups(), true, XOOPS_CENTERBLOCK_ALL, XOOPS_BLOCK_VISIBLE);
        } else {
            $block_arr = $xoopsblock->getAllBlocksByGroup(XOOPS_GROUP_ANONYMOUS, true, XOOPS_CENTERBLOCK_ALL, XOOPS_BLOCK_VISIBLE);
        }
        $block_count = count($block_arr);
        $xoopsLogger =& XoopsLogger::instance();
        for ($i = 0; $i < $block_count; $i++) {
            $bcachetime = intval($block_arr[$i]->getVar('bcachetime'));
            if (empty($bcachetime)) {
                $xoopsTpl->xoops_setCaching(0);
            } else {
                $xoopsTpl->xoops_setCaching(2);
                $xoopsTpl->xoops_setCacheTime($bcachetime);
            }
            $btpl = $block_arr[$i]->getVar('template');
            if ($btpl != '') {
                if (empty($bcachetime) || !$xoopsTpl->is_cached('db:' . $btpl)) {
                    $xoopsLogger->addBlock($block_arr[$i]->getVar('name'));
                    $bresult =& $block_arr[$i]->buildBlock();
                    if (!$bresult) {
                        continue;
                    }
                    $xoopsTpl->assign_by_ref('block', $bresult);
                    $bcontent =& $xoopsTpl->fetch('db:' . $btpl);
                    $xoopsTpl->clear_assign('block');
                } else {
                    $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime);
                    $bcontent =& $xoopsTpl->fetch('db:' . $btpl);
                }
            } else {
                $bid = $block_arr[$i]->getVar('bid');
                if (empty($bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html', 'blk_' . $bid)) {
                    $xoopsLogger->addBlock($block_arr[$i]->getVar('name'));
                    $bresult =& $block_arr[$i]->buildBlock();
                    if (!$bresult) {
                        continue;
                    }
                    $xoopsTpl->assign_by_ref('dummy_content', $bresult['content']);
                    $bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_' . $bid);
                    $xoopsTpl->clear_assign('block');
                } else {
                    $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime);
                    $bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_' . $bid);
                }
            }
            $title = $block_arr[$i]->getVar('title');
            switch ($block_arr[$i]->getVar('side')) {
                case XOOPS_CENTERBLOCK_CENTER:
                    if ($title != "") {
                        $cc_block .= '<tr valign="top"><td colspan="2"><strong>' . $title . '</strong><hr />' . $bcontent . '<br /><br /></td></tr>' . "\n";
                    } else {
                        $cc_block .= '<tr><td colspan="2">' . $bcontent . '<br /><br /></td></tr>' . "\n";
                    }
                    break;
                case XOOPS_CENTERBLOCK_LEFT:
                    if ($title != "") {
                        $cl_block .= '<p><strong>' . $title . '</strong><hr />' . $bcontent . '</p>' . "\n";
                    } else {
                        $cl_block .= '<p>' . $bcontent . '</p>' . "\n";
                    }
                    break;
                case XOOPS_CENTERBLOCK_RIGHT:
                    if ($title != "") {
                        $cr_block .= '<p><strong>' . $title . '</strong><hr />' . $bcontent . '</p>' . "\n";
                    } else {
                        $cr_block .= '<p>' . $bcontent . '</p>' . "\n";
                    }
                    break;
                default:
                    break;
            }
            unset($bcontent, $title);
        }
        echo '<table width="100%">' . $cc_block . '<tr valign="top"><td width="50%">' . $cl_block . '</td><td width="50%">' . $cr_block . '</td></tr></table>' . "\n";
    }
}
开发者ID:yunsite,项目名称:xoopsdc,代码行数:90,代码来源:old_functions.php


示例14: error

<?php

// $Id: upload.php 825 2011-12-09 00:06:11Z i.bitcero $
// --------------------------------------------------------------
// Red México Common Utilities
// A framework for Red México Modules
// Author: Eduardo Cortés <[email protected]>
// Email: [email protected]
// License: GPL 2.0
// --------------------------------------------------------------
include '../../../mainfile.php';
XoopsLogger::getInstance()->activated = false;
XoopsLogger::getInstance()->renderingEnabled = false;
function error($message)
{
    $data['error'] = 1;
    $data['message'] = $message;
    echo json_encode($data);
    die;
}
/**
* Handle uploaded image files only.
*/
$security = TextCleaner::getInstance()->decrypt(rmc_server_var($_POST, 'rmsecurity', 0), true);
$category = rmc_server_var($_POST, 'category', 0);
$data = $security;
//base64_decode($security);
$data = explode("|", $data);
// [0] = referer, [1] = session_id(), [2] = user, [3] = token
$xoopsUser = new XoopsUser($data[0]);
if (!isset($data[1]) || $data[1] != RMCURL . '/images.php') {
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:upload.php


示例15: saveBulkImages

/**
* @desc Almacena la información del grupo de imágenes
**/
function saveBulkImages()
{
    global $util, $mc, $xoopsUser;
    XoopsLogger::getInstance()->activated = false;
    XoopsLogger::getInstance()->renderingEnabled = false;
    set_time_limit(0);
    foreach ($_POST as $k => $v) {
        ${$k} = $v;
    }
    $ruta = "page={$page}&search={$search}&owner={$uid}&sort={$sort}&mode={$mode}";
    if ($xoopsUser->uid() == $uid) {
        $xu = $xoopsUser;
    } else {
        $xu = new XoopsUser($uid);
    }
    //Verificamos si el usuario se encuentra registrado
    $user = new GSUser($xu->uname());
    if ($user->isNew()) {
        //Insertamos información del usuario
        $user->setUid($uid);
        $user->setUname($xu->uname());
        $user->setQuota($mc['quota'] * 1024 * 1024);
        $user->setDate(time());
        if (!$user->save()) {
            send_error(__('User owner could not be created!', 'galleries') . "<br />" . $user->errors());
            die;
        } else {
            mkdir($mc['storedir'] . "/" . $user->uname());
            mkdir($mc['storedir'] . "/" . $user->uname() . "/ths");
            mkdir($mc['storedir'] . "/" . $user->uname() . "/formats");
        }
    } else {
        @mkdir($mc['storedir'] . "/" . $user->uname());
        @mkdir($mc['storedir'] . "/" . $user->uname() . "/ths");
        @mkdir($mc['storedir'] . "/" . $user->uname() . "/formats");
    }
    // Insertamos las etiquetas
    $tgs = explode(",", $tags);
    /**
     * @desc Almacena los ids de las etiquetas que se asignarán a la imágen
     */
    $ret = array();
    foreach ($tgs as $k) {
        $k = trim($k);
        if ($k == '') {
            continue;
        }
        // Comprobamos que la palabra tenga la longitud permitida
        if (strlen($k) < $mc['min_tag'] || strlen($k) > $mc['max_tag']) {
            continue;
        }
        // Creamos la etiqueta
        $tag = new GSTag($k);
        if (!$tag->isNew()) {
            // Si ya existe nos saltamos
            $ret[] = $tag->id();
            continue;
        }
        $tag->setTag($k);
        if ($tag->save()) {
            $ret[] = $tag->id();
        }
    }
    $errors = '';
    $k = 1;
    include_once RMCPATH . '/class/uploader.php';
    $updir = $mc['storedir'] . "/" . $xu->uname();
    $upths = $mc['storedir'] . "/" . $xu->uname() . "/ths";
    // Cargamos la imágen
    if (!file_exists($updir)) {
        mkdir($updir, 511);
    }
    if (!file_exists($upths)) {
        mkdir($upths, 511);
    }
    $uploader = new RMFileUploader($updir, $mc['size_image'] * 1024, array('gif', 'jpg', 'jpeg', 'png'));
    $err = array();
    if (!$uploader->fetchMedia('Filedata')) {
        send_error($uploader->getErrors());
    }
    if (!$uploader->upload()) {
        send_error($uploader->getErrors());
    }
    // Insertamos el archivo en la base de datos
    $img = new GSImage();
    $img->setTitle($uploader->savedFileName);
    $img->setOwner($uid);
    $img->setPublic(2);
    $img->setCreated(time());
    $img->setImage($uploader->getSavedFileName());
    if (!$image->save()) {
        unlink($uploader->savedDestination);
        send_error(__('File could not be inserted to database!', 'galleries'));
    }
    $ret['message'] = '1';
    $ret['id'] = $image->id();
    echo json_encode($ret);
//.........这里部分代码省略.........
开发者ID:laiello,项目名称:bitcero-modules,代码行数:101,代码来源:images.php


示例16: render

 /**
  * Get content for this page block
  *
  * @param int $unique
  * @param bool $last
  * @return array
  */
 function render($template, $unique = 0)
 {
     $block = array('blockid' => $this->getVar('pageblockid'), 'module' => $this->block->getVar('dirname'), 'title' => $this->getVar('title'), 'weight' => $this->getVar('priority'));
     $xoopsLogger =& XoopsLogger::instance();
     $bcachetime = intval($this->getVar('pbcachetime'));
     if (empty($bcachetime)) {
         $template->caching = 0;
     } else {
         $template->caching = 2;
         $template->cache_lifetime = $bcachetime;
     }
     $tplName = ($tplName = $this->block->getVar('template')) ? "db:{$tplName}" : "db:system_block_dummy.html";
     $cacheid = 'blk_' . $this->getVar('pageblockid');
     if ($this->getVar('cachebyurl')) {
         $cacheid .= "_" . md5($_SERVER['REQUEST_URI']);
     }
     if (!$bcachetime || !$template->is_cached($tplName, $cacheid)) {
         $xoopsLogger->addBlock($this->block->getVar('name'));
         if (!($bresult = $this->block->buildBlock())) {
             return false;
         }
         $template->assign('block', $bresult);
         $block['content'] = $template->fetch($tplName, $cacheid);
     } else {
         $xoopsLogger->addBlock($this->block->getVar('name'), true, $bcachetime);
         $block['content'] = $template->fetch($tplName, $cacheid);
     }
     return $block;
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:36,代码来源:pageblock.php


示例17: xos_kernel_Xoops2

$xoops = new xos_kernel_Xoops2();
$xoops->pathTranslation();
$xoopsRequestUri =& $_SERVER['REQUEST_URI'];
// Deprecated (use the corrected $_SERVER variable now)
/**
 * Create Instance of xoopsSecurity Object and check Supergolbals
 */
XoopsLoad::load('xoopssecurity');
$xoopsSecurity = new XoopsSecurity();
$xoopsSecurity->checkSuperglobals();
/**
 * Create Instantance XoopsLogger Object
 */
XoopsLoad::load('xoopslogger');
$xoopsLogger =& XoopsLogger::getInstance();
$xoopsErrorHandler =& XoopsLogger::getInstance();
$xoopsLogger->startTime();
$xoopsLogger->startTime('XOOPS Boot');
/**
 * Include Required Files
 */
include_once $xoops->path('kernel/object.php');
include_once $xoops->path('class/criteria.php');
include_once $xoops->path('class/module.textsanitizer.php');
include_once $xoops->path('include/functions.php');
/**
 * YOU SHOULD NEVER USE THE FOLLOWING CONSTANT, IT WILL BE REMOVED
 */
/**
 * Set cookie dope for multiple subdomains remove the '.'. to use top level dope for session cookie;
 * Requires functions
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:common.php


示例18: __construct

 public function __construct()
 {
     $this->db = XoopsDatabaseFactory::getDatabase();
     $this->db->setPrefix(XOOPS_DB_PREFIX);
     $this->db->setLogger(XoopsLogger::getInstance());
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:6,代码来源:dbmanager.php


示例19:

 /**
  * Deprecated, use getInstance() instead
  */
 function &instance()
 {
     return XoopsLogger::getInstance();
 }
开发者ID:gauravsaxena21,项目名称:simantz,代码行数:7,代码来源:xoopslogger.php


示例20: define

 define("XOOPS_MATCH_START", 0);
 define("XOOPS_MATCH_END", 1);
 define("XOOPS_MATCH_EQUAL", 2);
 define("XOOPS_MATCH_CONTAIN", 3);
 define("XOOPS_UPLOAD_PATH", XOOPS_ROOT_PATH . "/uploads");
 define("XOOPS_THEME_PATH", XOOPS_ROOT_PATH . "/themes");
 // ----- BEGIN: Already refactored stuff just kept for compat purposes -----
 //define( "SMARTY_DIR", XOOPS_PATH . "/Frameworks/XoopsCore/Pyro/Smarty.xoobj/smarty/" );
 define("XOOPS_CACHE_PATH", XOOPS_VAR_PATH . "/Caches");
 define("XOOPS_COMPILE_PATH", XOOPS_VAR_PATH . "/Application Support/xoops_template_Smarty");
 // ----- END: Already refactored stuff just kept for compat purposes -----
 define("XOOPS_THEME_URL", XOOPS_URL . "/themes");
 define("XOOPS_UPLOAD_URL", XOOPS_URL . "/uploads");
 set_magic_quotes_runtime(0);
 include_once XOOPS_ROOT_PATH . '/class/logger.php';
 $GLOBALS['xoopsLogger'] =& XoopsLogger::instance();
 if (!defined('XOOPS_XMLRPC')) {
     define('XOOPS_DB_CHKREF', 1);
 } else {
     define('XOOPS_DB_CHKREF', 0);
 }
 // ############## Include common functions file ##############
 include_once XOOPS_ROOT_PATH . '/include/functions.php';
 // #################### Connect to DB ##################
 require_once XOOPS_ROOT_PATH . '/class/database/database.php';
 $GLOBALS['xoopsDB'] = $xoops->loadService('legacydb');
 if (!$GLOBALS['xoopsDB']->allowWebChanges) {
     define('XOOPS_DB_PROXY', 1);
 }
 // ################# Include required files ##############
 require_once XOOPS_ROOT_PATH . '/kernel/object.php';
开发者ID:BackupTheBerlios,项目名称:xoops4-svn,代码行数:31,代码来源:common.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP XoopsMediaUploader类代码示例发布时间:2022-05-23
下一篇:
PHP XoopsLocale类代码示例发布时间: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