View Full Version : default settings for archive?
-okapi-
02-11-2005, 06:18 AM
is it possible to set a default category or a default amount of thumbs displayed on the archive page?
i don't want to have ALL the thumbs loaded every time i go to the archive, but only the latest 30 for example, or the thumbs of images of the last month - by default.
is there a way to achieve this?
im looking at doing this exact thing also...Im currently working on it...i'll let you know when i have some code to show ya.
-okapi-
02-11-2005, 08:04 PM
this would be great!
but... coding an archive limiter would also leed into coding a navigation for the archive...
[by the way, high quality photography on your site and a very nice layout, mark! i wonder how you implemented the function "most recent comments"...]
In Index.php
under this section
// visitor information in comments
// fix a popuplink
I added:
// last 10 comments
$comment_count = 0;
$recent_comments = ""; // comments stored in this string
if($_GET['showimage'] == "") { $imageid = $image_id; } else { $imageid = $_GET['showimage']; }
$recentquery = mysql_query("select t1.parent_id, t1.message, t1.name, t1.url, t2.headline, t2.id from ".$pixelpost_db_prefix."comments as t1 inner join pixelpost_pixelpost t2 on t1.parent_id = t2.id ORDER BY t1.id DESC limit 10");
while(list($parent_id, $comment_message, $comment_name, $comment_url, $comment_headline, $comment_image_id) = mysql_fetch_row($recentquery)) {
$comment_message = pullout($comment_message);
$comment_name = pullout($comment_name);
$comment_headline = pullout($comment_headline);
$comment_image = pullout($comment_image);
if($comment_url != "") {
$comment_url = "http://$comment_url"; // i'm running for president...
$comment_url = str_replace("http://http://","http://",$comment_url); // you see?
$comment_name = "<a href='$comment_url' title='$lang_visit_homepage' target='_blank'>$comment_name</a>";
}
$comment_headline = "<a href='/index.php?showimage=$comment_image_id' title='$comment_headline' target='_blank'>$comment_headline</a>";
$recent_comments .= "<b>$comment_name</b> on <b>$comment_headline</b><br />$comment_message <br \><br \>";
$comment_count++;
}
$recent_comments .= "";
$tpl = ereg_replace("<LAST_COMMENTS>",$recent_comments,$tpl);
Probably should have done it as an "addon", but not exactly sure how to...
btw, thanks so much on the compliments about my site and photos!!
:)
-okapi-
02-11-2005, 11:18 PM
wow...
thank you, mark!
for a while i wondered what calls that function to have the last 10 comments displayed... now i know, it's <LAST_COMMENTS>
thanks again!
Zlato
02-12-2005, 12:06 AM
Hi MArk !
First of all, congratulations for your site, really good inspiration and good looking layout... :wink:
Second, maybe you can help me : i wish i have the same navition as you in archive page : a ceratin amount of thumbnails then a new page, and so on like on your pages, can you help me to achieve on my page ?
By advance Thanks a lot.
( sorry for bad english... :( )
Anonymous
02-12-2005, 02:10 AM
Zlato, thanks for the nice comments about my site...i really appreciate it..
My archive page doesnt yet limit a certain amount of photos. I am working on it though as we speak. I can get it to limit however many i want, but am having problems getting just the remainder...
If you're talking about the drop down boxes for archive categories and date, i think they are available on the "addon" page...i just used what they had....
I'll hopefully have something working soon.. :)
usafdcc
02-12-2005, 03:06 AM
Great script, you should definantly make it into an addin. I did notice that it did not validate, but I was able to get it to validate by changing
$recent_comments .= "$comment_name on $comment_headline<br />$comment_message <br \><br \>";
$comment_count++;
to
$recent_comments .= "$comment_name on $comment_headline<br>$comment_message <br><br>";
$comment_count++;
Keep up the good work
ah, ur right! It looks like i had some / pointing the wrong way...
-okapi-
02-12-2005, 06:27 AM
hi mark,
it seems that
if($comment_url != "") {
$comment_url = "http://$comment_url"; // i'm running for president...
$comment_url = str_replace("http://http://","http://",$comment_url); // you see?
$comment_name = "<a href='$comment_url' title='$lang_visit_homepage' target='_blank'>$comment_name</a>";
does only work with a root install of pixelpost, because of the absolute urls.
please correct me, if i'm wrong.
i don't want to mess up the code by trying it myself: so how can relative paths be realized?
(besides, some servers have restrictions to calling scripts with absolute paths...)
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.