forum.coppermine-gallery.net
No Support => Modifications/Add-Ons/Hacks => Mods: Statistics => Topic started by: deejaymoni on January 18, 2006, 12:39:04 pm
-
Hello everybody,
I know that some of you guys are searchin' still this mod here by Nibbler: http://forum.coppermine-gallery.net/index.php?topic=9540.0
for the latest versions of coppermine. So I was trying to modify it and it works but I'm not a coder. So here is my modification that I have tested with coppermine 1.4.0 and 1.4.3
You can see it here in action: http://www.jessica-alba.de/gallery/index.php
<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.4.x //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002-2004 Gregory DEMAR modified by deejaymoni //
// http://www.chezgreg.net/coppermine/ //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team //
// see /docs/credits.html for details //
// ------------------------------------------------------------------------- //
// 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. //
// ------------------------------------------------------------------------- //
// $Id: anycontent.php,v 1.9 2004/08/02 08:15:13 gaugau Exp $
// ------------------------------------------------------------------------- //
/**
* Coppermine Photo Gallery 1.4.x anycontent.php
*
* This file file gets included in the index.php if you set the option in config
* can be used to display any content from any program, it is always to be edited
* according to tastes and then used
*
* @copyright 2002,2003 Gregory DEMAR, Coppermine Dev Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License V2
* @package Coppermine
* @version $Id: anycontent.php,v 1.9 2004/08/02 08:15:13 gaugau Exp $
*/
/* Days ago to start history */
$days = 4;
$end = time();
$counter = array();
$info = array();
$FORBIDDEN_SET_UPD = ($FORBIDDEN_SET) ? "AND $FORBIDDEN_SET" : '';
echo '<br />';
starttable("100%", "Updates");
for ($d = 0; $d < $days; $d++) {
$start = strtotime(date("Ymd")) - ($d*60*60*24);
$result = cpg_db_query("SELECT *,a.title AS album_title,p.owner_id AS owner FROM {$CONFIG['TABLE_PICTURES']} AS p,{$CONFIG['TABLE_ALBUMS']} AS a WHERE (APPROVED ='YES') AND (p.aid = a.aid) AND (ctime BETWEEN $start AND $end) $FORBIDDEN_SET_UPD ORDER BY ctime DESC");
while ($row = mysql_fetch_assoc($result)) {
$day = date("F jS",$row['ctime']);
$counter[$day][$row[album_title]] += 1;
$info[$day][$row[album_title]] = $row;
$users[$day][$row[album_title]][] = $row['owner'];
}
$end = $start;
}
$i = 0;
$test = array_keys($counter);
foreach ($counter as $day) {
foreach ($day as $album => $number) {
$date = $test[$i];
$album_info = $info[$date][$album];
echo '<tr><td class="tableb">' .$date. ": $number new pic".(($number > 1) ? 's' : '')." uploaded into album '<a href=\"thumbnails.php?album={$album_info['aid']}\">$album</a>' by ";
$links = array();
foreach ($users[$date][$album] as $u) {
if ($u > 0) $links[] = "<a href=\"profile.php?uid=$u\">". get_username($u) ."</a>";
}
$out = array_unique($links);
echo implode(', ',$out);
echo "</td></tr>";
}
$i++;
}
endtable();
?>
P.S. I didn't know where to put this topic sorry :-(
-
Excellent :)
Thanks Nibbler for the original, and thanks deejaymoni for the updated.
-
How do you use anycontent.php?
Jim
-
Search the docs for it.
-
Dates are displayed in english: March 8th
How can I make it displayed in french : Mer 8 mars
Thanks
-
Same way you did it before.
http://forum.coppermine-gallery.net/index.php?topic=9540.msg110044#msg110044
-
Same way you did it before.
http://forum.coppermine-gallery.net/index.php?topic=9540.msg110044#msg110044
It dose not seems to work. The dates have not changed : March 8th
Is it because it is now version 1.4.3 while before it was 1.3.5?
-
No it has nothing to do with it. Like Nibbler said same way. Here is an example for it:
Just change in into french date that's all
http://forum.coppermine-gallery.net/index.php?topic=9540.msg135810#msg135810
-
Thanks! I was looking for exactly this and it works great. ;)
-
Sorry, I do have a question. Is it possible to include the entire breadcrumb, such as the category the updated album is in, as well? The categories are fairly important to the organization of my site.
http://photos.zozzledislove.com (http://photos.zozzledislove.com)
-
Also, can it identify the filetype so that if a .wmv has been uploaded it says, "1 new video uploaded into album..." instead of pic?
-
Anyone who knows how I include my anycontent.php in my index.php? :-\
This is how my site looks like > http://jooohnny.ath.cx/gallery :o
Where do you think it's good to have the statsbox? ???
-
@bluebledthesea & johnnyh86: your questions are both not related to the mod that is being discussed on this thread, so you shouldn't have posted them here. RTFM! Please don't clutter this thread with general support questions.
@johnnyh86: http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#changing . Someone else has already asked the very same question on this very thread, and TranzNDance has answered the question. Asking once more is not a bright idea!
@bluebledthesea: edit lang/yourlanguage.php. However, if you change the text to read "video", it will be displayed for pics as well. Instead, use the word "file".
-
@bluebledthesea & johnnyh86: your questions are both not related to the mod that is being discussed on this thread, so you shouldn't have posted them here. RTFM! Please don't clutter this thread with general support questions.
@johnnyh86: http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#changing . Someone else has already asked the very same question on this very thread, and TranzNDance has answered the question. Asking once more is not a bright idea!
@bluebledthesea: edit lang/yourlanguage.php. However, if you change the text to read "video", it will be displayed for pics as well. Instead, use the word "file".
I don't see how it wasn't related to the mod. I was suggesting improvements to the code, not asking how to use it. Geez, sorry...
-
@johnnyh86: http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#changing . Someone else has already asked the very same question on this very thread, and TranzNDance has answered the question. Asking once more is not a bright idea!
...and where is "catlist/alblist/random,2/lastup,2". Can't find it in index.php or config.php and it doesn't stand in the manual.
-
May be I should clarify, I was asking to include more of the breadcrumb in what the update mod outputs. Only referring to this mod, nothing else in Coppermine.
Instead of saying just:
"July 6th: 16 new pics uploaded into album 'Mini Pool Party - September 24, 2005' by PJ"
I would like it to say:
"July 6th: 16 new pics uploaded into 'Connecticut College > Mini Pool Party - September 24, 2005' by PJ"
"Connecticut College" being the category the album is in.
-
...and where is "catlist/alblist/random,2/lastup,2". Can't find it in index.php or config.php and it doesn't stand in the manual.
I'm sending you a PM with the answer johnny.
-
No support by PM, it's against the idea to run a forum: questions and answers get posted publicly for the benfit of others.
I already told you not to clutter this thread with unrelated stuff - butt out of it!
-
No support by PM, it's against the idea to run a forum: questions and answers get posted publicly for the benfit of others.
I already told you not to clutter this thread with unrelated stuff - butt out of it!
You just basically said you weren't going to answer his question because it was already answered in the thread, then told us not to clutter it. I chose to PM him because this only made sense following the guidelines you set down.
......
-
...and where is "catlist/alblist/random,2/lastup,2". Can't find it in index.php or config.php and it doesn't stand in the manual.
Why not to read the docs or faq you have to put just one thing in your cpg configuration for showing this feature.
Little TIP Album list view -----> catlist/anycontent/alblist/random,2/lastup,2
-
I appreciate your readiness to help, yet coppermine core functionality shouldn't be discussed on a mod thread.
-
how to make it show only to "registed users" only?
-
alanlai,
try this plugin
http://forum.coppermine-gallery.net/index.php?topic=38148.0 (http://forum.coppermine-gallery.net/index.php?topic=38148.0)
It's this mod but then in a plugin, works wonders and is also adjustable so you can set who can see it.
Cheers!
Hein