aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Froese <greg.froese@gmail.com>2009-05-13 13:26:12 +0000
committerGreg Froese <greg.froese@gmail.com>2009-05-13 13:26:12 +0000
commitbc21cbc465d9cd4d86265246826ba02515541152 (patch)
tree6f8fc7b6d54ed9d3c5494ced2a44d671b2481871
parentb32a22535f4b41187475618769d0a4d07aba6684 (diff)
downloadelgg-bc21cbc465d9cd4d86265246826ba02515541152.tar.gz
elgg-bc21cbc465d9cd4d86265246826ba02515541152.tar.bz2
fixed sorting for most viewed and watermarking files to show proper owner when watermarking images in a group album
-rw-r--r--actions/upload.php3
-rw-r--r--friendmostviewed.php2
-rw-r--r--mostviewedimages.php2
-rw-r--r--yourmostviewed.php2
4 files changed, 5 insertions, 4 deletions
diff --git a/actions/upload.php b/actions/upload.php
index b31921483..f114f50ad 100644
--- a/actions/upload.php
+++ b/actions/upload.php
@@ -187,7 +187,8 @@
$watermark_filename = preg_replace("/[^\w-]+/", "-", $watermark_filename);
$watermark_filename = trim($watermark_filename, '-');
- $user_stamp_base = dirname(__FILE__) . "/" . $username . "_" . $watermark_filename . "_stamp";
+ $viewer = get_loggedin_user();
+ $user_stamp_base = dirname(__FILE__) . "/" . $viewer->name . "_" . $watermark_filename . "_stamp";
if( !file_exists( $user_stamp_base . $ext )) { //create the watermark if it doesn't exist
$commands = array();
$commands[] = 'convert -size 300x50 xc:grey30 -pointsize 20 -gravity center -draw "fill grey70 text 0,0 \''. $watermark_text . '\'" '. $user_stamp_base . '_fgnd' . $ext;
diff --git a/friendmostviewed.php b/friendmostviewed.php
index 901a8ff08..a196f51af 100644
--- a/friendmostviewed.php
+++ b/friendmostviewed.php
@@ -38,7 +38,7 @@
INNER JOIN " . $prefix . "metastrings ms ON md.value_id = ms.id
INNER JOIN " . $prefix . "metastrings ms2 ON md.name_id = ms2.id AND ms2.string = 'tp_views'
WHERE ent.owner_guid = " . $user->guid . "
- ORDER BY views DESC LIMIT $max";
+ ORDER BY (views+0) DESC LIMIT $max";
$result = get_data($sql);
diff --git a/mostviewedimages.php b/mostviewedimages.php
index caf755193..8831dc33e 100644
--- a/mostviewedimages.php
+++ b/mostviewedimages.php
@@ -17,7 +17,7 @@
$sql = "select md.entity_guid, md.owner_guid, md.enabled, ms.string as views from " . $prefix . "metadata md
inner join " . $prefix . "metastrings ms on md.value_id = ms.id
inner join " . $prefix . "metastrings ms2 on md.name_id = ms2.id and ms2.string = 'tp_views'
- order by views desc LIMIT $max";
+ order by (views+0) desc LIMIT $max";
$result = get_data($sql);
diff --git a/yourmostviewed.php b/yourmostviewed.php
index 40d05c038..f9a1af88a 100644
--- a/yourmostviewed.php
+++ b/yourmostviewed.php
@@ -20,7 +20,7 @@
INNER JOIN " . $prefix . "metastrings ms ON md.value_id = ms.id
INNER JOIN " . $prefix . "metastrings ms2 ON md.name_id = ms2.id AND ms2.string = 'tp_views'
WHERE ent.owner_guid = " . $viewer->guid . "
- ORDER BY views DESC LIMIT $max";
+ ORDER BY (views+0) DESC LIMIT $max";
$result = get_data($sql);