Author Topic: Random image as index / Zufälliges Bild als startseite  (Read 4068 times)

0 Members and 1 Guest are viewing this topic.

Offline FunnyUser

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Random image as index / Zufälliges Bild als startseite
« on: April 30, 2011, 07:45:11 PM »
Hello,
is it possible to show up a random image if a user clicks on the main page (index.php / home.html) ?

For e.g. the domain is: http://www.abc.com
1. A user types the domain in his browser.
2. There is no classic index with "news_images" and "categories". He will be shown a random image.

Thanks for helping!

-------------------------

Hallo,
ist es möglich, dass ein zufälliges Bild angzeigt wird, wenn jemand auf die index-seite der galerie geht (index.php / home.html)?

Beispiel: die Domain lautet: http://www.abc.com
1. Ein user geht auf die domain
2. es wird ihm nicht die klassische startseite mit neuen bildern etc. angezeigt, sondern es erscheint sofort ein zufälliges bild der gallerie

Danke für Eure hilfe!

Rembrandt

  • Guest
Re: Random image as index / Zufälliges Bild als startseite
« Reply #1 on: April 30, 2011, 08:28:02 PM »
Hi!

suche in der index.php:
$num_new_images $config['image_cells'];
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").")
        ORDER BY i.image_date DESC
        LIMIT 
$num_new_images";

und ersetze es mit:

$config
['image_cells'] = 1;
$num_new_images $config['image_cells'];
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").")
        ORDER BY RAND()
        LIMIT 
$num_new_images";


den restlichen style mußt du dir in der home.html anpassen.

mfg Andi

Offline FunnyUser

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: Random image as index / Zufälliges Bild als startseite
« Reply #2 on: May 01, 2011, 10:50:48 PM »
Okay, ich habe mich missverständlich ausgedrückt sorry!

Also er soll nicht ein zufälliges Bild auf der Startseite anzeigen, welches der Besucher dann anklicken kann, sonder es soll automatisch anstatt die index.php direkt ein zufälliges bild kommen.
Quasi eine weiterleitung zu einer zufälligen details.php (wobei die url sich auch dementsprechend ändern sollte).

PS: Ich nutze zusätzlich das SEO MOD (http://www.4homepages.de/forum/index.php?topic=17598.0)

Danke für Deine Hilfe!

Offline FunnyUser

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: Random image as index / Zufälliges Bild als startseite
« Reply #3 on: May 03, 2011, 05:11:15 PM »
Ich hatte mir das so gedacht, wie das bei http://www.likevids.me/ gemacht wird. Ich weiß, die nutzen kein 4images aber viell. versteht man so besser was ich meine.
Immer wenn man die Hauptseite neu lädt, kommt etwas anderes.

Danke danke danke!