Author Topic: Bestimmte image_id auslesen, certainly image_id selection  (Read 13309 times)

0 Members and 1 Guest are viewing this topic.

Offline Daniel

  • Full Member
  • ***
  • Posts: 183
  • php rockt
    • View Profile
Bestimmte image_id auslesen, certainly image_id selection
« on: November 23, 2007, 03:44:32 PM »
Hallo liebes Forum, dear all,

kann man per Abfrage eine bestimmt image_id auslesen und dann ( inkl. der dazu gehörigen Daten wie thumb, name, description..) ausgeben lassen?
is it possible to select by query one certainly image_id and give out all data from this image_id?

viele Grüße und Danke
best wishes and thanks

Daniel
4images in Benutzung/use seit/since 2002 / Version 1.7.6

Offline honda2000

  • 4images Guru
  • *******
  • Posts: 3.263
    • View Profile
    • Wir machen Internet!
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #1 on: November 23, 2007, 04:04:49 PM »
worauf willst du hinaus???

wenn du ein Bild anzeigen lässt, wird doch die ID angezeigt:

z.B.

http://www.welsh-terrier-online.de/galerie/

klickst du auf das erste Bild: http://www.welsh-terrier-online.de/galerie/details.php?image_id=205  kommt die Image-ID (in dem fall 205)

Offline Daniel

  • Full Member
  • ***
  • Posts: 183
  • php rockt
    • View Profile
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #2 on: November 23, 2007, 04:12:57 PM »
Hallo,

ich möchte eine fixe (feste) Gallerieseite erstellen wo ich lediglich die image_id einsetze und dann das thumb, die descrption etc. für die entsprechende image_id ausgegeben werden.
4images in Benutzung/use seit/since 2002 / Version 1.7.6

Offline honda2000

  • 4images Guru
  • *******
  • Posts: 3.263
    • View Profile
    • Wir machen Internet!

Offline Daniel

  • Full Member
  • ***
  • Posts: 183
  • php rockt
    • View Profile
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #4 on: November 23, 2007, 04:47:47 PM »
nein leider nicht, das ist der sitmap-mod
der gibt mir nur die cat's aus, nicht die image_id's
4images in Benutzung/use seit/since 2002 / Version 1.7.6

Offline honda2000

  • 4images Guru
  • *******
  • Posts: 3.263
    • View Profile
    • Wir machen Internet!
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #5 on: November 23, 2007, 05:08:06 PM »
dann wirst du wohl, das ganze per hand machen müssen, oder den Sitemap-Mod um die ID erweitern müssen

(sonst wüsst ich auch nix auf die Schnelle)

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #6 on: November 23, 2007, 10:09:09 PM »
hi Daniel,

wo willst du dies anzeigen lassen? in 4images gallery selbst oder auf einer externen seite?

lg
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline Daniel

  • Full Member
  • ***
  • Posts: 183
  • php rockt
    • View Profile
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #7 on: November 24, 2007, 07:23:46 AM »
hi Nicky,

extern wäre etwas besser.

Gruß
Daniel
4images in Benutzung/use seit/since 2002 / Version 1.7.6

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #8 on: November 24, 2007, 01:08:53 PM »
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: image_id.php                                         *
 *        Copyright: (C) 2007 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.0 for 4images 1.7.4                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    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.                                                        *
 *                                                                        *
 *************************************************************************/

// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH''./');

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

$site_db = new Db($db_host$db_user$db_password$db_name);
$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_description 
        FROM ("
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b)
        WHERE a.image_active=1 
        AND a.cat_id = b.cat_id 
        AND b.auth_viewcat="
.AUTH_ALL.
        AND b.auth_viewimage="
.AUTH_ALL."
        AND a.image_id = 28"
;
$row $site_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name format_text(trim($row['image_name']), 2);
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
$image_description = (!empty($row['image_description'])) ? format_text($row['image_description'], 101) : REPLACE_EMPTY;
echo 
"<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"<b>$image_description</b>\n";
?>


speichern als z.b.: image_id.php

einfügen in deiner externen seite mit

Code: [Select]
<?php
 
include("./image_id.php");
?>


Code: [Select]
        AND a.image_id = 28";
auf deine ID ändern

ROOT_PATH einstellen...

LG
« Last Edit: November 24, 2007, 07:56:57 PM by Nicky »
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline honda2000

  • 4images Guru
  • *******
  • Posts: 3.263
    • View Profile
    • Wir machen Internet!
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #9 on: November 24, 2007, 02:34:03 PM »
aber zeigt das jetzt nicht nur alle Daten für das Image mit der ID 28 an???

