privatpage mit gallery2

Dieses Thema im Forum "Webentwicklung" wurde erstellt von eRza, 26. August 2006 .

Schlagworte:
Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 26. August 2006
    hi,
    ich möchte mir eine privatpage machen wo meine ganzen bilder von partys usw. druf kommen.
    habs jetzt versucht mit subdreamer+gallery2 include plugin+gallery2 weil gallery2 meiner meinung nach das non+ultra is.
    aber das plugin bringt mir immer das ein fehler in der php datei is, da ich kein php behersche weiß ich nich was das sein könnte. kennt jemand ein alternatives cooles cms mit möglichkeit der gallery2 einbindung?
    jeder gute tipp bekommt natürlich ne 10. solle am betsen auch templates für das cms geben.
    cheers,
    deb1an
     
  2. 26. August 2006
    sag am besten erstmal die php fehlermeldung

    vllt kann man dir ja so schon helfen und du wirst glücklich
     
  3. 26. August 2006
    Zeig uns lieber den Fehler...

    EDIT: Da war wohl jemand schneller als ich.
     
  4. 26. August 2006
    Fatal error: Call to a member function on a non-object in /home/d/deb1an.de/public_html/plugins/p39_gallery/g2embed.php on line 114

    den fehle rbekomme ich. wäre sehr dankbar für jede hilfe
     
  5. 26. August 2006
    error ..

    hey,

    es wer natürlich noch hilfreich die betroffenen code segmente zu bekommen - denn anhand des codes kann man eventuell heraus finden was los ist / war ..

    Liebe grüße freakZ for Rr
     
  6. 26. August 2006
    Code:
    <?php
    
    // +------------------------------------------------------------------------------------------------------------------+
    // | Copyright © 2006 R. van Dam
    // | http://www.rvdam.com
    // |
    // | This program is free software. You can redistribute it and/or modify
    // | it under the terms of the GNU General Public License as published by
    // | the Free Software Foundation; either version 2 of the License.
    // +------------------------------------------------------------------------------------------------------------------+
    
    if(!defined('IN_SUBDREAMER'))
    {
     die("Hacking attempt!");
    }
    
    function g2Clean($data)
    {
     if(is_array($data))
     {
     foreach($data as $key => $val)
     {
     $return[$key] = g2Clean($val);
     }
    
     return ($return);
     }
     else
     {
     $data = str_replace("'", "'", $data);
     $data = str_replace("&quot;", '"', $data);
     $data = str_replace("&amp;", '&', $data);
     $data = str_replace("&lt;", '<', $data);
     $data = str_replace("&gt;", '>', $data);
     $g2Str = $str;
    
     return $data;
     }
    }
    
    $_GET = g2Clean($_GET);
    $_POST = g2Clean($_POST);
    
    global $DB, $categoryid, $settings, $userinfo, $mainsettings;
    
     if (!headers_sent()) {
     header('Content-Type: text/html; charset=UTF-8');
     }
    
    $settings = $DB->query_first("SELECT * FROM ".TABLE_PREFIX."p39_gallery_settings");
    
     if ($_REQUEST['sdg2_LoadFile'] == 'publishxp.DownloadRegistryFile') {
     echo'<IFRAME SRC="'.$settings['g2Uri'].'main.php?g2_view=publishxp.DownloadRegistryFile" WIDTH=0 HEIGHT=0></IFRAME>';
    
     }
    
    if ($settings['configured'] == false) die("Configuration error. Please configure the plugin.");
    
     $SD2G2Lang = array( 'Arabic.php' => 'ar_SA',
     'Bulgarian.php' => 'bg_BG',
     'Chinese-big5.php' => 'zh_CN',
     'Croatian.php' => 'hr_HR',
     'Danish.php' => 'da_DK',
     'Dutch.php' => 'nl_NL',
     'English.php' => 'en_EN',
     'Estonian.php' => 'et_EE',
     'Finnish.php' => 'fi_FI',
     'French.php' => 'fr_FR',
     'German.php' => 'de_DE',
     'Greek.php' => 'el_GR',
     'Icelandic.php' => 'is_IS',
     'Italian.php' => 'it_IT',
     'Lithuanian.php' => 'lt_LT',
     'Norwegian.php' => 'no_NO',
     'Portuguese.php' => 'pt_PT',
     'Romanian.php' => 'ro_RO',
     'Russian.php' => 'ru_RU',
     'Slovenian.php' => 'sl_SK',
     'Spanish.php' => 'es_ES',
     'Swedish.php' => 'sv_SE',
     'Turkish.php' => 'tr_TR');
    
     require_once($settings['g2Path'].'embed.php');
    
     $data = array();
    
     if ($userinfo['adminaccess'] == 1) {
     $uid='admin';
     } else {
     if ($userinfo['loggedin'] == 1) {
     $uid= $userinfo['username'];
     } else {
     $uid = '';
     }
     }
    
     list($sdLang, $sdVersion, $sdIso) = explode( "|", $mainsettings['language']);
     $g2Lang = $SD2G2Lang[$sdLang];
    
     // initiate G2
     $ret = GalleryEmbed::init(array('g2Uri' => $settings['g2Uri'],
     'embedUri' => '/index.php?categoryid='.$categoryid,
     'activeUserId' => $uid, 'activeLanguage' => $g2Lang, 'fullInit' => 'true'));
    
     if ($ret) {
     if ($ret->getErrorCode() & ERROR_MISSING_OBJECT) {
     $ret = GalleryEmbed::isExternalIdMapped($uid, 'GalleryUser');
     if ($ret && ($ret->getErrorCode() & ERROR_MISSING_OBJECT)) {
     $uPassword = $_COOKIE['sdpassword'];
     $args = array('fullname'=> $userinfo['username'], 'username'=> $userinfo['username'], 'hashedpassword'=> $uPassword, 'hashmethod'=> 'md5' , 'email'=> $userinfo['email'] , 'language' => $g2Lang, 'creationtimestamp'=> time());
     $retcreate = GalleryEmbed::createUser($uid, $args);
     if ($retcreate) {
     list($ret,$user) = GalleryCoreApi::fetchUserByUsername($uid);
     $g2userId = $user->getId();
     if(!GalleryEmbed::addExternalIdMapEntry($uid, $g2userId, "GalleryUser")) {
     echo 'Sorry, but your the following SD user could not be imported to Gallery 2:<br> '.$uid.'.<p> Here is the error message from G2: <br />'.$retcreate->getAsHtml();
     }
     }
     $ret = GalleryEmbed :: init(array ('embedUri' => '/index.php?categoryid='.$categoryid,
     'g2Uri' => $settings['g2Uri'], 'activeUserId' => $uid,
     'activeLanguage' => $g2Lang, 'fullInit' => 'true'));
    
    
     } else {
     echo 'G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
     }
     } else {
     echo 'G2 did not return a success status. Here is the error message from G2: <br />'.$ret->getAsHtml();
     }
     }
    
     // user interface: you could disable sidebar in G2 and get it as separate HTML to put it into a block
     GalleryCapabilities::set('showSidebarBlocks', $settings['g2SideBar']);
    
     // handle the G2 request
     $g2moddata = GalleryEmbed::handleRequest();
    
     // show error message if isDone is not defined
     if (!isset($g2moddata['isDone'])) {
     $data['bodyHtml'] = 'isDone is not defined, something very bad must have happened.';
     }
    
     // exit if it was an immediate view / request (G2 already outputted some data)
     if ($g2moddata['isDone']) {
     if ($_REQUEST['g2_view'] == 'publishxp.DownloadRegistryFile'){
     $LoadArg = '&sdg2_LoadFile=publishxp.DownloadRegistryFile';
     echo ' <script language="JavaScript">
     window.onload=document.location.href = \'index.php?categoryid='.$categoryid.'&g2_itemId='.$_REQUEST['g2_itemId'].$LoadArg.'\';
     </script>';
     }
     }
    
     // put the body html from G2 into the xaraya template
     $data['bodyHtml'] = isset($g2moddata['bodyHtml']) ? $g2moddata['bodyHtml'] : '';
    
     // get the page title, javascript and css links from the <head> html from G2
     $title = ''; $javascript = array(); $css = array();
    
     if (isset($g2moddata['headHtml'])) {
     list($data['title'], $css, $javascript) = GalleryEmbed::parseHead($g2moddata['headHtml']);
     $data['headHtml'] = $g2moddata['headHtml'];
     }
    
    
     /* Add G2 javascript */
     $data['javascript'] = '';
     if (!empty($javascript)) {
     foreach ($javascript as $script) {
     $data['javascript'] .= "\n".$script;
     }
     }
    
     /* Add G2 css */
     $data['css'] = '';
     if (!empty($css)) {
     foreach ($css as $style) {
     $data['css'] .= "\n".$style;
     }
     }
    
     // sidebar block
     if (isset($g2moddata['sidebarBlocksHtml']) && !empty($g2moddata['sidebarBlocksHtml'])) {
     $data['sidebarHtml'] = $g2moddata['sidebarBlocksHtml'];
     }
    
     echo $data['css'].$data['javascript'].$data['bodyHtml'];
    
    ?>
    zeile 114 sieht man ja
     
  7. 27. August 2006
    ganz einfach: es gibt die funktion "getID()" nicht...

    warum?? kA das kann ich dir nicht sagen, da ich mich mit den scripten nich auskenne....vllt ja jemand anders, aber aufjendefall fehlt diese funktion

    edit::// huch, ok zuviel alc sry =)
     
  8. 27. August 2006
    ne .. es gibt kein objekt mit dem namen $user
     
  9. 27. August 2006
    mhh, un wie kann ich des beheben?
     
  10. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.