|
|

27.07.2010, 17:48
 |
Aufsteigender Benutzer
|
|
Join Date: 11.2007
Location: Hannover
Age: 39
Posts: 152
Rep Power: 5
|
|
Photopost vBGallery v3.0
Hi,
nun gibts ja auch die vBGallery v3.0 für das vB4.
kann da jemand mal ein Modul schreiben, welches die letzten Bilder im vBCMS anzeigt?
Demo der Galerie: http: Heli-Hannover Galerie
Für die PhotoPost PHP Pro v7.02 gibts das ja hier schon.
Also das hier funktioniert soweit, aber es wird kein Rahmen um die Bilder erstellt:
Code:
<?php
/****** Pull images from vBGallery to external php page *****/
error_reporting(E_ALL & ~E_NOTICE);
if(!is_array($galimg))
{
$galimg = array();
}
// do not touch above
/***********************************/
/********** Start CONFIG ***********/
/***********************************/
$galimg['debug'] = false; // if set to true this bypasses security.. once you set a password in the main page, set this to false
$galimg['dbusername'] = 'xxx'; // the username for your db
$galimg['dbpassword'] = 'xxx'; // the password for your db
$galimg['dbname'] = 'xxx'; // the name of the database in which the gallery data is
$galimg['host'] = 'localhost'; // in 90% of cases its localhost, if not you can check in your vbulletin config file.
$galimg['tableprefix'] = 'xxx_'; /* if you are not sure, check with phpmyadmin your database for table: ppgal_images.. if its called vb_ppgal_images then your tableprefix is vb_ ( you can also find the tableprefix in the vbulletin config file - forums/includes/config.php)*/
/* Config for your gallery -- REQUIRED -- */
// first the url to the gallery
$galimg['galleryurl'] = 'http://www.heli-hannover.de/gallery'; // no trailing slash
// then the url to your files directory
$galimg['galleryfiles'] = 'http://www.heli-hannover.de/gallery/files'; // no trailing slash
// END OF REQUIRED CONFIG
/* Config phrase */
$galimg['noimages'] = 'No Images to display'; // phrase to tell user there are no images.. set to $galimg['noimages'] = ''; if you dont want any text..
/* Config for categories */
$galimg['includecatids'] = "'5','6','7','25'"; // make sure there are images in those cats
$galimg['allcats'] = true; // if false, you only get images from the included cats, if set to true, it overrides the includecats and takes images from the whole gallery, ignoring includecats
$galimg['extension'] = 'jpg'; // file extensions to show.. $galimg['extension'] = ''; to show all extensions.. ATTENTION.. if you have mp3s or videos or other this could give errors.. so $galimg['extension'] = 'jpg'; is recomended!!!
/* Config min or max sizes */
$galimg['useminmax'] = false; // if you are pulling images, you might want to limit the size to images that are bigger or smaller than a certain value so your layout wont break. If so, set this to true.. But be carefull: you must have images in the db that fit those sizes..
// these settings have no effect if you pull thumbnails !!!!
$galimg['minsize'] = '300'; // only display images that are bigger than that size in pixels (height and width)
$galimg['maxsize'] = '600'; // only display images that are smaller than that size in pixels (height and width)
/* Config for output */
$galimg['outputtype'] = 'thumb'; // output type settings: 'thumb' is thumbnail, 'image' is normal image
$galimg['outputnumber'] = 5; // set how many images or thumbs to pull from database.. (0 turns the whole thing off)
$galimg['random'] = false; // images will be random if true, if false they will show newest images..
$galimg['vertical'] = false; // true aligns the images vertically.. false horizontally
$galimg['spacing'] = 5; // spacing between the images ( its a margin.. so if you have more than 1 image, the real spacing will be two times the value in pixels you defined here.. $galimg['spacing']*2)
$galimg['galalign'] = 'center'; // output of div only 'center', 'left' or 'right' are accepted
/* Config for imageframe */
$galimg['useframe'] = true; // turns frame on and off
$galimg['framewidth'] = 8; // width of the frame. Just the amount. pixels are added in script
$galimg['framecolor'] = '#F7F7F7'; // color of the frame
$galimg['frameborderlight'] = '#E6E6E1'; // color of the lighter frame border
$galimg['frameborderdark'] = '#DADAD6'; // color of the darker frame border
/***********************************/
/********** End CONFIG ***********/
/***********************************/
/**** No need to touch below *****/
$galimg['outputnumber'] = intval($galimg['outputnumber']);
if($galimg['outputnumber'] > 0)
{
// clean vars
$galimg['outputtype'] = ($galimg['outputtype'] == 'image') ? 'image' : 'thumb';
$galimg['minmaxval'] = '';
if($galimg['useminmax'] AND $galimg['outputtype'] == 'image')
{
$galimg['minmaxval'] = ' AND height > ' . $galimg['minsize'] . ' AND width > ' . $galimg['minsize'] . ' AND height < ' . $galimg['maxsize'] . ' AND width < ' . $galimg['maxsize'];
}
$galimg['where'] = '';
if($galimg['allcats'])
{
if(strlen($galimg['extension'])>2)
{
$galimg['where'] = "WHERE extension = '" . $galimg['extension'] . "' AND valid = 1" . $galimg['minmaxval'];
}
}
else
{
if(!empty($galimg['includecatids']))
{
$galimg['where'] = "WHERE catid IN ('0',".$galimg['includecatids'].") AND valid = 1" . $galimg['minmaxval'];
if(strlen($galimg['extension'])>2)
{
$galimg['where'] .= " AND extension = '" . $galimg['extension'] . "'";
}
}
else
{
if(strlen($galimg['extension'])>2)
{
$galimg['where'] = "WHERE extension = '" . $galimg['extension'] . "' AND valid = 1" . $galimg['minmaxval'];
}
}
}
$galimg['orderby'] = ($galimg['random']) ? 'RAND(NOW())' : 'dateline DESC, imageid';
$galimg['galleryfiles'] = $galimg['galleryfiles'] . '/';
// construct the style for the image
$galimg['spacing'] = intval($galimg['spacing']);
if($galimg['spacing']>0 OR $galimg['useframe'])
{
$galimg['style'] = ' style="';
if($galimg['spacing']>0)
{
$galimg['style'] .= 'margin:' . $galimg['spacing'] . 'px;';
}
if($galimg['useframe'])
{
$galimg['style'] .= 'padding:' . $galimg['framewidth'] . 'px;';
$galimg['style'] .= 'background-color:' . $galimg['framecolor'] . ';';
$galimg['style'] .= 'border-top:1px solid ' . $galimg['frameborderlight'] . ';';
$galimg['style'] .= 'border-left:1px solid ' . $galimg['frameborderlight'] . ';';
$galimg['style'] .= 'border-bottom:1px solid ' . $galimg['frameborderdark'] . ';';
$galimg['style'] .= 'border-right:1px solid ' . $galimg['frameborderdark'] . ';';
}
$galimg['style'] .= '" ';
}
else
{
$galimg['style'] = '';
}
// connect to db and get the images
$con = mysql_connect("$galimg[host]","$galimg[dbusername]","$galimg[dbpassword]") or die( "Unable to connect to mySQL server");
mysql_select_db("$galimg[dbname]", $con);
$sql ="SELECT imageid, title, userid, filename, width, height, thumbname
FROM " . $galimg['tableprefix'] . "ppgal_images
$galimg[where]
ORDER BY $galimg[orderby]
LIMIT $galimg[outputnumber]";
$result = mysql_query($sql);
if ($result)
{
$row = array();
if(!in_array($galimg['galalign'],array('left', 'right', 'center')))
{
$galimg['galalign'] = 'center';
}
$output = '<div align="' . $galimg['galalign'] . '">';
while($row = mysql_fetch_array($result))
{
$imageid = $row['imageid'];
$userid = $row['userid'];
$title = stripslashes($row['title']);
if($galimg['outputtype'] == 'image')
{
$filename = $row['filename'];
$widthheight = 'width="' . $row['width'] . '" height="' . $row['height'] . '"';
}
else
{
$filename = $row['thumbname'];
$widthheight = '';
}
$arrChars = array();
for ($i = 0; $i < strlen($userid); $i++)
{
$arrChars[] = $userid[$i];
}
$uid = '';
foreach ($arrChars as $char)
{
$uid = $uid . $char ."/";
}
$output .= "
<a href=\"$galimg[galleryurl]/showimage.php?i=$imageid\"><img $galimg[style] src=\"$galimg[galleryfiles]$uid$filename\" alt=\"$title\" $widthheight border=\"0\" /></a>";
if($galimg['vertical'])
{
$output .= '<br />';
}
}
$output .= '</div>';
mysql_free_result($result);
unset($row);
}
else
{
$output = $galimg['noimages'];
}
if($galimg['debug'])
{
$output = $output . '<div align="center" style="margin-top:30px;"><b>Attention !!!</b> debug is on, set it to false if you are in production environment!</div><br /><br /><br />';
}
echo $output;
}
unset($galimg);
unset($output);
/****** /Pull image from Gallery - END *****/
$output=ob_get_contents();
?>
Last edited by Razfaz : 27.07.2010 at 18:02.
|

