Esta es una discusión para el tema [Hack]Imágenes aleatorias de vbGallery en el foro Soporte para Productos/Plugins, bajo la categoría Soporte vBulletin; Os pongo el hack que publique hace un mes en vbadvanced, es para enseñar fotos de forma aleatorias de la galería de vbGallery en el foro vb3.5
Mensaje original: http://www.vbadvanced.com/forum/show...0449#post60449
Solo funciona con VB 3.5 ...
Página:
Os pongo el hack que publique hace un mes en vbadvanced, es para enseñar fotos de forma aleatorias de la galería de vbGallery en el foro vb3.5
Mensaje original: http://www.vbadvanced.com/forum/show...0449#post60449
Solo funciona con VB 3.5 y Gallery 1.01
Primero, abre forum/index.php y busca:
Reemplaza con:Código PHP:'mailqueue'
Ahora busca:Código PHP:'mailqueue',
'gallery_c_cache',
'adv_gallery_opt',
'gallery_ugroups'
Reemplaza con:Código PHP:'forumhome_subforumseparator_post'
Ahora busca:Código PHP:'forumhome_subforumseparator_post',
'adv_gallery_imagebit'
Abajo de esto, añade:Código PHP:// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###
(Camba la variable $galleryimagelimit por el número de fotos que quieres que aparezcan)Código PHP://Latest Images In ForumHome BEGIN
require_once('./includes/functions_gallery.php');
require_once('./includes/class_bbcode.php');
$galleryimagelimit = 3; //Number of Images to Display
$categorycache = unserialize($vbulletin->gallery_c_cache);
$galleryoptions = unserialize($vbulletin->adv_gallery_opt);
$gallery_permissions = unserialize($vbulletin->gallery_ugroups);
if (!empty($vba_options))
{
$vba_options = array_merge($vba_options, $galleryoptions);
}
else
{
$vba_options = $galleryoptions;
}
// Create a list of fields to be shown in the imagebit
$showfield = explode(',', $vba_options['gallery_imagebitdisplay']);
if (!empty($showfield))
{
$showfields = array();
foreach ($showfield AS $field)
{
$showfields["$field"] = 1;
}
}
// If you DON'T want of these fields to show then unremark
// the line in question by removing the "//" in the front it.
//$showfields['description'] = 0;
//$showfields['rating'] = 0;
//$showfields['user'] = 0;
//$showfields['dateline'] = 0;
//$showfields['views'] = 0;
$showfields['dimensions'] = 0;
$showfields['filesize'] = 0;
//$showfields['posts'] = 0;
$showfields['lastpost'] = 0;
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$query = fetch_image_fields();
// Turn the category field off/on in the display.
//$show['category'] = 0;
if ($privatecatids = fetch_private_categories())
{
$privatecatids = explode(',', $privatecatids);
}
if ($vba_options['gallery_homeexcats'])
{
$vba_options['gallery_homeexcats'] = explode(',', $vba_options['gallery_homeexcats']);
$privatecatids = iif(empty($privatecatids), $vba_options['gallery_homeexcats'], array_merge($privatecatids, $vba_options['gallery_homeexcats']));
}
if (!empty($privatecatids))
{
$privcatids = 'images.catid NOT IN(' . implode(',', $privatecatids) . ') AND ';
}
$bbuserino['usergrouparray'] = fetch_membergroupids_array($bbuserinfo);
if (empty($galleryperms))
{
$bbuserino['usergrouparray'] = fetch_membergroupids_array($bbuserinfo);
if (empty($bbuserinfo['usergrouparray']))
{
$bbuserinfo['usergrouparray'] = array(1);
}
foreach ($bbuserino['usergrouparray'] AS $usergroupid)
{
if (empty($gallery_permissions["$usergroupid"]))
{
$usergroupid = 1;
}
foreach ($gallerypermissionsbit AS $option => $value)
{
if (!$galleryperms["$option"] OR in_array($option, array('moderateimages', 'moderateposts')))
{
$galleryperms["$option"] = 0;
if ($gallery_permissions["$usergroupid"]['gallery_perms'] & $value)
{
$galleryperms["$option"] = 1;
}
}
}
}
}
$getrand = $db->query_read("
SELECT imageid, images.title, filename, thumbname, originalname, extension, images.catid $query[fields]
FROM " . TABLE_PREFIX . "adv_gallery_images AS images
$query[tables]
WHERE $privcatids valid = 1 $ignquery
ORDER BY RAND()
LIMIT $galleryimagelimit
");
if ($db->num_rows($getrand))
{
while ($images = $vbulletin->db->fetch_array($getrand))
{
$adv_sorturl = '&catid=' . $images['catid'];
$randomimagebits .= construct_imagebits($images);
}
$randomimagebits .= construct_empty_cellbits($vba_options['gallery_columns']);
}
$db->free_result($getrand);
unset($images);
// ### Update the template to have the path qualified ###
$randomimagebits = str_replace(array('"showimage.php', '"browseimages.php'), array('"' . $vba_options['gallery_url'] . '/showimage.php', '"' . $vba_options['gallery_url'] . '/browseimages.php'), $randomimagebits);
//Latest Images In ForumHome END
Panel de Admin->Administrador de Estilos[tu estilo]->Editar plantillas->ForumHome
Ahora añade a tu template 'FORUMHOME' donde quieras que aparezcan el hack de las imágenes aleatorias
Código:<!-- start Gallery Images --> <table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%"> <thead> <tr> <td class="tcat" colspan="$vba_options[gallery_columns]"> <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_gallery_random')"> <img id="collapseimg_forumhome_gallery_random" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomtopic].gif" alt="" border="0"/> </a> <a href=" $vboptions[homeurl]/gallery/index.php">Galería de Imágenes</a> </td> </tr> </thead> <tbody id="collapseobj_forumhome_gallery_random" style="$vbcollapse[collapseobj_forumhome_gallery_random]"> <tr>$randomimagebits</tr> </tbody> </table> <!-- end Gallery Images -->
Puedes verlo funcionando en: http://www.bmwfaq.com
Última edición por dbembibre; 14/10/2005 a las 03:45
Mi Blog 1: http://www.bmwfaq.com/blogs/danny/
Mi Blog 2: http://www.vbseo.com/blogs/danny-bembibre/
Mi Web: http://www.bmwfaq.com
Mi Web: http://tweetboard.com
Arriba ____________________
Mi Blog 1: http://www.bmwfaq.com/blogs/danny/
Mi Blog 2: http://www.vbseo.com/blogs/danny-bembibre/
Mi Web: http://www.bmwfaq.com
Mi Web: http://tweetboard.com
Tu lo creaste?.. te basaste en algun otro Hack???
Si es mio, copie la idea de uno para 3.0, un Inglés también me pidió si podía usar mi código y hacer un plugin y le dije que si.Iniciado por Galadnor
Puedes ver en vbulletin.org, que pone "based on dbembibre code"
Mi Blog 1: http://www.bmwfaq.com/blogs/danny/
Mi Blog 2: http://www.vbseo.com/blogs/danny-bembibre/
Mi Web: http://www.bmwfaq.com
Mi Web: http://tweetboard.com
como puedo acerlo pa poner las pics en un modulo en vbadvance alguien sabe?
Si lo tienes en vbulletin.org
Mi Blog 1: http://www.bmwfaq.com/blogs/danny/
Mi Blog 2: http://www.vbseo.com/blogs/danny-bembibre/
Mi Web: http://www.bmwfaq.com
Mi Web: http://tweetboard.com
tengo un problema y ya lei algo en vbadvance pero le pego poco al inlish...me sale el cuadrado colapsable pero sin las imagenes y diminuto...como sino se expandiera...que pasa?
edit: solucionado horas despues
Última edición por Icarus; 11/07/2006 a las 00:19
Alguien POdria Decirme si este Hack Sirve en la 3.6.??
Salu2!