Skocz do zawartości


Need gallery skin help


  • Zamknięty temat Ten temat jest zablokowany
8 odpowiedzi na ten temat

#1 Feronso

Feronso

    Powoli zdobywa wiedzę

  • Użytkownicy
  • PipPip
  • 42 postów
  • Wersja:IP.Board 2.3.x

Napisany 23 styczeń 2010 - 22:26

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

#2 Spanner

Spanner

    PHP & IP.Board Developer

  • Administrator
  • 5430 postów
  • Płeć:Mężczyzna
  • Skąd:KrK
  • Wersja:IP.Board 3.3.x

Napisany 24 styczeń 2010 - 22:13

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

#3 Feronso

Feronso

    Powoli zdobywa wiedzę

  • Użytkownicy
  • PipPip
  • 42 postów
  • Wersja:IP.Board 2.3.x

Napisany 25 styczeń 2010 - 10:21

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

#4 Spanner

Spanner

    PHP & IP.Board Developer

  • Administrator
  • 5430 postów
  • Płeć:Mężczyzna
  • Skąd:KrK
  • Wersja:IP.Board 3.3.x

Napisany 25 styczeń 2010 - 18:08

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

#5 Feronso

Feronso

    Powoli zdobywa wiedzę

  • Użytkownicy
  • PipPip
  • 42 postów
  • Wersja:IP.Board 2.3.x

Napisany 26 styczeń 2010 - 11:37

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 />


#6 Spanner

Spanner

    PHP & IP.Board Developer

  • Administrator
  • 5430 postów
  • Płeć:Mężczyzna
  • Skąd:KrK
  • Wersja:IP.Board 3.3.x

Napisany 26 styczeń 2010 - 20:22

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));

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:

$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']);
}

and create template bit called galleryrand_row:

<td class="row1">{$images}</td>

and replace content in galleryrand_end to:
 </tr><tr><td class='catend' colspan='5'><!-- --></td></tr>
		</table>
</div><br />

and replace content in galleryrand_top to:
<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>


#7 Feronso

Feronso

    Powoli zdobywa wiedzę

  • Użytkownicy
  • PipPip
  • 42 postów
  • Wersja:IP.Board 2.3.x

Napisany 27 styczeń 2010 - 10:58

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

#8 Spanner

Spanner

    PHP & IP.Board Developer

  • Administrator
  • 5430 postów
  • Płeć:Mężczyzna
  • Skąd:KrK
  • Wersja:IP.Board 3.3.x

Napisany 27 styczeń 2010 - 13:22

I found paid mod: (FSY23) Random Gallery Images v1.2 and free: (BBR23)5 Random Images v2.0.0

#9 Spanner

Spanner

    PHP & IP.Board Developer

  • Administrator
  • 5430 postów
  • Płeć:Mężczyzna
  • Skąd:KrK
  • Wersja:IP.Board 3.3.x

Napisany 20 grudzień 2010 - 20:19

Problem został rozwiązany.


Strony ze skinami , [Invisionize.eu] IPS Company Blog - Improved Skin Generator , Skiny z wersji 2.3.6 a wersja 3.0 , Skiny do IP.Board 2.1.x: (DB21 - Skin) Dark Blue , [Invisionize.eu] IPS Company Blog - IP.Nexus 1.5 Dev Update: Mobile Skin


0 użytkowników czyta ten temat

0 użytkowników, 0 gości, 0 anonimowych użytkowników