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

Pages: 1 [2] 3
16
Mods & Plugins (Requests & Discussions) / Re: rating with smileys
« on: October 29, 2005, 09:45:45 PM »
I don't think it is that

I tried this:
Code: [Select]
<script type="text/javascript"><!--
 
 
  rating_imgo = new Array(6);
 
  for (i=0;i<=5;i++)
  {
  rating_imgo[i]=new Image;
  rating_imgo[i].src = 'http://www.aftertheparty.nl/templates/test/images/rating/'+i+'.gif'
  }
 
  function rating_level(lev)
  {
  x=lev
  y=lev+1

  rating_img = new Array(5)
  for (i=0;i<=6;i++) rating_img[i]=document.test.getElementById('rating'+i)
   
  if (lev==6)
 
  for (i=0;i<=x;i++) rating_img[i].src='http://www.aftertheparty.nl/templates/test/images/rating/'+lev+'.gif'
  for (i=y;i<6;i++) rating_img[i].src='http://www.aftertheparty.nl/templates/test/images/rating/6.gif'
 
  }
 
 
 
       
  --></script>

with:

Code: [Select]
<form method="post" name="test" action="img1283.html">
<span class="ratingbox">
<input type="hidden" name="action" value="rateimage" />
<input type="hidden" name="id" value="1283" />                   
<input type="hidden" name="rating" value="1" />
<input src="http://www.aftertheparty.nl/templates/test/images/rating/6.gif" type="image" class="ratingimg" width="20" height="20" id="rating0" onmouseover="rating_level(0)" onmouseout="rating_level(6)" />
</span>
</form>

And it still doesn't work..

17
Mods & Plugins (Requests & Discussions) / Re: rating with smileys
« on: October 29, 2005, 09:15:18 PM »
The code I now have is working, but when I intergrate it in the template (I added the javescript in the header) the javascrip doesn't work :S
Example at: www.aftertheparty.nl/test2.html

18
Mods & Plugins (Requests & Discussions) / rating with smileys
« on: October 29, 2005, 07:31:50 PM »
I have a nice ratingfuncton with smileys, but I don't no how to intergrate it with 4images.
You can see a preview at: http://www.aftertheparty.nl/test.html
Can someone please help me to "intergrate" this function?

19
How can I add the keywords (without links) to the alt description?
I tried to add  {image_keywords} to the media template, but I get random keywords  :?

20
I found it out myself:


Open member.php

Find:
Code: [Select]
$content .= "<table border=\"0\" align=\"center\">\n<tr>\n<td>\n".$media."\n</td>\n</tr>\n</table>\n";
Replace with:
Code: [Select]
$content .= "<table border=\"0\" align=\"center\">\n<tr>\n<td>\n<div align=\"center\"><a href=\"./includes/rotate.php?".URL_IMAGE_ID."=".$image_id."&amp;wize=neg\">".$lang['rotate_neg']."</a>&nbsp;<a href=\"./includes/rotate.php?".URL_IMAGE_ID."=".$image_id."&amp;wize=pos\">".$lang['rotate_pos']."</a></div><br />".$media."\n</td>\n</tr>\n</table>\n";



21
v@no, is it possible to cut the name to 12 letters in the {comment_image_name} which you use in: [MOD] Last comments v1

22
To add the rotate button for the admin:

Replace includes/rotate.php with this:
Code: [Select]
<?
// change to suit your needs eg: define (JPG_QUALITY, '75'); gives a more compressed
// image file, but a poorer quality, when re-writing the jpeg after rotation.

define('JPG_QUALITY', '100');


//define variables and includes (should be no need to change these)
define('ROOT_PATH', './../');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();


//is there an image_id and does the user have permission to delete the image? If not, send them back to the index page!
if (!$image_id || ($config['user_delete_image'] != 1)) {
    header("Location: ".$site_sess->url(ROOT_PATH."index.php", "&"));
    exit;
  }
 
//if ok so far, read the image info from the database 
  $sql = "SELECT image_id, cat_id, user_id, image_name, image_media_file, image_thumb_file
          FROM ".IMAGES_TABLE."
          WHERE image_id = $image_id";
         
  $image_row = $site_db->query_firstrow($sql);

