|
#21
|
|||
|
|||
|
Sorry if this is a trivial question, I am new to pixelpost and PHP;
What do I call the mod file? How do I install this mod? Are there any files to be modified? Thanks for any help [quote="raminia"]Another Addon! Archive page with thumbnails that have maximum number of thumbs in each pages. Usefull when you have plenty of photos in archive and you do not want it to be bulky. Two new tages <THUMBNAILS_WHOLE_PAGED> : Thumbnails but limited with maximum number your mention in each page. <THUMBNAILS_PAGES_LINKS> : Links to each page of archive of thumbnails in the Browse Archive page |
|
#22
|
||||
|
||||
|
its an addon not a modification. for addons u don't need to change codes. just copying the addon file to the addon folder of pixel post will enable them.
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7 |
|
#23
|
||||
|
||||
|
Quote:
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7 |
|
#24
|
|||
|
|||
|
Ok it seems it's work very fine, but the point I don't understand is why do you have 8 thumbs in a row, is it your choice by working on style sheets, as you already said to me ?
ANyway it's real fine ! the picture "Chandelier" is quite as i like to do myself, and this one is really good, i like it.
__________________
A. Zlatogorov Ecrivain de lumière |
|
#25
|
|||
|
|||
|
All is allright now i have change little things for my needs as you can see on my archive page...here are the modifications:
Code:
if($_GET['x'] == "browse") {
$thumb_output = "";
$where = "";
$limit = "";
if($_GET['category'] != "") { $where = "and (category='".$_GET['category']."')"; }
if ($_GET['pagenum'] != "") {$start = $maxnumber_thumbs*($_GET['pagenum']-1);
$limit = " limit $start , $maxnumber_thumbs ";};
$query = "select id,headline,image from ".$pixelpost_db_prefix."pixelpost where (datetime<='$cdate') $where order by datetime desc" .$limit;
$query = mysql_query($query);
$thumb_output .= "<table cellpadding=\"0\" cellspacing=\"0\" align=\"center\"><tr><td>";
$i = 0;
while(list($id,$title,$name) = mysql_fetch_row($query)) {
$i++;
$title = pullout($title);
$thumbnail = "thumbnails/thumb_$name";
$thumb_output .= "<td align=\"center\"><a href='$PHP_SELF?showimage=$id'><img src='$thumbnail' alt='$title' title='$title' class='thumbnails'onMouseOver=\"this.filters.gray.enabled=false\" onMouseOut=\"this.filters.gray.enabled=true\" /></a><br />$title<br /><!--$mydate--></td>";
if ($i == 5) {$i=0; $thumb_output .= "</td></tr><tr><td align=\"center\">";}
}
$thumb_output .= "</td></tr></table>";
Code:
if ($i == 5) for the, very small, rest i know you working on it ...
__________________
A. Zlatogorov Ecrivain de lumière |
|
#26
|
||||
|
||||
|
Quote:
the 8 pic are the result of the window size. try changing the windows size and you see there would be different number of rows and columns.
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7 |
|
#27
|
||||
|
||||
|
addon's new version. some new tags to handle the browse archive with a single <THUMBNAILS_WHOLE_PAGED> that behaves as <THUMBNAILS> when there is no page mentioned.
there is also some other usefull tags for achive page such as archive page number, the name of the category user is browsing. -- That's the version I mentioned in my last post and it is working on my pblog. Code:
<?php /* Requires Pixelpost version 1.3 Archive Thumb Paged Written by: Ramin Mehran Contact: raminia@yahoo.com Pixelpost www: http://www.pixelpunk.se/software/ License: http://www.gnu.org/copyleft/gpl.html */ $addon_name = "Archive thumb paged"; $addon_description = "Archive page with thumbnails that have maximum number of thumbs in each pages. Usefull when you have plenty of photos in archive and you do not want it to be bulky. <br>Two new tages<br> &lt;THUMBNAILS_WHOLE_PAGED&gt; : Thumbnails but limited with maximum number your mention in each page. <br> &lt;THUMBNAILS_PAGES_LINKS&gt; : Links to each page of archive of thumbnails in the Browse Archive page<br> also CATEGORY_NAME_PAGED_ARCHIVE and ARCHIVE_PAGES_NUM for navigation and title of archive page. "; $addon_version = "0.1"; // Edit this by your preference $maxnumber_thumbs = 50; // maximum number of thumbnails in each browse page (e.g 5) /* // 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); */ //--------------------------- if($_GET['x'] == "browse") { $thumb_output = ""; $where = ""; $limit = ""; $pagenum = $_GET['pagenum']; if($_GET['category'] != "") { $where = "and (category='".$_GET['category']."')"; } if ($_GET['pagenum'] != "") {$start = $maxnumber_thumbs*($_GET['pagenum']-1); $limit = " limit $start , $maxnumber_thumbs ";}; $query = "select id,headline,image from ".$pixelpost_db_prefix."pixelpost where (datetime<='$cdate') $where order by datetime desc" .$limit; $query = mysql_query($query); while(list($id,$title,$name) = mysql_fetch_row($query)) { $title = pullout($title); $thumbnail = "thumbnails/thumb_$name"; $thumb_output .= "<a href='$PHP_SELF?showimage=$id'><img src='$thumbnail' alt='$title' title='$title' class='thumbnails' /></a>"; } } $pagecounter=0; // Get number of photos in database $photonumb = mysql_query("select count(*) as count from ".$pixelpost_db_prefix."pixelpost where datetime<='$datetime'"); $row = mysql_fetch_array($photonumb); $pixelpost_photonumb = $row['count']; $num_browse_pages = ceil($pixelpost_photonumb/$maxnumber_thumbs); $Archive_pages_Links = ""; while ($pagecounter < $num_browse_pages) { $pagecounter++; $Archive_pages_Links .= "<a href=?x=browse&pagenum=$pagecounter>$pagecounter</a> "; } // new tages if ($pagenum!=""){ $tpl = ereg_replace("<THUMBNAILS_WHOLE_PAGED>",$thumb_output,$tpl); $tpl = ereg_replace("<THUMBNAILS_PAGES_LINKS>",$Archive_pages_Links,$tpl); $tpl = ereg_replace("<ARCHIVE_PAGES_NUM>",$pagenum,$tpl); $tpl = ereg_replace("<CATEGORY_NAME_PAGED_ARCHIVE>","",$tpl); } else { // the original thumbnails for browse archive if($_GET['category'] != "") { $catid = $_GET['category']; $query = mysql_query("select name from ".$pixelpost_db_prefix."categories where id='$catid'"); $images_category = mysql_fetch_array($query); $images_category = pullout($images_category['name']); } $tpl = ereg_replace("<THUMBNAILS>",$thumb_output,$tpl); $tpl = ereg_replace("<THUMBNAILS_PAGES_LINKS>",$Archive_pages_Links,$tpl); $tpl = ereg_replace("<ARCHIVE_PAGES_NUM>","all",$tpl); $tpl = ereg_replace("<THUMBNAILS_WHOLE_PAGED>",$thumb_output,$tpl); $tpl = ereg_replace("<CATEGORY_NAME_PAGED_ARCHIVE>",$images_category,$tpl);} ?>
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7 |
|
#28
|
|||
|
|||
|
All is ok ! Ramin....
but there's still this behavior : when on a category the navigation pages remain...sorry for that... For the rest as you can see here http://www.zlatogorov.com/pixelpost/...&pagenum=1 it's work G-R-E-A-T as usual Ramin ! Cheers
__________________
A. Zlatogorov Ecrivain de lumière |
|
#29
|
||||
|
||||
|
yes but wanted them to be there.
if you don't want them, move Code:
$tpl = ereg_replace("<THUMBNAILS_PAGES_LINKS>",$Archive_pages_Links,$tpl);
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7 |
|
#30
|
|||
|
|||
|
sorry
ops: don't understand how to do that...in which "if" clause
__________________
A. Zlatogorov Ecrivain de lumière |
| Post Reply |
| Thread Tools | |
|
|