예제 #1
0
            //vd( $gallery->getActiveUserId() );
            if ($g2User = GalleryEmbed::createUser($gBitUser->mUserId, array('username' => $gBitUser->mInfo['login'], 'email' => $gBitUser->mInfo['email'], 'fullname' => $gBitUser->mInfo['real_name'], 'creationtimestamp' => $gBitUser->mInfo['registration_date']))) {
                if ($gBitUser->isAdmin()) {
                    list($ret, $adminGroupId) = GalleryCoreApi::getPluginParameter('module', 'core', 'id.adminGroup');
                    if ($ret->isError()) {
                        return array($ret->wrap(__FILE__, __LINE__), false);
                    }
                    GalleryEmbed::addUserToGroup($activeUserId, 2);
                }
                //'language' => $gBitUser->mInfo['language'],
                //'password' => string,
                //'hashedpassword' => string,
                //'hashmethod' => string,
            } else {
                fatalError(tra($status->getAsHtml()));
                exit;
            }
        }
    }
    GalleryCapabilities::set('showSidebar', TRUE);
    $g2data = GalleryEmbed::handleRequest();
    //After enabling sidebar, no need to smarty menu and it is not working as of 2005 06 17
    //$gBitSmarty->assign_by_ref( 'menuLinks', $g2data['layoutData']['itemLinks'] );
    if ($g2data['isDone']) {
        exit;
        // G2 has already sent output (redirect or binary data)
    }
    $GLOBALS['ADODB_FETCH_MODE'] = ADODB_FETCH_ASSOC;
    $gBitSmarty->assign_by_ref('g2data', $g2data);
    $gBitSystem->display('bitpackage:gallery2/bitweaver_embed.tpl', NULL, array('display_mode' => 'display'));
}
 define("MOS_GALLERY2_PARAMS_EMBEDURI", "database.php?mandant=" . $mandant['mandant_id'] . "&tempid=gallery" . $url_und_sid);
 define("MOS_GALLERY2_PARAMS_LOGINREDIRECT", "database.php?mandant=2&tempid=gallery" . $url_und_sid);
 define("MOS_GALLERY2_PARAMS_DISPLAYSIDEBAR", 1);
 define("MOS_GALLERY2_PARAMS_DISPLAYLOGIN", 1);
 define("MOS_GALLERY2_PARAMS_EMBEDPATH", "");
 require_once MOS_GALLERY2_PARAMS_PATH . 'embed.php';
 $ret = GalleryEmbed::init(array('embedUri' => MOS_GALLERY2_PARAMS_EMBEDURI, 'embedPath' => MOS_GALLERY2_PARAMS_EMBEDPATH, 'relativeG2Path' => MOS_GALLERY2_PARAMS_RELATIVEG2PATH, 'loginRedirect' => MOS_GALLERY2_PARAMS_LOGINREDIRECT, 'activeUserId' => '0'));
 if (MOS_GALLERY2_PARAMS_DISPLAYSIDEBAR == 0) {
     GalleryCapabilities::set('showSidebar', false);
 } else {
     GalleryCapabilities::set('showSidebar', true);
 }
 if (MOS_GALLERY2_PARAMS_DISPLAYLOGIN == 0) {
     GalleryCapabilities::set('login', false);
 } else {
     GalleryCapabilities::set('login', true);
 }
 // handle the G2 request
 $g2moddata = GalleryEmbed::handleRequest();
 // show error message if isDone is not defined
 if (!isset($g2moddata['isDone'])) {
     echo 'isDone is not defined, something very bad must have happened.';
     exit;
 }
 // die if it was a binary data (image) request
 if ($g2moddata['isDone']) {
     exit;
     /* uploads module does this too */
 }
 if ($ret->isError()) {
     $bodyhtml .= $ret->getAsHtml();
예제 #3
0
파일: gallery2.php 프로젝트: radicalsuz/amp
<?

$modid = 8;
$intro_id = 64;
include("AMP/BaseDB.php");

require_once('gallery2/embed.php');


// initiate G2
GalleryEmbed::init(array('embedUri' => 'gallery2.php', 'embedPath' => '/', 'relativeG2Path' => 'gallery2'));

// user interface: you could disable sidebar in G2 and get it as separate HTML to put it into a block
GalleryCapabilities::set('showSidebarBlocks', false);

// handle the G2 request
$g2moddata = GalleryEmbed::handleRequest();

$dbcon=&AMP_Registry::getDbcon();
$dbcon->SetFetchMode("ADODB_FETCH_ASSOC");
include("AMP/BaseTemplate.php");
 
print $g2moddata['headHtml'];
print $g2moddata['bodyHtml'];
#print_r ($g2moddata['sidebarBlocksHtml']);

include("AMP/BaseFooter.php");

?> 
 function loadG2()
 {
     global $serendipity;
     if ($this->isG2Loaded === false) {
         require_once $this->get_config('g2dir') . 'embed.php';
         $ret = GalleryEmbed::init(array('g2Uri' => $this->get_config('g2uri'), 'embedUri' => $this->get_config('embedUri'), 'gallerySessionId' => $_COOKIE['PHPSESSID']));
         GalleryCapabilities::set('login', true);
         // handle the G2 request
         $this->g2moddata = GalleryEmbed::handleRequest();
         // show error message if isDone is not defined
         if (!isset($this->g2moddata['isDone'])) {
             print 'isDone is not defined, something very bad must have happened.';
             exit;
         }
         // die if it was a binary data (image) request
         if ($this->g2moddata['isDone']) {
             exit;
             /* uploads module does this too */
         }
         $this->isG2Loaded = true;
     }
 }