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

Pages: [1] 2
1
Mods & Plugins (Requests & Discussions) / New Pics in Category
« on: January 23, 2003, 05:44:47 PM »
gti-the-sexy

glad that my pm was some help for you ;-)

christian

2
Mods & Plugins (Requests & Discussions) / New Pics in Category
« on: January 23, 2003, 12:50:47 PM »
SLL

this looks really great! Was ist hard to make?

Btw: Didn't know that Russia has so many beautyful women ;-)

Just too bad that i cant read kyrillic and don't understand russian. What do you use your image gallery for?
 
Greetings
Christian

P.S.: The link to my web site is http://www.tt-owners.de. A Page about a car from Aud called "Audi TT"

3
Mods & Plugins (Requests & Discussions) / New Pics in Category
« on: January 23, 2003, 11:02:09 AM »
Hi SLL it finally works!!!

aaaaand: I get the username as well  :!:

There is a tiny little difference between the table "users" in 4images and the table "users" in phpBB:

In 4images the filed is called "user_name" but in phpBB the filed is called "username"

So when i changed as you wrote above the code

Code: [Select]
define('PIC_USERS_TABLE', '4images_users');

to the phpbb table

Code: [Select]
define('PIC_USERS_TABLE', 'phpbb_users');

I got the correct error:

Unknown column 'u.user_name' in 'field list'

Of course there is now no field "user_name" in phpBB. But if I change the $sql statement from "u.user_name" to "u.username" it works correct.

So here is the complete code for people who have included 4images and phpbb:

It is up to you SLL to move this code to the final section of the forum because ist is your great work!!! I will send you the link to my news page as soon as I have included it. Hopefully this evening ;-)

Greetings and 1000 Thank you to Russia ;-)

Code: [Select]
<?php 
define
&#40;'ROOT_PATH', './4images/'&#41;; 
define&#40;'PIC_CATEGORIES_TABLE', '4images_categories'&#41;; 
define&#40;'PIC_IMAGES_TABLE', '4images_images'&#41;; 
define&#40;'PIC_USERS_TABLE', 'phpbb_users'&#41;; 
include&#40;ROOT_PATH.'global.php'&#41;; 
require&#40;ROOT_PATH.'includes/sessions.php'&#41;; 
$user_access get_permission&#40;&#41;; 

$number_of_new_pics 5
$days_to_be_new 30

$new_cutoff time&#40;&#41; - 60 * 60 * 24 * $days_to_be_new; 
$cat_id_sql get_auth_cat_sql&#40;"auth_viewcat", "NOTIN"&#41;; 

   
$sql "SELECT MAX&#40;cat_id&#41; as max_id FROM ".PIC_CATEGORIES_TABLE
   
$row $site_db->query_firstrow&#40;$sql&#41;; 
   
$cat_max_id = &#40;!empty&#40;$row['max_id'&#93;&#41;&#41; ? $row['max_id'&#93; &#58; 0; 

$total_images_found 0
for &
#40;$i = 0; $i <= $cat_max_id; $i++&#41;&#123; 

  
$sql "SELECT i.image_id, i.cat_id, i.image_active, i.image_name, i.image_date, c.cat_name 
          FROM "
.PIC_IMAGES_TABLE." i,  ".PIC_CATEGORIES_TABLE." c 
          WHERE i.image_active = 1 AND i.image_date >= 
$new_cutoff AND c.cat_id = i.cat_id AND i.cat_id = $i"
   
$result $site_db->query&#40;$sql&#41;; 
   
$row $site_db->fetch_array&#40;$result&#41;; 
   
$images_in_category $site_db->get_numrows&#40;$result&#41;; 
   
$total_images_found $total_images_found $images_in_category

   
$category_name = &#40;$row['cat_name'&#93;&#41;; 
   
$category_id = &#40;$row['cat_id'&#93;&#41;; 
   
$category_link = &#40;"<a href=\"" . ROOT_PATH . "categories.php?cat_id=" . $category_id . "\">"&#41;; 

if &#40;$images_in_category&#41; &#123; 
   
echo "Found <b>$images_in_category</b> new images in category <b>$category_name</b>&nbsp;&nbsp;&nbsp;$category_link ...view category </a><br>";&#125; 

  
$sql "SELECT i.image_id, i.cat_id, i.image_active, i.image_name, i.image_date, c.cat_name, u.username 
          FROM "
.PIC_IMAGES_TABLE." i,  ".PIC_CATEGORIES_TABLE." c 
          LEFT JOIN "
