Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - propertysnaps

Pages: [1] 2
1
Hello,
Is it possible to add a button (image) to my categories.html page that will make it go to the next page?

I already have the paging setup like this   << 1,2,3,4 >> last page

But I want to add some extra buttons on another part of the screen,

I want one of those buttons to take me to the next page  (so it will go to:    /categories.php?cat_id=7&page=2)  where the 2 is the next page

Does any one know what code I can add to the link to make it dyanmically go to the next page? 

I would have thought that categories.php?cat_id=7&page=$next_page  would work - but it doesnt.

2
Fixed it by replacing


    if ($file_added) {
      @set_time_limit(120);
      $file['file_name'] = time().".zip";
      $file['file_data'] = $zipfile->file();
      $file['file_size'] = strlen($file['file_data']);
    }
    else {

with

    if ($file_added) {
      @set_time_limit(120);
 $file['file_data'] = $zipfile->send(time().".zip");

3
Weird, I have made the change but get this error now-

Fatal error: Call to undefined method Zipfile::file() in /home/property/public_html/imagemanager/download.php on line 353


this is my download.php file

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: download.php                                         *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.4                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) fr weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 0;

$nozip 1;
define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

function 
get_remote_file($url) {
  
$file_data "";
  
$url = @parse_url($url);
  if (isset(
$url['path']) && isset($url['scheme']) && eregi("http"$url['scheme'])) {
    
$url['port'] = (!isset($url['port'])) ? 80 $url['port'];
    if (
$fsock = @fsockopen($url['host'], $url['port'], $errno$errstr)) {
      @
fputs($fsock"GET ".$url['path']." HTTP/1.1\r\n");
      @
fputs($fsock"HOST: ".$url['host']."\r\n");
      @
fputs($fsock"Connection: close\r\n\r\n");
      
$file_data "";
      while (!@
feof($fsock)) {
        
$file_data .= @fread($fsock1000);
      }
      @
fclose($fsock);
      if (
preg_match("/Content-Length\: ([0-9]+)[^\/ \n]/i"$file_data$regs)) {
        
$file_data substr($file_datastrlen($file_data) - $regs[1], $regs[1]);
      }
    }
  }
  return (!empty(
$file_data)) ? $file_data 0;
}

function 
get_file_data($file_path) {
  global 
$script_url;
  
ob_start();
  @
ob_implicit_flush(0);
  @
readfile($file_path);
  
$file_data ob_get_contents();
  
ob_end_clean();
  if (!empty(
$file_data)) {
    return 
$file_data;
  }
  elseif (
is_remote_file($file_path)) {
    
$file_data get_remote_file($file_path);
  }
  else {
    if (!
file_exists($file_path)) {
      
$file_path preg_replace("/\/{2,}/""/"get_document_root()."/".$file_path);
    }
    if (
file_exists($file_path)) {
      
$file_size = @filesize($file_path);
      
$fp = @fopen($file_path"rb");
      if (
$fp) {
        
$file_data = @fread($fp$file_size);
        @
fclose($fp);
      }
    }
  }
  if (empty(
$file_data)) {
    if (
ereg("^\/"$file_path)) {
      
preg_match("/^(http:\/\/[^\/]+)/i"$script_url$regs);
      
$script_url $regs[1];
    }
    
$file_data get_remote_file($script_url."/".$file_path);
  }
  return (!empty(
$file_data)) ? $file_data 0;
}

function 
send_file($file_name$file_path) {
  
$data get_file_data($file_path);

  @
session_write_close();
	

	
header("Cache-Control: no-cache, must-revalidate");
  
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

  if (
get_user_os() == "MAC") {
    
header("Content-Type: application/x-unknown\n");
    
header("Content-Disposition: attachment; filename=\"".$file_name."\"\n");
  }
  elseif (
get_browser_info() == "MSIE") {
    
$disposition = (!eregi("\.zip$"$file_name)) ? 'attachment' 'inline';
    
header("Content-Disposition: $disposition; filename=\"".$file_name."\"\n");
    
header("Content-Type: application/x-ms-download\n");
  }
  else {
    
header("Content-Disposition: attachment; filename=\"".$file_name."\"\n");
    
header("Content-Type: application/octet-stream\n");
  }
  
header("Content-Length: ".strlen($data)."\n\n");

  echo 
$data;
}

$file = array();

if (
$action == "lightbox") {
  if (empty(
$user_info['lightbox_image_ids']) || !function_exists("gzcompress") || !function_exists("crc32")) {
    
redirect($url);
  }

  if (!
check_download_token($user_info['lightbox_image_ids'])) {
    
redirect("index.php");
  }

  
$image_id_sql str_replace(" "", "trim($user_info['lightbox_image_ids']));
  
$image_ids = array();
  
$sql "SELECT image_id, cat_id, image_media_file, image_download_url
          FROM "
.IMAGES_TABLE."
          WHERE image_active = 1 AND image_id IN (
$image_id_sql) AND cat_id NOT IN (".get_auth_cat_sql("auth_viewimage""NOTIN").", ".get_auth_cat_sql("auth_viewcat""NOTIN").get_auth_cat_sql("auth_download""NOTIN").")";
  
$result $site_db->query($sql);

  if (
$result) {
    include(
ROOT_PATH."includes/zip.php");
    
$zipfile = new zipfile();
    
$file_added 0;
    while (
$image_row $site_db->fetch_array($result)) {
      if (!empty(
$image_row['image_download_url'])) {
        if (
is_remote_file($image_row['image_download_url']) || is_local_file($image_row['image_download_url'])) {
          
$file_path $image_row['image_download_url'];
          
$file_name basename($image_row['image_download_url']);
        }
      }
      elseif (
is_remote($image_row['image_media_file'])) {
        
$file_path $image_row['image_media_file'];
        
$file_name get_basefile($image_row['image_media_file']);
      }
      else {
        
$file_path MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file'];
        
$file_name $image_row['image_media_file'];
      }

      if (!empty(
$file_path)) {
        @
set_time_limit(120);
        if (!
$file_data get_file_data($file_path)) {
          continue;
        }
        
$zipfile->add_file($file_data$file_name);
        
$file_added 1;
        unset(
$file_data);
        
$image_ids[] = $image_row['image_id'];
      }
    }

    if (
$file_added) {
      if (
$user_info['user_level'] != ADMIN) {
        
$sql "UPDATE ".IMAGES_TABLE."
                SET image_downloads = image_downloads + 1
                WHERE image_id IN ("
.trim(implode(", "$image_ids)).")";
        
$site_db->query($sql);
      }

      @
set_time_limit(120);
      
$file['file_data'] = $zipfile->send(time().".zip");
      exit;
    }
    else {
      
redirect($url);
    }
  }
}
elseif (
$image_id) {
  if (isset(
$HTTP_GET_VARS['size']) || isset($HTTP_POST_VARS['size'])) {
    
$size = (isset($HTTP_GET_VARS['size'])) ? intval($HTTP_GET_VARS['size']) : intval($HTTP_POST_VARS['size']);
  }
  else {
    
$size 0;
  }

  
$sql "SELECT cat_id, user_id, image_media_file, image_download_url, image_downloads
          FROM "
.IMAGES_TABLE."
          WHERE image_id = 
$image_id AND image_active = 1";
  
$image_row $site_db->query_firstrow($sql);

  if (!
$image_row || !check_permission("auth_viewcat"$image_row['cat_id']) || !check_permission("auth_viewimage"$image_row['cat_id'])) {
    
redirect($url);
  }
  else {
    if (!
check_permission("auth_download"$image_row['cat_id'])) {
      
redirect($url);
    }

    if (!
check_download_token($image_id)) {
      echo 
"Hotlinking is not allowed";
	
	
	
exit;
	
	
	
redirect("index.php");
    }
  }

  
$remote_url 0;
  if (!empty(
$image_row['image_download_url'])) {
    if (
is_remote_file($image_row['image_download_url']) || is_local_file($image_row['image_download_url'])) {
      
ereg("(.+)\.(.+)"basename($image_row['image_download_url']), $regs);
      
$file_name $regs[1];
      
$file_extension $regs[2];

      
$file['file_name'] = $file_name.(($size) ? "_".$size "").".".$file_extension;
      
$file['file_path'] = dirname($image_row['image_download_url'])."/".$file['file_name'];
    }
    else {
      
$file['file_path'] = $image_row['image_download_url'];
      
$remote_url 1;
    }
  }
  elseif (
is_remote_file($image_row['image_media_file'])) {
    
ereg("(.+)\.(.+)"get_basefile($image_row['image_media_file']), $regs);
    
$file_name $regs[1];
    
$file_extension $regs[2];

    
$file['file_name'] = $file_name.(($size) ? "_".$size "").".".$file_extension;
    
$file['file_path'] = dirname($image_row['image_media_file'])."/".$file['file_name'];
  }
  else {
    
ereg("(.+)\.(.+)"get_basefile($image_row['image_media_file']), $regs);
    
$file_name $regs[1];
    
$file_extension $regs[2];

    
$file['file_name'] = $file_name.(($size) ? "_".$size "").".".$file_extension;
    
$file['file_path'] = (is_local_file($image_row['image_media_file'])) ? dirname($image_row['image_media_file'])."/".$file['file_name'] : MEDIA_PATH."/".$image_row['cat_id']."/".$file['file_name'];
  }

  if (
$user_info['user_level'] != ADMIN) {
    
$sql "UPDATE ".IMAGES_TABLE."
            SET image_downloads = image_downloads + 1
            WHERE image_id = 
$image_id";
    
$site_db->query($sql);
  }

  if (!empty(
$file['file_path'])) {
    @
set_time_limit(120);
    if (
$remote_url) {
      
redirect($file['file_path']);
    }

    if (
$action == "zip" && !eregi("\.zip$"$file['file_name']) && function_exists("gzcompress") && function_exists("crc32")) {
      include(
ROOT_PATH."includes/zip.php");
      
$zipfile = new zipfile();
      
$zipfile->add_file(get_file_data($file['file_path']), $file['file_name']);

      
$zipfile->send(get_file_name($file['file_name']).".zip");
    } else {
        
send_file($file['file_name'], $file['file_path']);
    }
    exit;
  }
  else {
    echo 
$lang['download_error']."\n<!-- EMPTY FILE PATH //-->";
    exit;
  }
}

elseif (
$action == "page") {
  if (!
function_exists("gzcompress") || !function_exists("crc32")) {
    
header("Location: ".$site_sess->url($url"&"));
    exit;
  }

//-------------------------------------------------------\\
//------- need find out witch pictures are desplayed ----\\
//------ this code was taken from categories.php file ---\\
//----- with some modification-adaption to this script --\\
//------- so, if someone could give me an example --------\\
//------- how to transfer a string from one php file -----\\
//------ to another, I would really appreciated and ------\\
//--------------- modification would be less -------------\\ 
//----- (I've tryed use global $string; - it didnt work) --\\
//--------------------------------------------------------\\

$additional_sql "";
if (!empty(
$additional_image_fields)) {
  foreach (
$additional_image_fields as $key => $val) {
    
$additional_sql .= ", i.".$key;
  }
}
$sql "SELECT i.image_id, i.cat_id, i.user_id
        FROM ("
.IMAGES_TABLE." i,  ".Jobs_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id = 
$cat_id AND c.cat_id = i.cat_id
        ORDER BY "
.$config['image_order']." ".$config['image_sort']."
        LIMIT "
.$_GET['offset'].", $perpage";
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);
$page_download "";
while (
$image_row $site_db->fetch_array($result)){
$page_download .= ", ".$image_row['image_id'];
}
$image_id_sql trim($page_download", ");
//--------------------------------------------------------------\\
//---- the rest of the code was taken from download-lightbox----\\
//--------------------------------------------------------------\\
  
$sql "SELECT cat_id, image_media_file, image_download_url
          FROM "
.IMAGES_TABLE."
          WHERE image_active = 1 AND image_id IN (
$image_id_sql) AND cat_id IN (".get_auth_cat_sql("auth_download").")";
  
$result $site_db->query($sql);
  if (
$result) {
    include(
ROOT_PATH."includes/zip.php");
    
$zipfile = new zipfile();
    
$file_added 0;
    while (
$image_row $site_db->fetch_array($result)) {
      if (!empty(
$image_row['image_download_url'])) {
        if (
is_remote_file($image_row['image_download_url']) || is_local_file($image_row['image_download_url'])) {
          
$file_path $image_row['image_download_url'];
          
$file_name basename($image_row['image_download_url']);
        }
      }
      elseif (
is_remote($image_row['image_media_file'])) {
        
$file_path $image_row['image_media_file'];
        
$file_name basename($image_row['image_media_file']);
      }
      else {
        
$file_path MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file'];
        
$file_name $image_row['image_media_file'];
      }

      if (!empty(
$file_path)) {
        @
set_time_limit(120);
        if (!
$file_data get_file_data($file_path)) {
          continue;
        }
        
$zipfile->add_file($file_data$file_name);
        
$file_added 1;
        unset(
$file_data);
      }
    }

    if (
$file_added) {
      @
set_time_limit(120);
      
$file['file_name'] = time().".zip";
      
$file['file_data'] = $zipfile->file();
      
$file['file_size'] = strlen($file['file_data']);
    }
    else {
      
header("Location: ".$site_sess->url($url"&"));
      exit;
    }
  }
}

else {
  echo 
$lang['download_error']."\n<!-- NO ACTION SPECIFIED //-->";
  exit;
}

exit;
?>

4
I have just changed to a dedicated server and now this mod seems to have stoped working, I get this error (below)  however my lightbox download still works, so very weird.

This is the error.

DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id FROM 4images_images i, 4images_Jobs c LEFT JOIN 4images_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND i.cat_id = 373 AND c.cat_id = i.cat_id ORDER BY image_name ASC LIMIT 0, 40
Unknown column 'i.user_id' in 'on clause'

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/property/public_html/imagemanager/includes/db_mysql.php on line 116

DB Error: Bad SQL Query: SELECT cat_id, image_media_file, image_download_url FROM 4images_images WHERE image_active = 1 AND image_id IN () AND cat_id IN (0, 451, 519, 488, 515, 484, 478, 486, 490, 462, 465, 476, 480, 448, 444, 494, 210, 333, 461, 518, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 561, 249, 446, 166, 341, 248, 247, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 48, 49, 56, 58, 62, 63, 64, 66, 68, 69, 70, 72, 73, 75, 77, 81, 83, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97, 98, 99, 100, 101, 102, 103, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 121, 122, 123, 124, 125, 126, 127, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 147, 148, 150, 151, 152, 154, 156, 157, 159, 160, 161, 162, 163, 164, 165, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 209, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 223, 224, 225, 226, 227, 228, 229, 231, 232, 233, 234, 235, 236, 237, 239, 240, 241, 242, 243, 244, 245, 246, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 321, 322, 323, 324, 326, 327, 328, 329, 330, 331, 332, 334, 335, 336, 337, 338, 339, 340, 342, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 361, 362, 363, 364, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 380, 381, 382, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 439, 432, 433, 434, 435, 436, 437, 438, 440, 441, 442, 443, 445, 447, 449, 450, 452, 453, 454, 455, 456, 457, 458, 459, 460, 463, 464, 466, 467, 468, 469, 470, 475, 477, 479, 481, 482, 483, 485, 487, 489, 493, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 516, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 556, 557, 558, 559, 560)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND cat_id IN (0, 451, 519, 488, 515, 484, 478, 486, 490, 462, 465, 476, 480, ' at line 3



Any help or ideas would be great

5
Hello, I have searched this forum and cant find an answere,
When I try to uncheck the tick box for the user permisisons for each catergory it will untick but when I save the changes it reverts back to being ticked again.
I think this bug may be fixed in the new version, however I have made a lot of mods to my gallery and would like to avoide doing the upgrade.

Any help would be great!

Thanks
Vince

6
Hi,
This problem has been on here before i think, but I cant find an answer to my problem.  When ever I try to uncheck or untick  the boxs in the permmisions section under "user" and "permissions" it unticks but then when I save the change and go back to the same screen the box is still checked.

I think the new version fixes this problem, however I have to many mods on mine to upgrade it.
Is anyone able to offer solution to fix this bug?

Thanks
Vince DeStefano

7
Hi,
I apologize if I have posted this in the wrong area.
Im a freelance photographer who sells photos to news peppers.

I was wondering if anyone knows of a solution or module that will remove my watermark when my client buys/downloads the photo.

I invoice all my clients so I really just want an ordering system that tracks who downloaded the photo(info such as account user name, photo and price) I can then invoice them from this,

The second part is where when they view a photo at say medium res (800X600) and decide to buy it, the system will let them download a full res version(3888 X xxxx pixels) without the watermark.

In summary -

-Checkout system, doesnt need credit card facilities, only user name and price/photo tracking

-Allow a download of the full sized image with no water mark.

This system is basically what they use on stock photo websites.

If anyone knows of a plug-in that would be great, otherwise I am happy to pay someone to develop it.

Thanks
Vince DeStefano

8
I got it work now with 1.7.4 no problem or mods.

9
Hi,
Is it possible to set up the lightbox so it downloads the files as one whole folder rather than a zip file? 
Some of my real esatate clients struggle to understand what a zip file is let alone unzip one.

So I need a mod where it downloads the images as a folder, size is not important as there are usally only 3-4 images at about 80k each.

Thanks
Vince

10
Hi,
I have set my cells and rows to 10 X 4 but the maximum per page it will show is 30.

Is there a  way to make this more,

Which file do I change?

Thanks
Vince

11
Hi,
I tried using this mod  http://www.4homepages.de/forum/index.php?topic=3479

but I am using 1.7.4 so it won't work.

I get this error.


f
Warning: Cannot modify header information - headers already sent by (output started at /home/property/public_html/imagemanager/download.php:1) in /home/property/public_html/imagemanager/includes/zip.php on line 204

Warning: Cannot modify header information - headers already sent by (output started at /home/property/public_html/imagemanager/download.php:1) in /home/property/public_html/imagemanager/includes/zip.php on line 207

Warning: Cannot modify header information - headers already sent by (output started at /home/property/public_html/imagemanager/download.php:1) in /home/property/public_html/imagemanager/includes/zip.php on line 212

Warning: Cannot modify header information - headers already sent by (output started at /home/property/public_html/imagemanager/download.php:1) in /home/property/public_html/imagemanager/includes/zip.php on line 217
PKh^xa1.jpgwT0 6tTWi" "fH"H4)"DEAA:HT IHrc9=~ZNٳ<{ٳ"6upvV a! >+@ = ;q<GkB \



Is anyone able to make a solution for me that works? I will pay AU$80 if some one can make the mod work or make a new one.

Thanks
Vince DeStefano

12
Has anyone made this work with 1.7.4

13
Hi,
Does anyone know of a mod where I can add a button so I can download all the images in a category?
Rather than selecting the light box for each image individually, It would save a lot of time if we could select all for download.

Thanks
Vince

14
Hi,
I use 4images gallery to distrubute photos to my clients, as I am a photographer.

I need a mod where I can upload a full size image to the server.

The client then needs to be able to view a scaled down version of this image and then also be able to download a high res versin if they want to.(ie full size)

I am sure there is a mod out like this but I just cant find it.

any help would be apreciated.

thanks
vince

15
Hi,
Don't worry, I have now done it myself  :lol:
Works well, Just use a simple CGI script form and used a hidden field to send the user details.

Created a page called order.php  which is basicly the same as index.php and then made a template called order.html and inserted the form.

Took about 10 minutes.

Cheers

Pages: [1] 2