dann müsste man ja für 500 Bilder, 500x diese Datei erstellen, oder???

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #10 on: November 24, 2007, 03:11:53 PM »
@Nicky:

Code: [Select]
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

for:

Code: [Select]
$thumb_src = (is_remote($row['image_thumb_file'])) ? get_file_name(basename($row['image_thumb_file'])) : ROOT_PATH.THUMB_DIR."/".$cat_id."/".get_file_name(basename($row['image_thumb_file']));
« Last Edit: February 18, 2011, 02:39:03 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #11 on: November 24, 2007, 03:34:34 PM »
aber zeigt das jetzt nicht nur alle Daten für das Image mit der ID 28 an???

dann müsste man ja für 500 Bilder, 500x diese Datei erstellen, oder???

hi honda,

er will doch ein einziges bestimmtes thumbnail auf der extra seite zeigen.
so hab ich das verstanden

@thundstrike,
thx
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline Daniel

  • Full Member
  • ***
  • Posts: 183
  • php rockt
    • View Profile
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #12 on: November 24, 2007, 06:18:03 PM »
Danke Nicky, super Sache,
bis auf die description hab ich ein 1a Ausgabe.  :D

Honda hat natürlich recht,
man müßte die image_id noch fexibel machen und als Parameter über die url einsteuern.

Ich habs grad mal probiert,
AND a.image_id=$T";
und dann in der url www.meinschmuddelseite.de/image_id?T=10160

Geht.  :D

Frag mich grad aber noch warum die description des Bildes nicht angezeigt wird ...

« Last Edit: November 24, 2007, 06:44:41 PM by Daniel »
4images in Benutzung/use seit/since 2002 / Version 1.7.6

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #13 on: November 24, 2007, 08:13:09 PM »
okay description geändert von
Code: [Select]
$description = (!empty($row['image_description'])) ? format_text($row['image_description'], 1, 0, 1) : REPLACE_EMPTY;
auf
Code: [Select]
$image_description = (!empty($row['image_description'])) ? format_text($row['image_description'], 1, 0, 1) : REPLACE_EMPTY;

hab genau ein bild bei mir ausgewählt der keine beschreibung hat, deshalb keine anzeige (obere code geändert)  :mrgreen:..

okay Daniel,
diese url existiert nicht  :P

jetzt verstehe ich nicht genau was du machen willst....

wenn du es per URL aufrufen willst dann ist der code
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: image_id.php                                         *
 *        Copyright: (C) 2007 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.0 for 4images 1.7.4                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    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.                                                        *
 *                                                                        *
 *************************************************************************/

// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH''./');
error_reporting(E_ALL);

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

if (isset(
$HTTP_GET_VARS[URL_IMAGE_ID]) || isset($HTTP_POST_VARS[URL_IMAGE_ID])) {
  
$image_id = (isset($HTTP_POST_VARS[URL_IMAGE_ID])) ? intval($HTTP_POST_VARS[URL_IMAGE_ID]) : intval($HTTP_GET_VARS[URL_IMAGE_ID]);
}
else {
  
$image_id 0;
}

$site_db = new Db($db_host$db_user$db_password$db_name);
$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_description 
        FROM ("
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b)
        WHERE a.image_active=1 
        AND a.cat_id = b.cat_id 
        AND b.auth_viewcat="
.AUTH_ALL.
        AND b.auth_viewimage="
.AUTH_ALL."
        AND a.image_id = 
$image_id";
$row $site_db->query_firstrow($sql);
$cat_id $row['cat_id'];
$image_name format_text(trim($row['image_name']), 2);
$thumb_src = (is_remote($row['image_thumb_file'])) ? get_basefile(stripslashes(trim($row['image_thumb_file']))) : ROOT_PATH.THUMB_DIR."/".$cat_id."/".get_basefile(stripslashes(trim($row['image_thumb_file'])));
$image_description = (!empty($row['image_description'])) ? format_text($row['image_description'], 101) : REPLACE_EMPTY;
echo 
"<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"<b>$image_description</b>\n";
?>


http://www.deineseite.de/image_id.php?image_id=55

auf jeden fall ist Nicky confused
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.873
    • View Profile
Re: Bestimmte image_id auslesen, certainly image_id selection
« Reply #14 on: November 24, 2007, 08:22:01 PM »
Hallo Ihr,

im Grunde habe ich es schon verstanden das Daniel lediglich eine ID Auslesen will.

Bloß was ich nicht verstehen kann ist, was macht das Eigendlich für einen Sinn  :?

nobby