.PIC_USERS_TABLE." u ON u.user_id = i.user_id 
          WHERE i.image_active = 1 AND i.image_date >= 
$new_cutoff AND c.cat_id = i.cat_id AND i.cat_id = $i 
          ORDER BY i.image_date DESC 
          LIMIT 
$number_of_new_pics"

   
$result $site_db->query&#40;$sql&#41;; 
  
while &#40;$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123; 
   
$image_name = &#40;$row['image_name'&#93;&#41;; 
   
$image_id = &#40;$row['image_id'&#93;&#41;; 
   
$image_date format_date&#40;$config['date_format'&#93;." ".$config['time_format'&#93;,$row['image_date'&#93;&#41;; 
   
$category_name = &#40;$row['cat_name'&#93;&#41;; 
   
$user_name = &#40;$row['user_name'&#93;&#41;; 
   
$media_path = &#40;$row['image_media_file'&#93;&#41;; 
   
$image_link = &#40;"<a href=\"" . ROOT_PATH . "details.php?image_id=" . $image_id . "\">"&#41;; 

   
echo "<ul><b>$image_name</b> uploaded by <b>$user_name</b> at <b>$image_date</b>&nbsp;&nbsp;&nbsp;$image_link ...view image </a></ul>"
  &
#125; 
&#125; 
if &#40;!$total_images_found&#41; &#123; 
   
$gallery_link = &#40;"<a href=\"" . ROOT_PATH . "index.php" . "\">"&#41;; 
   
echo "No new images found within last $days_to_be_new days. Click $gallery_link here</a> to surf the gallery...<br>"
   &
#125; else &#123; 
  
$allnew_link = &#40;"<a href=\"" . ROOT_PATH . "search.php?search_new_images=1" . "\">"&#41;; 
   
echo "$allnew_link Would you like to see all new images? </a>"
   &
#125; 
?>

4
Mods & Plugins (Requests & Discussions) / New Pics in Category
« on: January 22, 2003, 04:11:16 PM »
Well I am finally getting closer  :wink:

On my test system only the user name is missing yet. Maybe the productive environment will solve my problem

Found 2 new images in category Sternfahrt    ...view category

PIC00025 uploaded by     ...view image
PIC00023 uploaded by     ...view image
Show all new images?


Maybe a little bug:

If $number_of_new_pics is been set to "1" and there has been no picture uploaded I get the following code and I can't click the link like mentioned in a thread before:

Show all new images?

It seems that the variable

Code: [Select]
$allnew_link

will be ignored because the html code shows only

Show all new images? </a>

with the missing http:.... string.

Can you include a "if...else question"

If there are new pics in the last x day show me:

Found 2 new images in category Sternfahrt    ...view category
PIC00025 uploaded by     ...view image
PIC00023 uploaded by     ...view image
Show all new images?


If there are no pics in the last days show me

There are no New pics. Klick here to surf the image gallery.

This should make the circle round if there were no new pics. I tried to add an "else" somewhere in your code but I couldn't figure out where to put it.


Below is the code with the included "define" lines and the added "PIC_" for people like me using phpBB and 4images together. I hope that the user name problem can be fixed.

Once again a big thank you to SSL  :!:  :!:  :!:
Christian

Code: [Select]
<?php 

define
&#40;'ROOT_PATH', './4images/'&#41;;
define&#40;'PIC_CATEGORIES_TABLE', '4images_categories'&#41;; 
define&#40;'PIC_IMAGES_TABLE', '4images_images'&#41;; 
define&#40;'PIC_USERS_TABLE', '4images_users'&#41;; 
include&#40;ROOT_PATH.'global.php'&#41;; 
require&#40;ROOT_PATH.'includes/sessions.php'&#41;; 
$user_access get_permission&#40;&#41;; 

$number_of_new_pics 1
$days_to_be_new 100

$new_cutoff time&#40;&#41; - 60 * 60 * 24 * $days_to_be_new; 
$cat_id_sql get_auth_cat_sql&#40;"auth_viewcat", "NOTIN"&#41;; 

   
$sql "SELECT MAX&#40;cat_id&#41; as max_id FROM ".PIC_CATEGORIES_TABLE
   
$row $site_db->query_firstrow&#40;$sql&#41;; 
   
$cat_max_id = &#40;!empty&#40;$row['max_id'&#93;&#41;&#41; ? $row['max_id'&#93; &#58; 0; 

for &#40;$i = 0; $i <= $cat_max_id; $i++&#41;&#123; 

  
$sql "SELECT i.image_id, i.cat_id, i.image_active, i.image_name, i.image_date, c.cat_name 
          FROM "