//is the user a registered user and the 'owner' of the image? If not, send them back to the index page!
  if ($user_info['user_level'] == ADMIN OR !$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] = $image_row['user_id'])) {

 
//so far so good, more variables need defining...
$ok=false;
$file=$image_row[image_media_file];
$cat_id=$image_row[cat_id];
$path_to_media = ROOT_PATH.MEDIA_DIR."/".$cat_id."/";
$path_to_thumbs = ROOT_PATH.THUMB_DIR."/".$cat_id."/";
$ext = get_file_extension($file); 

//clockwise or anticlockwise?
$degrees=0;
if ($wize=="neg"){$degrees = 90;}
if ($wize=="180"){$degrees = 180;}
if ($wize=="pos"){$degrees = 270;}

// Load existing images (if a 'jpg')
if (($ext == "jpg") || ($ext == "jpeg"))
{
$source_image = imagecreatefromjpeg($path_to_media.$file);
$source_thumb = imagecreatefromjpeg($path_to_thumbs.$file);
$ok=true;
}

// Load existing images (if a 'gif')
if ($ext == "gif")
{
$source_image = imagecreatefromgif($path_to_media.$file);
$source_thumb = imagecreatefromgif($path_to_thumbs.$file);
$ok=true;
}

if ($ok) //is it ok to process?
{
// Rotate
$rotate_image = imagerotate($source_image, $degrees, 0);
$rotate_thumb = imagerotate($source_thumb, $degrees, 0);

//Create new file names using timestamp as 'random' prefix to force browser to reload
$new_file_name=time().".".$ext;
$new_image = $path_to_media.$new_file_name;
$new_thumb = $path_to_thumbs.$new_file_name;

//Output 'new' images
if (($ext == "jpg") || ($ext == "jpeg"))
{
imagejpeg($rotate_image,$new_image,JPG_QUALITY);
imagejpeg($rotate_thumb,$new_thumb,JPG_QUALITY);
}

if ($ext == "gif")
{
imagegif($rotate_image,$new_image);
imagegif($rotate_thumb,$new_thumb);
}

//Delete 'old' files
unlink($path_to_media.$file);
unlink($path_to_thumbs.$file);
imagedestroy($rotate_image);
imagedestroy($rotate_thumb);
imagedestroy($source_image);
imagedestroy($source_thumb);


//write 'new' filenames to database
$sql=" UPDATE `4images_images`
SET `image_media_file` = '$new_file_name',`image_thumb_file` = '$new_file_name'
WHERE `image_id` = '$image_id'
LIMIT 1";

$result = $site_db->query($sql);

} //end of processing

//display new rotated image
header("Location: ".$site_sess->url(ROOT_PATH."details.php?&".URL_IMAGE_ID."=".$image_id, "&"));
}
  elseif (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $image_row['user_id'])) {
    header("Location: ".$site_sess->url(ROOT_PATH."index.php", "&"));
      exit;
  }

?>

Open details.php

FIND:
Code: [Select]
if ($user_info['user_level'] == ADMIN) {
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>&nbsp;";
}

REPLACE WITH:
Code: [Select]
if ($user_info['user_level'] == ADMIN) {
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>&nbsp;";
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."includes/rotate.php?".URL_IMAGE_ID."=".$image_id."&amp;wize=90")."\">".$lang['rotate_neg']."</a>&nbsp;";
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."includes/rotate.php?".URL_IMAGE_ID."=".$image_id."&amp;wize=270")."\">".$lang['rotate_pos']."</a>";
}

When an Image is uploaded, you get a page with te result, is it possible to add the rotate option to that page?
 :!:

23
Mods & Plugins (Releases & Support) / Re: [MOD] multiupload
« on: October 17, 2005, 10:40:31 AM »
Is there a way to set the maximum filesize to a smaller amount if a member uses the multiuploadform?
Because users get a timeout if the files are to big.

24
Mods & Plugins (Releases & Support) / Re: [MOD] multiupload
« on: September 13, 2005, 06:23:33 PM »
1. REPLACE the line you added before:
Code: [Select]
$image_name = ($image_name!="" && empty($HTTP_POST_VARS['image_name'.$fileext]))?$image_name:un_htmlspecialchars(trim($HTTP_POST_VARS['image_name'.$fileext]));
2. BY:
Code: [Select]
if (empty($HTTP_POST_VARS['image_name'.$fileext]))  
    {
    $error = 1;
    $field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU",
                        str_replace(":", "", $lang['image_name']), $lang['field_required']);
    $msg .= (($msg != "") ? "<br />" : "").$field_error;
    $action = "uploadform";
    $sendprocess = 1;
    break;
    }
else
    {
    $image_name = un_htmlspecialchars(trim($HTTP_POST_VARS['image_name'.$fileext]));
    }
...I think that should do the trick.

After I edited this, I've got the normal upload page (with an upload message) after a successful upload with only 2 images, is it possible to show the images I uploaded.

Maybe you can add a check if the "media_file" input has a value, and than check if all the images titles have a value.

25
Mods & Plugins (Requests & Discussions) / Icons as .png
« on: June 15, 2005, 07:55:25 PM »
The icons for a icon without a thumbnail are gifs. How can I make it png-files?

26
Fatal error: Call to undefined function: read_cookie_data()
This is a function that is part of 4images already and it can be found inside includes/sessions.php

Either you have modified that file, unlikely, or you have missed a ; or ) or { } somewhere and this has thrown off the PHP parser.  Recheck your code very carefully, restore your clean backup files and try installing the mod again.
Maybe it has something to do with the phpbb intergration which I use.

27
I've got the error  :(
Fatal error: Call to undefined function: read_cookie_data() in /home/aftertheparty.nl/www/includes/page_header.php on line 300

28
On the old forum vividviews posted this MOD, does some still have this?
It's saved the value in a cookie.

29
It worked, but is it also possible to show these extra fields in the details page?

30
Plugins / Re: [PLUGIN] Batch Import From ZIP Files
« on: May 04, 2005, 01:10:18 PM »
I'm using the phpbb intergration and I get a DB Error and he can't find any users

Pages: 1 [2] 3