Recent Topics

1 May 04, 2012 20:36    

Hi, I want to have a Photo index on each category of Photoblog.

Now, when I click a category it show the last picture and I want to have a photo index when I click a category. Please, can you help me? How do it?

My photoblog is http://rafaelquevedo.com/blogs/blog4.php

Thanks.

2 May 09, 2012 17:26

Do you want to only display previews on category pages and no posts at all?

Edit your index.main.php
replace this

// --------------------------------- START OF POSTS -------------------------------------
// Display message if no post:
display_if_empty();

while( $Item = & mainlist_get_item() )
{	// For each blog post:
	// ---------------------- ITEM BLOCK INCLUDED HERE ------------------------
	skin_include( '_item_block.inc.php', array(
			'content_mode' => 'auto',		// 'auto' will auto select depending on $disp-detail
			'image_size'	 =>	'fit-400x320',
		) );
	// ----------------------------END ITEM BLOCK  ----------------------------
} // ---------------------------------- END OF POSTS ------------------------------------

with this

// --------------------------------- START OF POSTS -------------------------------------
// Display message if no post:
display_if_empty();

if( $disp_detail == 'posts-cat' )
{	// Category view
	skin_widget( array(
		// CODE for the widget:
		'widget' => 'coll_media_index',
		// Optional display params
		'block_start' => '',
		'block_end' => '',
		'block_display_title' => false,
		'thumb_size' => 'fit-80x80',
		'thumb_layout' => 'grid',
		'grid_start' => '<table class="image_index" cellspacing="3">',
		'grid_end' => '</table>',
		'grid_nb_cols' => 8,
		'grid_colstart' => '<tr>',
		'grid_colend' => '</tr>',
		'grid_cellstart' => '<td>',
		'grid_cellend' => '</td>',
		'order_by' => $Blog->get_setting('orderby'),
		'order_dir' => $Blog->get_setting('orderdir'),
		'limit' => 1000,
	) );
}
else
{
	while( $Item = & mainlist_get_item() )
	{	// For each blog post:
		// ---------------------- ITEM BLOCK INCLUDED HERE ------------------------
		skin_include( '_item_block.inc.php', array(
				'content_mode' => 'auto',		// 'auto' will auto select depending on $disp-detail
				'image_size'	 =>	'fit-400x320',
			) );
		// ----------------------------END ITEM BLOCK  ----------------------------
	} // ---------------------------------- END OF POSTS ------------------------------------
}

3 May 09, 2012 21:04

Thanks for your help.

I see the general index not work and now neither the category index (with your code).

I haven't edited anything. The error could be the setup?

Thanks

4 May 09, 2012 22:48

You must attach pictures to posts, not just insert <img> tags

5 May 10, 2012 10:17

Wow!!! It's working!!!!

Thanks, thanks, thanks, thanks, thanks, thanks!!! :D

Sorry, it's an abuse, i know but... I can change the size of the pictures of index thumbnails and the size of pictures in preview? :p

Thnak you very much. You are big!

6 May 10, 2012 20:36

Just edit 'thumb_size' => 'fit-80x80', to something else. You can get sizes from /conf/_advanced.php

7 Oct 28, 2015 00:35

Hi,
I come back to this old post because I have a similar question. In 2012 sam2kb gave an answer which does not solve my problem...
I use now v6.6.5. In the photoblog I want to display an index of the current category (only the thumbs of the photo belonging to a specific category)). I previously did this in v4.1.x with a modification of the script /inc/widgets/widgets/_coll_media_index.widget.php and I now would like to do the same thing WITHOUT having to modify a script in the /inc directory.
So my question is : how can I display an index of a specific category with modifications limited to the photoblog skin.
I hope somebody is still following this thread? Thanks in advance for any response.
Jacques

8 Oct 28, 2015 08:27

@lefataliste let me see if I understood what you want, do you need something like the layout displayed in the screenshot below?

These are the changes I made to do that:

https://github.com/mgsolipa/b2evolution/commit/3b1da50a9cfb4db08615e6722e2a353a582a9ec4

I attached the modified index.main.php to replace your own /skins/photoblog/index.main.php, if you have no more modifications in it. You also need to copy the attached file _posts_media_index.inc.php into the /skins/photoblog folder.

Regards!


Attachments:

9 Oct 28, 2015 10:55

Thank you mgsolipa :)
I shall use your scripts to modify my photoblog skin. I'll let you know if the result is what I expect. In fact, it looks similar to what I previously did in v4., so this should do the job. Thanks again.