.PIC_IMAGES_TABLE." i,  ".PIC_CATEGORIES_TABLE." c 
          WHERE i.image_active = 1 AND i.image_date >= 
$new_cutoff AND c.cat_id = i.cat_id AND i.cat_id = $i"
   
$result $site_db->query&#40;$sql&#41;; 
   
$row $site_db->fetch_array&#40;$result&#41;; 
    
$images_in_category $site_db->get_numrows&#40;$result&#41;; 

   
$category_name = &#40;$row['cat_name'&#93;&#41;; 
   
$category_id = &#40;$row['cat_id'&#93;&#41;; 
    
$category_link = &#40;"<a href=\"" . ROOT_PATH . "categories.php?cat_id=" . $category_id . "\">"&#41;; 

if &#40;$images_in_category&#41; &#123; echo "Found <b>$images_in_category</b> new images in category <b>$category_name</b>&nbsp;&nbsp;&nbsp;$category_link ...view category </a><br>"; &#125; 

  
$sql "SELECT i.image_id, i.cat_id, i.image_active, i.image_name, i.image_date, c.cat_name, u.user_name 
          FROM "
.PIC_IMAGES_TABLE." i,  ".PIC_CATEGORIES_TABLE." c 
          LEFT JOIN "
.PIC_USERS_TABLE." u ON u.user_id = i.user_id 
          WHERE i.image_active = 1 AND i.image_date >= 
$new_cutoff AND c.cat_id = i.cat_id AND i.cat_id = $i 
          ORDER BY i.image_date DESC 
          LIMIT 
$number_of_new_pics"

   
$result $site_db->query&#40;$sql&#41;; 
  
while &#40;$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123; 
   
$image_name = &#40;$row['image_name'&#93;&#41;; 
   
$image_id = &#40;$row['image_id'&#93;&#41;; 
   
$category_name = &#40;$row['cat_name'&#93;&#41;; 
   
$user_name = &#40;$row['user_name'&#93;&#41;; 
   
$media_path = &#40;$row['image_media_file'&#93;&#41;; 
   
$image_link = &#40;"<a href=\"" . ROOT_PATH . "details.php?image_id=" . $image_id . "\">"&#41;; 
   
$allnew_link = &#40;"<a href=\"" . ROOT_PATH . "search.php?search_new_images=1" . "\">"&#41;; 

   
echo "<ul><b>$image_name</b> uploaded by <b>$user_name</b>&nbsp;&nbsp;&nbsp;$image_link ...view image </a></ul>"
  &
#125; 
&#125; 
   
echo "$allnew_link Show all new images? </a>"
?>

5
Mods & Plugins (Requests & Discussions) / New Pics in Category
« on: January 22, 2003, 02:09:05 PM »
I guess it is because I use 4images together with phpBB forum.

The table "phpbb_users" is in the same database as all other tables of 4images

Christian

6
Mods & Plugins (Requests & Discussions) / New Pics in Category
« on: January 22, 2003, 02:03:02 PM »
I tried the same scrpt but now I get the following error:

DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.image_active, i.image_name, i.image_date, c.cat_name, u.user_name FROM 4images_images i, 4images_categories c LEFT JOIN phpbb_users u ON u.user_id = i.user_id WHERE i.image_active = 1 AND i.image_date >= 1043153567 AND c.cat_id = i.cat_id AND i.cat_id = 0 ORDER BY i.image_date DESC LIMIT 15
Unknown column 'u.user_name' in 'field list'

DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.image_active, i.image_name, i.image_date, c.cat_name, u.user_name FROM 4images_images i, 4images_categories c LEFT JOIN phpbb_users u ON u.user_id = i.user_id WHERE i.image_active = 1 AND i.image_date >= 1043153567 AND c.cat_id = i.cat_id AND i.cat_id = 1 ORDER BY i.image_date DESC LIMIT 15
Unknown column 'u.user_name' in 'field list'

DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.image_active, i.image_name, i.image_date, c.cat_name, u.user_name FROM 4images_images i, 4images_categories c LEFT JOIN phpbb_users u ON u.user_id = i.user_id WHERE i.image_active = 1 AND i.image_date >= 1043153567 AND c.cat_id = i.cat_id AND i.cat_id = 2 ORDER BY i.image_date DESC LIMIT 15
Unknown column 'u.user_name' in 'field list'
Show all new images?

So what is wrong now?  :roll:

Thank you again for your help

