|
|
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
*/
?>
|
|
|
Source code |
1 2 3 |
<html>
<? include("zufallsbild.php"); ?>
</html>
|
|
|
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
*/
?>
|
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
|
|
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;
}
}
?>
|
Forum Software: Burning Board® 3.1.4 RC 1, developed by WoltLab® GmbH