You are not logged in.

1

Friday, January 18th 2008, 9:23am

Zufallsbild in Portalbox

Hallo zusammen,

habe diese Frage zwar schon an anderer Stelle gestellt, aber bisher noch keine Antwort erhalten. Wie kann ich die Zufallsbild Funktion in eine Portalbox integrieren. Bisher habe ich folgendes probiert.

Eine eigene Box installiert und dann eine php Datei mit folgendem Inhalt auf den Server geladen

PHP Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  true'embedUri' => '/''g2Uri' => '/var/www/vhosts/koi-scene.de/subdomains/probe/httpdocs/ga/main.php'));
 if ($ret) {
     print 'GalleryEmbed::init failed, here is the error message: ' $ret->getAsHtml();
     exit;
 }
 /*
  * See "Site admin" -> "image block" for all available options. the parameters are the same
  * as for the external imageblock
  */
 list ($ret$bodyHtml$headHtml) = GalleryEmbed::getImageBlock(array('blocks' => 'randomImage',
                                                                 'show' => 'title|date'));
 if ($ret) {
     print 'GalleryEmbed::getImageBlock failed, here is the error message: ' $ret->getAsHtml();
     exit;
 }
 /* $bodyHtml contains the image block. print it somewhere on your website */
 print $bodyHtml;
 /*
  * $headHtml is not required. if you use imageframes for your imageblocks, you need to print 
  * $headHtml in the  section of your web page
  */
 ?>


Das Zufallsbild wurde dann auch beim Aufruf im Browser angezeigt.

Für die Anzeige in einer Box habe ich es mit folgendem Aufruf versucht.

Source code

1
2
3
<html>
<? include("zufallsbild.php"); ?>
</html>


Ich habe es auch mit Pfadanpassungen probiert.........

Leider bleibt die Box leer............

Würde mich über eine Hilfestellung sehr freuen :)
Gruß

Jürgen

markusw

Administrator

Posts: 253

Location: Regensburg

Occupation: Wirtschaftsinformatiker

  • Send private message

2

Friday, January 18th 2008, 10:49pm

Hi,
für das einbinden eines Image Blocks brauchst Du keine Embed, das geht auch einfacher. Mit fopen();, dann musst Du nur noch den Image Bloc auswählen, den Du anzeigen willst.

Ich werde wohl vorerst keine Portal Box anbieten.

Hier ist beschrieben, wie Du das mit dem Embed am besten einstellst. http://codex.gallery2.org/Gallery2:Galle…d:getImageBlock

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 <?php
 /* You'll have to change the /gallery2/ thing in the following 2 lines probably */
 require_once(dirname(__FILE__) . '/gallery2/embed.php');
 $ret = GalleryEmbed::init(array('fullInit' => true, 'embedUri' => '/', 'g2Uri' => '/gallery2/main.php'));
 if ($ret) {
     print 'GalleryEmbed::init failed, here is the error message: ' . $ret->getAsHtml();
     exit;
 }
 /*
  * See "Site admin" -> "image block" for all available options. the parameters are the same
  * as for the external imageblock
  */
 list ($ret, $bodyHtml, $headHtml) = GalleryEmbed::getImageBlock(array('blocks' => 'randomImage',
                                                                 'show' => 'title|date'));
 if ($ret) {
     print 'GalleryEmbed::getImageBlock failed, here is the error message: ' . $ret->getAsHtml();
     exit;
 }
 /* $bodyHtml contains the image block. print it somewhere on your website */
 print $bodyHtml;
 /*
  * $headHtml is not required. if you use imageframes for your imageblocks, you need to print 
  * $headHtml in the <head> section of your web page
  */
 ?>
Schöne Grüße, Markus

https://www.rettungspfoten.de

3

Saturday, January 19th 2008, 11:45am

Hi Markus,

das sind für mich böhmische Dörfer 8| Den PHP Code den Du gepostet hast, ist genau der, den ich schon gefunden habe. Der funktioniert ja auch, wenn ich die php Datei im Browser direkt aufrufe. Das Problem ist nur, das ich das nicht in einer Portalbox angezeigt bekomme. Da bräuchte ich Hilfestellung. Mit einem einfachen include ist da nix zu machen ;(
Gruß

Jürgen

4

Sunday, January 20th 2008, 11:14pm

ich hätte auch sehr große interesse an diesem addon bzw diesen parket

markusw

Administrator

Posts: 253

Location: Regensburg

Occupation: Wirtschaftsinformatiker

  • Send private message

5

Monday, January 21st 2008, 2:03pm

Hi,
ich seh schon, ich muss mir so ein Portal mal installieren und das entwickeln ;-)

Welches Portal gibt es denn, bzw. habt ihr im Einsatz?
Schöne Grüße, Markus

https://www.rettungspfoten.de

6

Monday, January 21st 2008, 5:19pm

http://www.wbb3mods.com/support/unsere-p…9-portal-1-0-4/

dieses nutze ich, es wäre sau geil wenn es machbar wäre dieses zufalls bild da in einer box xy darzustellen da viele einfach dieses button übersehen

7

Tuesday, January 22nd 2008, 9:38am

