Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 02-15-2005, 10:58 AM
-okapi-'s Avatar
-okapi- Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Vienna, Austria
Posts: 252
browsing a specific category?

after raminia's fabulous work i feel encouraged to ask another question...
(please don't bite my head off)

what could actually be done to enable visitors to browse only one specific category? i mean, without having to go back to the archive each time and choosing the desired category again and clicking a thumbnail.
what, if there were links to categories (one or more, or a dropdown field) right on the image_template page, and one could browse continuously through a choosen category via the navigation thumbs, until other selection?

an example:
let's say i have 600 photos in total. 300 in the category "animals", and 300 in the category "people". what, if i want to browse only "animals" for a while, without going back to the archive all the time?

but maybe this would be asked a little bit too much, and couldn't be done without touching the core code...?
__________________
a visual notebook
michael singer photography
http://www.a-visual-notebook.at
Reply With Quote
  #2  
Old 02-15-2005, 12:36 PM
raminia's Avatar
raminia+ Offline
Team Pixelpost
 
Join Date: Jan 2005
Location: FL, US
Posts: 3,706
Send a message via Yahoo to raminia
old thread



Did you see this thread?
http://www.pixelpost.org/forum/viewtopic.php?t=403

I've made the following addon from the code I wrote there but I don't put it in the addon section now. Copy/paste the following code in an empty php file and use this addon and tell me what's ur opinion about.

Code:
$addon_name = "Category List of Links";
$addon_description = "This addon will enables the tag &ltCATEGORY_LINKS_AS_LIST>
 A vertical List of category names with link to each.";

$addon_version = "0.1";

	// Get the number of thumbnails shown at once from the admin config
	$cfgquery = mysql_query("select * from ".$pixelpost_db_prefix."config");
	$cfgrow = mysql_fetch_array($cfgquery);

	//---------------------------
	
	$browse_select = " <a href='?x=browse'> $lang_browse_all </a><br>"; 
	$query = mysql_query("select * from ".$pixelpost_db_prefix."categories order by name"); 
	while(list($id,$name) = mysql_fetch_row($query)) { 
    $name = pullout($name); 
    $category_Link_List .= "<a href='?x=browse&category=$id'>$name</a><br>"; 
    };


  $tpl = ereg_replace("<CATEGORY_LINKS_AS_LIST>",$category_Link_List,$tpl);
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7
Reply With Quote
  #3  
Old 02-15-2005, 12:54 PM
Zlato Offline
pp regular
 
Join Date: Feb 2005
Location: Paris - FRANCE
Posts: 43
Hi Ramin ! Great achievement ! in addition to this I've tried to add a count of pictures by category, but something goes wrong, the statement in Mysql is good but i miss something in PHP.

So it will look like
cat1 (12)
cat2(7)
cat3(0)

and so on...

can you help ops:

Regards
__________________
A. Zlatogorov
Ecrivain de lumière
Reply With Quote
  #4  
Old 02-15-2005, 01:16 PM
raminia's Avatar
raminia+ Offline
Team Pixelpost
 
Join Date: Jan 2005
Location: FL, US
Posts: 3,706
Send a message via Yahoo to raminia
partial answer
modify the index.php at about line 113
Code:
// images/main site
if($_GET['x'] == "" ) {
// Get Current Image.
if($_GET['showimage'] == "" ) {
	$query = mysql_query("select * from ".$pixelpost_db_prefix."pixelpost where datetime<='$cdate' order by datetime DESC limit 0,1");
	
	} else {
		if($_GET['categoryid'] =="" ){
			echo $_GET['categoryid'];
			$query = mysql_query("select * from ".$pixelpost_db_prefix."pixelpost where (id='".$_GET['showimage']."')");
		}
		else
		{
    	$where = " (category='".$_GET['categoryid']."')"; 
    	$query = mysql_query("select * from ".$pixelpost_db_prefix."pixelpost where  $where order by datetime desc");
    }

	
	}
and use this new addon

Code:
<?php
/*

Requires Pixelpost version 1.3
Category List of Links (vertical)
Written by: Ramin Mehran
Contact: raminia@yahoo.com 


Pixelpost www: http://www.pixelpunk.se/software/
License: http://www.gnu.org/copyleft/gpl.html

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/

$addon_name = "Category List of Links";
$addon_description = "This addon will enables the tag &ltCATEGORY_LINKS_AS_LIST>
 A vertical List of category names with link to each.";

$addon_version = "0.1";

	// Get the number of thumbnails shown at once from the admin config
	$cfgquery = mysql_query("select * from ".$pixelpost_db_prefix."config");
	$cfgrow = mysql_fetch_array($cfgquery);

	//---------------------------
	
	$browse_select = " <a href='?x=browse'> $lang_browse_all </a><br>"; 
	$query = mysql_query("select * from ".$pixelpost_db_prefix."categories order by name"); 
	while(list($id,$name) = mysql_fetch_row($query)) { 
    $name = pullout($name); 
    $category_Link_List .= "<a href='?showimage=0&categoryid=$id'>$name</a><br>"; 
    };


  $tpl = ereg_replace("<CATEGORY_LINKS_AS_LIST>",$category_Link_List,$tpl);
	    

?>
and then write some code to produce thumbnails according to the category id. (it's simple)
but in this way this would not be a photoblog anymore but just a photo album!
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7
Reply With Quote
  #5  
Old 02-15-2005, 01:58 PM
-okapi-'s Avatar
-okapi- Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Vienna, Austria
Posts: 252
you're amazing me again...

i can't test your code right now, but actually i'm not sure, if i have found the right words to express exactly what i want to achieve:

let me try it in other words:
i want to temporarily modify the behaviour of the (four) navigation thumbs (image_template) in that way, that, if enabled, thumbnail navigation in only one specific category is available. a "back" button or a "view all" button should disable this functionality.

just to be able to browse through one category via the thumbnail navigation of the main page, not to have to go to the archive page again and again.
__________________
a visual notebook
michael singer photography
http://www.a-visual-notebook.at
Reply With Quote
  #6  
Old 02-15-2005, 02:03 PM
raminia's Avatar
raminia+ Offline
Team Pixelpost
 
Join Date: Jan 2005
Location: FL, US
Posts: 3,706
Send a message via Yahoo to raminia
this need a hack on index.php almost very deep!
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7
Reply With Quote
  #7  
Old 02-15-2005, 02:04 PM
raminia's Avatar
raminia+ Offline
Team Pixelpost
 
Join Date: Jan 2005
Location: FL, US
Posts: 3,706
Send a message via Yahoo to raminia
Quote:
Originally Posted by Zlato
Hi Ramin ! Great achievement ! in addition to this I've tried to add a count of pictures by category, but something goes wrong, the statement in Mysql is good but i miss something in PHP.

So it will look like
cat1 (12)
cat2(7)
cat3(0)

and so on...

can you help ops:

Regards
This is for you.
download it from the addon section
http://www.pixelpost.org/index.php?x...amp;details=42

I give up! I have to do some work on my MSc project but I'm facinated by PHP coding.... I give up for now and I'll go do some research on my thesis subject....
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7
Reply With Quote
  #8  
Old 02-15-2005, 03:12 PM
Zlato Offline
pp regular
 
Join Date: Feb 2005
Location: Paris - FRANCE
Posts: 43
Another time to say T-H-A-N-K-S, i know, it's not enough, but how can I do some more ?

You're my best.

Hope i could help you one day or another (not with PHP at the moment, i think, but i'll try to become better and better...)...



Alexander Zlatogorov
__________________
A. Zlatogorov
Ecrivain de lumière
Reply With Quote
  #9  
Old 02-15-2005, 03:25 PM
-okapi-'s Avatar
-okapi- Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Vienna, Austria
Posts: 252
ramin, you did it again!
you made me happy!

the latest updates of random thumbnails and random image work perfectly!
i think these addons mean a great encrease of flexibility for pixelpost users again.
thank you for spending your time, your knowledge and your energy to create features for pixelpost, we photobloggers are longing for...!

---
just a note:
for me random image works fine with:
&lt;a href='index.php?showimage=&lt;IMAGE_RANDOM>'>Rando m photo</a>
but not with:
&lt;a href='$PHP_SELF?showimage=&lt;IMAGE_RANDOM>' >Random photo</a>
---

thanks again,
michael
__________________
a visual notebook
michael singer photography
http://www.a-visual-notebook.at
Reply With Quote
  #10  
Old 02-15-2005, 04:58 PM
-okapi-'s Avatar
-okapi- Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Vienna, Austria
Posts: 252
Quote:
Originally Posted by raminia
this need a hack on index.php almost very deep!
i think, this would be definitly not worth the effort, if it can't be done as an addon.

but you know, people always want some more...
__________________
a visual notebook
michael singer photography
http://www.a-visual-notebook.at
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 08:14 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs