|
#1
|
||||
|
||||
|
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...? |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
||||
|
||||
|
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");
}
}
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&gt; 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); ?> 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 |
|
#5
|
||||
|
||||
|
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. |
|
#6
|
||||
|
||||
|
this need a hack on index.php almost very deep!
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7 |
|
#7
|
||||
|
||||
|
Quote:
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 |
|
#8
|
|||
|
|||
|
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 |
|
#9
|
||||
|
||||
|
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: <a href='index.php?showimage=<IMAGE_RANDOM>'>Rando m photo</a> but not with: <a href='$PHP_SELF?showimage=<IMAGE_RANDOM>' >Random photo</a> --- thanks again, michael |
|
#10
|
||||
|
||||
|
Quote:
but you know, people always want some more...
|
| Post Reply |
| Thread Tools | |
|
|