Skocz do zawartości
  • 0
Feronso

Need gallery skin help

Pytanie

Hello Spanner :)

i found a Tutorial for IP.Gallery 2.2.3 that show how can randomly show 5 images on Board index 2.2.6

here is code

Open Sources/Action_public/boards.php

find


$this->process_all_cats();

ad after

$this->rand_gallery_images();

find


}


  ?>

add above

    function rand_gallery_images()

         {

             $rand5_html = "";


             if ( $this->ipsclass->vars['gallery_offline'] || ! $this->ipsclass->member['id'] )

             {

                 return $rand5_html;

             }


             $this->ipsclass->DB->build_query(array('select' => 'gallery_perms', 'from' => 'members', 'where' => "id=".$this->ipsclass->member['id']));

             $this->ipsclass->DB->exec_query();


             $this->ipsclass->member = array_merge($this->ipsclass->member, $this->ipsclass->DB->fetch_row());

             $perms = explode(':', $this->ipsclass->member['gallery_perms']);


             if (! $perms[2])

             {

                 return $rand5_html;

             }


             define( 'GALLERY_PATH'     , ROOT_PATH . 'sources/components_public/gallery/' );

             define( 'GALLERY_LIBS'     , GALLERY_PATH . 'lib/' );


             require_once( ROOT_PATH . 'sources/api/api_core.php' );

             require_once( ROOT_PATH . 'sources/api/gallery/api_gallery.php' );


             $this->ipsclass->vars['gallery_img_show_rate']     = 1;

             $this->ipsclass->vars['gallery_use_rate']          = 1;


             $this->ipsclass->load_language( 'lang_gallery' );

             $this->ipsclass->load_template( 'skin_gallery_global' );


             $this->ipsclass->DB->load_cache_file(ROOT_PATH.'sources/sql/'.SQL_DRIVER.'_gallery_queries.php', 'gallery_sql_queries');


             require_once( GALLERY_LIBS . 'lib_gallery.php' );

             $this->glib             = new lib_gallery();

             $this->glib->ipsclass     =& $this->ipsclass;

             $this->glib->category    =& $this->category;


             require( GALLERY_LIBS . 'lib_categories.php' );

             $this->category             = new lib_categories();

             $this->category->ipsclass     =& $this->ipsclass;

             $this->category->normal_init();


             require( GALLERY_LIBS . 'lib_albums.php' );

             $this->albums             = new lib_albums();

             $this->albums->ipsclass =& $this->ipsclass;

             $this->albums->glib     =& $this->glib;


             require_once ( GALLERY_LIBS . 'lib_imagelisting.php' );

             $img_list = new lib_imagelisting();

             $img_list->ipsclass     =& $this->ipsclass;

             $img_list->glib         =& $this->glib;

             $img_list->category        =& $this->category;

             $img_list->init();


             $gal_api             = new api_gallery;

             $gal_api->ipsclass     = $this->ipsclass;

             $gal_api->glib         = & $this->glib;

             $gal_api->category    = & $this->category;


             if ($this->ipsclass->vars['gallery_stats_where'] == 'both' || $this->ipsclass->vars['gallery_stats_where'] == 'cat')

             {

                 $allow_cats = $this->category->get_allowed_cats(1, $this->category->data);

                 if (! count($allow_cats)) return $rand5_html;

             }


             if ($this->ipsclass->vars['gallery_stats_where'] == 'both' || $this->ipsclass->vars['gallery_stats_where'] == 'album')

             {

                 $allow_albums = $this->glib->get_allowed_albums();

                 if (! count($allow_albums)) return $rand5_html;

             }


             $total = $this->ipsclass->vars['gallery_idx_num_row'];


             $img_list->get_listing_data(array(

                  'st'           => 0,

                  'show'         => $total,

                  'approve'      => 1,

                  'sort_key'     => 'RAND()',

                  'allow_cats'   => $allow_cats,

                  'allow_albums' => $allow_albums,

                         )     );


             $show['name'] = str_replace("<#NUM#>", $total, $this->ipsclass->lang['random5']);


             $collapsed_ids = ','.$this->ipsclass->my_getcookie('collapseprefs').',';


             $show['div_fo'] = 'show';

             $show['div_fc'] = 'none';


             if (strstr($collapsed_ids, ',rand,'))

             {

                 $show['div_fo'] = 'none';

                 $show['div_fc'] = 'show';

             }


             $rand5_html .= $this->ipsclass->compiled_templates['skin_boards']->galleryrand_top($show);

             $rand5_html .= $img_list->get_html_listing(array('imgs_per_col' => $this->ipsclass->vars['gallery_idx_num_col'], 'imgs_per_row' => $this->ipsclass->vars['gallery_idx_num_row'], 'can_rate' => ($this->ipsclass->vars['gallery_use_rate'] && $this->ipsclass->member['g_rate']) ? 1 : 0));

             $rand5_html .= $this->ipsclass->compiled_templates['skin_boards']->galleryrand_end($total);


             return $rand5_html;

         }
But unfortunately the skin adding part is damaged during converting IPB 2.2 to 3.0 but i have maked 2 templates in Board_index 1.galleryrand_top 2.galleryrand_end with data variable $show"" here it is template galleryrand_top

<div class='borderwrap' style="display:{$show['div_fc']}" id='fc_rand'>

        <div class='maintitle'>

                <p class='expand'><a href="javascript:togglecategory('rand',0);"><{E_PLUS}></a></p>

                <p><{CAT_IMG}> {$show5['name']}</p>

        </div>

