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

Pages: 1 2 3 [4] 5 6 7
46
updated ( i couldnt remember the lines)

47
sauber, danke! hat gleich beim ersten bzw. zweiten versuch geklappt! // great, worked in first try

ich hatte immer die folgende fehlermeldung, da der pfad zu meinem wasserzeichen-BILD nicht korrekt war und anscheinend nur bilder als wasserzeichen im PNG Format verwendet werden können:

Warning: imagesx(): supplied argument is not a valid Image resource in /homepages/6/d96478316/htdocs/photos/includes/annotate.php on line 176

Warning: imagesy(): supplied argument is not a valid Image resource in /homepages/6/d96478316/htdocs/photos/includes/annotate.php on line 177

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /homepages/6/d96478316/htdocs/photos/includes/annotate.php on line 184

Warning: imagecolortransparent(): supplied argument is not a valid Image resource in /homepages/6/d96478316/htdocs/photos/includes/annotate.php on line 185

Warning: imagecopymerge(): supplied argument is not a valid Image resource in /homepages/6/d96478316/htdocs/photos/includes/annotate.php on line 186

49
yes it is.

look at this thread --> http://www.4homepages.de/forum/index.php?topic=6729.0

there is somewhere a post from somebody, who asks the same and solves it. i cant remember who it was, but it was somebody from the netherlands

50
plz dont forget do edit the path for

Code: [Select]
RewriteBase
in the code above.[/b] how to do that, look at the posts before.

51
good to know.

52
did u try my fix mentioned above?

53
Feedback & Suggestions / Gallerie wurde geSpamed / Hacked!!!
« on: July 09, 2007, 04:25:38 PM »
Hi,

ich war bisher eigentlich überzeugt von 4Images.
Heute jedoch musste ich bemerken, dass meine Webseite extrem langsam war. Das machte mich stutzig und sah im Quellcode nach.

Ein Spammer hatte in jede HTML Template Datei folgenden Iframe platziert:

Code: [Select]
<iframe width=0 height=0 frameborder=0 src=http://www.free20.com/portal/index.php?aff=razec marginwidth=0 marginheight=0 vspace=0 hspace=0 allowtransparency=true scrolling=no></iframe></html>
Das erscheint mir einleuchtend, laut Anleitung sollen ja alle Template Dateien die vollen Zugriffs, Lese und Schreibrechte bekommen (chmod 777).

Ist das eine Sicherheitslücke bei 4images oder mein Fehler?

Jedensfalls ist mein zuvor 100% positiver Eindruck von 4images jetzt getrügt und ich werde die Rechte auf das Minimum runterbrechen.

54
Könnte was mit den Sessions zu tun haben. Werden die überall richtig übergeben?

55
I have seen on http://www.turkiye-resimleri.com/k-aksaray-5.htm that the thumbnail links to the detail page also are seo friendly. how would i do that?

56
as i see my categories are renamed to cat-aus-der-luft-1.htm. when i click on the category, i get a 404 error.

any idea?


// EDIT //

If fixed it:

Code: [Select]
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /4images/
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}

#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
</IfModule>

What I did, was uncommenting the "RewriteBase" and adding the path to 4images.


Details on http://www.4homepages.de/forum/index.php?topic=6729.0


57
Du hast natürlich recht!

Mmmh...ich hab aber den MySQl 5 und funzt trotzdem.

habs gleich im original code bearbeitet!

58
Hi,