27.07.2010, 22:29
 |
Aufsteigender Benutzer
|
|
Join Date: 05.2008
Posts: 369
Rep Power: 4
|
|
Wenn die nicht so teuer wäre 
__________________
|

02.08.2010, 08:15
 |
Aufsteigender Benutzer
|
|
Join Date: 11.2007
Location: Hannover
Age: 39
Posts: 152
Rep Power: 5
|
|
|
Kann denn keiner helfen?
|

02.08.2010, 12:47
 |
Web Design
|
|
Join Date: 12.2003
Location: In Spocks Quartier
Age: 33
Posts: 16,877
Rep Power: 10
|
|
|
Bei echo $output; musst du noch die DIV Container setzen, schau es dir im Quelltext von den anderen Module ab.
|

04.08.2010, 09:27
 |
Aufsteigender Benutzer
|
|
Join Date: 11.2007
Location: Hannover
Age: 39
Posts: 152
Rep Power: 5
|
|
|
Habe ich schon versucht, aber dann bleibt die seite komplett weiss.
Wo genau muss ich das machen?
|

04.08.2010, 22:51
 |
Web Design
|
|
Join Date: 12.2003
Location: In Spocks Quartier
Age: 33
Posts: 16,877
Rep Power: 10
|
|
|
Dann hast du einen Fehler eingebaut, wie sah der geänderte Quelltext denn aus?
|

08.08.2010, 10:55
 |