7
Mods & Plugins (Requests & Discussions) / New Pics in Category
« on: January 22, 2003, 01:42:48 PM »
Back to your last code ;-)

Hello again

I tried to adjust the file to my table names. My tables are called "4images_categories" and "4images_images". So I changed the code for the table names. But now I get a parse error in line 14. Why? This code is in line 14:

Code: [Select]
  $sql = "SELECT MAX(cat_id) as max_id FROM ".4images_categories;

What I didn't understand ist what the "." in front of the table name means. In the other code you write the table name in quotas (") and have a dot at the beginning and the end of the table name. Is there something wrong? Because for me it didn't work. Maybe a navive question of an amateur ;-)

Below you'll find the complete code with the replaced table names. Is ther anything else to change?

Greetings Christian

Code: [Select]
<?php 

define
&#40;'ROOT_PATH', './4images/'&#41;; 
include&#40;ROOT_PATH.'global.php'&#41;; 
require&#40;ROOT_PATH.'includes/sessions.php'&#41;; 
$user_access get_permission&#40;&#41;; 

$number_of_new_pics 15
$days_to_be_new 1

$new_cutoff time&#40;&#41; - 60 * 60 * 24 * $days_to_be_new; 
$cat_id_sql get_auth_cat_sql&#40;"auth_viewcat", "NOTIN"&#41;; 

   
$sql "SELECT MAX&#40;cat_id&#41; as max_id FROM ".4images_categories
   
$row $site_db->query_firstrow&#40;$sql&#41;; 
   
$cat_max_id = &#40;!empty&#40;$row['max_id'&#93;&#41;&#41; ? $row['max_id'&#93; &#58; 0; 

for &#40;$i = 0; $i <= $cat_max_id; $i++&#41;&#123; 

  
$sql "SELECT i.image_id, i.cat_id, i.image_active, i.image_name, i.image_date, c.cat_name 
          FROM "
.4images_images." i,  ".4images_categories." c 
          WHERE i.image_active = 1 AND i.image_date >= 
$new_cutoff AND c.cat_id = i.cat_id AND i.cat_id = $i"
   
$result $site_db->query&#40;$sql&#41;; 
   
$row $site_db->fetch_array&#40;$result&#41;; 
    
$images_in_category $site_db->get_numrows&#40;$result&#41;; 

   
$category_name = &#40;$row['cat_name'&#93;&#41;; 
   
$category_id = &#40;$row['cat_id'&#93;&#41;; 
    
$category_link = &#40;"<a href=\"" . ROOT_PATH . "categories.php?cat_id=" . $category_id . "\">"&#41;; 

if &#40;$images_in_category&#41; &#123; echo "Found <b>$images_in_category</b> new images in category <b>$category_name</b>&nbsp;&nbsp;&nbsp;$category_link ...view category </a><br>"; &#125; 

  
$sql "SELECT i.image_id, i.cat_id, i.image_active, i.image_name, i.image_date, c.cat_name, u.user_name 
          FROM "
.4images_images." i,  ".4images_categories." c 
          LEFT JOIN "
.4images_users." u ON u.user_id = i.user_id 
          WHERE i.image_active = 1 AND i.image_date >= 
$new_cutoff AND c.cat_id = i.cat_id AND i.cat_id = $i 
          ORDER BY i.image_date DESC 
          LIMIT 
$number_of_new_pics"

   
$result $site_db->query&#40;$sql&#41;; 
  
while &#40;$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123; 
   
$image_name = &#40;$row['image_name'&#93;&#41;; 
   
$image_id = &#40;$row['image_id'&#93;&#41;; 
   
$category_name = &#40;$row['cat_name'&#93;&#41;; 
   
$user_name = &#40;$row['user_name'&#93;&#41;; 
   
$media_path = &#40;$row['image_media_file'&#93;&#41;; 
   
$image_link = &#40;"<a href=\"" . ROOT_PATH . "details.php?image_id=" . $image_id . "\">"&#41;; 
   
$allnew_link = &#40;"<a href=\"" . ROOT_PATH . "search.php?search_new_images=1" . "\">"&#41;; 

   
echo "<ul><b>$image_name</b> uploaded by <b>$user_name</b>&nbsp;&nbsp;&nbsp;$image_link ...view image </a></ul>"
  &
#125; 
&#125; 
   
echo "$allnew_link Show all new images? </a>"
?>

8
Mods & Plugins (Requests & Discussions) / New Pics in Category
« on: January 20, 2003, 12:09:02 PM »
Hello

I forgot one little thing. I hope you can help me:

