[Hack]Imágenes aleatorias de vbGallery

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:


Resultados 1 al 8 de 8

Temas similares

  1. Por Dtech en el foro vBulletin 3 - Preguntas, Problemas y Soluciones
  2. Por tresor en el foro vBulletin 3 - Preguntas, Problemas y Soluciones
  3. Por tresor en el foro vBulletin 3 - Preguntas, Problemas y Soluciones
  4. problemas con vbgallery Respuestas: 0
    Por superbigo en el foro Soporte para Productos/Plugins
  1. #1
    Miembro especial Miembro de diamante Array Avatar de dbembibre
    Fecha de ingreso
    01 oct, 04
    Ubicación
    Madrid
    Mensajes
    518
    Gustado
    5 Veces
    Me Gustan
    0 Veces

    Predeterminado [Hack]Imágenes aleatorias de vbGallery

    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:

    Código PHP:
    'mailqueue' 
    Reemplaza con:

    Código PHP:
     'mailqueue'
        
    'gallery_c_cache'
        
    'adv_gallery_opt'
        
    'gallery_ugroups' 
    Ahora busca:

    Código PHP:
     'forumhome_subforumseparator_post' 
    Reemplaza con:

    Código PHP:
     'forumhome_subforumseparator_post'
    'adv_gallery_imagebit' 
    Ahora busca:


    Código PHP:
     // ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ### 
    Abajo de esto, añade:

    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($vbulletinfetch_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
    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&#237;a de Im&#225;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

  2. #2
    Miembro especial Miembro de diamante Array Avatar de dbembibre
    Fecha de ingreso
    01 oct, 04
    Ubicación
    Madrid
    Mensajes
    518
    Gustado
    5 Veces
    Me Gustan
    0 Veces

    Predeterminado Re: [Hack]Imágenes aleatorias de vbGallery

    Arriba ____________________

  3. #3
    Miembro especial Miembro de diamante Array Avatar de Galadnor
    Fecha de ingreso
    15 oct, 04
    Ubicación
    Santiasco de Chile
    Mensajes
    672
    Gustado
    1 Veces
    Me Gustan
    0 Veces

    Predeterminado Re: [Hack]Imágenes aleatorias de vbGallery

    Tu lo creaste?.. te basaste en algun otro Hack???

  4. #4
    Miembro especial Miembro de diamante Array Avatar de dbembibre
    Fecha de ingreso
    01 oct, 04
    Ubicación
    Madrid
    Mensajes
    518
    Gustado
    5 Veces
    Me Gustan
    0 Veces

    Predeterminado Re: [Hack]Imágenes aleatorias de vbGallery

    Cita Iniciado por Galadnor
    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.
    Puedes ver en vbulletin.org, que pone "based on dbembibre code"

  5. #5
    Miembro especial Miembro de plata Array
    Fecha de ingreso
    30 ene, 06
    Mensajes
    59
    Gustado
    0 Veces
    Me Gustan
    0 Veces

    Predeterminado Re: [Hack]Imágenes aleatorias de vbGallery

    como puedo acerlo pa poner las pics en un modulo en vbadvance alguien sabe?

  6. #6
    Miembro especial Miembro de diamante Array Avatar de dbembibre
    Fecha de ingreso
    01 oct, 04
    Ubicación
    Madrid
    Mensajes
    518
    Gustado
    5 Veces
    Me Gustan
    0 Veces

    Predeterminado Re: [Hack]Imágenes aleatorias de vbGallery

    Si lo tienes en vbulletin.org

  7. #7
    Miembro Array
    Fecha de ingreso
    09 jul, 06
    Mensajes
    1
    Gustado
    0 Veces
    Me Gustan
    0 Veces

    Predeterminado Re: [Hack]Imágenes aleatorias de vbGallery

    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

  8. #8
    Miembro Array Avatar de Diab0lic0x
    Fecha de ingreso
    04 mar, 06
    Mensajes
    8
    Gustado
    0 Veces
    Me Gustan
    0 Veces

    Predeterminado Re: [Hack]Imágenes aleatorias de vbGallery

    Alguien POdria Decirme si este Hack Sirve en la 3.6.??

    Salu2!