Aufsteigender Benutzer
|
|
Join Date: 11.2007
Location: Hannover
Age: 39
Posts: 152
Rep Power: 5
|
|
Der sah so aus:
Code:
<?php
/****** Pull images from vBGallery to external php page *****/
error_reporting(E_ALL & ~E_NOTICE);
if(!is_array($galimg))
{
$galimg = array();
}
// do not touch above
/***********************************/
/********** Start CONFIG ***********/
/***********************************/
$galimg['debug'] = false; // if set to true this bypasses security.. once you set a password in the main page, set this to false
$galimg['dbusername'] = 'xxx'; // the username for your db
$galimg['dbpassword'] = 'xxx'; // the password for your db
$galimg['dbname'] = 'xxx'; // the name of the database in which the gallery data is
$galimg['host'] = 'localhost'; // in 90% of cases its localhost, if not you can check in your vbulletin config file.
$galimg['tableprefix'] = 'xxx_'; /* if you are not sure, check with phpmyadmin your database for table: ppgal_images.. if its called vb_ppgal_images then your tableprefix is vb_ ( you can also find the tableprefix in the vbulletin config file - forums/includes/config.php)*/
/* Config for your gallery -- REQUIRED -- */
// first the url to the gallery
$galimg['galleryurl'] = 'http://www.heli-hannover.de/gallery'; // no trailing slash
// then the url to your files directory
$galimg['galleryfiles'] = 'http://www.heli-hannover.de/gallery/files'; // no trailing slash
// END OF REQUIRED CONFIG
/* Config phrase */
$galimg['noimages'] = 'No Images to display'; // phrase to tell user there are no images.. set to $galimg['noimages'] = ''; if you dont want any text..
/* Config for categories */
$galimg['includecatids'] = "'5','6','7','25'"; // make sure there are images in those cats
$galimg['allcats'] = true; // if false, you only get images from the included cats, if set to true, it overrides the includecats and takes images from the whole gallery, ignoring includecats
$galimg['extension'] = 'jpg'; // file extensions to show.. $galimg['extension'] = ''; to show all extensions.. ATTENTION.. if you have mp3s or videos or other this could give errors.. so $galimg['extension'] = 'jpg'; is recomended!!!
/* Config min or max sizes */
$galimg['useminmax'] = false; // if you are pulling images, you might want to limit the size to images that are bigger or smaller than a certain value so your layout wont break. If so, set this to true.. But be carefull: you must have images in the db that fit those sizes..
// these settings have no effect if you pull thumbnails !!!!
$galimg['minsize'] = '300'; // only display images that are bigger than that size in pixels (height and width)
$galimg['maxsize'] = '600'; // only display images that are smaller than that size in pixels (height and width)
/* Config for output */
$galimg['outputtype'] = 'thumb'; // output type settings: 'thumb' is thumbnail, 'image' is normal image
$galimg['outputnumber'] = 5; // set how many images or thumbs to pull from database.. (0 turns the whole thing off)
$galimg['random'] = false; // images will be random if true, if false they will show newest images..
$galimg['vertical'] = false; // true aligns the images vertically.. false horizontally
$galimg['spacing'] = 5; // spacing between the images ( its a margin.. so if you have more than 1 image, the real spacing will be two times the value in pixels you defined here.. $galimg['spacing']*2)
$galimg['galalign'] = 'center'; // output of div only 'center', 'left' or 'right' are accepted
/* Config for imageframe */
$galimg['useframe'] = true; // turns frame on and off
$galimg['framewidth'] = 8; // width of the frame. Just the amount. pixels are added in script
$galimg['framecolor'] = '#F7F7F7'; // color of the frame
$galimg['frameborderlight'] = '#E6E6E1'; // color of the lighter frame border
$galimg['frameborderdark'] = '#DADAD6'; // color of the darker frame border
/***********************************/
/********** End CONFIG ***********/
/***********************************/
/**** No need to touch below *****/
$galimg['outputnumber'] = intval($galimg['outputnumber']);
if($galimg['outputnumber'] > 0)
{
// clean vars
$galimg['outputtype'] = ($galimg['outputtype'] == 'image') ? 'image' : 'thumb';
$galimg['minmaxval'] = '';
if($galimg['useminmax'] AND $galimg['outputtype'] == 'image')
{
$galimg['minmaxval'] = ' AND height > ' . $galimg['minsize'] . ' AND width > ' . $galimg['minsize'] . ' AND height < ' . $galimg['maxsize'] . ' AND width < ' . $galimg['maxsize'];
}
$galimg['where'] = '';
if($galimg['allcats'])
{
if(strlen($galimg['extension'])>2)
{
$galimg['where'] = "WHERE extension = '" . $galimg['extension'] . "' AND valid = 1" . $galimg['minmaxval'];
}
}
else
{
if(!empty($galimg['includecatids']))
{
$galimg['where'] = "WHERE catid IN ('0',".$galimg['includecatids'].") AND valid = 1" . $galimg['minmaxval'];
if(strlen($galimg['extension'])>2)
{
$galimg['where'] .= " AND extension = '" . $galimg['extension'] . "'";
}
}
else
{
if(strlen($galimg['extension'])>2)
{
$galimg['where'] = "WHERE extension = '" . $galimg['extension'] . "' AND valid = 1" . $galimg['minmaxval'];
}
}
}
$galimg['orderby'] = ($galimg['random']) ? 'RAND(NOW())' : 'dateline DESC, imageid';
$galimg['galleryfiles'] = $galimg['galleryfiles'] . '/';
// construct the style for the image
$galimg['spacing'] = intval($galimg['spacing']);
if($galimg['spacing']>0 OR $galimg['useframe'])
{
$galimg['style'] = ' style="';
if($galimg['spacing']>0)
{
$galimg['style'] .= 'margin:' . $galimg['spacing'] . 'px;';
}
if($galimg['useframe'])
{
$galimg['style'] .= 'padding:' . $galimg['framewidth'] . 'px;';
$galimg['style'] .= 'background-color:' . $galimg['framecolor'] . ';';
$galimg['style'] .= 'border-top:1px solid ' . $galimg['frameborderlight'] . ';';
$galimg['style'] .= 'border-left:1px solid ' . $galimg['frameborderlight'] . ';';
$galimg['style'] .= 'border-bottom:1px solid ' . $galimg['frameborderdark'] . ';';
$galimg['style'] .= 'border-right:1px solid ' . $galimg['frameborderdark'] . ';';
}
$galimg['style'] .= '" ';
}
else
{
$galimg['style'] = '';
}
// connect to db and get the images
$con = mysql_connect("$galimg[host]","$galimg[dbusername]","$galimg[dbpassword]") or die( "Unable to connect to mySQL server");
mysql_select_db("$galimg[dbname]", $con);
$sql ="SELECT imageid, title, userid, filename, width, height, thumbname
FROM " . $galimg['tableprefix'] . "ppgal_images
$galimg[where]
ORDER BY $galimg[orderby]
LIMIT $galimg[outputnumber]";
$result = mysql_query($sql);
if ($result)
{
$row = array();
if(!in_array($galimg['galalign'],array('left', 'right', 'center')))
{
$galimg['galalign'] = 'center';
}
$output = '<div align="' . $galimg['galalign'] . '">';
while($row = mysql_fetch_array($result))
{
$imageid = $row['imageid'];
$userid = $row['userid'];
$title = stripslashes($row['title']);
if($galimg['outputtype'] == 'image')
{
$filename = $row['filename'];
$widthheight = 'width="' . $row['width'] . '" height="' . $row['height'] . '"';
}
else
{
$filename = $row['thumbname'];
$widthheight = '';
}
$arrChars = array();
for ($i = 0; $i < strlen($userid); $i++)
{
$arrChars[] = $userid[$i];
}
$uid = '';
foreach ($arrChars as $char)
{
$uid = $uid . $char ."/";
}
$output .= "
'<div class="vbcmsmodul collapse">
<h2 class="blockhead vbcmsmodul_head">
Galerie
</h2>
<div class="blockrow vbcmsmodul_body">'
<a href=\"$galimg[galleryurl]/showimage.php?i=$imageid\"><img $galimg[style] src=\"$galimg[galleryfiles]$uid$filename\" alt=\"$title\" $widthheight border=\"0\" /></a>";
if($galimg['vertical'])
{
$output .= '<br />';
}
}
$output .= '</div></div></div>';
mysql_free_result($result);
unset($row);
}
else
{
$output = $galimg['noimages'];
}
if($galimg['debug'])
{
$output = $output . '<div align="center" style="margin-top:30px;"><b>Attention !!!</b> debug is on, set it to false if you are in production environment!</div><br /><br /><br />';
}
echo $output;
}
unset($galimg);
unset($output);
/****** /Pull image from Gallery - END *****/
$output=ob_get_contents();
?>
|

