Author Topic: Auto generate keywords if keywords field left emty by users  (Read 37992 times)

0 Members and 1 Guest are viewing this topic.

Offline navyseal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Auto generate keywords if keywords field left emty by users
« Reply #15 on: April 03, 2008, 05:16:36 PM »
sorry..it justsnt wanst parsing due to server issues...coming back to the issue

when I execute this script all I get is

"Fehler beim Schreiben in Tabelle."
This is after displaying one file ID...output is something like this

Quote
Bild ID: 794
Bildname: 01. Michelle's Theme
Beschreibung:
Keywords: 01. Michelle's Theme
Filename: 01._Michelles_Theme.mp3

Fehler beim Schreiben in Tabelle.

Offline satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
Re: Auto generate keywords if keywords field left emty by users
« Reply #16 on: April 28, 2008, 04:07:00 PM »
Hello :)

I have a error :


Quote
An unexpected error occured. Please try again later.
Fehler beim Schreiben in Tabelle.

Thanks :)

Offline KamelN

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Auto generate keywords if keywords field left emty by users
« Reply #17 on: May 01, 2008, 12:18:45 AM »


thanks for this wonderful mod  :)

 :( :( :( :( :(
error there



Quote
Warning: include(./gallery/config.php) [function.include]: failed to open stream: No such file or directory in /home/*****/public_html/*******/autokeywords.php on line 7

Warning: include() [function.include]: Failed opening './gallery/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/*****/public_html/*****/autokeywords.php on line 7

Warning: include(./gallery/includes/db_mysql.php) [function.include]: failed to open stream: No such file or directory in /home/*****/public_html/*****/autokeywords.php on line 8

Warning: include() [function.include]: Failed opening './gallery/includes/db_mysql.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/*****/public_html/********/autokeywords.php on line 8

Warning: include(./gallery/includes/constants.php) [function.include]: failed to open stream: No such file or directory in /home/******/public_html/*******/autokeywords.php on line 9

Warning: include() [function.include]: Failed opening './gallery/includes/constants.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/**********/public_html/***********/autokeywords.php on line 9

Fatal error: Class 'Db' not found in /home/********/public_html/*******/autokeywords.php on line 11

Offline navyseal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Auto generate keywords if keywords field left emty by users
« Reply #18 on: May 21, 2008, 06:01:26 AM »
well having an apostrophe in the image name will cause an error. This is for my problem though...the script is working fine after removing all apostrophes.

Offline SunnyUK

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Auto generate keywords if keywords field left emty by users
« Reply #19 on: May 30, 2008, 04:55:24 PM »
Thank you for this script. It's very close to what I was looking for, but not exactly. Maybe someone can explain to me how I can make it suit my purposes completely?

1) instead of generating the keywords from all sorts of fields, I would like to generate them from the ITPC keywords (the intention is that if people have already tagged their photos, these tags should become 4images keywords) - and only from the ITPC keywords.

2) instead of having a script that runs on request, I would like it integrated in the upload process so it does its magic each and every time somebody uploads a new image.

Is this possible? Any hints about how to go about it would be greatly appreciated.

(I'm using 4images 1.7.6 and am not a php programmer)

Offline lona_jasty

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Auto generate keywords if keywords field left emty by users
« Reply #20 on: January 08, 2009, 02:29:34 PM »
I am seeing blank page, I am using 4images v1.7.6
I have changed my path but no use

Any help, appreciated

Regards

Offline satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
Re: Auto generate keywords if keywords field left emty by users
« Reply #21 on: December 24, 2009, 12:15:14 AM »
Hello,

I have a problem with this script, where a _ or, in the title or description, the script does not work

Code: [Select]
ID: 7727
Nom de l image : Buzzards' Roost, Fall Creek Falls State Park, Tennessee
Description :
Mots cles: Buzzards' Roost, Fall Creek Falls State Park, Tennessee
Nom du fichier: Buzzards_Roost_Fall_Creek_Falls_State_Park_Tennessee.jpg


An unexpected error occured. Please try again later.
Fehler beim Schreiben in Tabelle.

Can you help-me ?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Auto generate keywords if keywords field left emty by users
« Reply #22 on: December 24, 2009, 02:12:59 AM »
How exactly doesn't work?
just in case you didn't know, 4images uses space to separate keywords and does not support sentences as one keyword.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
Re: Auto generate keywords if keywords field left emty by users
« Reply #23 on: December 24, 2009, 12:09:13 PM »
The error here is this:
http://www.fond-ecran-gratuit.biz/autokeywords.php

In fact, I do not know, is that there is a way for those _ be automatically replaced by spaces?

Offline alsunna

  • Pre-Newbie
  • Posts: 8
    • View Profile
Re: Auto generate keywords if keywords field left emty by users
« Reply #24 on: March 10, 2010, 12:12:48 AM »
So how do I use this script?
I added the file with the updates, but how do I use it?


And I keep getting an error, after I added those changes by thunderstrike..

Parse error: syntax error, unexpected '}' in */*/public_html/gallery/autokeywords.php on line 34

Offline zhono

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: Auto generate keywords if keywords field left emty by users
« Reply #25 on: November 08, 2010, 03:33:10 AM »
I changed the root path, uploaded, and ran it. The first time I ran it, it did some images, from maybe 2 categories. But after that, when I click it to do more, all I get is a blank page.

Offline zhono

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: Auto generate keywords if keywords field left emty by users
« Reply #26 on: November 14, 2010, 01:11:06 AM »
Well, i edited it a bit, and it works. But now I'm trying to pull the category name of each image, and insert that as the keyword, instead of the image name. I got it to the point where it worked, but only for 1 image at a time. I have over 200,000 images, so that just won't work.

Here's what I'm using:

Code: [Select]
<?php



define
('ROOT_PATH''/home/*********/public_html/');

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) OR die("Keine Verbindung zum Datenbankserver.");



$sql "SELECT image_id, cat_id, image_name, image_description, image_keywords, image_media_file 
        FROM "
.IMAGES_TABLE.
        WHERE image_keywords = ''"
;

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

while (
$row $site_db->fetch_array($result)){
  
$image_id $row['image_id'];
  
$cat_id $row['cat_id'];
  
$image_name $row['image_name'];
  
$image_description $row['image_description'];
  
$image_keywords $row['image_keywords'];
  
$image_media_file $row['image_media_file'];

  
  
$sql2 "SELECT cat_id, cat_name 
        FROM "
.CATEGORIES_TABLE.
        WHERE cat_id = 
$cat_id";

$result2 $site_db->query($sql2);

while (
$row $site_db->fetch_array($result2)){
  
$new_keywords $row['cat_name'];
}
  echo 
"Image ID: ".$image_id."<br>\n";
  echo 
"Image Name: ".$image_name."<br>\n";
  echo 
"Description: ".$image_description."<br>\n";
  echo 
"Keywords: ".$new_keywords."<br>\n";
  echo 
"Filename: ".$image_media_file."<br>\n";
  echo 
"<br><hr>\n";
  
$sql "UPDATE ".IMAGES_TABLE." SET image_keywords = '$new_keywords' WHERE image_id = '$image_id'";
  
$result mysql_query($sql) OR die("Fehler beim Schreiben in Tabelle.");
  }
  @
mysql_close($site_db); 

?>

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: Auto generate keywords if keywords field left emty by users
« Reply #27 on: May 26, 2011, 11:03:40 PM »
ist es möglich dies ein wenig an die neue Version anzupassen, am besten im Admin, und auswählbar ob mit oder ohne Beschreibung (mir reicht der Bildname  :wink:)
Und wenn es geht, die alten Keywörter belassen, nur ergänzen.
habe es mal in einer Testversion ausprobiert, läuft kurz an (so ca. 50 Bilder) danach wird es abgebrochen (Fehler beim Schreiben in Tabelle.)

LG
Danke Harald




Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: Auto generate keywords if keywords field left emty by users
« Reply #28 on: June 02, 2011, 07:52:40 PM »
Habe raus gefunden warum das Programm stehen bleibt, und zwar wenn der Bildname ein `drin hat, wird es nicht unter Keywords gespeichert.
z.B. Let`s go

Kann man das in diesem Script ändern? denn unter Bildname wird es ja auch gespeichert.

LG
Danke Harald




Rembrandt

  • Guest
Re: Auto generate keywords if keywords field left emty by users
« Reply #29 on: June 04, 2011, 05:44:49 PM »
Hi!

ist es möglich dies ein wenig an die neue Version anzupassen, am besten im Admin, und auswählbar ob mit oder ohne Beschreibung (mir reicht der Bildname  :wink:)
Und wenn es geht, die alten Keywörter belassen, nur ergänzen......

ich habe eine neue Version gemacht, schau es dir mal an:
http://www.4homepages.de/forum/index.php?topic=29651.msg157630#msg157630

mfg Andi