10 Oct 28, 2015 12:53

Hello mgsolipa
I'm sorry but your suggestion is not what I'm looking for :(

I do not want to replace the standard display of the photoblog by an index.
I want to have the possibility to alternatively display an index using a link in a menu post.
The link that I used previously was like this :

my-site/photos/?disp=mediaidx&jl_main_cat=30&jl_main_cat_name=Album:%20Galerie

this would display a thumbnails index of all the photo belonging to the cat #30
This was possible because I modified the v4 file _coll_media_index.widget.php

I would like to have a solution without modifying any file in the /inc dir
Is there a possibility to call mediaidx and to limit the display to a specified category ?

take care

11 Oct 30, 2015 08:38

@lefataliste all right, now I understand.

Please check this new commit: https://github.com/mgsolipa/b2evolution/commit/f7304da7a4697dacf0ae33f9b483a7061189bbe0

There is a new _mediaidx.disp.php file to be included in your skin. When you go to disp=mediaidx, you see the regular mediaidx output, but if you send the jl_main_cat parameter in the URL, the list is filtered and displayed as in the screenshot of my previous comment.

Btw, the name of the expected parameter jl_main_cat may be set in the skin's configuration display.

12 Nov 03, 2015 13:01

@mgsolipa YES that's similar to what I previously did with a modification of the file _coll_media_index.widget.php.

Thank you so much for your commitment. I shall work with what you developed... Btw is it possible to put the file _coll_media_index.widget.php into the photoblog skin dir ?

Here is an example of how your suggestion of modification works on my blog at the present time:
http://www.le-fataliste.fr/blabla/photos.php?disp=mediaidx&jl_main_cat=25&jl_main_cat_name=Djanet (Tassili)

I modified the scripts to include the cat_name in the title. But rather than giving a second additional parameter (jl_main_cat_name) it would be more clever to get the Category name from its number. Do you know - can you tell me please - how to do that ?

Take care. JL

13 Nov 03, 2015 17:07

@mgsolipa Hello :)
I found a little problem : some of my photos have a legend, some not.
Consequently, the resulting display vary according to the presence of a legend : when one is present, the image is centered over this legend. So the thumbs are non longer aligned. The left-right position of the image depends on the length of the legend.

I did not find how to modify the parameters to have both the image and the legend aligned to the left.
The temporary solution I used is to globally center everything.

Can you help ?

You can test the display here
original display :
http://www.le-fataliste.fr/blabla/photos.php/?disp=mediaidx&jl_main_cat=43&jl_main_cat_name=Album%20:%20Nature&jl_test=1

centered display :
http://www.le-fataliste.fr/blabla/photos.php/?disp=mediaidx&jl_main_cat=43&jl_main_cat_name=Album%20:%20Nature&jl_test=0

Take care. JL

15 Nov 06, 2015 17:14

@lefataliste I'm not sure if there are better ways to get a category object from its ID or urlname, but this is a pretty simple one:

$ChapterCache = new ChapterCache();
$ChapterByID = $ChapterCache->get_by_ID($chapter_ID);
$ChapterByUrlname = $ChapterCache->get_by_urlname($chapter_urlname);

All the parameters of the category will be attributes of each object. So, you can get access to its name this way: $ChapterByID->name, and so on for the rest of attributes.

16 Nov 09, 2015 11:31

@mgsolipa Many thanks for your help. You are right : the solution that you propose is simple ... once you know it ;) (almost) everything is under control now.

17 Nov 09, 2015 12:55

@mgsolipa Sorry, but there is still a problem ::everyting works fine when I test the mediaindex BUT if the visitor is NOT connected, he/she gets the following message:

Fatal error: Class 'ChapterCache' not found

I managed to avoid the error message with a test

if (class_exists('ChapterCache'))

but then I cannot get the category name :(
Any solution ?

Take care. JL

18 Nov 09, 2015 14:32

@mgsolipa I think that I (hopefully) solved the problem.
I replaced

$ChapterCache = new ChapterCache();
$ChapterByID = $ChapterCache->get_by_ID($chapter_ID);

by

$jlChapterCache = & get_ChapterCache();
$ChapterByID = $jlChapterCache->get_by_ID($jl_cat_ID);

Apparently, it works unless I misunderstood something in which case I would appreciate your comments.
Take care. JL


Form is loading...