示例#1
0
    /**
     * retrieves value(s) for one setting
     * 
     * may be called statically
     * 
     * @param int $userId
     * @param string $setting
     * @return stdClass
     */
    public static function getSetting($userId, $setting)
    {
        $c = self::get();
        if (self::loggedIn() && $userId == $c->getId() && isset($c->_settings)) {
            if (isset($c->_settings[$setting])) {
                return $c->_settings[$setting];
            }
        }
        $query = '
SELECT `value`, `valueint`, `valuedate` FROM `user_settings`
WHERE `user_id` = ' . (int) $userId . ' AND `setting` = \'' . $c->dao->escape($setting) . '\'
        ';
        $s = $c->dao->query($query);
        if ($s->numRows() == 0) {
            return false;
        }
        $d = $s->fetch(PDB::FETCH_OBJ);
        if (self::loggedIn() && $userId == self::$_instance->getId()) {
            $c->_settings->{$setting} = $d;
        }
        return $d;
    }
示例#2
0
        $vars = PPostHandler::getVars($callbackId);
        ?>

<form method="post" action="gallery/create/finished" class="def-form" id="gallery-create-form">
<input type="hidden" name="<?php 
        echo $callbackId;
        ?>
" value="1"/>
<p class="small">
    <img src="images/icons/add.png" class="float_left"> <?php 
        echo $words->get('GalleryCreateNewPhotoset');
        ?>
    &nbsp;&nbsp;
    <input type="hidden" name="new" id="newGallery" value="1">
    <input name="g-user" type="hidden" value="<?php 
        echo $User->getId();
        ?>
">
    <input name="g-title" type="text" size="20" maxlength="30">
    <input type="submit" name="button" value="<?php 
        echo $words->getBuffered('Create');
        ?>
" id="button" />
</p>
</form>


<?php 
    } elseif ($type == 'gallery') {
        /*
        /* If the controls handle images within a gallery