this is a mod, found by coincedence and some modifications by SLL (http://www.4homepages.de/forum/index.php?topic=3529.msg25302#msg25302)


What this MOD will do:

- Shows the most rated picture
- Shows the most voted picture
- Shows the most commented picture
- Shows the most downloaded picture
- Shows the most viewed picture

on a page outside of 4Images! I have used this mod in Wordpress!


ok, lets go:

1. Create a new .php file and name it something like "bestpictures.php" or something like that. Save it in the root folder of 4images.

  so it would look like that: /4images/bestpictures.php

2. Put the following code in it:


Code: [Select]
<?php
// error_reporting(E_ALL);
define('ROOT_PATH''../4images/');
define('SITE_URL''http://www.yourdomain.de/');

// Bild des Tages: für 24 Stunden wird einer der besten Bilder aus
// Datenbank gelesen und angezeigt. Nach 24 Stunden wechselt das Bild.
/**************************************************************************
*                                                                        *
*    4images - A Web Based Image Gallery Management System               *
*    ----------------------------------------------------------------    *
*                                                                        *
*             File: potd.php                                           *
*        Copyright: (C) 2002 Jan Sorgalla                                *
*            Email: jan@4homepages.de                                    *
*              Web: http://www.4homepages.de                             *
*    Scriptversion: 1.0 for 4images 1.7                                *
*                                                                        *
*    Never released without support from: Nicky (http://www.nicky.net) and SLL (;   *
*                                                                        *
**************************************************************************
*                                                                        *
*    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
*    bedingungen (http://www.4homepages.de/4images/lizenz.php) für       *
*    weitere Informationen.                                              *
*    ---------------------------------------------------------------     *
*    This script is NOT freeware! Please read the Copyright Notice       *
*    (http://www.4homepages.de/4images/lizenz_e.php) for further         *
*    information.                                                        *
*                                                                        *
*************************************************************************/
//Based on the Photo of the Day mod by SLL and V@no
//additional tweaking by Omnirayf 9-5-2003
// and c-bass ( 6. Juli 2007)

include_once(ROOT_PATH.'config.php');
include_once(
ROOT_PATH.'includes/db_mysql.php');
include_once(
ROOT_PATH.'includes/constants.php');

define('PIC_CATEGORIES_TABLE''4images_categories');
define('PIC_IMAGES_TABLE''4images_images');

$pics_db = new Db($db_host$db_user$db_password$db_name);

function 
is_remote($file_name) {
  return (
preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i'$file_name)) ? 0;
}

echo 
"<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\"><tr>\n";

# -----------------------------------------------------------------------------------------------------------------------------------

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_comments, a.image_downloads, a.image_votes, a.image_rating, a.image_hits
FROM ("
.PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b)
WHERE a.image_active=1 AND a.cat_id = b.cat_id
ORDER BY a.image_rating DESC
LIMIT 1"
;

$row $pics_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo 
"<td><a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Most rated<br></td>\n";

# -----------------------------------------------------------------------------------------------------------------------------------

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_comments, a.image_downloads, a.image_votes, a.image_rating, a.image_hits
FROM ("
.PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b)
WHERE a.image_active=1 AND a.cat_id = b.cat_id
ORDER BY a.image_votes DESC
LIMIT 1"
;

$row $pics_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo 
"<td><a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Most voted<br></td>\n";

# -----------------------------------------------------------------------------------------------------------------------------------

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_comments, a.image_downloads, a.image_votes, a.image_rating, a.image_hits
FROM ("
.PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b)
WHERE a.image_active=1 AND a.cat_id = b.cat_id
ORDER BY a.image_comments DESC
LIMIT 1"
;

$row $pics_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo 
"<td><a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Most commented<br></td>\n";

# -----------------------------------------------------------------------------------------------------------------------------------

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_comments, a.image_downloads, a.image_votes, a.image_rating, a.image_hits
FROM ("
.PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b)
WHERE a.image_active=1 AND a.cat_id = b.cat_id
ORDER BY a.image_downloads DESC
LIMIT 1"
;

$row $pics_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo 
"<td><a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Most downloaded<br></td>\n";

# -----------------------------------------------------------------------------------------------------------------------------------

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_comments, a.image_downloads, a.image_votes, a.image_rating, a.image_hits
FROM ("
.PIC_IMAGES_TABLE." a, ".PIC_CATEGORIES_TABLE." b)
WHERE a.image_active=1 AND a.cat_id = b.cat_id
ORDER BY a.image_hits DESC
LIMIT 1"
;

$row $pics_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo 
"<td><a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Most viewed<br></td>\n";

# -----------------------------------------------------------------------------------------------------------------------------------

echo "</tr></table>\n";

?>



3. EDIT in the first lines of the code the domain and the path to your 4images installlation! It might be, if u have different database table name, that u also have to change them in the code.
If u dont want for example shown the most viewed pictures, comment the sql query in the code.


4. Test the file by calling it directly over your browser like http://www.yourdomain.de/4images/bestpictures.php

5. Put this line of code, where u want to have the pictures.

            
Code: [Select]
<?php include("http://www.yourdomain.de/4images/bestpictures.php"); ?>

59
Mods & Plugins (Releases & Support) / Re: Mebbernind!
« on: July 05, 2007, 10:11:53 PM »
Mebbernind!

I think I have it figured out with the help of a couple of friends....

Code: [Select]
<?php

/**************************************************************************
*                                                                        *
*    4images - A Web Based Image Gallery Management System               *
*    ----------------------------------------------------------------    *
*                                                                        *
*             File: potd.php                                           *
*        Copyright: (C) 2002 Jan Sorgalla                                *
*            Email: jan@4homepages.de                                    *
*              Web: http://www.4homepages.de                             *
*    Scriptversion: 1.0 for 4images 1.7                                *
*                                                                        *
*    Never released without support from: Nicky (http://www.nicky.net) and SLL (;   *
*                                                                        *
**************************************************************************
*                                                                        *
*    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
*    bedingungen (http://www.4homepages.de/4images/lizenz.php) für       *
*    weitere Informationen.                                              *
*    ---------------------------------------------------------------     *
*    This script is NOT freeware! Please read the Copyright Notice       *
*    (http://www.4homepages.de/4images/lizenz_e.php) for further         *
*    information.                                                        *
*                                                                        *
*************************************************************************/
//Based on the Photo of the Day mod by SLL and V@no
//additional tweaking by Omnirayf 9-5-2003

// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH''./4images/');
//include(ROOT_PATH.'global.php');
include(ROOT_PATH.'config.php');
include(
ROOT_PATH.'includes/db_mysql.php');
include(
ROOT_PATH.'includes/constants.php');

$site_db = new Db($db_host$db_user$db_password$db_name);
function 
is_remote($file_name) {
  return (
preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i'$file_name)) ? 0;
}
    switch (
POTD_SELECT_MODE) {
   case 
"by_rating"     $select_mode "i.image_rating"$select_mode2 ", i.image_votes DESC"; break;
   case 
"by_votes"      $select_mode "i.image_votes"$select_mode2 ", i.image_name ASC"; break;
   case 
"by_comments"   $select_mode "i.image_comments"$select_mode2 ", i.image_name ASC"; break;
   case 
"by_downloads"  $select_mode "i.image_downloads"$select_mode2 ", i.image_name ASC"; break;
   case 
"by_hits"                $select_mode "i.image_hits"$select_mode2 ", i.image_name ASC"; break;
   default                             : 
$select_mode "i.image_rating"$select_mode2 ", i.image_votes DESC"; break;
}

$sql "SELECT COUNT(*) as total_images
        FROM "
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b 
        WHERE a.image_date<"
.mktime(000date("m"), date("d"), date("y"))."
AND a.image_active=1 
        AND a.cat_id = b.cat_id 
        AND b.auth_viewcat="
.AUTH_ALL.
        AND b.auth_viewimage="
.AUTH_ALL."
        "
;
$row $site_db->query_firstrow($sql);
$total_images $row['total_images'];

mt_srand(mktime(000date("m"), date("d"), date("y")));
$number = ($total_images 1) ? mt_rand(0$total_images 1) : 0;

$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments 
        FROM "
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b 
        WHERE a.image_date<"
.mktime(000date("m"), date("d"), date("y"))."
AND a.image_active=1 
        AND a.cat_id = b.cat_id 
        AND b.auth_viewcat="
.AUTH_ALL.
        AND b.auth_viewimage="
.AUTH_ALL.
        LIMIT 
$number, 1";
$row $site_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo 
"<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><center><a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Comments: $image_comments</center></td></tr></table>\n";
?>

Copy this code to Notepad or Homesite or UltraEdit, rename to potd.php, toss it in your root directory, and then test it by direct url call. You should get any old pic in your 4images database, regardless of stats. Refresh, and the pic should remain the same. After midnight of the date you implement the mod, the pic should change to another random pic for another 24 hours.

This mod has been optimized for people who are using Postnuke or PhpNuke and want a Photo of the Day block. Just make a new php script block and put this into it:
Code: [Select]
include("http://www.your-own-site.com/potd.php");
?>
It works, believe me, especially if you are using Postnuke. Otherwise, if you are having problems with it, add the opening <?php tag.

Let me know if it works for you, as it works for me. This way I can go and slap my friends for their help. :wink:


Hi,

i wanted to have the REAL Photo of the day for 24 hours, too.

How to do that on an extern page was told in the thread i mention. It isnt much do do, if u want to have it in your template.

Replace the code in the functions.php with:

Code: [Select]
//-----------------------------------------------------
//--- Photo Of The Day --------------------------------
//-----------------------------------------------------

function get_potd_image() {
    global $site_db, $site_template, $select_mode;

$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");

    switch (POTD_SELECT_MODE) {
   case "by_rating"     : $select_mode = "i.image_rating"; $select_mode2 = ", i.image_votes DESC"; break;
   case "by_votes"      : $select_mode = "i.image_votes"; $select_mode2 = ", i.image_name ASC"; break;
   case "by_comments"   : $select_mode = "i.image_comments"; $select_mode2 = ", i.image_name ASC"; break;
   case "by_downloads"  : $select_mode = "i.image_downloads"; $select_mode2 = ", i.image_name ASC"; break;
   case "by_hits"                : $select_mode = "i.image_hits"; $select_mode2 = ", i.image_name ASC"; break;
   default                             : $select_mode = "i.image_rating"; $select_mode2 = ", i.image_votes DESC"; break;
}

$sql = "SELECT COUNT(*) as total_images
        FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
        WHERE a.image_date<".mktime(0, 0, 0, date("m"), date("d"), date("y"))."
AND a.image_active=1
        AND a.cat_id = b.cat_id
        AND b.auth_viewcat=".AUTH_ALL."
        AND b.auth_viewimage=".AUTH_ALL."
        ";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];

mt_srand(mktime(0, 0, 0, date("m"), date("d"), date("y")));
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;

$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
        FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
        WHERE a.image_date<".mktime(0, 0, 0, date("m"), date("d"), date("y"))."
AND a.image_active=1
        AND a.cat_id = b.cat_id
        AND b.auth_viewcat=".AUTH_ALL."
        AND b.auth_viewimage=".AUTH_ALL."
        LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo "<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><center><a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments</center></td></tr></table>\n";

  $potd_image = $site_db->query_firstrow($sql);
$site_db->free_result();
$template = 'potd_image';
show_image($potd_image, "", 1);
$potd_image = $site_template->parse_template($template);
}

//-----------------------------------------------------


Now it is shown in the template, but i dont know yet, how to use it with the {potd_image}


---EDIT---

ok I tried to add the following code and it works almost:

Code: [Select]
$potd_image = $site_db->query_firstrow($sql);
$site_db->free_result();
$template = 'potd_image';
show_image($potd_image, "", 1);
$potd_image = $site_template->parse_template($template);
return $potd_image;

any idea?

60
habt ihr es hinbekommen? ich habe da noch eine lösung gefunden

Pages: 1 2 3 [4] 5 6 7