</div>

<div class='borderwrap' style="display:{$show['div_fo']}" id='fo_rand'>

        <div class='maintitle'>

                <p class='expand'><a href="javascript:togglecategory('rand',1);"><{E_MINUS}></a></p>

                <p><{CAT_IMG}> {$show['name']}</p>

        </div>

        <table class='ipbtable' cellspacing='1'>

template galleryrand_end
                <tr><td class='catend' colspan='5'><!-- --></td></tr>

        </table>

</div><br />

but nothing show because i 100 sure my skin codes are rong could you please help me to fix this skin issue if possible ?

thanks you

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

8 odpowiedzi na to pytanie

Polecane posty

  • 0

Do I understand well that you have problem with random images after converting this mod to IP.Board 3.0.x ? If yes you have a hook with random 6 images from gallery and you can simply change 6 images to 5 or something else

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
  • 0

sorry for confusion i made.

actually i have taken this tutorial from another IPB official brazilian forum and the tutorial damaged after admin convert his forum to IPB 3 just half part visible to there but the skin part is missing and damaged i have asked him to make it another for 2.3 users but he said he have leave 2.3 series from aged and he is only give support to just IPB 3.x

i need just a little help what i put in the skin part that show 5 random images from IP.Gallery 2.3.3 as this tutorial make for.

thanks

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
  • 0

Hello,

unfortunately I don't know this mod and I don't know what is missing and how can I help you :(

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
  • 0

Hello, i understand spanner but i know you are a good PHP developer + IPB its the reason i have came and ask here.

you don't need to do anything in this mod just look this tutorial in my first post and see the 2 templates and just tell me what is the wrong in skin template that not showing the random images because the 2 templates i taken from OLD 5 random images modification that available at invisionize.

just look this below templates this all templates codes for old gallery you need to just tell me what call i put in the templates that show random images from that modification tutorial.

HERE:

template galleryrand_top


<div class='borderwrap' style="display:{$show['div_fc']}" id='fc_rand'>

        <div class='maintitle'>

                <p class='expand'><a href="javascript:togglecategory('rand',0);"><{E_PLUS}></a></p>

                <p><{CAT_IMG}> {$show['name']}</p>

        </div>

</div>

<div class='borderwrap' style="display:{$show['div_fo']}" id='fo_rand'>

        <div class='maintitle'>

                <p class='expand'><a href="javascript:togglecategory('rand',1);"><{E_MINUS}></a></p>

                <p><{CAT_IMG}> {$show['name']}</p>

        </div>

        <table class='ipbtable' cellspacing='1'>
template galleryrand_end
                <tr><td class='catend' colspan='5'><!-- --></td></tr>

        </table>

</div><br />

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
  • 0

Error is in this line:

$img_list->get_html_listing(array('imgs_per_col' => $this->ipsclass->vars['gallery_idx_num_col'], 'imgs_per_row' => $this->ipsclass->vars['gallery_idx_num_row'], 'can_rate' => ($this->ipsclass->vars['gallery_use_rate'] && $this->ipsclass->member['g_rate']) ? 1 : 0));
[/code] look into $img_list->get_html_listing. Probably in this function is something wrong. You can create own template bit but i don't know gallery base structure in this version. If I have created this mod, I changed this line:
[code]$rand5_html .= $img_list->get_html_listing(array('imgs_per_col' => $this->ipsclass->vars['gallery_idx_num_col'], 'imgs_per_row' => $this->ipsclass->vars['gallery_idx_num_row'], 'can_rate' => ($this->ipsclass->vars['gallery_use_rate'] && $this->ipsclass->member['g_rate']) ? 1 : 0));
to:

while( $row = $this->ipsclass->DB->fetch_row() )
{
$rand5_html .= $rand5_html .= $this->ipsclass->compiled_templates['skin_boards']->galleryrand_row('LINK_TO_IMAGE'.$row['image_name']);
}[/code] and create template bit called galleryrand_row:
[code]
<td class="row1">{$images}</td>
and replace content in galleryrand_end to:
 </tr><tr><td class='catend' colspan='5'><!-- --></td></tr>
</table>
</div><br />[/code] and replace content in galleryrand_top to:
[code]<div class='borderwrap' style="display:{$show['div_fc']}" id='fc_rand'>
<div class='maintitle'>
<p class='expand'><a href="javascript:togglecategory('rand',0);"><{E_PLUS}></a></p>
<p><{CAT_IMG}> {$show['name']}</p>
</div>
</div>
<div class='borderwrap' style="display:{$show['div_fo']}" id='fo_rand'>
<div class='maintitle'>
<p class='expand'><a href="javascript:togglecategory('rand',1);"><{E_MINUS}></a></p>
<p><{CAT_IMG}> {$show['name']}</p>
</div>
<table class='ipbtable' cellspacing='1'><tr>

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
  • 0

nope nothing happen :( .. is there any mod OR tutorial that show how can we show 5 images from IP.gallery ? no matter that is random or last 5 or latest 5.

i just wanted to show 5 images on index from ip.gallery 2.2.3

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
Gość
Temat jest zablokowany i nie można w nim pisać.

  • Kto przegląda   0 użytkowników

    Brak zalogowanych użytkowników przeglądających tę stronę.

×

Ważne informacje

Kontynuując przeglądanie strony, wyrażasz zgodę na używanie przez nas plików cookies.