08.08.2010, 11:09
 |
Aufsteigender Benutzer
|
|
Join Date: 11.2007
Location: Hannover
Age: 39
Posts: 152
Rep Power: 5
|
|
So habe noch was versucht, aber dann werde die Bilder untereinander angezeigt. Der Rahmen ist aber dann vorhanden, aber auch mehrmals:
Code:
<?php
/****** Pull images from vBGallery to external php page *****/
error_reporting(E_ALL & ~E_NOTICE);
if(!is_array($galimg))
{
$galimg = array();
}
// do not touch above
/***********************************/
/********** Start CONFIG ***********/
/***********************************/
$galimg['debug'] = false; // if set to true this bypasses security.. once you set a password in the main page, set this to false
$galimg['dbusername'] = 'xxx'; // the username for your db
$galimg['dbpassword'] = 'xxx'; // the password for your db
$galimg['dbname'] = 'xxx'; // the name of the database in which the gallery data is
$galimg['host'] = 'localhost'; // in 90% of cases its localhost, if not you can check in your vbulletin config file.
$galimg['tableprefix'] = 'xxx_'; /* if you are not sure, check with phpmyadmin your database for table: ppgal_images.. if its called vb_ppgal_images then your tableprefix is vb_ ( you can also find the tableprefix in the vbulletin config file - forums/includes/config.php)*/
/* Config for your gallery -- REQUIRED -- */
// first the url to the gallery
$galimg['galleryurl'] = 'http://www.heli-hannover.de/gallery'; // no trailing slash
// then the url to your files directory
$galimg['galleryfiles'] = 'http://www.heli-hannover.de/gallery/files'; // no trailing slash
// END OF REQUIRED CONFIG
/* Config phrase */
$galimg['noimages'] = 'No Images to display'; // phrase to tell user there are no images.. set to $galimg['noimages'] = ''; if you dont want any text..
/* Config for categories */
$galimg['includecatids'] = "'5','6','7','25'"; // make sure there are images in those cats
$galimg['allcats'] = true; // if false, you only get images from the included cats, if set to true, it overrides the includecats and takes images from the whole gallery, ignoring includecats
$galimg['extension'] = 'jpg'; // file extensions to show.. $galimg['extension'] = ''; to show all extensions.. ATTENTION.. if you have mp3s or videos or other this could give errors.. so $galimg['extension'] = 'jpg'; is recomended!!!
/* Config min or max sizes */
$galimg['useminmax'] = false; // if you are pulling images, you might want to limit the size to images that are bigger or smaller than a certain value so your layout wont break. If so, set this to true.. But be carefull: you must have images in the db that fit those sizes..
// these settings have no effect if you pull thumbnails !!!!
$galimg['minsize'] = '300'; // only display images that are bigger than that size in pixels (height and width)
$galimg['maxsize'] = '600'; // only display images that are smaller than that size in pixels (height and width)
/* Config for output */
$galimg['outputtype'] = 'thumb'; // output type settings: 'thumb' is thumbnail, 'image' is normal image
$galimg['outputnumber'] = 5; // set how many images or thumbs to pull from database.. (0 turns the whole thing off)
$galimg['random'] = false; // images will be random if true, if false they will show newest images..
$galimg['vertical'] = false; // true aligns the images vertically.. false horizontally
$galimg['spacing'] = 5; // spacing between the images ( its a margin.. so if you have more than 1 image, the real spacing will be two times the value in pixels you defined here.. $galimg['spacing']*2)
$galimg['galalign'] = 'center'; // output of div only 'center', 'left' or 'right' are accepted
/* Config for imageframe */
$galimg['useframe'] = true; // turns frame on and off
$galimg['framewidth'] = 8; // width of the frame. Just the amount. pixels are added in script
$galimg['framecolor'] = '#F7F7F7'; // color of the frame
$galimg['frameborderlight'] = '#E6E6E1'; // color of the lighter frame border
$galimg['frameborderdark'] = '#DADAD6'; // color of the darker frame border
/***********************************/
/********** End CONFIG ***********/
/***********************************/
/**** No need to touch below *****/
$galimg['outputnumber'] = intval($galimg['outputnumber']);
if($galimg['outputnumber'] > 0)
{
// clean vars
$galimg['outputtype'] = ($galimg['outputtype'] == 'image') ? 'image' : 'thumb';
$galimg['minmaxval'] = '';
if($galimg['useminmax'] AND $galimg['outputtype'] == 'image')
{
$galimg['minmaxval'] = ' AND height > ' . $galimg['minsize'] . ' AND width > ' . $galimg['minsize'] . ' AND height < ' . $galimg['maxsize'] . ' AND width < ' . $galimg['maxsize'];
}
$galimg['where'] = '';
if($galimg['allcats'])
{
if(strlen($galimg['extension'])>2)
{
$galimg['where'] = "WHERE extension = '" . $galimg['extension'] . "' AND valid = 1" . $galimg['minmaxval'];
}
}
else
{
if(!empty($galimg['includecatids']))
{
$galimg['where'] = "WHERE catid IN ('0',".$galimg['includecatids'].") AND valid = 1" . $galimg['minmaxval'];
if(strlen($galimg['extension'])>2)
{
$galimg['where'] .= " AND extension = '" . $galimg['extension'] . "'";
}
}
else
{
if(strlen($galimg['extension'])>2)
{
$galimg['where'] = "WHERE extension = '" . $galimg['extension'] . "' AND valid = 1" . $galimg['minmaxval'];
}
}
}
$galimg['orderby'] = ($galimg['random']) ? 'RAND(NOW())' : 'dateline DESC, imageid';
$galimg['galleryfiles'] = $galimg['galleryfiles'] . '/';
// construct the style for the image
$galimg['spacing'] = intval($galimg['spacing']);
if($galimg['spacing']>0 OR $galimg['useframe'])
{
$galimg['style'] = ' style="';
if($galimg['spacing']>0)
{
$galimg['style'] .= 'margin:' . $galimg['spacing'] . 'px;';
}
if($galimg['useframe'])
{
$galimg['style'] .= 'padding:' . $galimg['framewidth'] . 'px;';
$galimg['style'] .= 'background-color:' . $galimg['framecolor'] . ';';
$galimg['style'] .= 'border-top:1px solid ' . $galimg['frameborderlight'] . ';';
$galimg['style'] .= 'border-left:1px solid ' . $galimg['frameborderlight'] . ';';
$galimg['style'] .= 'border-bottom:1px solid ' . $galimg['frameborderdark'] . ';';
$galimg['style'] .= 'border-right:1px solid ' . $galimg['frameborderdark'] . ';';
}
$galimg['style'] .= '" ';
}
else
{
$galimg['style'] = '';
}
// connect to db and get the images
$con = mysql_connect("$galimg[host]","$galimg[dbusername]","$galimg[dbpassword]") or die( "Unable to connect to mySQL server");
mysql_select_db("$galimg[dbname]", $con);
$sql ="SELECT imageid, title, userid, filename, width, height, thumbname
FROM " . $galimg['tableprefix'] . "ppgal_images
$galimg[where]
ORDER BY $galimg[orderby]
LIMIT $galimg[outputnumber]";
$result = mysql_query($sql);
if ($result)
{
$row = array();
if(!in_array($galimg['galalign'],array('left', 'right', 'center')))
{
$galimg['galalign'] = 'center';
}
$output = '<div align="' . $galimg['galalign'] . '">';
while($row = mysql_fetch_array($result))
{
$imageid = $row['imageid'];
$userid = $row['userid'];
$title = stripslashes($row['title']);
if($galimg['outputtype'] == 'image')
{
$filename = $row['filename'];
$widthheight = 'width="' . $row['width'] . '" height="' . $row['height'] . '"';
}
else
{
$filename = $row['thumbname'];
$widthheight = '';
}
$arrChars = array();
for ($i = 0; $i < strlen($userid); $i++)
{
$arrChars[] = $userid[$i];
}
$uid = '';
foreach ($arrChars as $char)
{
$uid = $uid . $char ."/";
}
$output .= "
'<div class=\"vbcmsmodul collapse\">
<h2 class=\"blockhead vbcmsmodul_head\">
Galerie
</h2>
<div class=\"blockrow vbcmsmodul_body\">
<a href=\"$galimg[galleryurl]/showimage.php?i=$imageid\"><img $galimg[style] src=\"$galimg[galleryfiles]$uid$filename\" alt=\"$title\" $widthheight border=\"0\" /></a>";
if($galimg['vertical'])
{
$output .= '<br />';
}
}
$output .= '</div></div></div>';
mysql_free_result($result);
unset($row);
}
else
{
$output = $galimg['noimages'];
}
if($galimg['debug'])
{
$output = $output . '<div align="center" style="margin-top:30px;"><b>Attention !!!</b> debug is on, set it to false if you are in production environment!</div><br /><br /><br />';
}
echo $output;
}
unset($galimg);
unset($output);
/****** /Pull image from Gallery - END *****/
$output=ob_get_contents();
?>
Habe die \ noch eingefügt !
Komisch ist auch, dass nur die Bilder angezeigt werden und nicht die Beschreibung und der Uploader.
|

