D
dbembibre
Gamma
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
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/showthread.php?p=60449#post60449
Solo funciona con VB 3.5 y Gallery 1.01
Primero, abre forum/index.php y busca:
Reemplaza con:
Ahora busca:
Reemplaza con:
Ahora busca:
Abajo de esto, añade:
(Camba la variable $galleryimagelimit por el número de fotos que quieres que aparezcan)
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
Puedes verlo funcionando en: http://www.bmwfaq.com
Mensaje original: http://www.vbadvanced.com/forum/showthread.php?p=60449#post60449
Solo funciona con VB 3.5 y Gallery 1.01
Primero, abre forum/index.php y busca:
PHP:
'mailqueue'
Reemplaza con:
PHP:
'mailqueue',
'gallery_c_cache',
'adv_gallery_opt',
'gallery_ugroups'
Ahora busca:
PHP:
'forumhome_subforumseparator_post'
Reemplaza con:
PHP:
'forumhome_subforumseparator_post',
'adv_gallery_imagebit'
Ahora busca:
PHP:
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###
Abajo de esto, añade:
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
(Camba la variable $galleryimagelimit por el número de fotos que quieres que aparezcan)
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
Insertar CODE, HTML o PHP:
<!-- 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