• [Mod] Random image / Zufallsbild 5 0 5 1
Currently:  

Author Topic: [Mod] Random image / Zufallsbild  (Read 893397 times)

0 Members and 1 Guest are viewing this topic.

Offline Harry

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • http://7summits.com
Re: [Mod] Random image / Zufallsbild
« Reply #30 on: August 02, 2002, 04:32:16 PM »
oh, one more tiny question, how do I define the category name to be used in the caption or alt tag?

Thanks for your help, can't wait to send you guys my first ecard :-)

Harry
Trips & Expeditions to the 7 summits: the highest mountains on the seven continents. Kilimanjaro, Aconcagua and more!
Check out http://7summits.com

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #31 on: August 02, 2002, 04:54:15 PM »
change line
Code: [Select]

$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments

to
Code: [Select]

$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, b.cat_name

add after
Code: [Select]

  $cat_id = $row['cat_id'];

this
Code: [Select]

  $cat_name = $row['cat_name'];

now you can use  $cat_name in echo..
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 Harry

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • http://7summits.com
Re: [Mod] Random image / Zufallsbild
« Reply #32 on: August 12, 2002, 11:50:35 AM »
Hi Nicky, thanks for all the support, one more question which was not answered before:

How can I choose from more than one category?
I would like to randomize from a category and it's subcategories, so for example cat id = 4 & 9 & 15.

Can this be done?

Thanks,
best regards,
Harry
Trips & Expeditions to the 7 summits: the highest mountains on the seven continents. Kilimanjaro, Aconcagua and more!
Check out http://7summits.com

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Re: [Mod] Random image / Zufallsbild
« Reply #33 on: August 12, 2002, 12:33:46 PM »
Put this in the two queries:
Code: [Select]
AND a.cat_id IN (4, 9, 15)
Greets Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Harry

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • http://7summits.com
Re: [Mod] Random image / Zufallsbild
« Reply #34 on: August 12, 2002, 12:56:27 PM »
Quote from: Jan
Put this in the two queries:
Code: [Select]
AND a.cat_id IN (4, 9, 15)
Greets Jan


Thx  :)
Trips & Expeditions to the 7 summits: the highest mountains on the seven continents. Kilimanjaro, Aconcagua and more!
Check out http://7summits.com

Offline Big_Fish

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #35 on: August 26, 2002, 02:52:21 PM »
Ich krieg immer nur "Security violation"  :?:

Offline Big_Fish

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #36 on: August 26, 2002, 03:07:54 PM »
Ähm also das Standard Script geht immer noch nicht aber wenn man das ganze als Bild (image hader bla) ausgibt, gehts?  :?:  :?:  :?:

Offline X-Fan

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.comixfan.com/xfan/
Re: [Mod] Random image / Zufallsbild
« Reply #37 on: August 27, 2002, 05:22:26 AM »
Okay, I'm lost. :(

What directory does random.php go in?

And what code do you need to put to have this come up on, say, my vBulletin forums main page?  And where do I put the code?
Eric J. Moreels
ComiX-Fan Editor-in-Chief
e-mail: webmaster@comixfan.cjb.net
Web: http://www.comixfan.com/xfan
AIM: XFan2k

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #38 on: August 27, 2002, 06:50:32 PM »
Quote from: Big_Fish
Ähm also das Standard Script geht immer noch nicht aber wenn man das ganze als Bild (image hader bla) ausgibt, gehts?  :?:  :?:  :?:


so gemacht wie ich es geschrieben habe ?
oder doch am code herumgefummelt ? ;)
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 Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #39 on: August 27, 2002, 06:56:59 PM »
Quote from: X-Fan
Okay, I'm lost. :(

What directory does random.php go in?

And what code do you need to put to have this come up on, say, my vBulletin forums main page?  And where do I put the code?


in category where you want..
but i suggest to use SCRIPT_URL..

on your VB, i would try to put it anywhere into "forumhome" template..
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 Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #40 on: August 27, 2002, 07:05:56 PM »
into template it's not working
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 Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #41 on: August 27, 2002, 07:19:17 PM »
well, i found something else..

instead off echo output in random.php
you can use this
Code: [Select]

print("
document.write('<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a>');
");


and this in your forumhome template
Code: [Select]

<SCRIPT language='JavaScript'  src='http://YOUR_DOMAIN/random.php'></SCRIPT>
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

Warhead

  • Guest
Re: [Mod] Random image / Zufallsbild
« Reply #42 on: August 29, 2002, 10:14:13 AM »
@BIgFish
Das Problem hatte ich auch, aber wenn du den Pfad zum random.php änderst, dann müsste es gehen!!!

Code: [Select]
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', '../images/');


da random.php bei mir in "phpbb2"-ordner liegt, und ich daher ein verzeichnis zurücksetzen musste, habe ich es einfach geändert!

Offline Joe.Emre

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #43 on: August 29, 2002, 04:18:33 PM »
Hallo Jan!:)
ich würde gerne seperat ein random script in meine seite einbinden.Es kommt aber immer eine fehlermeldung!wenn ich den code
einbinde!oder muss ich einen html code kopieren?da´wo bilder steht sollte das random script rein!
Code: [Select]
<?php 
include&#40;"./random.php"&#41;; 
?>

http://www.joeemre.de/apportal/
das ist das random script,aber wie bekomme ich es auf meine seite?!
http://www.joeemre.de/random.php
habe schon ne menge gelesen hier, aber ich raff es nicht!


MfG
Joe.Emre

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #44 on: August 29, 2002, 05:27:39 PM »
wozu doppelter posting ¿ ;)

was für eine fehlermeldung erhälst du ?

oder probiert dieses:
http://www.4homepages.de/forum/viewtopic.php?p=4347#4347
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