09.08.2010, 15:48
 |
Web Design
|
|
Join Date: 12.2003
Location: In Spocks Quartier
Age: 33
Posts: 16,877
Rep Power: 10
|
|
Code:
$output .= "
'<div class=\"vbcmsmodul collapse\">
Rot markiertes gehört da nicht hin.
|

10.08.2010, 16:36
 |
Aufsteigender Benutzer
|
|
Join Date: 11.2007
Location: Hannover
Age: 39
Posts: 152
Rep Power: 5
|
|
|
Ja, dann werden mir die Bilder aber alle untereinander angezeigt mit jeweils einen Rahmen von <div class=\"vbcmsmodul collapse\"> !
|

10.08.2010, 16:50
 |
Aufsteigender Benutzer
|
|
Join Date: 11.2007
Location: Hannover
Age: 39
Posts: 152
Rep Power: 5
|
|
So ich habe es hinbekommen, Der eigene Eintrag musste weiter nach oben, hier der richtige Code für alle, die es gebrauchen können (Es muss nur oben die Datenbank angegeben und mit den xxx ersetzt werden).
Beispiel: Startseite - Heli-Hannover.de - Heli Freunde in und um Hannover
Ganz nach unten Scrollen !!!
Code:
<?php
/****** Pull images from vBGallery to external php page *****/
error_reporting(E_ALL & ~E_NOTICE);
if(!is_array($galimg))
{
$galimg = array();
}
// do not touch above
/***********************************/
/********** Start CONFIG ***********/
/***********************************/
$galimg['debug'] = false; // if set to true this bypasses security.. once you set a password in the main page, set this to false
$galimg['dbusername'] = 'xxx'; // the username for your db
$galimg['dbpassword'] = 'xxx'; // the password for your db
$galimg['dbname'] = 'xxx'; // the name of the database in which the gallery data is
$galimg['host'] = 'localhost'; // in 90% of cases its localhost, if not you can check in your vbulletin config file.
$galimg['tableprefix'] = 'xxx_'; /* if you are not sure, check with phpmyadmin your database for table: ppgal_images.. if its called vb_ppgal_images then your tableprefix is vb_ ( you can also find the tableprefix in the vbulletin config file - forums/includes/config.php)*/
/* Config for your gallery -- REQUIRED -- */
// first the url to the gallery
$galimg['galleryurl'] = 'http://www.heli-hannover.de/gallery'; // no trailing slash
// then the url to your files directory
$galimg['galleryfiles'] = 'http://www.heli-hannover.de/gallery/files'; // no trailing slash
// END OF REQUIRED CONFIG
/* Config phrase */
$galimg['noimages'] = 'No Images to display'; // phrase to tell user there are no images.. set to $galimg['noimages'] = ''; if you dont want any text..
/* Config for categories */
$galimg['includecatids'] = "'5','6','7','25'"; // make sure there are images in those cats
$galimg['allcats'] = true; // if false, you only get images from the included cats, if set to true, it overrides the includecats and takes images from the whole gallery, ignoring includecats
$galimg['extension'] = 'jpg'; // file extensions to show.. $galimg['extension'] = ''; to show all extensions.. ATTENTION.. if you have mp3s or videos or other this could give errors.. so $galimg['extension'] = 'jpg'; is recomended!!!
/* Config min or max sizes */
$galimg['useminmax'] = false; // if you are pulling images, you might want to limit the size to images that are bigger or smaller than a certain value so your layout wont break. If so, set this to true.. But be carefull: you must have images in the db that fit those sizes..
// these settings have no effect if you pull thumbnails !!!!
$galimg['minsize'] = '300'; // only display images that are bigger than that size in pixels (height and width)
$galimg['maxsize'] = '600'; // only display images that are smaller than that size in pixels (height and width)
/* Config for output */
$galimg['outputtype'] = 'thumb'; // output type settings: 'thumb' is thumbnail, 'image' is normal image
$galimg['outputnumber'] = 5; // set how many images or thumbs to pull from database.. (0 turns the whole thing off)
$galimg['random'] = false; // images will be random if true, if false they will show newest images..
$galimg['vertical'] = false; // true aligns the images vertically.. false horizontally
$galimg['spacing'] = 5; // spacing between the images ( its a margin.. so if you have more than 1 image, the real spacing will be two times the value in pixels you defined here.. $galimg['spacing']*2)
$galimg['galalign'] = 'center'; // output of div only 'center', 'left' or 'right' are accepted
/* Config for imageframe */
$galimg['useframe'] = true; // turns frame on and off
$galimg['framewidth'] = 8; // width of the frame. Just the amount. pixels are added in script
$galimg['framecolor'] = '#F7F7F7'; // color of the frame
$galimg['frameborderlight'] = '#E6E6E1'; // color of the lighter frame border
$galimg['frameborderdark'] = '#DADAD6'; // color of the darker frame border
/***********************************/
/********** End CONFIG ***********/
/***********************************/
/**** No need to touch below *****/
$galimg['outputnumber'] = intval($galimg['outputnumber']);
if($galimg['outputnumber'] > 0)
{
// clean vars
$galimg['outputtype'] = ($galimg['outputtype'] == 'image') ? 'image' : 'thumb';
$galimg['minmaxval'] = '';
if($galimg['useminmax'] AND $galimg['outputtype'] == 'image')
{
$galimg['minmaxval'] = ' AND height > ' . $galimg['minsize'] . ' AND width > ' . $galimg['minsize'] . ' AND height < ' . $galimg['maxsize'] . ' AND width < ' . $galimg['maxsize'];
}
$galimg['where'] = '';
if($galimg['allcats'])
{
if(strlen($galimg['extension'])>2)
{
$galimg['where'] = "WHERE extension = '" . $galimg['extension'] . "' AND valid = 1" . $galimg['minmaxval'];
}
}
else
{
if(!empty($galimg['includecatids']))
{
$galimg['where'] = "WHERE catid IN ('0',".$galimg['includecatids'].") AND valid = 1" . $galimg['minmaxval'];
if(strlen($galimg['extension'])>2)
{
$galimg['where'] .= " AND extension = '" . $galimg['extension'] . "'";
}
}
else
{
if(strlen($galimg['extension'])>2)
{
$galimg['where'] = "WHERE extension = '" . $galimg['extension'] . "' AND valid = 1" . $galimg['minmaxval'];
}
}
}
$galimg['orderby'] = ($galimg['random']) ? 'RAND(NOW())' : 'dateline DESC, imageid';
$galimg['galleryfiles'] = $galimg['galleryfiles'] . '/';
// construct the style for the image
$galimg['spacing'] = intval($galimg['spacing']);
if($galimg['spacing']>0 OR $galimg['useframe'])
{
$galimg['style'] = ' style="';
if($galimg['spacing']>0)
{
$galimg['style'] .= 'margin:' . $galimg['spacing'] . 'px;';
}
if($galimg['useframe'])
{
$galimg['style'] .= 'padding:' . $galimg['framewidth'] . 'px;';
$galimg['style'] .= 'background-color:' . $galimg['framecolor'] . ';';
$galimg['style'] .= 'border-top:1px solid ' . $galimg['frameborderlight'] . ';';
$galimg['style'] .= 'border-left:1px solid ' . $galimg['frameborderlight'] . ';';
$galimg['style'] .= 'border-bottom:1px solid ' . $galimg['frameborderdark'] . ';';
$galimg['style'] .= 'border-right:1px solid ' . $galimg['frameborderdark'] . ';';
}
$galimg['style'] .= '" ';
}
else
{
$galimg['style'] = '';
}
// connect to db and get the images
$con = mysql_connect("$galimg[host]","$galimg[dbusername]","$galimg[dbpassword]") or die( "Unable to connect to mySQL server");
mysql_select_db("$galimg[dbname]", $con);
$sql ="SELECT imageid, title, userid, filename, width, height, thumbname
FROM " . $galimg['tableprefix'] . "ppgal_images
$galimg[where]
ORDER BY $galimg[orderby]
LIMIT $galimg[outputnumber]";
$result = mysql_query($sql);
if ($result)
{
$row = array();
if(!in_array($galimg['galalign'],array('left', 'right', 'center')))
{
$galimg['galalign'] = 'center';
}
$output = '<div align="' . $galimg['galalign'] . '">
<div class="vbcmsmodul collapse">
<h2 class="blockhead vbcmsmodul_head">
Galerie
</h2>
<div class="blockrow vbcmsmodul_body">
';
while($row = mysql_fetch_array($result))
{
$imageid = $row['imageid'];
$userid = $row['userid'];
$title = stripslashes($row['title']);
if($galimg['outputtype'] == 'image')
{
$filename = $row['filename'];
$widthheight = 'width="' . $row['width'] . '" height="' . $row['height'] . '"';
}
else
{
$filename = $row['thumbname'];
$widthheight = '';
}
$arrChars = array();
for ($i = 0; $i < strlen($userid); $i++)
{
$arrChars[] = $userid[$i];
}
$uid = '';
foreach ($arrChars as $char)
{
$uid = $uid . $char ."/";
}
$output .= "
<a href=\"$galimg[galleryurl]/showimage.php?i=$imageid\"><img $galimg[style] src=\"$galimg[galleryfiles]$uid$filename\" alt=\"$title\" $widthheight border=\"0\" /></a>";
if($galimg['vertical'])
{
$output .= '<br />';
}
}
$output .= '</div></div></div>';
mysql_free_result($result);
unset($row);
}
else
{
$output = $galimg['noimages'];
}
if($galimg['debug'])
{
$output = $output . '<div align="center" style="margin-top:30px;"><b>Attention !!!</b> debug is on, set it to false if you are in production environment!</div><br /><br /><br />';
}
echo $output;
}
unset($galimg);
unset($output);
/****** /Pull image from Gallery - END *****/
$output=ob_get_contents();
?>
|