Is there a way to modify the code that the follwing result will appear:

- New image(s) in category A on 01/18/2003
- New image(s) in category B on 01/16/2003

1) I would like to set a time span for the result like:

Code: [Select]
"Show me those categories where new images have been added the recent 7 days"

Not every image should be listed by name. The category is all I need :-).  Otherwise the list will grow too much and be too long for the news page. I would like to display only the category name as in my sample above.

2) If I click on the cateqory I should jump to the category in the image gallery.

May I ask you for another 5 min to write me the code please. Many thanks in advance!!!

Christian

9
Mods & Plugins (Requests & Discussions) / New Pics in Category
« on: January 20, 2003, 11:49:31 AM »
Wow  :!:

I didn't expect to have a ready file  8O

Thank you for this fast reply. The result really looks like what I expected. I will try it this evening. Many thanks!!!  :P

I will let you know if this is what I was looking for and post my news page as soon as it is included.

Christian

10
Mods & Plugins (Requests & Discussions) / New Pics in Category
« on: January 17, 2003, 03:22:18 PM »
Hello

I would like to include a php file in my main page with the following content:

Quote
NEWEST PICS in the IMAGE GALLERY!!!

You can find new Pics in Catagory:

- .... (insert name here) (date)
- .... (insert name here) (date)
- ....


No pic should pop up here. Only the category name and the date of the last update should appear.

The category name should be clickable and lead to the category in the image gallery

It would be fine to adjust the time. Lets say I would like to know smething like "list those categories where there has been an upload in the last 3 days" or so.

As I am not very firm with php and sql could you please send me an example or create a mod for that.

I think this might be very useful especially for news pages. See my newspage on http://www.tt-owners.de/php/news/news.php . I display the last threads from phpBB forum on the left side at "Diskussionstreff" and I would like to add the last categories of the image gallery below or on the right side.

WHY?
Especially in news pages you are forced to provide all kind of information just in compressed summarised form to make some appetite for more browsing.

Praying for some helpful people wo initialise a tiny little mod for me and all others. I guess that shouldn't bee to hard. Maybe the random pic mod can be adjusted to my description?

Greetings
Christian

11
Hallo

kann man ähnlich wie mit dem Random Mod eine php Datei mit den Thumps der letzten - sagen wir 4 uploads per include befehl in einer andere Seite einbinden? Kann man die Random Mod irgendwie modifizieren so daß ich diese verwenden kann? Ich kann leider zu wenig php.

i want to include the 4 newest pictures with an include php file. is it possible to modify the random pic mod so that i might use it? does anyone already have a solution? my php knowledge is really bad.

Danke für euere Hilfe!

Grüße
Christian

12
Discussion & Troubleshooting / getimagesize: Read error
« on: December 02, 2002, 09:55:29 AM »
Hallo Jan

Danke für die Antwort! Schade.

Wie kann ich sonst korrupte Bilder finden die Gäste upgeloadet haben. Hast Du noch einen Tip?

Eine schöne Woche noch!

Gruß
Christian

13
Discussion & Troubleshooting / getimagesize: Read error
« on: November 30, 2002, 07:16:38 PM »
Hallo Jan

Danke Dir für die Antwort. Ich war schon verwirrt. Es waren in der Tat Bilder dabei die nicht komplett upgeloadet waren.

kann man so etwas irgendwie überprüfen. ich meine es ist ja dumm wenn ich den Upload freigebe und 4images hängt dann wegen irgendeinem korrupten Bild. Hast Du da einen Tip wie man korrupte bilder finden kann oder gibt es in 4images einen Debug Modus der das korrupte Bild "annsagt"?

Grüße
Christian

14
Discussion & Troubleshooting / getimagesize: Read error
« on: November 29, 2002, 07:58:49 PM »
Hallo

Wenn ich images mit netpbm verkleinern will bekomme ich folgende meldung:

Code: [Select]
Warning: getimagesize: Read error! in /home/httpd/docs/ttomuc/4images/admin/thumbnailer.php on line 115

Anbei line 115:

Code: [Select]
$image_info = getimagesize(MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file']);

Wo liegt da der Wurm drin?

Viele Grüße
Christian

15
Installation, Update & Configuration / eCard und eigenes Fenster
« on: November 19, 2002, 12:40:25 PM »
Hallo Jan

ich sage nur s.o. :

Quote
Ich komme mit der Formatierung nicht klar.


Das hat mit Javascript leider nichts zu tun sondern damit daß ich um Hilfe gebeten habe.

Christian

Pages: [1] 2