habe dafür versucht die Bix "Deine Box" etwas zu modifizieren, wo dann auch das Bild in der Portalbox angezeigt wird. Wenn ich aber dann diese Box im Forum aktiviere, dann funzt es irgendwie nicht so ganz.

8

Tuesday, January 22nd 2008, 1:42pm

Hi Markus,

suuuuuper Idee :D
Gruß

Jürgen

9

Tuesday, January 22nd 2008, 10:24pm

würde so einiges tun um es zubekommen da meine gallerie einbisschen unter geht weil viele den button übersehen

10

Wednesday, January 23rd 2008, 5:56pm

hat da jemand vielleicht schon was kleines gebastelt was funzen würde

11

Wednesday, January 23rd 2008, 6:17pm

$host="xxx"; $user="xxx"; $password="xxx"; $db_name="xxx"; $connect=mysql_connect($host,$user,$password); if(!$connect) die ("Konnte keine Verbindung zur MySQL-Datenbank aufbauen."); $select_db=mysql_select_db($db_name); $query="SELECT * FROM rGallery_items order by itemID desc limit 1"; $aufruf=mysql_query($query); while ($row=mysql_fetch_array($aufruf,MYSQL_BOTH)) {echo "<img src='http://deinedomain.de/wbb/index.php?page=RGalleryImageWrapper&itemID=".$row['itemID']."&type=thumb'>";
}


<center><iframe src="http://deinedomain.de/rgal_pic.php" width="100" height="100" scrolling="no" border="0" frameborder="0"></iframe></center>

in wie fern könnte ich das an diese gallerie anpassen das wurde bei einer anderen eben gepostet

markusw

Administrator

Posts: 253

Location: Regensburg

Occupation: Wirtschaftsinformatiker

  • Send private message

12

Wednesday, January 23rd 2008, 11:56pm

Hi,
das ist bei der Gallery2 nicht so einfach, da neben einer ItemID auch noch eine Revision existiert, schwierig das zu erklären. Eben aus diesem Grund gibt es ja den Image Block, der Kümmert sich um Rechte und den ganzen Kram.
Schöne Grüße, Markus

https://www.rettungspfoten.de

13

Saturday, January 26th 2008, 10:01am

das heisst es wird in nächster zeit auch nicht realisierbar sein

14

Saturday, January 26th 2008, 10:08am

Hi Chefkiller,

Markus kriegt das bestimmt hin. Tippe mal, das er schon fleissig am testen ist :)
Gruß

Jürgen

15

Saturday, January 26th 2008, 11:22am

es wäre total geil will ungern auf die andere wbb gallerie umsteigen

markusw

Administrator

Posts: 253

Location: Regensburg

Occupation: Wirtschaftsinformatiker

  • Send private message

16

Saturday, January 26th 2008, 6:13pm

Hi,
kommt, wolte das eigentlich heute fertig machen, nur ist mir heute morgen an meinem Auto was kaputt gegangen und das hat mich jetzt den ganzen Tag gekostet. Schau mer mal was ich da heute noch auf die Reihe krieg.
Schöne Grüße, Markus

https://www.rettungspfoten.de

17

Sunday, January 27th 2008, 11:58am

das wäre ja sau geil würde mich sehr freuen

18

Monday, January 28th 2008, 6:39am

ich möchte nicht nerven aber gans schon fortschritte.

mfg

19

Monday, January 28th 2008, 11:03am

ich hatte dazu die Box "YourBox" genommen, wo ich den Code der Datei lib/data/boxes/yourBox.class.php so abgeändert habe:

PHP Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 <?php
class YourBox {
 protected $YourBoxData = array();
 public function __construct($data$boxname "") {
  $this->YourBoxData['templatename'] = "yourbox";
  $this->YourBoxData['boxID'] = $data['boxID'];
  $this->getBoxStatus($data);
  #$this->YourBoxData['data'] = @readfile($data);
  #$this->YourBoxData['data'] = WBBCore::getCache()->get('box-' . $data['boxID']);

$file file_get_contents('http://www.Domain.de/index.php?page=Gallery2&g2_view=imageblock.External&g2_blocks=randomImage&g2_show=none&g2_link=none');
define('FILE'$file); 
 }
 protected function getBoxStatus($data) {
  // get box status
  $this->YourBoxData['Status'] = 1;
  if (WBBCore::getUser()->userID) {
   $this->YourBoxData['Status'] = intval(WBBCore::getUser()->yourbox);
  }
  else {
   if (WBBCore::getSession()->getVar('yourbox') !== false) {
    $this->YourBoxData['Status'] = WBBCore::getSession()->getVar('yourbox');
   }
  }
 }
 public function getData() {
  return $this->YourBoxData;
 }
}
?> 


in der TPL hat man dann die Variable {@FILE} zur Verfügung. Im Portal gibt es bei der Anzeige keine Probleme, nur wenn man sich diese Box im Forum anzeigen lassen will. Eventl. gibt es da ja noch eine Lösung für.

20

Monday, January 28th 2008, 4:54pm

verstehe ichd as richtig das es hiermit gehe

versteh das gerade nicht so // sorry