11.08.2010, 17:24
 |
Aufsteigender Benutzer
|
|
Join Date: 11.2007
Location: Hannover
Age: 39
Posts: 152
Rep Power: 5
|
|
So, nun ist es noch besser.
Habe ein wenig Infos hinzugefügt wie: Uploader, Views und Kommentaranzahl sowie den Link zum User: Beispiel: Startseite - Heli-Hannover.de - Heli Freunde in und um Hannover
Code:
<?php
/****** Pull images from vBGallery to external php page *****/
error_reporting(E_ALL & ~E_NOTICE);
if(!is_array($galimg))
{
$galimg = array();
}
// do not touch above
/***********************************/
/********** Start CONFIG ***********/
/***********************************/
$galimg['debug'] = false; // if set to true this bypasses security.. once you set a password in the main page, set this to false
$galimg['dbusername'] = 'xxx'; // the username for your db
$galimg['dbpassword'] = 'xxx'; // the password for your db
$galimg['dbname'] = 'xxx'; // the name of the database in which the gallery data is
$galimg['host'] = 'localhost'; // in 90% of cases its localhost, if not you can check in your vbulletin config file.
$galimg['tableprefix'] = 'xxx'; /* if you are not sure, check with phpmyadmin your database for table: ppgal_images.. if its called vb_ppgal_images then your tableprefix is vb_ ( you can also find the tableprefix in the vbulletin config file - forums/includes/config.php)*/
/* Config for your gallery -- REQUIRED -- */
// first the url to the gallery
$galimg['galleryurl'] = 'http://www.xxx.de/gallery'; // no trailing slash
// then the url to your files directory
$galimg['galleryfiles'] = 'http://www.xxx.de/gallery/files'; // no trailing slash
// END OF REQUIRED CONFIG
/* Config phrase */
$galimg['noimages'] = 'No Images to display'; // phrase to tell user there are no images.. set to $galimg['noimages'] = ''; if you dont want any text..
/* Config for categories */
$galimg['includecatids'] = "'5','6','7','25'"; // make sure there are images in those cats
$galimg['allcats'] = true; // if false, you only get images from the included cats, if set to true, it overrides the includecats and takes images from the whole gallery, ignoring includecats
$galimg['extension'] = 'jpg'; // file extensions to show.. $galimg['extension'] = ''; to show all extensions.. ATTENTION.. if you have mp3s or videos or other this could give errors.. so $galimg['extension'] = 'jpg'; is recomended!!!
/* Config min or max sizes */
$galimg['useminmax'] = false; // if you are pulling images, you might want to limit the size to images that are bigger or smaller than a certain value so your layout wont break. If so, set this to true.. But be carefull: you must have images in the db that fit those sizes..
// these settings have no effect if you pull thumbnails !!!!
$galimg['minsize'] = '300'; // only display images that are bigger than that size in pixels (height and width)
$galimg['maxsize'] = '600'; // only display images that are smaller than that size in pixels (height and width)
/* Config for output */
$galimg['outputtype'] = 'thumb'; // output type settings: 'thumb' is thumbnail, 'image' is normal image
$galimg['outputnumber'] = 5; // set how many images or thumbs to pull from database.. (0 turns the whole thing off)
$galimg['random'] = false; // images will be random if true, if false they will show newest images..
$galimg['vertical'] = false; // true aligns the images vertically.. false horizontally
$galimg['spacing'] = 5; // spacing between the images ( its a margin.. so if you have more than 1 image, the real spacing will be two times the value in pixels you defined here.. $galimg['spacing']*2)
$galimg['galalign'] = 'center'; // output of div only 'center', 'left' or 'right' are accepted
/* Config for imageframe */
$galimg['useframe'] = true; // turns frame on and off
$galimg['framewidth'] = 8; // width of the frame. Just the amount. pixels are added in script
$galimg['framecolor'] = '#F7F7F7'; // color of the frame
$galimg['frameborderlight'] = '#E6E6E1'; // color of the lighter frame border
$galimg['frameborderdark'] = '#DADAD6'; // color of the darker frame border
/***********************************/
/********** End CONFIG ***********/
/***********************************/
/**** No need to touch below *****/
$galimg['outputnumber'] = intval($galimg['outputnumber']);
if($galimg['outputnumber'] > 0)
{
// clean vars
$galimg['outputtype'] = ($galimg['outputtype'] == 'image') ? 'image' : 'thumb';
$galimg['minmaxval'] = '';
if($galimg['useminmax'] AND $galimg['outputtype'] == 'image')
{
$galimg['minmaxval'] = ' AND height > ' . $galimg['minsize'] . ' AND width > ' . $galimg['minsize'] . ' AND height < ' . $galimg['maxsize'] . ' AND width < ' . $galimg['maxsize'];
}
$galimg['where'] = '';
if($galimg['allcats'])
{
if(strlen($galimg['extension'])>2)
{
$galimg['where'] = "WHERE extension = '" . $galimg['extension'] . "' AND valid = 1" . $galimg['minmaxval'];
}
}
else
{
if(!empty($galimg['includecatids']))
{
$galimg['where'] = "WHERE catid IN ('0',".$galimg['includecatids'].") AND valid = 1" . $galimg['minmaxval'];
if(strlen($galimg['extension'])>2)
{
$galimg['where'] .= " AND extension = '" . $galimg['extension'] . "'";
}
}
else
{
if(strlen($galimg['extension'])>2)
{
$galimg['where'] = "WHERE extension = '" . $galimg['extension'] . "' AND valid = 1" . $galimg['minmaxval'];
}
}
}
$galimg['orderby'] = ($galimg['random']) ? 'RAND(NOW())' : 'dateline DESC, imageid';
$galimg['galleryfiles'] = $galimg['galleryfiles'] . '/';
// construct the style for the image
$galimg['spacing'] = intval($galimg['spacing']);
if($galimg['spacing']>0 OR $galimg['useframe'])
{
$galimg['style'] = ' style="';
if($galimg['spacing']>0)
{
$galimg['style'] .= 'margin:' . $galimg['spacing'] . 'px;';
}
if($galimg['useframe'])
{
$galimg['style'] .= 'padding:' . $galimg['framewidth'] . 'px;';
$galimg['style'] .= 'background-color:' . $galimg['framecolor'] . ';';
$galimg['style'] .= 'border-top:1px solid ' . $galimg['frameborderlight'] . ';';
$galimg['style'] .= 'border-left:1px solid ' . $galimg['frameborderlight'] . ';';
$galimg['style'] .= 'border-bottom:1px solid ' . $galimg['frameborderdark'] . ';';
$galimg['style'] .= 'border-right:1px solid ' . $galimg['frameborderdark'] . ';';
}
$galimg['style'] .= '" ';
}
else
{
$galimg['style'] = '';
}
// connect to db and get the images
$con = mysql_connect("$galimg[host]","$galimg[dbusername]","$galimg[dbpassword]") or die( "Unable to connect to mySQL server");
mysql_select_db("$galimg[dbname]", $con);
$sql ="SELECT imageid, title, userid, username, views, posts, filename, width, height, thumbname
FROM " . $galimg['tableprefix'] . "ppgal_images
$galimg[where]
ORDER BY $galimg[orderby]
LIMIT $galimg[outputnumber]";
$result = mysql_query($sql);
if ($result)
{
$row = array();
if(!in_array($galimg['galalign'],array('left', 'right', 'center')))
{
$galimg['galalign'] = 'center';
}
$output = '
<div class="vbcmsmodul collapse">
<h2 class="blockhead vbcmsmodul_head">
Die letzten 5 Galerie Bilder</h2>
<div class="blockrow vbcmsmodul_body">
<div align="' . $galimg['galalign'] . '">
<table border="0" width="100%">
<tr>
';
while($row = mysql_fetch_array($result))
{
$imageid = $row['imageid'];
$userid = $row['userid'];
$username = $row['username'];
$views = $row['views'];
$posts = $row['posts'];
$title = stripslashes($row['title']);
if($galimg['outputtype'] == 'image')
{
$filename = $row['filename'];
$widthheight = 'width="' . $row['width'] . '" height="' . $row['height'] . '"';
}
else
{
$filename = $row['thumbname'];
$widthheight = '';
}
$arrChars = array();
for ($i = 0; $i < strlen($userid); $i++)
{
$arrChars[] = $userid[$i];
}
$uid = '';
foreach ($arrChars as $char)
{
$uid = $uid . $char ."/";
}
$output .= "
<td align=\"center\">
$title<br /><a href=\"$galimg[galleryurl]/showimage.php?i=$imageid\"><img $galimg[style] src=\"$galimg[galleryfiles]$uid$filename\" $widthheight border=\"0\" /></a><br />Von: <b><a href=\"/member.php?u=$userid\">$username</a></b><br />Angesehen: $views<br />Kommentare: $posts";
if($galimg['vertical'])
{
$output .= '<br />';
}
}
$output .= '</tr></table></div></div></div>';
mysql_free_result($result);
unset($row);
}
else
{
$output = $galimg['noimages'];
}
if($galimg['debug'])
{
$output = $output . '<div align="center" style="margin-top:30px;"><b>Attention !!!</b> debug is on, set it to false if you are in production environment!</div><br /><br /><br />';
}
echo $output;
}
unset($galimg);
unset($output);
/****** /Pull image from Gallery - END *****/
$output=ob_get_contents();
?>
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
HTML code is Off
|
|
|
|