4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Nicky on July 12, 2002, 10:43:02 AM
-
:flag-de: hi an alle
:flag-en: hi all,
:flag-de: hier ist der Zufallsbild MOD für extra seiten ausserhalb ihrer Gallerie:
:flag-en: here the Random image MOD for extra sites outside your Gallery:
http://www.nicky.net/4images/random.txt
:flag-de: speichere den inhalt als random.php
:flag-en: save the content as random.php
:flag-de: random.php wurde mit folgenden befehl z.b. in die datei random_mod.php inkludiert
:flag-en: random.php was included as example into the random_mod.php site with
<?php
include("./random.php");
?>
:flag-de: viel spass
:flag-en: have fun
p.s.:
:flag-de: vielen dank an JAN der 99% der arbeit geleistet hat ;)
:flag-en: many thanks to JAN who maked 99% of this mod ;)
# addons for external sites
include thumbail and link on an external site with java script.
http://www.4homepages.de/forum/index.php?topic=1020.msg126303#msg126303
include big image and link on an external site with java script.
http://www.4homepages.de/forum/index.php?topic=1020.msg126326#msg126326
-
Hallo Nicky,
Wenn jetzt allerdings jemand so wie ich die Minniatur in einer kleinen Portalbox per i frame anzeigen lässt, und bei einem klick auf das Minniaturbild nicht die ganze Galerie in dieser Box geöffnet haben möchte, der sollte folgenden HTML Code in der random.php ändern.
Suche:
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Ersetze mit:
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_new\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Nun sollte die Galerie auf jeden Fall auf einer eigenen Seite öffnen.
Wer die Galerie im selben Browserfenster wie das Portal anzeigen lassen will, der sollte folgenden Code verwenden:
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_top\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
l.g.
kralle
PS: Ein fettes DANKE an Nicky
-
*g*
gerne, gerne..
ist ja selbstveständlich..
oder target=\"FrameName\" ;)
-
First, thanks to Niky and Jan for this random mod. It's nice and compact and I think I might use it in other parts of my web site.
But ideally, I'd like to use a random image in a different way. For my web site home page, I'd like to display a random image. But instead of displaying the thumbnail and using the random image html template file, I'd like to only display the full image as shown in details.php and I'd like that image to be a link to the details.php page for it.
How would I do this???
-
hi chris,
you mean like that
-
Yeah, that's it !
Can you post the code for me?
-
here we go:
http://www.nicky.net/4images/random_full.txt
have fun
-
Hallo Nicky,
finde diese Funktion Random Image auf anderen seite prima!
Habe die random.php bei mir installiert und funktioniert auch prima, wenn ich diese Datei direkt aufrufe.
Aber sobald ich die random.php in eine bestehende Seite per:
<?php
include("./random.php");
?>
einbinden will, nimmt er immer die relative Adresse vom Thumbnails, von der PHP seite wo ich die random.php include.
Siehe z. B. hier:
http://www.brinkmann-online.de/homepages/bonline/news/news2000.php
In der random.php kann ich im root_path auch keine absolute Adresse eingeben, dann bekomme ich einen Fehler.
Den Link zu details.php habe ich auf der random.php in absolut ändern können, aber nicht zum thumbnail.
Das muss dochirgendwie gehen, ich mach da bestimmt irgendwo einen Fehler?!?
Ich hoffe Du hast mein Kauderwelsch verstanden :wink:
Gruß Daniel
-
wo befindet sich die random.php ?
-
okay
probier mal das(E: try this)
in der random.php (E: in random.php)
nach (E: after)
include(ROOT_PATH.'includes/constants.php');
füge dies ein (E: add this(ofcourse your own url))
define('SCRIPT_URL', 'http://www.brinkmann-online.de/umleitung/4images/');
dann ändere (E: change):
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
auf (E: to):
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
-
Supi, danke das funktioniert prima!
Das ist hier ein Service - wow!
Nebenbei hab ich wieder mehr erfahren, wie php so finzt
Thx Daniel
-
Can I modify this code to select a random image from just one category of my gallery? If so, how?
Thanks,
Tim
-
@timblount
sure!
in the two queries put
AND a.cat_id=XXX
XXX = where is your category number
-
Hmm I'm not sure what I'm doing wrong.
Here's the code:
$sql = "SELECT COUNT(*) as total_images
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id=2
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."<br>
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id=2
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."<br>
LIMIT $number, 1";
and here's the error:
DB Error: Bad SQL Query: SELECT COUNT(*) as total_images FROM 4images_images a, 4images_categories b WHERE a.image_active=1 AND a.cat_id=2 AND b.auth_viewcat=0 AND b.auth_viewimage=0<br>
You have an error in your SQL syntax near '' at line 7
DB Error: Bad SQL Query: SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments FROM 4images_images a, 4images_categories b WHERE a.image_active=1 AND a.cat_id=2 AND b.auth_viewcat=0 AND b.auth_viewimage=0<br> LIMIT 0, 1
You have an error in your SQL syntax near 'LIMIT 0, 1' at line 7
:?:
-Tim
-
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id=2
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."<br>
LIMIT $number, 1";
I don't think the HTML tag <br> belongs in either of the SQL statements. Try deleting them or download the script again to use the original source code.
-
Ist es möglich das Random Image auf einer CGI-Seite (Gäastebuch) anzuzeigen.
Kann ich da den Include Befehl verwenden oder gibt es da eine andere Lösung?
Gruss Daniel
-
Thanks I must have put those in in Dreamweaver somewhere along the line. :wink:
-
@dabri: Nein, geht leider nicht.
Gruß Jan
-
@Jan
ich musste damit ich das Zufallsbild in mein PHPKIT incuden kann, Deinen Code etwas modifiziren, da sich PHPKIT beim includen "fremder" Seiten als sehr zickig erweist. Verstosse ich damit gegen die Lizensbestimmungen oder geht das OK (ich frage aus schlechter Erfahrung herraus). Zu sehen ist ganze auf http://www.mycatsonline.de.
-
Alles ok. Ausschnitt aus den Lizenzbestimmungen:
Der Nutzer von 4images kann auf eigenes Risiko die Software verändern und/oder auf seine Bedürfnisse anpassen.
Gruß Jan
-
@Jan
Danke für die schnelle Antwort :D
-
Leider geht bei mir der iclude Befehl nicht aber wenn ich die random.php aufrufe funktioniert diese wunderbar. Wenn ich nun den <?php
include("./random.php");
?> Befehl anwende zeigt er mir auf der jeweiligen Seite nichts an das hab ich schon probiert wenn ich die random.php Datei in den selben Ordner lege oder im Hauptordner nie zeigt er was an:
Also meine komplette Seite liegt zB. im Ordner test/ und die datei random.php im Hauptordner also eine Ebene tiefer dann muesste doch der Pfad so <?php
include("../random.php");
?> aussehen geht aber nicht
Die datei random.php im selben ordner muesste der Pfad so <?php
include("random.php");
?> aussehen geht aber auch nicht WIESO nur ??? Danke an Euch
-
hat sich erledigt geht ja nur in php seiten ;) :oops:
-
Hi Nicky & Jan,
I was wondering if there is a possibility to call for x number of random images. It will not work if I just copy the random.php file multiple times
"Cannot redeclare class db in /images/includes/db_mysql.php on line 25"
and
"Cannot redeclare" errors when I copy random.pho and past as random2.php and comment out the includes in random2.php.
Can you help? Would like to display 3 or 4 images from a certain category.
Thanks in advance,
best regards,
Harry
-
Help, please!
How I can include this mod into main page of phpBB? I mean without <IFRAME> (http://prostor.com.ua/forum).
This mod don't work in .TPL (index_body.tpl) :cry:
Sorry, but I know PHP very good...
How can I resolve this problem?
Thanks!
-
@bovkun,
i saw that you did it ;)
-
@Harry,
here is it:
http://www.nicky.net/4images/random_more_pics.txt
for certain category add this: http://www.4homepages.de/forum/viewtopic.php?p=4360#4360
-
@bovkun,
i saw that you did it ;)
No. It made with IFRAME, but I don't like it.
How do it without IFRAME?
-
try to put the code anywhere into the phpbb index.php
let me know if this will help..
-
@Harry,
here is it:
http://www.nicky.net/4images/random_more_pics.txt
for certain category add this: http://www.4homepages.de/forum/viewtopic.php?p=4360#4360
Not exactly, but I like it :wink:
This works for most of my pages, I like that there is little chance of double images.
But on some of my pages I would like to choose from 2 different categories.
If I include like this:
<?php include("random_cat1.php") ?>
<?php include("random_cat2.php") ?>
<?php include("random_cat1.php") ?>
<?php include("random_cat2.php") ?>
<?php include("random_cat1.php") ?>
It works, but chances are high I get double images.
Can I also let the random-more-pics.php file choose from more than one category?
Thanks for your help,
best regards,
Harry
-
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
-
change line
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
to
$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
$cat_id = $row['cat_id'];
this
$cat_name = $row['cat_name'];
now you can use $cat_name in echo..
-
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
-
Put this in the two queries:
AND a.cat_id IN (4, 9, 15)
Greets Jan
-
Put this in the two queries:
AND a.cat_id IN (4, 9, 15)
Greets Jan
Thx :)
-
Ich krieg immer nur "Security violation" :?:
-
Ähm also das Standard Script geht immer noch nicht aber wenn man das ganze als Bild (image hader bla) ausgibt, gehts? :?: :?: :?:
-
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?
-
Ä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 ? ;)
-
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..
-
into template it's not working
-
well, i found something else..
instead off echo output in random.php
you can use this
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
<SCRIPT language='JavaScript' src='http://YOUR_DOMAIN/random.php'></SCRIPT>
-
@BIgFish
Das Problem hatte ich auch, aber wenn du den Pfad zum random.php änderst, dann müsste es gehen!!!
// 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!
-
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!<?php
include("./random.php");
?>
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
-
wozu doppelter posting ¿ ;)
was für eine fehlermeldung erhälst du ?
oder probiert dieses:
http://www.4homepages.de/forum/viewtopic.php?p=4347#4347
-
Sorry für das doppel poste! :oops: ok ich veruch es mal!
Mfg
Joe.emre
-
kannst du mich mal koriegieren?
* *
*************************************************************************/
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', 'http://www.joeemre.de/random.php');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
Mfg
Joe.Emre
-
ja kann ich ;)
wenn die random.php hier ist:
http://www.joeemre.de/random.php
define('ROOT_PATH', './4images/');
define('SCRIPT_URL', 'http://www.joeemre.de/4images/');
und wennst die random.php ind dein apportal integrieren willst
dann ist es:
<?php
include("../random.php"); // .. = verzeichnis höher . = gleicher verzeichnis
?>
-
kannst du mich wieder koriegieren :)
*************************************************************************/
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', './4images/');
define('SCRIPT_URL', 'http://www.joeemre.de/4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
ist das richtig?
Mfg
Joe.Emre
-
schau mal bitte!
http://www.joeemre.de/apportal/
was mache ich falsch? :(
Mfg
Joe.Emre
-
includen mit
../random.php
nicht
./random.php
-
geht nicht!
<?php
include("../random.php");
?>
hab ich eingegeben aber wenn ich dann auf meine seite geh kommt immer das hierWarning: Unable to access ./random.php in /home/www/htdocs/joeemre.de/apportal/inc/navi_links.inc(36) : eval()'d code on line 88
Warning: Failed opening './random.php' for inclusion (include_path='.:/usr/lib/php') in /home/www/htdocs/joeemre.de/apportal/inc/navi_links.inc(36) : eval()'d code on line 88
Mfg
Joe.Emre
P.S.bitte gib nicht auf mir zu helfen! :wink:
http://www.joeemre.de/apportal/
-
hmmm...
wie schauts mit
<?php
include("../../random.php");
?>
-
ähmmm nein geht auch nicht! :?
was kann das noch sein?
Mfg
Joe.Emre
-
so wie der code ist einfach kopieren richtig?!
-
Wenn ich mich mal kurz einmischen darf. Deine Fehlermeldung sagt, dass Du immer noch
./random.php
drinstehen hast. Es muss aber
../random.php
sein.
Jan
-
jede hilfe ist mir recht Jan!
ich sitze schon fast den ganzen tag drann!also habt ihr icq dann könnt ihr euch mal selber vergewissern!was mich natürlich freuen wird, wenn ich das mal geschaft habe!
Mfg
Joe.Emre
P.S.
habe ich aber so rein kopiert<?php
include("../../random.php");
?>
und so ausprobiert<?php
include("../random.php");
?>
-
Hier: http://www.4homepages.de/forum/viewtopic.php?p=7012#7012
hast Du behauptet
../random.php
genommen zu haben.
Die Fehlermeldung sagt aber, dass Du
./random.php
drinstehen hast.
Also, irgendwas machst Du falsch. Kann ja eigentlich nicht so schwer sein ;)
Jan
-
okay..
in der random.php ändere diese zeile:
von
define('ROOT_PATH', './4images/');
auf
define('ROOT_PATH', '../4images/');
-
ohhhhhhhhh man endlich vielen,vielen dank an Nicky und Jan für den echt super tollen suport.
ich kann mich nur vor euch verbeugen ! 8)
jetzt kann ich endlich beruhigt schlafen gehen!
Mfg
Joe.Emre
P.S.ihr seid SPITZE :!:
-
Hi ich bins schon wieder
Ich hab das script auf meiner Seite (http://www.virtualcave1.curvedspaces.com) eingebaut, und auf der Hauptseite sieht es sehr schön aus.
Weil es in meiner Fussdatei ist, habe ich die am Anfang genannten Veränderungen durchgeführt, damit es von überall aus angezeigt wird. Leider klappt das nicht.
Ich erhalte folgende errors sobald ich auf eine andere Unterseite gehe:
Warning: Unable to access ./4images/config.php in /users/curvedspaces.com/virtualcave1/random.php on line 30
Warning: Failed opening './4images/config.php' for inclusion (include_path='.:/usr/local/lib/php') in /users/curvedspaces.com/virtualcave1/random.php on line 30
Warning: Unable to access ./4images/includes/db_mysql.php in /users/curvedspaces.com/virtualcave1/random.php on line 31
Warning: Failed opening './4images/includes/db_mysql.php' for inclusion (include_path='.:/usr/local/lib/php') in /users/curvedspaces.com/virtualcave1/random.php on line 31
Warning: Unable to access ./4images/includes/constants.php in /users/curvedspaces.com/virtualcave1/random.php on line 32
Warning: Failed opening './4images/includes/constants.php' for inclusion (include_path='.:/usr/local/lib/php') in /users/curvedspaces.com/virtualcave1/random.php on line 32
Fatal error: Cannot instantiate non-existent class: db in /users/curvedspaces.com/virtualcave1/random.php on line 37
Was muss ich ändern? Oder liegt das schon wieder an meinem Gratisprovider, der das nicht zulässt? Vielleicht darf man da keine ganzen Adressen (also mit http://...) eingeben. Gibt es in dem Fall eine Möglichkeit, das Problem zu umgehen?
-
hier stand nichts.
-
Hi,
wie Ihr wisst verwende ich phpnuke.
(Problem geloest. Vgl.
http://www.4homepages.de/forum/viewtopic.php?p=8606#8606
)
-
hallo
hat vielleicht jemand von euch ein wbb (woltlab burning board) mit portal ... ??
ich wuerde nemlich gerne sowas in eine portalbox einbinden, das man dann dort eine zufaelliges bildchen sehen kann ... was muss man denn da einbinden ...
und nochwas die gallery liegt auf einem komplett anderen space als das board ist das ein problem ... ??
-
Hallo,
ich habe auf meiner Startseite 2 Frames. Der obere soll immer bleiben, im unteren ist das Zufallsbild, News etc. Wenn ich jetzt auf das Zufallsbild klicke öffnet sich die Galerie in einem neuen Fenster, aber ich will dass sie sich nur im Mainframe öffnet, sprich der obere Frame bleibt.
Siehe www.spiegelbilder.2in.de
Was muss ich ändern?
-
@harle,
ich würde sagen mit target=\"_main\" oder vielleicht target=\"mainFrame\" im random script ...
-
hallo
ich habe da auch so meine probleme bei der einbindung ...
gallery ist auf ... http://mitglied.lycos.de/xtase
board ist auf ... http://xtase.net/forum/auto
da will ich es in einem portal einbinden ...
wie geht das denn da und wo muss ich die random.php hinspielen ??!!
-
@xtase,
sind das zwei verschiedene server ?
wenn ja, irgendwo bei diesen mode hab ich eine javascript einbindung gepostet ....
-
@harle,
ich würde sagen mit target=\"_main\" oder vielleicht target=\"mainFrame\" im random script ...
das habe ich auch schon versucht, aber irgendwie ging dann alles kaputt. Könntest du mir sagen, wo genau das hin muss? ich hatte es hinter den Link gesetzt.
-
@xtase,
sind das zwei verschiedene server ?
wenn ja, irgendwo bei diesen mode hab ich eine javascript einbindung gepostet ....
ja es liegt auf 2 server ...
aber wenn das nur so einfach wäre da muss man nemlich irgendwie beim wbb am code herumfummeln irgendwie muss man da die random.php per file() in eine Var schreiben dann str_replace das es mit {name} verfügbar ist und dann in die jeweilige portalbox reinschreiben {name} habe ich mir sagen lassen aber wie das geht *hehe* da bin ich gerade mal dabei zu gucken ob ich das hinbekomme ... die gallery und das wbb vertragen sich halt doch noch nicht so gut ... :D :D
-
du brauchst im wbb code nicht viel herumfummeln..
es reicht nur in einen oder mehreren templates dies einzufügen:
http://www.4homepages.de/forum/viewtopic.php?p=6794#6794
natürlich mit entsprechender änderung in der random.php auf dem lycos server
-
öhm habe ich das jetzt richtig verstanden ... !! ... ich muss die random auf den lycos server packen obwohl ich die gallery extern auf xtase.net in meinem board einbinden will ... ??
ich habe immer geglaubt ich muss dasd random.php auf xtase.net packen und es dann von dort aus auf aufrufen weil man ja den code für die gallery eh angeben muss in der datei selber ...
-
Kann das bitte mal jemand in einen Script legen ? :D
Das hier ist ja das grösste Chaos, das ich je gesehen habe !
Also eine Komplettlösung wäre ja das beste für alle, auch für Newbies wie mich !
Gruss
Michi
-
Kann sich einer Vorstellen, was ich hier falsch gemacht habe ?
http://www.badboys.ch/4images/random.php
da kommt einfach kein Bild !
Obwohl der Pfad stimmt !
Gruss
Michi
-
olala,
eine komplettlösung wird es NIE geben, wenn alle es anders einbinden möchten....
also,
was geht bei dir nicht ¿ :roll:
-
Kann sich einer Vorstellen, was ich hier falsch gemacht habe ?
http://www.badboys.ch/4images/random.php
da kommt einfach kein Bild !
Obwohl der Pfad stimmt !
Gruss
Michi
es wird nie eins kommen, wennst, nur für registrierte benützen den klick auf thumbs erlauben tust..
-
So nun hat es geklappt :D
Ich habe hier eine Kopie von meiner random.php
Die gehört in ein unterverzeichnis ./4images/nuke
<body bgcolor="E5E5E5"> <--- hier wird die Seiten Farbe bestimmt !
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', '../../4images/');
define('SCRIPT_URL', 'http://www.deine Domain.de/4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<Center><a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_top\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a></Center><br>\n";
?>
Dann noch einen Auszug den ich mit einem Iframe gemacht habe ! ( für das Portal )
<body bgcolor="#E5E5E5">
<p align="center">
<iframe name="I1" scrolling="no" align="middle" border="0" frameborder="0" src="http://www.deine Domain.de/4images/nuke/random.php" width="133" height="127">
Ihr Browser unterstützt Inlineframes nicht oder zeigt sie in der derzeitigen Konfiguration nicht an.
</iframe></p>
So ... nun danke ich allen die mir geholfen haben ?
Gruss
Michi
-
Cool :oops:
Es funktioniert nun alles !
Danke
-
Ich hoffe es kann mir jemand helfen ....
Weil sonst die Gallery garnicht zur geltung kommt !
Gruss
Michi
-
wie bereits gesagt, wennst auf die thumbs nicht klicken kannst, wirds nicht funktionieren..
aber probiere mal dies:
in beiden queries
AND b.auth_viewimage=".AUTH_ALL."
auf
AND b.auth_viewimage=2
ändern..
-
Jep ... die random.php Seite funktioniert jetzt ...
Was muss ich denn nun machen das ich die in eine Andere PHP seite als Link einfügen kann ...
So das man das Bild auf der anderen PHP -Seite sieht `?
Wie gebe ich den das die Verknüpfung an ... ???
Gruss und besten Dank
Michi
-
das hätten wir schon einige male besprochen...
lese diesen thread von anfang an...
-
Put this in the two queries:
AND a.cat_id IN (4, 9, 15)
Greets Jan
ähm, wo ist das genau zum einfügen, was ist mit two queries gemeint?
-
Hallo
bekomme immer nur diese Fehlermeldung:
Security violationSecurity violation
Fatal error: Cannot instantiate non-existent class: db in /home/www/web232/html/4images/random.php on line 34
Warum hat das Skript denn Probleme mit der DB zu komunizieren?
Der Pfad wo 4images und alle Daten liegen ist eigentlich ok.
Grüsse
Andrè
-
am trying to use this mod - I am very new to PHP so am probably doing something very stupid...
I have installed the random.php and it is working
http://www.ukscrappers.co.uk/gallery/random.php
however, when I try and include this into HTML I just get a blank screen.
my test page is http://www.ukscrappers.co.uk/phptest.htm
the code for this is
<html>
<head>
<title>random image Test</title>
</head>
<body>
<?php
include("../random.php");
?>
</body>
</html>
and random.php looks like this
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', '../gallery/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
random.php is in both the root directory and the gallery directory as I wasnt' sure which was correct.
I'm sorry if this has already been covered in this thread - my German is very poor.
Vielen Dank
Bev
-
@BevS97,
you can't use php inludes into HTML files ;)
-
just to add for anyone else struggling with this.
You can mix html and php but you have to rename the file to end in .php and then it all works fine.
bev
-
Hallo zusammen,
wie kann ich denn in der random.php die Anzahl der Aufrufe (Hits) einfügen. Bisher ist nur der Name des Bildes und die Anzahl der Kommentare zu sehen.
viele Grüße
Matthias
www.gpaed.de
-
Assuming you want to change what is displayed along with the thumbnail, you need to look in the themes directory. there is a file called thumbnail_bit
you need to change that - or copy it and point to the new file in random.php
-
Hier ein Versuch die random.php mit Hits und Bewertung zu ergänzen.
Funktioniert nicht ;-(
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$image_hits = $row['image_hits'];
$image_rating = $row['image_rating'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
echo "Hits: $image_hits<br>\n";
echo "Bewertung: $image_rating<br>\n";
?>
Wer hat einen Lösungsvorschlag?
Matthias
-
naja, musst auch die $sql query ergänzen..
SQL SELECT .....
-
Danke für den Tipp, jetzt läufts.
viele Grüße
Matthias
www.gpaed.de
-
Now the randome image works, but at the first button block it gave me this error and it stops loading the page.
Fatal error: Call to a member function on a non-object in D:\milo\nuke\includes\blocks\button.php on line 53
Does enyone know what can be? and how to resolve the problem?
-
Hallo!
Ich habe [Mod] Random image / Zufallsbild ausprobiert und es funktioniert nur auf der index.php: http://www.strodthoff-online.de/abi91/index.php
Auf den folgenden Seiten verliert das Image den Pfad und wird nicht mehr angezeigt.
Folgendes habe ich verwendet:
define('SCRIPT_URL', 'http://www.brinkmann-online.de/umleitung/4images/');
und
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
aber dann bekomme ich folgende Db-Errors:
DB Error: Bad SQL Query: SELECT COUNT(*) as total_images 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
Table 'DB41221.IMAGES_TABLE' doesn't exist
DB Error: Bad SQL Query: SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments 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 LIMIT 0, 1
Table 'DB41221.IMAGES_TABLE' doesn't exist
Kann das wieder an meine DB von Strato liegen, denn die Tabellen sind doch vorhanden!
Vielen Dank im voraus! Kompliment an den Forum-Moderator, der immer suuuper schnell und gut antwortet!!!
-
Die Datei "includes/constants.php" wird bei Dir scheinbar nicht richtig included.
Überprüfe mal diese Zeile
include(ROOT_PATH.'includes/constants.php');
Probiere es zur Not mal mit einem absoluten Pfad auf die constants.php
include('/absoluter/pfad/zu/includes/constants.php');
Jan
-
Mit
include(ROOT_PATH.'includes/constants.php');
und auch mit dem absoluten Pfad klappt es nicht.
Nur in der index.php funktioniert es. Habe ich vielleicht im header selbst nicht richtig includet (wahrscheinlich Anfängerproblem. aber was soll ich machen?!)?
include("/home/strato/www/st/www.strodthoff-online.de/htdocs/abi91/index/random.php")
Ich habe den server path angegeben, weil alles andere nicht richtig funktionierte. Ich dachte, dass kann ja nicht falsch sein.
Helft mir, habe ich irgendwo einen Denkfehler?
In:
http://www.strodthoff-online.de/abi91/index.php
funktionierts in:
http://www.strodthoff-online.de/abi91/4images/index.php nicht!
Ich wäre sehr dankbar für eine Hilfe!!!
-
Das Problem dürfte
define('ROOT_PATH', './4images/');
sein. Hier gibst Du einen relativen Pfad an der natürlich nur von eine Ordnerebene aus funktioniert.
Du kannst das aber aus der random.php herausziehen. Einfach löschen und die random.php so inlcuden:
Für http://www.strodthoff-online.de/abi91/index.php :
define('ROOT_PATH', './4images/');
include("/home/strato/www/st/www.strodthoff-online.de/htdocs/abi91/index/random.php");
Für http://www.strodthoff-online.de/abi91/index.php :
define('ROOT_PATH', './');
include("/home/strato/www/st/www.strodthoff-online.de/htdocs/abi91/index/random.php");
Jan
-
Für http://www.strodthoff-online.de/abi91/index.php :
define('ROOT_PATH', './4images/');
include("/home/strato/www/st/www.strodthoff-online.de/htdocs/abi91/index/random.php");
Für http://www.strodthoff-online.de/abi91/index.php :
define('ROOT_PATH', './');
include("/home/strato/www/st/www.strodthoff-online.de/htdocs/abi91/index/random.php");
Jan
...heißt das, dass ich, da der include-Befehl für die random.php im header liegt, für http://www.strodthoff-online.de/abi91/index.php und http://www.strodthoff-online.de/abi91/4images/index.php zwei verschiedene Header benutzen muß?
Meinst Du bei der zweiten Code-Angabe eigentlich http://www.strodthoff-online.de/abi91/4images/index.php und nicht nochmal http://www.strodthoff-online.de/abi91/index.php?
Ich hoffe Du verstehst mich noch...
-
Meinst Du bei der zweiten Code-Angabe eigentlich http://www.strodthoff-online.de/abi91/4images/index.php und nicht nochmal http://www.strodthoff-online.de/abi91/index.php?
Ja ;)
Also gut, andere Möglichkeit. Definiere für ROOT_PATH den absoluten Pfad in random.php
define('ROOT_PATH', '/absoluter/pfad/zu/4images/');
Dann ersetzt Du
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
durch
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : "http://www.strodthoff-online.de/abi91/4images/".THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
Und
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
durch
echo "<a href=\"http://www.strodthoff-online.de/abi91/4images/details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Jan
-
Vielen, vielen Dank!!!!!
Es funktioniert!
-
Jan can you help me out? I have random image but i want to change the white box to grey behind the images and I want to remove the link from the images. I used Michi modified random image script.
Jan kann Sie mir heraus helfen? ich haben gelegentliches Bild, aber ich möchte den weißen Kasten zum Grau hinter den Bildern ändern und ich möchte die Verbindung von den Bildern entfernen.
http://babelfish.altavista.com/tr
Thanks.
PS: Great Script!!! I plan on sending you a donation as soon as I get all the problems worked out. You deserve it!
-
1. Maybe you should change the body color of your iFrame:
<body bgcolor="#E5E5E5">
2. Just edit this line:
echo "<Center><a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_top\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a></Center><br>\n";
Maybe this will work for you:
echo "<Center><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></Center><br>\n";
Jan
-
Is there a way to filter pictures without thumnails? or atleast make the script print media thumnbail. otherwise it shows in source like this:
<img src="www.mydomain.com/4images/data/thumnails/3/">
with no file name, that makes broken picture.
P.S. with original script I have limit of one <?php include("random.php"); ?> per page, after second time script calls, the page after that point become blank.
-
@ Jan - Thanks Jan - that removed the link. I am still stuck with the white backgraound. I've tried everything even CSS. Nothing works. Here is my code from inside PostWrap:
<html>
<body bgcolor="#e5e5e5">
<p align="center">
<iframe src="http://www.chphoto.net/chphoto/random.php" name="I1" width="100" marginwidth="0" height="100" marginheight="0" align="middle" scrolling="no" frameborder="0" vspace="0" style="color: grey" border="o" >
</iframe>
<a href="modules.php?op=modload&name=PostWrap&file=index&page=chphoto">CHPHOTO.NET</a>
</p>
</body>
</html>
But I think the color may need to be set in random.php
Here is my code:
<?php
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', '../chphoto/');
define('SCRIPT_URL', 'http://www.chphoto.net/chphoto/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<Center><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a></Center><br>\n";
?>
-
strange, I just tryed Michi's script, it does change color to grey.
make sure that u add at the top of random.php file <body bgcolor="#e5e5e5">
but there is a disadventage of <iframe>. when u use <iframe>, its like u insert whole new, independent page, so, whatever u setup in <header><body> in the main page it doesnt transfer into <iframe>....
but there is more. when browser see <iframe> tag it's clean the space where that page will be desplayed. so in that moment that part become white and u cant change anything, because browser has not load new page source and it doesnt know yet what color will be in that spot. (style="" in iframe preference will not affect)
and that's actualy what I was talking about in my first reply above ^^^
-
I've seen modification how to make random.php work with sertan categories, but is that possible use all categories and filter the ones I dont want to use?
if I have 200+ categories this way:
AND a.cat_id IN (4, 9, 15)
would be just pain...if I dont want use 2 categories...
or it would be easier if I creat a new group, then set witch categories that group can access and use this code?:
AND b.auth_viewimage=2
or that code only works as 'guest','registered', or 'admin'? (sry, dont speak german)
-
I'm having a problem
i get this x boxes
http://www.torquespeed.net/random.php
-
irocracer, I have the same problem when use
AND a.cat_id IN (4, 9, 15)
format.
it's only works for me with first, original format AND a.cat_id = b.cat_id
-
I think I fixed the script when it chose non picture file and shows red X.
I modified it so now it wont return full <img code, but will return full path with filename. Plus now u can show thumbnail and/or full picture.
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './4images/'); // change this to your 4images dir.
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/default/icons/"); // path to your template icons.
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
function get_file_extension($file_name) {
ereg("(.+)\.(.+)", basename($file_name), $regs);
return strtolower($regs[2]);
}
function check_thumb_type($file_name) {
return (preg_match('#(gif|jpg|jpeg|png)$#is', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_extention = get_file_extension($row['image_media_file']);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
if (empty($row['image_thumb_file'])) {
$thumb_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
}
if (!check_thumb_type($image_extention)) {
$full_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
}
$full_src_link = ROOT_PATH."details.php?image_id=$image_id";
?>
Now u'll need call random.php file just ones
<?php include("random.php"); ?>
after that u can show thumbnail:
<img src="<?php echo $thumb_src; ?>" border="1">
or show full picture:
<img src="<?php echo $full_src; ?>" border="1">
if u need add link to the image, use like this:
<a href="<?php echo $full_src_link; ?>">
<img src="<?php echo $thumb_src; ?>" border="1">
</a>
-
not sure if i set this right : can you double check it ?
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', '/home/virtual/site1/fst/var/www/html/members/gallery/'); // change this to your 4images dir.
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/home/virtual/site1/fst/var/www/html/default/icons/"); // path to your template icons.
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
function get_file_extension($file_name) {
ereg("(.+)\.(.+)", basename($file_name), $regs);
return strtolower($regs[2]);
}
function check_thumb_type($file_name) {
return (preg_match('#(gif|jpg|jpeg|png)$#is', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_extention = get_file_extension($row['image_media_file']);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
if (empty($row['image_thumb_file'])) {
$thumb_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
}
if (!check_thumb_type($image_extention)) {
$full_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
}
$full_src_link = ROOT_PATH."details.php?image_id=$image_id";
?>
-
this is my test page
http://www.torquespeed.net/test/main.php
-
no, one line should be like this:
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/default/icons/"); // path to your template icons.
since u already set ROOT_PATH, u dont need repeat it for ICON_PATH
u only need change path for ICON_PATH if u use different templates then default, then just change /default/icons/ to /your_templates_folder/icons/
-
sorry to be buggin you :
i have this error on the test page
Warning: Failed opening './members/gallery/config.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site1/fst/var/www/html/random.php on line 29
Warning: Failed opening './members/gallery/includes/db_mysql.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site1/fst/var/www/html/random.php on line 30
Warning: Failed opening './members/gallery/includes/constants.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site1/fst/var/www/html/random.php on line 31
Fatal error: Cannot instantiate non-existent class: db in /home/virtual/site1/fst/var/www/html/random.php on line 33
you can find my test page here
http://www.torquespeed.net/test/main.php
-
well, I can see, that u use compleately different gallery script, not 4images:
http://gallery.menalto.com/modules.php?op=modload&name=News&file=index
atleast, define('ROOT_PATH', '/home/virtual/site1/fst/var/www/html/members/gallery/'
point to that gallery.
if u use 4images, make sure that this path point to root of 4images directory.
-
well, I can see, that u use compleately different gallery script, not 4images:
http://gallery.menalto.com/modules.php?op=modload&name=News&file=index
atleast, define('ROOT_PATH', '/home/virtual/site1/fst/var/www/html/members/gallery/'
point to that gallery.
if u use 4images, make sure that this path point to root of 4images directory.
ya i have too , but the main gallery i use is 4 images
www.torquespeed.net ...... i'm transfering all images from the old to the new which is 4images..
4images ,
www.torquespeed.net/members/gallery
-
ah, ok. now I see where is the problem:
try change this:define('ROOT_PATH', '/home/virtual/site1/fst/var/www/html/members/gallery/');
to this:define('ROOT_PATH', './members/gallery/');
-
this is what the random.php file looks like
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './members/gallery/'); // change this to your 4images dir.
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/templates/default/icons/"); // path to your template icons.
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
function get_file_extension($file_name) {
ereg("(.+)\.(.+)", basename($file_name), $regs);
return strtolower($regs[2]);
}
function check_thumb_type($file_name) {
return (preg_match('#(gif|jpg|jpeg|png)$#is', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_extention = get_file_extension($row['image_media_file']);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
if (empty($row['image_thumb_file'])) {
$thumb_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
}
if (!check_thumb_type($image_extention)) {
$full_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
}
$full_src_link = ROOT_PATH."details.php?image_id=$image_id";
?>
-
ok, lets see.
since u put your random.php (main.php) file in /text/ dir, u'll need change define('ROOT_PATH', './members/gallery/');
to thisdefine('ROOT_PATH', '../../members/gallery/');
if that wont work, try delete one ' ../ ' so it would looks like this:
../members/gallery/
and about ICON_PATH, u put extra ' /templates/ '
delete it because its allready added by TEMPLATE_DIR
-
lol... error
Warning: Failed opening '././members/gallery/config.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site1/fst/var/www/html/random.php on line 29
Warning: Failed opening '././members/gallery/includes/db_mysql.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site1/fst/var/www/html/random.php on line 30
Warning: Failed opening '././members/gallery/includes/constants.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site1/fst/var/www/html/random.php on line 31
Fatal error: Cannot instantiate non-existent class: db in /home/virtual/site1/fst/var/www/html/random.php on line 33
test page 1
http://www.torquespeed.net/test/main.php
test page 2
http://www.torquespeed.net/test.php
random.php
http://www.torquespeed.net/random.php
-
hmmm....did u copy/past my code?
make sure it's ../ not ./
let me explain what is the differenece between those two.
if u have your gallery as www.yoursite.com/members/gallery/
and then u put your random.php into www.yoursite.com/test/random.php
then u must change ROOT_PATH to ../members/gallery/
if u put as ./members/gallery/ the server will trying find your path as www.yoursite.com/test/members/gallery/
" ../ " means, server will look one directory behind it was called from.
" ./ " means, server will look from the same directory it was called from.
so, again. as many dirrectories are bihind your random.php (/test/proba/random/pictures/random.php ) as many ../../../../ u must put to make sure server look from the root.
hope this can help.
so, if u run your random.php from the root, change to this: ./members/gallery/
if u run from /test/random.php - to this: ../members/gallery/
-
OIC ... let me play with it today ..
so , i have to place random.php into folder called " test ' ?
ok , give that a try
I do wait to thak you so much for the help your giving me .... by now, i'll be hitting head on the computer screen about 20 times...
>>>>>>>>>>>>>>>>>>> I'll give it a try and i';; let you know
thanks
hmmm....did u copy/past my code?
make sure it's ../ not ./
let me explain what is the differenece between those two.
if u have your gallery as www.yoursite.com/members/gallery/
and then u put your random.php into www.yoursite.com/test/random.php
then u must change ROOT_PATH to ../members/gallery/
if u put as ./members/gallery/ the server will trying find your path as www.yoursite.com/test/members/gallery/
" ../ " means, server will look one directory behind it was called from.
" ./ " means, server will look from the same directory it was called from.
so, again. as many dirrectories are bihind your random.php (/test/proba/random/pictures/random.php ) as many ../../../../ u must put to make sure server look from the root.
hope this can help.
so, if u run your random.php from the root, change to this: ./members/gallery/
if u run from /test/random.php - to this: ../members/gallery/
-
ok , still not working ... i have no idea ...
but this is what i have ..
test page:
http://www.torquespeed.net/test.php > I get X boxes and links going no where..
location of Random:
http://www.torquespeed.net/random.php
code am using for /random.php
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './members/gallery/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
code in html: /test.php
<html>
<?php require("/home/virtual/site1/fst/var/www/html/forums/main.php"); ?>
<body bgcolor="#DFDFDF" link="#66899C" alink="#FF0000" vlink="#66899C">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber12">
<tr>
<td width="100%">
<p align="center"> <?php require("/home/virtual/site1/fst/var/www/html/php/header.php"); ?></td>
</tr>
</table>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="93%" id="AutoNumber7" height="15">
<tr>
<td width="100%" height="1" background="http://www.torquespeed.net/forums/style_images/1/tile_back.gif">
<?php
echo bar(1);
?></td>
</tr>
</table>
</center>
</div>
<p style="margin-top: 0; margin-bottom: 0" align="center">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="93%" id="AutoNumber1" height="30">
<tr>
<td width="100%" height="30">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="AutoNumber19">
<tr>
<td width="100%">
<p align="center"> <?php require("./random.php"); ?><img src="<?php echo $thumb_src; ?>" border="1"></td>
</tr>
<tr>
<td width="100%"> </td>
</tr>
</table>
</center>
</div>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber10" height="25">
<tr>
<td width="100%" height="25" background="http://www.torquespeed.net/forums/style_images/1/tile_back.gif"> <img border="0" src="http://www.torquespeed.net/forums/style_images/1/nav_m.gif" width="8" height="8">
<font color="#FFFFFF" face="Tahoma">Home</font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="14" style="border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#FFFFFF" width="100%" id="AutoNumber14">
<tr>
<td width="50%" bordercolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber15">
<tr>
<td width="100%"> <?php
echo news(7,2,0,500);
?></td>
</tr>
</table>
</td>
<td width="50%" bordercolor="#FFFFFF">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber16">
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber17">
<tr>
<td width="100%" background="http://www.torquespeed.net/forums/style_images/1/tile_sub.gif">
<p align="center">Top 12 Topics</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber18">
<tr>
<td width="2%" bgcolor="#FFFFFF"> </td>
<td width="98%" bgcolor="#FFFFFF"> <?php
echo posts_x(12);
?></td>
</tr>
<tr>
<td width="2%" bgcolor="#FFFFFF"> </td>
<td width="98%" bgcolor="#FFFFFF"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="14" bgcolor="#9FB3D0">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber11">
<tr>
<td width="50%"> </td>
<td width="50%">
<p align="right"> </td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber13">
<tr>
<td width="100%">
<p align="center"><?php require("/home/virtual/site1/fst/var/www/html/php/footer.php"); ?></td>
</tr>
<tr>
<td width="100%"> </td>
</tr>
</table>
-
dokterjur:
Hi, I want to include a random image into my site, but im getting this error:
Parse error: parse error in /usr/local/slash/apache/vhosts/beachhousepaal1.com/httpdocs/fotoalbum/4images/random.php on line 34
Here is my code
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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
define('ROOT_PATH', 'http://www.beachhousepaal1.com/fotoalbum/4images/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
$site_db = new Db($db_http://www.beachhousepaal1.com, $db_***, $db_***, $db_fotoalbum); //Wow! what happend to this line?
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
I suggest u delite this file and start over.
its looks like u edited it too much. from the entire script all u need is change ROOT_PATH nothing else.
so, in your case, since u r trying to run random.php from the same directory as your 4images script u'll need change ROOT_PATH like this:
define('ROOT_PATH', './');
that should be it.
if u want put random.php file into different directory, then u'll need change ./ for ROOT_PATH as I 'tryed' explain in my previos replyes.
-
Thanks! It worked! You can check it out at http://www.beachhousepaal1.com/test
This site is in Dutch language and only the first page works at this moment.
-
man , i really need this mod , but for somereason is not working for me... this can be my problem....
I have 4images working for my board: this is the hack i installed:
http://www.ibresource.com/forums/index.php?act=ST&f=6&t=3830&s=83d869d97b7eb66136bd0bb21298c28e
my gallery:
http://www.torquespeed.net/members/gallery/
My Random code looks like this:
http://www.torquespeed.net/random.php
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './members/gallery/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
I get notthing but x boxes and links going no where
-
Well, I really dont know now, we tryed with u all kind of stuff...
but I asume, that integration 4mages with IBF does correction in 4images Database. and random.php cant correctly read information from database.
I'll try to look what changes make IBF integration, but, since I know almost nothing about PHP and MySQL...
maybe somebody else can figure it out?
-
Hey, I got an idea!
when u integrated 4images with IBF u had to replace constants.php file.
so, try to put in /includes/ folder original 4images constants.php file, but rename it as constants2.php and change in random.php
include(ROOT_PATH.'includes/constants2.php');
probably wont work, but worth to try. ;)
-
nope , same problem ... x boxes .... humm there has to be a way
-
Take a look at the HTML source code of your page and check the image source.
Jan
-
i get following erorrs when i try to run on my computer using PHPTriad:
Warning: Failed opening 'http://localhost/test/4images/config.php' for inclusion (include_path='.;c:\php4\pear') in C:\PROGRAM FILES\PHP EXPERT EDITOR\php60B3.TMP on line 32
Warning: Failed opening 'http://localhost/test/4images/includes/db_mysql.php' for inclusion (include_path='.;c:\php4\pear') in C:\PROGRAM FILES\PHP EXPERT EDITOR\php60B3.TMP on line 33
Warning: Failed opening 'http://localhost/test/4images/includes/constants.php' for inclusion (include_path='.;c:\php4\pear') in C:\PROGRAM FILES\PHP EXPERT EDITOR\php60B3.TMP on line 34
Fatal error: Cannot instantiate non-existent class: db in C:\PROGRAM FILES\PHP EXPERT EDITOR\php60B3.TMP on line 36
-
here is the lines that i have edited :
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', 'http://localhost/test/4images/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
-
http://4homepages.de/forum/viewtopic.php?p=12199#12199
-
Take a look at the HTML source code of your page and check the image source.
Jan
html code , what you mean .. please detail me
-
Hi Leuts,
hat jemand eine Idee wie ich folgenden Fehler beseitigen könnte?
Fatal error: Cannot redeclare class db in /kunden/mysterynews.net/webseiten/gallery/includes/db_mysql.php on line 28
Edit: Habs gefunden. Hatte irrtümlicher weise die random.php doppelt included. :)
-
is there another way where i can get the ramdom images for people that use the IBF mod ?
-
Hallo,
habe mit einiger Mühe das Zufallbild in eine Portalbox eingebunden. (Habe dazu das Script benutzt)
Wie kriege ich denn Jetzt die Bildbeschreibung dazu?
Jörg
Okay, war easy, sollte zuerst Kopf einschalten!
Funktioniert einwandfrei!
-
i received this error after i put it in random_more_pics.php on my index.php page
DB Error: Bad SQL Query: SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments FROM 4images_images a, phpbb_categories b WHERE a.image_active=1 AND a.cat_id = b.cat_id AND b.auth_viewcat=0 AND b.auth_viewimage=0 ORDER BY RAND() LIMIT 4
Unknown column 'b.auth_viewcat' in 'where clause'
help please?
thanks :(
-
and this is the code
<?php
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', './4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 4;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
ORDER BY RAND()
LIMIT $num_images";
$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_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<hr>\n";
}
?>
-
You have a wrong table name in your query: phpbb_categories
If you don't find the error, just change
".CATEGORIES_TABLE."
to
4images_categories
Jan
-
I did just like wat u said Jan....I change
".CATEGORIES_TABLE."
to 4images_categories
but i got this error:
Parse error: parse error in /home2/klh/public_html/randommulti.php on line 43
:?:
-
Can you post line 43.
Jan
-
ok this is the line
LINE 43 -----> FROM ".IMAGES_TABLE." a, "4images_categories" b
[/code]
-
You did not read my instructions correctly ;)
FROM ".IMAGES_TABLE." a, 4images_categories b
Don't put the double quotes around 4images_categories.
Jan
-
This mod works fine for me, as well as phpBB Fetch Info does, but only one of these mods on the same page, alone. When I'm trying to run both mods together, on the same page, the phpBB Fetch Info doesn't work at all. I'm using different database for 4images and pbpBB.
Please advise, what could be the reason for this conflict? Thanks in advance!
<?php
#################################################################
## Mod Title: phpBB Fetch Info
## Author: Ca5ey <ca5ey@clanunity.net> Volker Rattel
#################################################################
#-----[ EXAMPLE USAGE ]------------------------------------------
## <?php
## define('IN_PHPBB', true);
## include('phpbb_fetch_info.php');
## $info = phpbb_fetch_info();
## ?>
## Total Posts: <?php echo $info['f_total_posts']; ?><br>
## Total Users: <?php echo $info['f_total_users']; ?><br>
## Newest User: <?php echo $info['newest_username']; ?><br>
## Newest User ID: <?php echo $info['newest_userid']; ?><br>
## User Online: <?php echo $info['f_user_online']; ?><br>
#################################################################
$phpbb_root_path = './phpBB2/';
$CFG['close_db'] = 1;
if (!file_exists($phpbb_root_path . 'extension.inc')) {
die('<b>phpBB Fetch Info:</b> The $phpbb_root_path setting is wrong and DOES NOT point to your forum.');
}
include_once ($phpbb_root_path . 'extension.inc');
include_once ($phpbb_root_path . 'common.'.$phpEx);
function phpbb_fetch_info()
{
global $db;
$info = array();
$info['f_total_posts'] = get_db_stat('postcount');
$info['f_total_users'] = get_db_stat('usercount');
$newest_user = get_db_stat('newestuser');
$info['newest_userid'] = $newest_user[0];
$info['newest_username'] = $newest_user[1];
$sql = 'SELECT
COUNT(session_id)
FROM
' . SESSIONS_TABLE . '
WHERE
session_time >= ' . ( time() - 300 );
if( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
}
$f_user_online = $db->sql_fetchrow($result);
$info['f_user_online'] = $f_user_online[0];
if ($CFG['close_db']) {
$db->sql_close();
}
return $info;
} // phpbb_fetch_info
?>
-
Thanks Jan
It is woking now. :)
but there is a conflict with my other fetch post.
like SLL said, i get one to work but then the others don't work.
Thanks again Jan
U R DA MAN! 8)
-
YESSS!!!! I finally got it! :D
CATEGORIES_TABLE definiton is duplicated in both scripts. Just rename it to anything else and define directly in Random Images script...
That's it!
-
Hi, I am a little confused with the original directions, I was wondering if someone could write them a little more descriptive, I dont know where to put what and what to put, if you could do this that would be awesome, thanks!
~Nate~
-
I was wondering if someone could write them a little more descriptive
Sure... just rename one of duplicated definitions to anything else and define them directly in the script (not in the includes!):
define('PIC_CATEGORIES_TABLE', '4images_categories');
define('PIC_IMAGES_TABLE', '4images_images');
{skipped}
$sql = "SELECT COUNT(*) as total_images FROM ".PIC_IMAGES_TABLE." a, ".PIC_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."";
$row = $pics_db->query_firstrow($sql);
More clear now? :wink:
-
no. sorry SLL, im still confused, but once I started uploading images the random image appeared on every page and its working so... thanks anyway though!
~Nate~
-
no. sorry SLL, im still confused
Now I know why :) You are talking about random images in 4images, but this MOD shows random image outside your gallery, just on any webpage, for example, on the title page of your website. Have a look, how it works at http://www.dalnet.ru
-
define('PIC_CATEGORIES_TABLE', '4images_categories');
define('PIC_IMAGES_TABLE', '4images_images');
which file is it under?
can you post the completed script here, please?
:)
[/quote]
-
can you post the completed script here, please?
OK, to make our life easier, below are three scripts running on the homepage of my site:
- one to show random image from 4images gallery;
- one to fetch last few topics from phpBB board;
- one to fetch some stats from phpBB board;
[/list:u]
The code is not mine! I just modified it a bit and have managed scripts to work on the same page.
Save this one as random.php
<?php
define('ROOT_PATH', './4images/');
define('SITE_URL', 'http://faces.dalnet.ru/');
include_once(ROOT_PATH.'config.php');
include_once(ROOT_PATH.'includes/db_mysql.php');
define('PIC_CATEGORIES_TABLE', '4images_categories');
define('PIC_IMAGES_TABLE', '4images_images');
define('THUMB_DIR', 'data/thumbnails');
define('AUTH_ALL', 0);
define('AUTH_USER', 2);
define('AUTH_ACL', 3);
define('AUTH_ADMIN', 9);
$pics_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images FROM ".PIC_IMAGES_TABLE." a, ".PIC_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."";
$row = $pics_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments FROM ".PIC_IMAGES_TABLE." a, ".PIC_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." LIMIT $number, 1";
$row = $pics_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo "<b><div class=\"ltgreytext\">$image_name</b></div>\n";
echo "» <a target=\"a\" href=\"".SITE_URL."\">âñåãî â àëüáîìå <b>$total_images</b> ôîòî</a><br>\n";
?>
Save this one as recent.php
<?php
define('IN_PHPBB', true);
$limit = "7"; // how many topics to fetch?
$phpbb_root_path = "./phpBB2/";
$phpbb_main_url = "http://forum.dalnet.ru/";
include_once($phpbb_root_path . 'extension.inc');
include_once($phpbb_root_path . 'common.'.$phpEx);
$recent_sql = "SELECT topic_id,topic_title,topic_last_post_id,forum_id FROM " . TOPICS_TABLE . " WHERE forum_id !='3' AND forum_id <'8' ORDER BY topic_last_post_id DESC LIMIT $limit";
$recent = $db->sql_query($recent_sql);
echo "<table cellspacing=0 cellpadding=1 width=\"100%\">";
while ($line = mysql_fetch_array($recent)) {
$security=FALSE;
if($forum_auth == 2 && $userdata['user_level'] == ADMIN) {
$security=TRUE;
}
if($forum_auth == 3 && ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == 2)) {
$security=TRUE;
}
if($forum_auth == 0) {
$security=TRUE;
}
if($security == TRUE)
{
$lastpost_array=$db->sql_query("SELECT post_time FROM " . POSTS_TABLE . " WHERE post_id =" . $line['topic_last_post_id']);
$lastpost=mysql_fetch_array($lastpost_array);
$lastpost=$lastpost['post_time'];
$lastpost=create_date("d M - H:m", $lastpost, $board_config['board_timezone']);
$j = stripslashes($line['topic_title']);
$k = substr($j, 0, 35) . "...";
echo "<tr><td class=\"menutext\" align=\"left\">» <a target=\"f\" href=\"$phpbb_main_url" . "viewtopic.php?t=" . $line['topic_id'] . "\" class=\"menutext\">" . $k . "</a></td>";
echo "<td class=\"ltgreytext\" align=\"right\">$lastpost</td></tr>";
}};
echo "</table>";
?>
Save this one as phpbb_fetch_info.php
<?php
$phpbb_root_path = './phpBB2/';
define ('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include_once($phpbb_root_path.'config.'.$phpEx);
include_once($phpbb_root_path.'includes/db.'.$phpEx);
include_once($phpbb_root_path.'includes/constants.'.$phpEx);
function phpbb_fetch_stats()
{
global $db;
$result = array();
$result['total_posts'] = get_db_stat('postcount');
$result['total_users'] = get_db_stat('usercount');
$newest_user = get_db_stat('newestuser');
$result['user_id'] = $newest_user['user_id'];
$result['username'] = $newest_user['username'];
$sql = 'SELECT session_id FROM ' . SESSIONS_TABLE . ' WHERE session_time >= ' . (time() - 300);
$query = $db->sql_query($sql);
$user_online = $db->sql_fetchrow($query);
$result['user_online'] = count($user_online);
echo "$table_prefix\n<br>";
return $result;
}
?>
Then open your index.php and insert the following tags into the proper places:
<?php
include('phpbb_fetch_info.php');
$stats = phpbb_fetch_stats();
echo 'Total posts: ' . $stats['total_posts'] . ', total users: ' . $stats['total_users'] . ', now online: ' . $stats['user_online'] . ', last registered: ' . $stats['username'];
?>
<?php include("recent.php"); ?>
<?php include("random.php"); ?>
Demo: http://www.dalnet.ru/home.php
-
wow 8) is is working fantastic!!!!
ABOUT RANDOM.PHP....Can you show me how to set, so that it only randomize certain categories?
Thanks SLL
-
Can you show me how to set, so that it only randomize certain categories?
Try to play with this query:
$sql = "SELECT COUNT(*) as total_images FROM ".PIC_IMAGES_TABLE." a, ".PIC_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."";
... adding something like AND b.cat_id !='2' AND b.cat_id <'4'
-
Thanks SSL
8) U R DA MAN 8)
-
How can I post multiple THUMBNAILS in 1 page?
<?php
include("./random.php");
?>
I tried doing it in 2 tables .. but
Fatal error: Cannot redeclare class db in /home/ahahchen/public_html/tradertt/4images/includes/db_mysql.php on line 28
What can I do then?
-
I want to put 2 different random thumbnails in 1 webpage ... but I keep getting that error cause they are querying the same database.. how can I overcome it?
-
Even if I use 1 table ... I keep getting just a CROSS and not a picture and the link to it is
http://www.tipscheck.com/tradertt/4images/details.php?image_id=
WHy is there no image_id number behind ?
-
Even if I use 1 table ... I keep getting just a CROSS and not a picture and the link to it is
http://www.tipscheck.com/tradertt/4images/details.php?image_id=
WHy is there no image_id number behind ?
THis happens when I keep refreshing the page ... I am using a FULL IMAGE random_full.php and if I chg my
AND a.cat_id = 3
the problem occurs
But when I chg it back to
AND a.cat_id = b.cat_id
it does not have this problem .. HELP !!
-
any luck yet on having it work when you have IBF mod in 4images ?
-
can you post the completed script here, please?
OK, to make our life easier, below are three scripts running on the homepage of my site:
- one to show random image from 4images gallery;
- one to fetch last few topics from phpBB board;
- one to fetch some stats from phpBB board;
[/list:u]
The code is not mine! I just modified it a bit and have managed scripts to work on the same page.
Save this one as random.php
<?php
define('ROOT_PATH', './4images/');
define('SITE_URL', 'http://faces.dalnet.ru/');
include_once(ROOT_PATH.'config.php');
include_once(ROOT_PATH.'includes/db_mysql.php');
define('PIC_CATEGORIES_TABLE', '4images_categories');
define('PIC_IMAGES_TABLE', '4images_images');
define('THUMB_DIR', 'data/thumbnails');
define('AUTH_ALL', 0);
define('AUTH_USER', 2);
define('AUTH_ACL', 3);
define('AUTH_ADMIN', 9);
$pics_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images FROM ".PIC_IMAGES_TABLE." a, ".PIC_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."";
$row = $pics_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments FROM ".PIC_IMAGES_TABLE." a, ".PIC_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." LIMIT $number, 1";
$row = $pics_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SITE_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" vspace=\"2\" alt=\"$image_name\"></a><br>\n";
echo "<b><div class=\"ltgreytext\">$image_name</b></div>\n";
echo "» <a target=\"a\" href=\"".SITE_URL."\">âñåãî â àëüáîìå <b>$total_images</b> ôîòî</a><br>\n";
?>
Save this one as recent.php
<?php
define('IN_PHPBB', true);
$limit = "7"; // how many topics to fetch?
$phpbb_root_path = "./phpBB2/";
$phpbb_main_url = "http://forum.dalnet.ru/";
include_once($phpbb_root_path . 'extension.inc');
include_once($phpbb_root_path . 'common.'.$phpEx);
$recent_sql = "SELECT topic_id,topic_title,topic_last_post_id,forum_id FROM " . TOPICS_TABLE . " WHERE forum_id !='3' AND forum_id <'8' ORDER BY topic_last_post_id DESC LIMIT $limit";
$recent = $db->sql_query($recent_sql);
echo "<table cellspacing=0 cellpadding=1 width=\"100%\">";
while ($line = mysql_fetch_array($recent)) {
$security=FALSE;
if($forum_auth == 2 && $userdata['user_level'] == ADMIN) {
$security=TRUE;
}
if($forum_auth == 3 && ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == 2)) {
$security=TRUE;
}
if($forum_auth == 0) {
$security=TRUE;
}
if($security == TRUE)
{
$lastpost_array=$db->sql_query("SELECT post_time FROM " . POSTS_TABLE . " WHERE post_id =" . $line['topic_last_post_id']);
$lastpost=mysql_fetch_array($lastpost_array);
$lastpost=$lastpost['post_time'];
$lastpost=create_date("d M - H:m", $lastpost, $board_config['board_timezone']);
$j = stripslashes($line['topic_title']);
$k = substr($j, 0, 35) . "...";
echo "<tr><td class=\"menutext\" align=\"left\">» <a target=\"f\" href=\"$phpbb_main_url" . "viewtopic.php?t=" . $line['topic_id'] . "\" class=\"menutext\">" . $k . "</a></td>";
echo "<td class=\"ltgreytext\" align=\"right\">$lastpost</td></tr>";
}};
echo "</table>";
?>
Save this one as phpbb_fetch_info.php
<?php
$phpbb_root_path = './phpBB2/';
define ('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include_once($phpbb_root_path.'config.'.$phpEx);
include_once($phpbb_root_path.'includes/db.'.$phpEx);
include_once($phpbb_root_path.'includes/constants.'.$phpEx);
function phpbb_fetch_stats()
{
global $db;
$result = array();
$result['total_posts'] = get_db_stat('postcount');
$result['total_users'] = get_db_stat('usercount');
$newest_user = get_db_stat('newestuser');
$result['user_id'] = $newest_user['user_id'];
$result['username'] = $newest_user['username'];
$sql = 'SELECT session_id FROM ' . SESSIONS_TABLE . ' WHERE session_time >= ' . (time() - 300);
$query = $db->sql_query($sql);
$user_online = $db->sql_fetchrow($query);
$result['user_online'] = count($user_online);
echo "$table_prefix\n<br>";
return $result;
}
?>
Then open your index.php and insert the following tags into the proper places:
<?php
include('phpbb_fetch_info.php');
$stats = phpbb_fetch_stats();
echo 'Total posts: ' . $stats['total_posts'] . ', total users: ' . $stats['total_users'] . ', now online: ' . $stats['user_online'] . ', last registered: ' . $stats['username'];
?>
<?php include("recent.php"); ?>
<?php include("random.php"); ?>
Demo: http://www.dalnet.ru/home.php
i am getting this error:
Fatal error: Cannot instantiate non-existent class: db in random.php on line 16
(i am only using the random image script)
HELP ME PLEEEASE! :cry:
-
Hi,
Good mod, he work 2 days and now it don't work :-(
he don't to find the image_id=
This is the javascript version : http://central-galerie.com/4images/random.php
a problem with my database ?
hi an alle, hi all,
D: hier ist der Zufallsbild MOD für extra seiten ausserhalb ihrer Gallerie:
E: here the Random image MOD for extra sites outside your Gallery:
http://www.nicky.net/4images/random.txt
D: speichere den inhalt als random.php
E: save the content as random.php
D: random.php wurde mit folgenden befehl in die random_mod.php inkludiert
E: random.php was included into the random_mod.php site
D: mit
E: with
<?php
include("./random.php");
?>
D: viel spass
E: have fun
p.s.:
D: vielen dank an JAN der 99% der arbeit geleistet hat ;)
E: many thanks to JAN who maked 99% of this mod ;)
-
Hallo,
ich bekomme beim Versuch das so einzubinden eine Fehlermeldung:
Warning: Failed opening './4images/config.php' for inclusion (include_path='.:/usr/share/php') in /var/home/rot-weiss-erfurt.com/www/pix/random.php on line 30
Warning: Failed opening './4images/includes/db_mysql.php' for inclusion (include_path='.:/usr/share/php') in /var/home/rot-weiss-erfurt.com/www/pix/random.php on line 31
Warning: Failed opening './4images/includes/constants.php' for inclusion (include_path='.:/usr/share/php') in /var/home/rot-weiss-erfurt.com/www/pix/random.php on line 32
Fatal error: Cannot instantiate non-existent class: db in /var/home/rot-weiss-erfurt.com/www/pix/random.php on line 34
Ich hoffe ich habe alles richitg verstanden, hier deshalb meine Vorgehensweise:
1. random.txt von oben als random.php in 4images Verzeichniss
2. Den Code von oben
<?php
include("./random.php");
?>
in meine Seite eingefügt. Als das nicht funktionierte, habe ich die Pfadangabe von ./random.php zu http://www.meinedomain.com/ornder/random.php geändert.
Da nix ging poste ich nun hier... ;)
Gruß
-
Erst einmal vielen Dank für diesen genialen Mod.
Die Thumbnails werden perfekt auf meiner anderen Website angezeigt.
Es gibt da allerdings noch ein kleines Problem.
Liegt das Thumbnail nicht auf dem 4images-Server, da es von einem User per URL hinzugefügt wurde, wird das Bild natürlich nicht angezeigt. Kann man da evtl. noch eine Abfrage einfügen, die den Ort der thumbnail-Datei bestimmt oder den Code so ändern, dass nur thumbnails angezeigt werden, die auf dem 4images-Server liegen???
Vielen Dank für Eure Hilfe!
Gruß
Markus
-
Okay, wer hat eine funktionierende random.php für mich. Irgendwie akzeptier er den Pfad nicht, egal was ich tue. Wenn ich als root_path den kompletten Pfad nehme, dann funktioniert zwar das Script, aber das Bild wird nicht angezeigt! Kann ich das irgendwie ändern?
Gruß
-
Habe das mal eingebunden aber kriege da nur folgenden Fehler.
DB Error: Bad SQL Query: SELECT COUNT(*) as total_images FROM 4images_images a, hexboardcategories b WHERE a.image_active=1 AND a.cat_id = b.cat_id AND b.auth_viewcat=0 AND b.auth_viewimage=0
Unknown column 'b.auth_viewcat' in 'where clause'
DB Error: Bad SQL Query: SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments FROM 4images_images a, hexboardcategories b WHERE a.image_active=1 AND a.cat_id = b.cat_id AND b.auth_viewcat=0 AND b.auth_viewimage=0 LIMIT 0, 1
Unknown column 'b.auth_viewcat' in 'where clause'
Wobei hexbioardcategorie eun Table vom phpbb ist und nicht von 4images.
-
could someone help me modify this mod to view only new images from a certain category using V@no's code...
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './4images/'); // change this to your 4images dir.
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/default/icons/"); // path to your template icons.
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a- z]+#i', $file_name)) ? 1 : 0;
}
function get_file_extension($file_name) {
ereg("(.+)\.(.+)", basename($file_name), $regs);
return strtolower($regs[2]);
}
function check_thumb_type($file_name) {
return (preg_match('#(gif|jpg|jpeg|png)$#is', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_extention = get_file_extension($row['image_media_file']);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
if (empty($row['image_thumb_file'])) {
$thumb_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
}
if (!check_thumb_type($image_extention)) {
$full_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
}
$full_src_link = ROOT_PATH."details.php?image_id=$image_id";
?>
thnx ^_~
-
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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) fur *
* 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', './4images/'); // change this to your 4images dir.
include(ROOT_PATH.'global.php');
$new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
$sql = "SELECT IF(a.image_date >= $new_cutoff,RAND()+1,1) as random_no, a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_thumb_file, a.image_comments, a.user_id
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."
ORDER BY random_no DESC, RAND()
LIMIT 1";
$row = $site_db->query_firstrow($sql);
$image_extention = get_file_extension($row['image_media_file']);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
if (empty($row['image_thumb_file'])) {
$thumb_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
}
if (!check_thumb_type($image_extention)) {
$full_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
}
$full_src_link = ROOT_PATH."details.php?image_id=$image_id";
?>
it will chose an image from new images, but if there is no new images, it will chose random from whole gallery.
-
Erst einmal Kompliment für das tolle Script, das im grossen und ganzen auch toll läuft. Allerdings habe ich ein Problem, was zwar nicht am Script liegt, aber vielleicht fällt jemanden eine Lösung ein:
Ich würde gerne das Zufallsbild gerne in mein Guestbook (MySQL/PHP) integrieren, allerdings lassen die Templates keinen PHP-Code zu :cry: Gibt es vielleicht einen Trick wie man trotzdem das Zufallsbild integrieren könnte? Bisher habe ich leider noch keine Lösung gefunden....
-
hi.
the script v@no posted was exactly was i was trying to find in this board here. i would like to get a random foto, but not out of the whole gallery but only the new ones. so i thought v@nos code was right but when i uploaded that php page and started it in my browser, the only source code it created was:
<html><body></body></html>
i changed the 4images path to the same i used in the original random php script.
still the same error.
see it here on this page:
http://www.odd-fish.de/randomnew.php
original random script:
http://www.odd-fish.de/random.php
anyone an idea ?
cheers, fab
-
hi.
the script v@no posted was exactly was i was trying to find in this board here. i would like to get a random foto, but not out of the whole gallery but only the new ones. so i thought v@nos code was right but when i uploaded that php page and started it in my browser, the only source code it created was:
<html><body></body></html>
i changed the 4images path to the same i used in the original random php script.
still the same error.
see it here on this page:
http://www.odd-fish.de/randomnew.php
original random script:
http://www.odd-fish.de/random.php
anyone an idea ?
cheers, fab
my code works different way then original.
read here how to use it:
http://4homepages.de/forum/viewtopic.php?p=12102#12102
P.S. u can not use it from .html page, only from .php
-
I've tried this mod and it works fine except when there isn't a thumbnail it doesn't seem to display anything at all, not even the default image. Anyway to get it to do that?
-
I've tried this mod and it works fine except when there isn't a thumbnail it doesn't seem to display anything at all, not even the default image. Anyway to get it to do that?
if you would read through the whole posts in this thread, u'd found your answer. :roll:
btw, I posted in my previous replay the link to it :roll:
-
works perfect now, thx a lot V@no !!! :D :D
-
Okay, sorry V@no. I got it working now and it displays the default image now. :) Thanks for that.
Is there any way to display multiple random images with your script? Sorry if this has already been answered. I tried to find it in the thread but it's very long and gets confusing because I only speak English.
-
Was hat Matthias 70 hier geändert damit es läuft.
Ich will den Kategorienamen anzeigen lassen!!!!
Hier ein Versuch die random.php mit Hits und Bewertung zu ergänzen.
Funktioniert nicht ;-(
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$image_hits = $row['image_hits'];
$image_rating = $row['image_rating'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
echo "Hits: $image_hits<br>\n";
echo "Bewertung: $image_rating<br>\n";
?>
Wer hat einen Lösungsvorschlag?
Matthias
-
Man muss unter:
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, b.cat_name
Anfügen: b.cat_name
dann ein bischen weiter unten:
$cat_name = $row['cat_name'];
Und das ist dann die Ausgabe:
echo "Kategorie:<br><a href=\"".ROOT_PATH."categories.php?cat_id=$cat_id\">\n";
echo "$cat_name<br></a>\n";
[/code]
-
Ich hätte da mal ne frage ist es möglich die Random funktion in script mit den neuen Bildern zu verbinden wenn ja wie? :?:
-
Ich hätte da mal ne frage ist es möglich die Random funktion in script mit den neuen Bildern zu verbinden wenn ja wie? :?:
sorry if I missaderstud u ;)
http://4homepages.de/forum/viewtopic.php?p=17715#17715
-
Thanks for this MOD, it works fine! :)
I would want to know if it would be possible that the MOD shows a random image of a certain member , or the last image added to the gallery (globally or the last image added by a certain member).
I think that this is possible with mySQL queries but I dont know anything of mySQL.
Anybody can help me?
Thanks
-
I would want to know if it would be possible that the MOD shows a random image of a certain member , or the last image added to the gallery (globally or the last image added by a certain member).
"last image added"? if u are talking about random image from "new" images, then I belive the changes were posted inbetween the replays.
if u want show random image from only one user, then try to change the original code:$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
to this:$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.user_id
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.user_id = XXXXX
AND a.cat_id = b.cat_id
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
LIMIT $number, 1";
change XXXXX to your user's ID number
P.S. I havent test this, just an idea ;)
-
Erst einmal VIELEN DANK für das Script. Dat iss super und *man höre und staune* es hat FAST auf Anhieb funktioniert.
Nun ja... ich habe da eine eher bescheidene Frage... (an der ich jetzt schon länger sitze, als am Script zurechtbasteln selbst... und dat nervt mich... daher frag ich...)
Ich binde die random.php via IFrame in eine Box auf meinem Portal ein. Mein Problem ist, dass das Bild im IFrame rechtsbündig angezeigt wird. Ich hätte es so gern mittig...
der Code des IFrames sollte eigentlich sowas von stimmen...
<p align="center">
<iframe scrolling="no" align="center" border="0" frameborder="0" src="http://www.meine Domain.de/random.php" width="130" height="165">
</iframe></p>
Ich tippe daher mal darauf, dass ich das in der random.php ändern muss...
Der Ausgabeteil ...echo blabla... ist ebenfalls mit gecenterten Tags ausgestattet... Wo könnte ich denn noch "centerse" unterbringen, damit das Bild mittig angezeigt wird???
Vielen Dank für Eure Hilfe...
Liebe Grüße,
Vicky
PS.: ich wette, sobald ich auf "absenden" klicke, klickt es auch bei mir...
-
try to repalace:
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
with this:echo "<table width=\"100%\" border=\"0\" cellpading=\"0\" cellspacing=\"0\">\n<tr>\n<\td width=\"130\" height=\"165\" align=\"center\" valign=\"center\">";
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
echo "</td>\n</tr>\n</table>\n";
-
Hallo V@no
vielen Dank für Deine schnelle Hilfe...
Leider mag die Box dat nicht so gern...
Ich bekommen angezeigt:
< d width="130" height="165" align="center" valign="center">
dann das Bild RECHTSBÜNDIG :cry:
Da fehlt irgend wo ein Koma oder es ist ein Strich zu viel... *such*
Liebe Grüße,
Vicky
-
sorry, typo :?
remove this:echo "<table width=\"100%\" border=\"0\" cellpading=\"0\" cellspacing=\"0\">\n<tr>\n<\td width=\"130\" height=\"165\" align=\"center\" valign=\"center\">";
-
Hallo ich wusste nicht ob ich ein neuen Thread aufmachen sollte.
Hier ist eine fertige version von der random_more_pics.txt für das IPB 1.1.1 MOD Portal Beta 2 von Dragoran hier zu finden (http://www.ibplanet.de/forums/index.php?act=downloads&CODE=02&id=4) (Achtung um das zu sehen muss man da eingeloggt sein)
Ein paar ergänzungen hab ich vorgenommen.
Angezeigt wird ...
- Name
- Hits
- Downloads
- Bewertung (gesamt)
- Beschreibung
- Kommentare
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './4images/');
include('/homepages/11/XXXXXXXXXX/4images/config.php');
include('/homepages/11/XXXXXXXXXX/4images/includes/db_mysql.php');
include('/homepages/11/XXXXXXXXXX/4images/includes/constants.php');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 4;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_rating, a.image_votes, a.image_hits, a.image_downloads, 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."
ORDER BY RAND()
LIMIT $num_images";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)){
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_votes = $row['image_votes'];
$image_hits = $row['image_hits'];
$image_downloads = $row['image_downloads'];
$image_name = $row['image_name'];
$image_rating = $row['image_rating'];
$image_description = $row['image_description'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<table width=\"100%\" border=\"0\"><tr>";
echo "<td width=\"41%\"><div align=\"center\"><a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a></div></td>";
echo "<td width=\"59%\"><p><strong>Name:</strong> $image_name<strong><br>";
echo "Hits: </strong>$image_hits<strong><br>";
echo "Downloads: </strong>$image_downloads<strong><br>";
echo "Bewertungen: </strong>$image_rating (von $image_votes)<br>";
echo "<strong>Beschreibung: </strong>$image_description<strong></strong> </p>";
echo "<p><strong>Kommentare:</strong> $image_comments<br>";
echo "[<a href=\"".ROOT_PATH."details.php?image_id=$image_id\">Vergrössern</a>]";
echo "</p></td></tr><tr><td colspan=\"2\"><hr color=\"#465584\" width=\"90%\" size=\"1\"></td></tr></table>\n";
}
?>
Anleitung:
1. Kompletten Code Kopieren und als Random.php speichern!
2. den PFAD zur 4images Gallerie eintragen.
3. Die anzahl der Bilder eingeben die Angezeigt werden sollen.
4. Speichern und ins Hauptverzeichnis 4images hochladen
5. ACP -> Portal PHP Box erstellen.
Das eintragen...
include("http://www.deine_url.de/4images/random.php");
Fertig!
Achtung: es passt nur in die Mitte da der Text rechts neben dem Bild angezeigt wird. Falls jemand was nicht möchtest muss er einfach im echo Teil unten endfernen.
@Jan
Is das ok wenn ich das auch in die IPB Foren als MOD poste?
Nein ich will es nicht als meins ausgeben... dazu fehlt mir PHP verständnis :)
-
Hi kann mann diesen mod innerhalb des scriptes nutzen und trotzdem die Randomnewpics funktion haben? D.h. daß die neuen pics abwechselnd geziegt werden? :?
-
This mod worked straight away for me! Thanks VERY much!
Laura
(see the gallery for my little girl here: http://www.incredesign.com/megan/
-
Is it possible for me to add to the random.php script a line to open the random image in a new window when a user clicks on it?
-
Is it possible for me to add to the random.php script a line to open the random image in a new window when a user clicks on it?
add target='_blank' inside <a href link
for example <a href='address' target='blank'><img src...></a>
-
Sorry confuses me a bit!
img src is set from Gallery's random image, "address"? should this be of my gallery?
Sorry, but no experience of PHP script's.
Mike.
Here is the address where I am testing random image, see what happens if it is clicked on! http://www.hovegallery.co.uk/Gallery/Random.htm
-
Hi all
Wie muss ich den der Link aussehen wenn ich das zufallsbild den jeweiligen Boardstyle anpassen will ? (wbb2)
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_new\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a>\n";
-
Is it possible for me to add to the random.php script a line to open the random image in a new window when a user clicks on it?
add target='_blank' inside <a href link
for example <a href='address' target='blank'><img src...></a>
Can anyone help me on how I should add this code to make the image open in a new window?
-
:D Thanks to v@no, his patience with me has got this working for me at last, so simple but so am I sometimes!!! :oops:
-
Now i really read through all of these pages, but it seems, my problem is not detailed here.
I can add a single picture to my homepage and I can add multiple pictures under each other using the "multiple" version.
But what to do if I try to get 3 pictures from 3 different categories next to each other in one line?
A possibility for doing this with seperate includes to use it in a table would be best.
is there anything I can do for this?
here's the link to show you what I mean
http://www.abiwolnzach02.com/indexnew.php
TIA folks!
You're doing a great job, expecially in support!
-
Is there a similar mod/php for 1.7.1 ?
I'd like to insert a random thumb and description into my webpages, on the same server, but outside of the 4images program.
Thanks!!
-
Hello,
Thanks for this mod. Exactly what I needed. May I ask; How can I modify this so that it displays images even when a user is not logged in or the category is only available to 'registered' users?
In other words, all of my images require registration, but I'd like to include this random.php in other webpages that non-users see. It's OK if they cant see the full 4images details page, but just the thumbnail and description. Does that make sense?
here we go:
http://www.nicky.net/4images/random_full.txt
have fun
-
Anyone?
-
Hello,
Thanks for this mod. Exactly what I needed. May I ask; How can I modify this so that it displays images even when a user is not logged in or the category is only available to 'registered' users?
In other words, all of my images require registration, but I'd like to include this random.php in other webpages that non-users see. It's OK if they cant see the full 4images details page, but just the thumbnail and description. Does that make sense?
here we go:
http://www.nicky.net/4images/random_full.txt
have fun
Yes... I have the same doubt :cry:
-
hi
thanx for the mod, working fine in test.php, but when i call this mod in postnuke php block i got this error DB Error: Could not connect to the database server (, ).
.
any help?
i also tried to download postnuke module which is mention in this forum but its not avilable any more on the that site http://www.netforum.com, if any one have that mod plz, i want :(
-
Hello
i have installed this mod - which is not working - but sins i install it - the checkimages.php is not working anymore?
i don't know if this is just unlucky or if the
<?php
include("./random.php");
?>
modifeyes something else
hope of feedback
vincent
-
mmm....what this mod has anything to do with checkimages.php?
where did u include the random.php ??? 8O
perhaps u missunderstood the purpose of this mod - display a random image ON EXTERNAL PAGE (not on 4images-based pages) ?
and because of that there is no 4images files should be changed for this mod...
-
Hi V@no
:( what about my problem, a try many ways, but nothing happens on postnuke site, i crated a test.php page outside of postnuke root path, there it will show me random images, but when i call script in postnuke page , i got this message. DB Error: Could not connect to the database server (, ).
. :( any help plz, may be i miss something in this post, but i dont know german, i also tried to translate these german post into english, but cannot get help :( :( :(, any one, any help
-
Hello please
I installed the RANDOM MORE PIX MOD(allows more than 1 thumbnail) ,The problem is the images are coming Vertically,how do I make them horizonatlly to be dispalyed on my web page?
Thanx in advance
-
Hi-
Ok, as I try to integrate this with wbb 2.3.2 I have a problem-
I have created this random.php and in it stands this
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_full.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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黵 *
* 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
define('ROOT_PATH', '../4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
print("
document.write('<a href=\"".SCRIPT_URL."/details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a>');
");
?>
my 4images directory
www.thecenterofthenet.com/4images/
my wbb
www.thecenterofthenet.com/ww2/
in my index template I have created this:
<SCRIPT language='JavaScript' src='http://thecenterofthenet.com/wbb2/random.php'></SCRIPT>
The problem is that I get the link, however no image.
It seems to me somthing is wrong with the thumbnail source. However, since the paths seem to be correct why isnt it finding the thumbnail source?
I mean, if you want to see the error you can check out www.thecenterofthenet.com/wbb2/
underneath the login window you can see the correct link to the details.
Site is under heavy constriction.
Thanks-
Robert
-
hi ich bin neu hier und absoluter newbie und bräuchte hilfe. wäre SUPER wenn ihr mir helfen könntent
ich hab das auch probiert, das ein zufallsbild auf meiner seite erscheint.. weis jedoch nicht so recht wie genau das funktioniert... meine hauptseite ist eine html seite.. hoffe das macht nichts... sie ist im mom auch noch nicht hochgeladen, weil ich dafür noch ein bisschen brauche bis die fertig ist....
aber wie genau muss ich das anstellen..?
hab also diese random.php seite runtergeladen und geöffnet.. welche änderungen muss ich da genau vornehmen, damit dann ein Zufallsbild auf der hp erscheint?
Möchte das Zufallsbild mit Inlineframes unter meiner späteren navigation einbinden...
die random.php hab ich jetzt mal normal in meinen 4images ordner geladen (also in keinen unterordner).
wäre seeeeehhr dankbar wenn ihr auch mir helfen könntet
mfg
-
Hello,
It works perfectly, but i want to show more than 1 random picture.
I would like to show 4 or 5 different random pictures next to each other
Can anybody help me??
Thanx a lot
-
Thank you for the Code.
I display 4random images and want to show this images in horizontal form. Now I have it in vertical direction.
What must i do?
-
It works fine for me - BUT it shows only one "random" pic, always the same :( After Reloading etc, every time the same pic :(
-
hi ich bin neu hier und absoluter newbie und bräuchte hilfe. wäre SUPER wenn ihr mir helfen könntent
ich hab das auch probiert, das ein zufallsbild auf meiner seite erscheint.. weis jedoch nicht so recht wie genau das funktioniert... meine hauptseite ist eine html seite.. hoffe das macht nichts... sie ist im mom auch noch nicht hochgeladen, weil ich dafür noch ein bisschen brauche bis die fertig ist....
aber wie genau muss ich das anstellen..?
hab also diese random.php seite runtergeladen und geöffnet.. welche änderungen muss ich da genau vornehmen, damit dann ein Zufallsbild auf der hp erscheint?
Möchte das Zufallsbild mit Inlineframes unter meiner späteren navigation einbinden...
die random.php hab ich jetzt mal normal in meinen 4images ordner geladen (also in keinen unterordner).
wäre seeeeehhr dankbar wenn ihr auch mir helfen könntet
mfg
hi,
also in der random.php folgende root einstellung eintragen define('ROOT_PATH', './'); da sich die random.php ja im 4images ordner befindet.
die index.html seite in index.php umbenennen(html funkt nicht) und mit diesem befehl einbinden
<?php
include("/4images/random.php");
?>
oder
<?php
include("../random.php");
?>
speicherst du die random.php in dem verzeichnis wo deine hauptseite ist (dort wo die pics erscheinen sollen dann reicht dieser befehl
<?php
include("random.php");
?>
und den root pfad define('ROOT_PATH', '/4images/'); so umbenennen
ich hoffe ich hab alles richtig erklärt :oops: bin selbst noch recht neu auf diesem gebiet ;) falls etwas falsch sein sollte bitte berichtigt mich dann ruhig *g*
-
Hello,
It works perfectly, but i want to show more than 1 random picture.
I would like to show 4 or 5 different random pictures next to each other
Can anybody help me??
Thanx a lot
this is my random_morepics.php .mod created by nicky
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', '../4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 4;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
ORDER BY RAND()
LIMIT $num_images";
$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_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<hr>\n";
}
?>
-
Thank you for the Code.
I display 4random images and want to show this images in horizontal form. Now I have it in vertical direction.
What must i do?
:?: Anyone with the solution to show them horizontal (in a table) instead of vertical?
Looked in the code of 4images to figure out how it creates e.g. the thumbnails in a table but did not get me anywhere. :(
-
I have another question. I write it here, because I didn´t find any similiar topic.
I want to integrate the pictures from the "Categories" in another Website with a other domain.
How can I realize this?
-
Thank you for the Code.
I display 4random images and want to show this images in horizontal form. Now I have it in vertical direction.
What must i do?
:?: Anyone with the solution to show them horizontal (in a table) instead of vertical?
Looked in the code of 4images to figure out how it creates e.g. the thumbnails in a table but did not get me anywhere. :(
I don´t know wich random.php u are using, but the originial has an echo command with a <br> tag in the end. I have´nt test this mod yet, but it might work if u remove that tag.
( echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n"; )
ALWAYS backup your file first, I might be totaly wrong.
-
Thanks,
A simple solution, did not see it myself.
It does not create a table but I think I can do something with it...
Loet
-
hello
i'm sorry if this question has allready been posted (and answer .. ) but after many reshearch i don't find it (or if it will be answered in german .. i don't understand it .. orry)
I would like mke change to get a random image from the entire site enven if i'm in categorie and sub categorie
Cause i'm making a photo gallery with 2 others people .. and i would alow thier pic being display in the random box even if user is surfing in my cat
thx for all (and sorry for my crappy english)
*solve .. by changing 2 lines un categorie.html .. sorry :mrgreen:
-
this question has nothing to do with the mod (if I understood you correctly). All u need to do is replace any {random_cat_image} tags in the templates with {random_image}
-
Wenn ich die Rendem.php aufrufe bekomme ich nur eine Fehlermeldung:
Fatal error: Cannot instantiate non-existent class: db in /usr/export/www/hosting/ices/random.php on line 34
Bitte helft mir
-
Ok I am browsing through this thread for hours and I a meither blind or too tired so forgive me.
my random.php is located in http://www.irishbreen.com/
my gallery in http://www.irishbreen.com/photos/
My random.php code is this
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './photos/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
define('SCRIPT_URL', 'http://www.irishbreen.com/photos/');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
but when I click on random.php it shows red X's and the source code I get is <a href="http://www.irishbreen.com/photos/details.php?image_id="><img src="http://www.irishbreen.com/photos/data/thumbnails//" border="0" alt=""></a><br>
<b></b><br>
Comments: <br>
it seems that it cant find the image_id for some reason. Any ideas ?
-
that's because u cant see any images if u are not logged in (visiting as a guest)
you'll need either remove completly two instances of these two lines: AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
or replace them with: AND b.auth_viewcat<".AUTH_ADMIN."
AND b.auth_viewimage<".AUTH_ADMIN."
The first variant will not check any permissions of the categories and second will not show images from categories where only admin is allowed to see.
-
thanks V@no that worked liek a charm!!!
-
How I can make it work? I have this thing on my index page -
Warning: main(http://gilmore-girls.frihost.net/www/gallery/http://gilmore-girls.frihost.net/www/gallery/config.php): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/aalia/public_html/random.php on line 30
Warning: main(): Failed opening 'http://gilmore-girls.frihost.net/www/gallery/http://gilmore-girls.frihost.net/www/gallery/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/aalia/public_html/random.php on line 30
Warning: main(http://gilmore-girls.frihost.net/www/gallery/http://gilmore-girls.frihost.net/www/gallery/includes/db_mysql.php): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/aalia/public_html/random.php on line 31
Warning: main(): Failed opening 'http://gilmore-girls.frihost.net/www/gallery/http://gilmore-girls.frihost.net/www/gallery/includes/db_mysql.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/aalia/public_html/random.php on line 31
Warning: main(http://gilmore-girls.frihost.net/www/gallery/http://gilmore-girls.frihost.net/www/gallery/includes/constants.php): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/aalia/public_html/random.php on line 32
Warning: main(): Failed opening 'http://gilmore-girls.frihost.net/www/gallery/http://gilmore-girls.frihost.net/www/gallery/includes/constants.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/aalia/public_html/random.php on line 32
Fatal error: Cannot instantiate non-existent class: db in /home/aalia/public_html/random.php on line 34
-
the root path u specifyed doesnt look as a correct path:
http://gilmore-girls.frihost.net/www/gallery/http://gilmore-girls.frihost.net/www/gallery/
its not internet path, its RELATIVE (./ and/or ../) type of path
-
Moin,
dann will ich mich auch mal in diesen Mega-Thread reinhängen, der verdammt schwer zu verfolgen ist... :roll:
Vorab vielen Dank an Nicky für die Mod-Datei. Ist genaus das, was ich gesucht habe. Leider bekomme ich das Teil aber nicht so recht zum laufen.
Die random.php liegt auf meiner HP im Hauptverzeichnis. Wenn ich sie direkt über die URL aufrufe, bekomme ich das Zufallsbild auch angezeigt.
Die 4images-Galerie liegt in einem Ordner im Hauptverzeichnis meiner HP. Der Pfad in der random.php ist daher wie folgt definiert:
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', './4images/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
define('SCRIPT_URL', 'http://www.Colourconcept.net/4images/');
Die zweite Pfadbeschreibung die hier im Thread auftaucht, habe ich also auch schon integriert. Auf meiner Postnuke-Seite möchte ich das Zufallsbild in einem Block am rechten Seitenrand anzeigen. Ich habe daher dort einen php-Block generiert und die random.php mit dem folgenden Befehl eingebunden:
include("random.php");
Leider führt das aber nicht zum gewünschten Ergebnis. Es wird nichts angezeigt :( Ändere ich etwas in der random.php oder im include-Befehl, bekomme ich allerdings sofort Fehlermeldungen. Hat jemand 'ne Idee, wo mein Problem liegt?
Besten Dank vorab
-
Hallo,
also, ich würde das random_mod auch gerne nutzen, habe dabei folgende Probleme:
Einbindung mit include in sidebar.php (www.one-brain-cellers.de/wordpress/wp-content/themes/rin/sidebar.php) :
Warning: main() [function.main]: open_basedir restriction in effect. File(/usr/lib/php/random.php) is not within the allowed path(s): (/home/www/htdocs/one-brain-cellers.de/.) in /home/www/htdocs/one-brain-cellers.de/wordpress/wp-content/themes/rin/sidebar.php on line 32
Warning: main(random.php) [function.main]: failed to create stream: Operation not permitted in /home/www/htdocs/one-brain-cellers.de/wordpress/wp-content/themes/rin/sidebar.php on line 32
Warning: main() [function.main]: Failed opening 'random.php' for inclusion (include_path='.:/usr/lib/php') in /home/www/htdocs/one-brain-cellers.de/wordpress/wp-content/themes/rin/sidebar.php on line 32
Einbindung mit iFrame:
Security violationSecurity violation
Fatal error: Cannot instantiate non-existent class:db in /home/www/htdocs/one-brain-cellers.de/wordpress/wp-content/themes/rin/random.php on line 35
random.php :
define('ROOT_PATH', 'http://www.one-brain-cellers.de/4images/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
define('SCRIPT_URL', 'http://www.one-brain-cellers.de/4images/');
.
.
.
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";?>
random.php liegt auf www.one-brain-cellers.de/wordpress/wp-content/themes/rin/
4images auf www.one-brain-cellers.de/4images
Das mit dem include-Befehl scheint ein Problem mit meinem Webspace zu sein, das funktioniert generell nicht. Auch die hier vorgestellte Java Variante funktioniert nicht (passiert garnichts).
Kann mir jemand bitte helfen?
Liebe Grüße
Buzzdee
-
hallo buzzdee
deine random.php liegt im falschen ordner.sie muss in den hauptordner des blogs kopiert werden ;) nicht in
den theme ordner.
und dieser abschnitt in der random php muss dann wie folgt lauten
define('ROOT_PATH', '../4images/');
hier kannst du es dir ansehen http://maikew.ma.funpic.de/blog/ :wink:
-
:?: Anyone with the solution to show them horizontal (in a table) instead of vertical?
Looked in the code of 4images to figure out how it creates e.g. the thumbnails in a table but did not get me anywhere. :(
I use this code to keep them horizonal
echo "<table border='0' width='133' bgcolor='#FFFFFF' Align=left>\n";
echo "<TR>\n";
echo "<TD><a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a></TD>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD bgcolor='#FFFFFF'><b>$image_name</b></TD>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD bgcolor='#FFFFFF'>Comments: $image_comments</TD>\n";
echo "</TR>\n";
echo "</table>\n";
-
It works fine for me - BUT it shows only one "random" pic, always the same :( After Reloading etc, every time the same pic :(
I have this problem too, does anyone know why that would be? My code is on here: http://www.dhost.info/rosablasiclub/home.php (it's a test page for a new version right now)
-
Could someone pleeeease help me with this? I'm done with the rest of the site and I am just waiting for this to be fixed so I can put all of it online.. my random.php code is as follows:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', '../rosablasiclub/archive/4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_blank\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"random picture\"></a><br>\n";
?>
-
hi,
ich bin auch ein großer fan der gallery hochachtung an die macher.
so jetzt zum eigentlichen problem:
ich habe meine hp mit dem clan manager pro gemacht und dort gefällt mir das mit dem potm nicht, weil man dort jedes einzelne bild zuweisen muss was in der box angezeigt werden soll, nun hab ich mir die random.php runtergeladen soweit auch alles umeditiert, sie funzt auch soweit aber wenn ich sie einbinden will dann verzieht mein ganzes style, weiß einer dazu rat? hab mit ifram sowie include gearbeitet
hier meine random.php
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_new\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
aso bevor ich es vergesse das design wird in 2 php dateien gesplittet aus der html
die sich footer und header nennen
hoffe mir kann einer helfen
hier der link
www.ph-multigaming.de.vu
nich wundern ich nutz im moment wieder das potm von dem script
-
so habs von allein hinbekommen aber andere frage kann man den namen und diesen comments bereich rausnehmen und den hintergrund transparent machen???
-
Hey um.. not to seem incredibly impatient or anything.. but is anyone ever going to help me?! If you don't know the answer please at least tell me that so I won't be waiting for nothing..
-
sry das ich nochmal nerve :P
wenn es schon nicht transparent geht, würde es dann gehen das ich das hintergundbild dann in der php datei mit eintrage?
das komische ist ja das bei firefox das hintergrundbild angezeigt wird bei dem potm.
hoffe mir kann jetzt einer helfen
-
Hi
can this MOD cover my requirements mentioned in the following post?
http://www.4homepages.de/forum/index.php?topic=9774.msg47864#msg47864
Thanks!
-
hi an alle, hi all,
D: hier ist der Zufallsbild MOD für extra seiten ausserhalb ihrer Gallerie:
E: here the Random image MOD for extra sites outside your Gallery:
http://www.nicky.net/4images/random.txt
D: speichere den inhalt als random.php
E: save the content as random.php
D: random.php wurde mit folgenden befehl in die random_mod.php inkludiert
E: random.php was included into the random_mod.php site
D: mit
E: with
<?php
include("./random.php");
?>
D: viel spass
E: have fun
p.s.:
D: vielen dank an JAN der 99% der arbeit geleistet hat ;)
E: many thanks to JAN who maked 99% of this mod ;)
Hallo, habe gerade nach einer Möglichkeit gesucht ein Zufallsbild in meine Seite einzubauen. Habe als Random.php gespeichert und Hochgeladen aber irgendwie weiß ich nicht wo ich die random_mod.php hernehmen soll und wie ich die sachen dann auf meiner Page auf der Linken Seite einfüge. Bin ein neuling in sachen php aber hoffe das mir jemand weiterhelfen kann. Des weiteren möchte ich die Galerie per iframe einbinden. Das klappt auch aber ich muß dann scrollen nachdem ich ein Bild angeklickt habe. Wie mache ich dieses bündig? Danke für eure Hilfe im vorraus. Marc
-
Hi!
I've looked through all this topic, but didn't manage to fix my issue. It's all in this:
Security violationSecurity violation
Fatal error: Cannot instantiate non-existent class: db in /home/166413/http/foto/random.php on line 34
this is my code in random.php:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', 'http://www.ipoding.ru/foto/');
include('http://www.ipoding.ru/foto/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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 4;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
ORDER BY RAND()
LIMIT $num_images";
$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_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<hr>\n";
}
?>
Password and user name of the db are typed in correctly....
I have no idea what to fix. Please help me!
My 4images: http://www.ipoding.ru/foto/index.php ----- don't get shocked, it's all in Russian
-
Try this:
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', '/usr/local/httpd/htdocs/.../foto/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
Good luck!
Markus
-
Try this:
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', '/usr/local/httpd/htdocs/.../foto/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
Good luck!
Markus
Now i get this:
Warning: main(): open_basedir restriction in effect. File(/usr/local/httpd/htdocs/.../foto/config.php) is not within the allowed path(s): (/home/166413) in /home/166413/http/foto/random.php on line 30
Warning: main(/usr/local/httpd/htdocs/.../foto/config.php): failed to open stream: Not owner in /home/166413/http/foto/random.php on line 30
Warning: main(): open_basedir restriction in effect. File(/usr/local/httpd/htdocs/.../foto/config.php) is not within the allowed path(s): (/home/166413) in /home/166413/http/foto/random.php on line 30
Warning: main(/usr/local/httpd/htdocs/.../foto/config.php): failed to open stream: Not owner in /home/166413/http/foto/random.php on line 30
Warning: main(): Failed opening '/usr/local/httpd/htdocs/.../foto/config.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/166413/http/foto/random.php on line 30
Warning: main(): open_basedir restriction in effect. File(/usr/local/httpd/htdocs/.../foto/includes/db_mysql.php) is not within the allowed path(s): (/home/166413) in /home/166413/http/foto/random.php on line 31
Warning: main(/usr/local/httpd/htdocs/.../foto/includes/db_mysql.php): failed to open stream: Not owner in /home/166413/http/foto/random.php on line 31
Warning: main(): open_basedir restriction in effect. File(/usr/local/httpd/htdocs/.../foto/includes/db_mysql.php) is not within the allowed path(s): (/home/166413) in /home/166413/http/foto/random.php on line 31
Warning: main(/usr/local/httpd/htdocs/.../foto/includes/db_mysql.php): failed to open stream: Not owner in /home/166413/http/foto/random.php on line 31
Warning: main(): Failed opening '/usr/local/httpd/htdocs/.../foto/includes/db_mysql.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/166413/http/foto/random.php on line 31
Warning: main(): open_basedir restriction in effect. File(/usr/local/httpd/htdocs/.../foto/includes/constants.php) is not within the allowed path(s): (/home/166413) in /home/166413/http/foto/random.php on line 32
Warning: main(/usr/local/httpd/htdocs/.../foto/includes/constants.php): failed to open stream: Not owner in /home/166413/http/foto/random.php on line 32
Warning: main(): open_basedir restriction in effect. File(/usr/local/httpd/htdocs/.../foto/includes/constants.php) is not within the allowed path(s): (/home/166413) in /home/166413/http/foto/random.php on line 32
Warning: main(/usr/local/httpd/htdocs/.../foto/includes/constants.php): failed to open stream: Not owner in /home/166413/http/foto/random.php on line 32
Warning: main(): Failed opening '/usr/local/httpd/htdocs/.../foto/includes/constants.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/166413/http/foto/random.php on line 32
Fatal error: Cannot instantiate non-existent class: db in /home/166413/http/foto/random.php on line 34
even if I remove ' : define(ROOT_PATH, '/usr/local/httpd/htdocs/.../foto/');
still same :(
if I change it to define(ROOT_PATH.'/usr/local/httpd/htdocs/.../foto/');
I get:
Warning: Wrong parameter count for define() in /home/166413/http/foto/random.php on line 28
Warning: main(ROOT_PATHconfig.php): failed to open stream: No such file or directory in /home/166413/http/foto/random.php on line 30
Warning: main(ROOT_PATHconfig.php): failed to open stream: No such file or directory in /home/166413/http/foto/random.php on line 30
Warning: main(): Failed opening 'ROOT_PATHconfig.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/166413/http/foto/random.php on line 30
Warning: main(ROOT_PATHincludes/db_mysql.php): failed to open stream: No such file or directory in /home/166413/http/foto/random.php on line 31
Warning: main(ROOT_PATHincludes/db_mysql.php): failed to open stream: No such file or directory in /home/166413/http/foto/random.php on line 31
Warning: main(): Failed opening 'ROOT_PATHincludes/db_mysql.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/166413/http/foto/random.php on line 31
Warning: main(ROOT_PATHincludes/constants.php): failed to open stream: No such file or directory in /home/166413/http/foto/random.php on line 32
Warning: main(ROOT_PATHincludes/constants.php): failed to open stream: No such file or directory in /home/166413/http/foto/random.php on line 32
Warning: main(): Failed opening 'ROOT_PATHincludes/constants.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/166413/http/foto/random.php on line 32
Fatal error: Cannot instantiate non-existent class: db in /home/166413/http/foto/random.php on line 34
:( :( :(
-
Sorry, the ... stand for the Rest of your Home-Path
i.e. /usr/local/httpd/htdocs/.../Foto/ or /home/166413/http/foto ;)
Cheers,
Markus
My random_more.php without comments and image name:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', '/usr/local/httpd/htdocs/.../4images/');
define('YOUR_URL', 'http://www.4imagesurl.de/4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 5;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
ORDER BY RAND()
LIMIT $num_images";
$result = $site_db->query($sql);
echo '<table><tr>';
while ($row = $site_db->fetch_array($result)){
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : YOUR_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo '<td>';
echo " <a target=\"_top\" href=\"".YOUR_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a>\n";
echo '</td>';
}
echo '</tr></table>'
?>
-
Thx. I returned to the first error I recieved.
Security violationSecurity violation
Fatal error: Cannot instantiate non-existent class: db in /home/166413/http/foto/random.php on line 34
As I think, line 34 requires new Db class:
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
So the problem migth be in /includes/db_mysql.php ?
Here is my code:
?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: db_mysql.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7.1 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
if (!defined('ROOT_PATH')) {
die("Security violation");
}
class Db {
var $no_error = 0;
var $connection;
var $query_id = 0;
var $query_count = 0;
var $query_time = 0;
var $query_array = array();
var $table_fields = array();
function Db($db_host, $db_user, $db_password = "", $db_name = "", $db_pconnect = 0) {
$connect_handle = ($db_pconnect) ? "mysql_pconnect" : "mysql_connect";
if (!$this->connection = $connect_handle($db_host, $db_user, $db_password)) {
$this->error("Could not connect to the database server ($db_host, $db_user).", 1);
}
if ($db_name != "") {
if (!@mysql_select_db($db_name)) {
@mysql_close($this->connection);
$this->error("Could not select database ($db_name).", 1);
}
}
return $this->connection;
}
function close() {
if ($this->connection) {
if ($this->query_id) {
@mysql_free_result($this->query_id);
}
return @mysql_close($this->connection);
}
else {
return false;
}
}
function query($query = "") {
unset($this->query_id);
if ($query != "") {
if ((defined("PRINT_QUERIES") && PRINT_QUERIES == 1) || (defined("PRINT_STATS") && PRINT_STATS == 1)) {
$startsqltime = explode(" ", microtime());
}
if (!$this->query_id = @mysql_query($query, $this->connection)) {
$this->error("<b>Bad SQL Query</b>: ".htmlentities($query)."<br /><b>".mysql_error()."</b>");
}
if ((defined("PRINT_QUERIES") && PRINT_QUERIES == 1) || (defined("PRINT_STATS") && PRINT_STATS == 1)) {
$endsqltime = explode(" ", microtime());
$totalsqltime = round($endsqltime[0]-$startsqltime[0]+$endsqltime[1]-$startsqltime[1],3);
$this->query_time += $totalsqltime;
$this->query_count++;
}
if (defined("PRINT_QUERIES") && PRINT_QUERIES == 1) {
$query_stats = htmlentities($query);
$query_stats .= "<br><b>Querytime:</b> ".$totalsqltime;
$this->query_array[] = $query_stats;
}
return $this->query_id;
}
}
function fetch_array($query_id = -1, $assoc = 0) {
if ($query_id != -1) {
$this->query_id = $query_id;
}
if ($this->query_id) {
return ($assoc) ? mysql_fetch_assoc($this->query_id) : mysql_fetch_array($this->query_id);
}
}
function free_result($query_id = -1) {
if ($query_id != -1) {
$this->query_id = $query_id;
}
return @mysql_free_result($this->query_id);
}
function query_firstrow($query = "") {
if ($query != "") {
$this->query($query);
}
$result = $this->fetch_array($this->query_id);
$this->free_result();
return $result;
}
function get_numrows($query_id = -1) {
if ($query_id != -1) {
$this->query_id = $query_id;
}
return mysql_num_rows($this->query_id);
}
function get_insert_id() {
return ($this->connection) ? @mysql_insert_id($this->connection) : 0;
}
function get_next_id($column = "", $table = "") {
if (!empty($column) && !empty($table)) {
$sql = "SELECT MAX($column) AS max_id
FROM $table";
$row = $this->query_firstrow($sql);
return (($row['max_id'] + 1) > 0) ? $row['max_id'] + 1 : 1;
}
else {
return NULL;
}
}
function get_numfields($query_id = -1) {
if ($query_id != -1) {
$this->query_id = $query_id;
}
return @mysql_num_fields($this->query_id);
}
function get_fieldname($query_id = -1, $offset) {
if ($query_id != -1) {
$this->query_id = $query_id;
}
return @mysql_field_name($this->query_id, $offset);
}
function get_fieldtype($query_id = -1, $offset) {
if ($query_id != -1) {
$this->query_id = $query_id;
}
return @mysql_field_type($this->query_id, $offset);
}
function affected_rows() {
return ($this->connection) ? @mysql_affected_rows($this->connection) : 0;
}
function is_empty($query = "") {
if ($query != "") {
$this->query($query);
}
return (!mysql_num_rows($this->query_id)) ? 1 : 0;
}
function not_empty($query = "") {
if ($query != "") {
$this->query($query);
}
return (!mysql_num_rows($this->query_id)) ? 0 : 1;
}
function get_table_fields($table) {
if (!empty($this->table_fields[$table])) {
return $this->table_fields[$table];
}
$this->table_fields[$table] = array();
$result = $this->query("SHOW FIELDS FROM $table");
while ($row = $this->fetch_array($result)) {
$this->table_fields[$table][$row['Field']] = $row['Type'];
}
return $this->table_fields[$table];
}
function error($errmsg, $halt = 0) {
if (!$this->no_error) {
echo "<br /><font color='#FF0000'><b>DB Error</b></font>: ".$errmsg."<br />";
if ($halt) {
exit;
}
}
}
} // end of class
?>
Maweryk, maybe you can post yours db_mysql.php?
-
The problem is in ROOT_PATH setting:
define('ROOT_PATH', 'http://www.ipoding.ru/foto/');
include(ROOT_PATH.'config.php');
The path must be FULL LOCAL and NOT FULL INTERNET path. if you dont know the full local path to your 4images directory, then you should ask your host administrator.
What Maweryk showed you was an example of what they have on their server. You must adopt it to your server path.
-
Thanks v@no. Next time I should explain it better. :oops:
Cheers,
Markus
-
Thanks a lot!
It was as simple as
define('ROOT_PATH', './');
I just found it in lightbox.php (it was the first document I opend).
Also fixed some more things and it's working!
Thanks a lot!
-
Hallo,
hab den Mod grade erfolgreich(mit kleinen anpassungen) in mein wbblite/portal integriert.
Ein Problem hab ich noch:
Wie muss ich das ändern damit der Link in einem neuen Fenster geöffnet wird?
print("
document.write('<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a>');
");
-
z.B. so ... :wink:
... <a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a>...
-
hab ich schon versucht so, dann wird das bild überhaupt nicht angezeigt...
-
Habs jetzt selbst rausgefunden...
So muss es aussehen:
<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\" border=\"1\"></a>
-
ja, ... genau ... :mrgreen:
-
Hallo!
Ich bekomme es auch nicht auf die Reihe, ein Zufallsbild in meinem Portal anzeigen zu lassen.
Ich fang am besten ganz von vorne mit meinen Unklarheiten an *hehe*:
Ich habe auf meinem Webspace ein 4images Verzeichnis und eins für das Forum (wbblite)
1)
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', './4images/');
Hier muss ich die URL zu meiner Galerie angeben, richtig?
Wäre das hier dann korrekt?:
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', '.http://www.abc.de/4images/');
2)
In welches Verzeichnis muss die random.php? Ich habe sie in das Hauptverzeichnis von 4images kopiert!?
Oder muss die random.php gar nicht als Datei irgendwo rein, sondern nur der Code irgendwo integriert werden in eine bestehende Datei?
3)
Wenn ich das Modul über iFrame einbinden möchte, als eine Portalbox, muss ich dann nur die URL zu der Datei angeben, also:
http://www.123.de/4images/random.php
?
...oder benötige ich dazu irgendwo diesen Code:
<?php
include("./random.php");
?>
?
----------
Tut mir Leid, dass ich das nicht auf die Reihe kriege...
Hoffe trotzdem auf Hilfe ;)
Grüße
WoD
-
zu 2:
Ich hab die random.php in /4images
zu 3:
Binde es am besten über JavaScript ein.
z.B.:
<SCRIPT language='JavaScript' src='http://www.***.de/4images/random.php'>
Hab das so in einer Portalbox bei mir stehen.
Hab Dir meine random.php angehängt, da waren noch andere Änderungen nötig, musst nur die Adresse anpassen, damit müsste es eigentlich funktionieren.
-
a) Hm, wenn ich das so in die Portalbox schreibe, wird mir der Kalender(!?) angezeigt :|
b) Es ist bei der Angabe der URL in der random.php dorch richtig, dass vor dem http ein Punkt ist?
'.http://...
-
nein kein punkt
welches portal hast du denn?
-
Das Portal Lite für das Woltlab Burning Board Lite
-
Also: Ich verwende nun die von dir verwendete random.php, bekomme aber folgende Fehlermeldung beim direkten Aufruf der .php im Browser:
Fatal error: Cannot instantiate non-existent class: db in /usr/export/www/vhosts/funnetwork/hosting/donrenato/4images/random.php on line 35
Linie 35 entspricht:
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
Muss ich da nun weitere Angaben zu meiner mySQL Datenbank machen oder wie?
Falls ja, was muss ich da ersetzen?
Grüße
WoD
-
nein, das müsste so laufen. Hab sonst keine Änderungen gemacht...
-
Hm, ich teste es nochmal mit einem anderen Browser...
Und ich muss in der random.php wirklich nur den Pfad zu 4images (ist 4images hier gleichbedeutend mit Galerie oder muss ich quasi nach /4iamges/data/... verlinken?) und zum Java Script verlinken?
Keine weiteren Änderungen vornehmen?
Grüße
WoD
-
poste mal deine random.php
Zu welchem JavaScript willst du verlinken? Das ist nur für die Portalbox, damit wird die php aufgerufen.
-
Gut, die Ordnerstruktur auf der Hauptseite meines FTP-Servers sieht wie folgt aus:
->wbblite
->4images
Die random.php habe ich im Ordner 4images.
Die portal.php liegt direkt im wbblite Ordner.
Meine random.php
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', 'http://donrenato.funpic.de/4images/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
define('SCRIPT_URL', 'http://donrenato.funpic.de/4images/');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
print("
document.write('<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"><img src=\"".$thumb_src."\" border=\"1\" alt=\"$image_name\"></a>');
");
?>
Hier die Fehlermeldung bei direktem Aufruf der Datei im Browser:
http://donrenato.do.funpic.de/4images/random.php
-
OK, ändere
define('ROOT_PATH', 'http://donrenato.funpic.de/4images/');
in
define('ROOT_PATH', './');
-
Hm, Bilder werden aber noch immer nicht angezeigt, jedenfalls nicht sichtbar *hm*
Klickt einfach mal den Link zur random.php an, da seht ihr sowas "halbes".
Grüße
WoD
-
bei mir kommt bei dem Bild:
404: Die angeforderte Datei ist leider nicht verfügbar!
EDIT: Achso, das verweist auf den /wbblite ordner und nicht in den /4images
http://donrenato.funpic.de/wbblite/data/thumbnails/24/IMG_0445.JPG
Kann es sein das du immer noch eine falsche random.php auf dem server hast?
schick mir doch nochmal die aktuelle random.php.
-
Hm, irgendwiee abenteuerlich, dass ich das nicht auf die Reihe kriege :oops:
Hier meine aktuelle random.php, so wie sie jetzt gerade auf dem ftp-Server liegt:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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');
define('SCRIPT_URL', 'http://donrenato.funpic.de/wbblite/');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
print("
document.write('<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"><img src=\"".$thumb_src."\" border=\"1\" alt=\"$image_name\"></a>');
");
?>
Grüße
WoD
-
aja kein wunder ;)
ändere
define('SCRIPT_URL', 'http://donrenato.funpic.de/wbblite/');
in
define('SCRIPT_URL', 'http://donrenato.funpic.de/4images/');
-
Super!! :D Dankeschön :) Funktioniert jetzt alles 1A *ThumbsUp* :)
-
Hi!
Also ich hab auch den "security"-Fehler, möchte jetzt das der Link nichtmehr auf die Galerie zeigt sondern auf das Galerie-Modul selbst...
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_top\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Wie muss diese Zeile dann heißen ?
Noch besser wäre ja eine Lösung für den Security-Fehler :-(
GreeTzzZ
EggL
-
was meinst du mit galleriemodul?
Gib mal en Link.
-
Hello,
Great plugin!
My issue is that the database call needs to be closed in Random.php so that the remaining php includes in my WordPress page work properly.
Currently, I include this code which works great:
<?php include ("random.php"); ?>
Unfortunately, any WordPress includes that come after the above include, try to look up their tables in the gallery database, causing db errors.
The WordPress includes look like this:
<?php wp_list_pages('title_li='); ?>
Error message on the page for this Include is this:
WordPress database error: [Table 'mm_gallery.wp_posts' doesn't exist]
SELECT * FROM wp_posts WHERE post_status = 'static' ORDER BY post_title ASC
I'm too new at this, but what I think needs to be done is to somehow terminate the db connection iin Random.php so that the remaining includes on the page will work.
In Random.php, I've tried adding mysql_close($foobar); after the three echo lines (66, 67, 68) but nothing happens.
Then, if I remove $foobar from between the parenthesis, the errors go away, but so to any WordPress includes. But the random picture works though!
Next, I tried adding $db->db_close&; in the same location in Random.php, however, that killed the entire remaining page contents after the random.php include!
Not sure what I'm looking for here. Apparently WordPress uses it's own include mechanism which is what's creating some of these issues. I've posted over there about this problem as well, but no on seems to know.
Thanks!
-
Hi Leute,
ich habe eine kleines Problem mit der random.php (http://www.hairstories.de/bilder/random.php/).
Es hat eigentlich alles Funktioniert.
Nur mir wird kein Bild angezeigt, sondern nur ein Weißes viereck mit einen roten Kreuz drin.
Ich muß dazu sagen, das meine Bilder zwar auf dem gleichen Server liegen, wie das Script, aber nicht im gleichen verzeichnis.
mfg Dom :)
E Hi people,
I have small problem with random.php (http://www.hairstories.de/bilder/random.php/). It actually functioned everything. Only to me no picture, but only white a square with red cross is indicated in it. I must say to it, who my pictures lie on the same server, like the Script, but not in the same listing.
mfg Dom :)
-
I have a question, if I run my 4images program on a subdomain what should I write then?
like this http://gallery.yoursite.com ???
-
As long as your subdomain is pointing to the same server where your 4images is, then you dont need to change anything, just make sure paths within the mod are correct.
If subdomain pointing to a different webserver (computer), then I doubt you can use this mod. You will only be able retrive the image file itself, without any information such as name, category, etc.
-
i have the gallery on the same domain and some ip address, but what should I write? (the code)
-
why this error show?
Security violationSecurity violation
Fatal error: Cannot instantiate non-existent class: db in /home/neshoni/public_html/gallery/random.php on line 34
-
Probably ROOT_PATH is not correct
-
Hi there!
great mod, but I have a problem,
I am using this on www.bonjovi.pl, right bottom.
I am also using a stat script. This script uses classes named just like the ones in 4images, for example "db".
When I add "random image" to my webiste the stat script is not working.
Is there other way to include the "random image", maybe with js or something?
I can post that script, but all its system uses this clases and I can't rename it.
What should I do?
-
You can modify includes/db_mysql.php and save it as includes/db_mysql_new.php
and then update this line:include(ROOT_PATH.'includes/db_mysql_new.php');
in random.php
-
thank you, it was simple as hell, but real hard for me to think of...
Innymi słowy, proste jak jebanie ;)
-
hallo
wer kann mir weiterhelfen.
ich habe die mod... für random und zufallsbild von hier. ich weis nicht wie ich sie in meinem forum einbinden muss, damit ich ein zufallsbild und die 5 neusten bilder auf der startseite angezeigt kriege
ich nutze das phpkit 1.6.1 für meine webseite.
-
@hobit
hast du eine homepage?
-
Hallo Vincent
Ich habe eine Page, die für über 18 ist.
Dort sollen auch Bilder gezeigt werden, wie ich auf der Startseite mit anzeigen lassen will
-
Hallo Vincent
Hier der Link zu meiner Seite
www.real-sex-kontakt.de/member (http://www.real-sex-kontakt.de/member)
Vielleicht hilft das weiter
-
Hallo ich habe meine random.php denke ich hinbekommen
zumindest kann ich sie im browser öfnen und ein bild sehen.
http://mark-foto.dyndns.org/xampp/4images/random.php
ich hätte sie aber gern unter dem letzten botten links was bzw wie muss ich das machen
in welchen dateien wird was Geändert ?
um es dort da zustellen ?
http://mark-foto.dyndns.org/xampp/4images/
ich finde leider keine anwort bei euch weil mein englisch auch nicht das beste ist.
kann mir jemand helfen?????
-
Hi McMark,
du mußt alle Dateien ändern, wo du dein Menü eingtragen hast ändern.
Alle Dateien befinden sich im Templateverzeichnis drin.
- categories.hml
- details.html
- error.html
- home.html
- lightbox.html
- member.html
- postcard_create.html
- register.html
- search.html
- top.html
Viel Spaß!
mfg Dom :) [/color]
-
Okay wird gemacht :D
aber was ändere ich jetzt??? :?:
muss da das "<?php include("./random.php"); ?>
rein????
danke für dir hilfe
gruss McMark
-
@mcmark
Habe bei Dir auf der Seite geschaut, was hast Du gemacht, das die Thumbs angezeigt werden?
bei mir zeigt 4images keine thumbs an, obwohl auf Utothumbs erzeugen steht
-
Hi McMark,
genau so muß du es machen. Dann sollte es funktionieren.
mfg Dom :)
-
Hallo Dom01
ich habe alle datein die du aufgeliste hast geändert und in die zeille wo (random_image) stand
<?php
include("./random.php");
?>
eingetragen aber es tut sich garnichts
hast du noch eine idee
oder kann mir noch jemand helfen???
danke für jede hilfe
Gruß McMark
-
Hi McMark,
schick mir mal den Quellcode per PM von der Home.html .
mfg Dom :)
-
Hallo Dom01 schau mal bei mir rein hat geklapt :D danke :mrgreen:
ich habe in
categories.hml
details.html
error.html
home.html
lightbox.html
member.html
postcard_create.html
register.html
search.html
top.html
unter <?php include("4blueo1.php"); ?></p>
<?php include("http://den genauen pfart der random angegeben /random.php"); ?></p>
und siehe da es klappt danke
-
Hi Mark,
das freud mich, daß es entlich funktioniert. Aber ich frage mich wirklich, warum das nicht gleich funktioniert hat.
mfg Dom :)
-
ich weis nicht warum ????
ich feu mich auch das es jetzt klappt
danke noch mal werde mich jetzt dem nächsten mod zuwenden.
gruß McMark
-
Hi, I guess I'm rather late with this - I have a problem. I'm not sure if it was covered, I can't really follow the thread well with the two languages mixed together, lol.
Umm, so this random.php file works and everything: http://pink-pistol.net/gallery/random.php
But when I try to include it on my page, here: http://blog.pink-pistol.net it doesn't show up. Instead of the thumbnail it shows the alt text or something.
Oh, and can I get rid of the "comments (x)" link or no? It's not a big deal if not.
Thanks!
xo - Ashley
-
You random.php file is located in gallery folder so you must update
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', './4images/');
line in order to show it on your home page. Other words, you can not use same script to show random image on home page and in gallery folder. Move the random.php into your root directory and update the line above.
As of comments thingie, remove this line:echo "Comments: $image_comments<br>\n";
P.S. I could not find any random image referrence on your home page...
-
I'm still having problems... could you tell me exactly what to put? I've been fooling around with the path and placing the random.php file in different folders (including my main directory) but it just doesn't show up. I don't get errors, I just can't see an image - only a link.
There was no mention on my blog of a random image because I removed it - I don't want people seeing my site all screwed up, of course.
Here is my random.php file (it's in my main public_html folder)
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './gallery/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
?>
(you can see that it works, here: http://pink-pistol.net/random.php)
Now, here is part of my header for my blog. I've tried the root path and just the url.
<p class="head" align="left">Random Photo</p>
<?php
include("http://pink-pistol.net/random.php");
?>
Please help!
Thanks <3
-
You can not use full internet path in the include. use
include("random.php");
-
Okay... I tried that and I just get errors. The page I'm trying to include it on is in a directory called /blog - so do I need the random.php file in the /blog directory or what? Nothing is working, ugh.
I also tried including /home/pink/public_html/random.php
-
Hallo,
ich hab ebenfalls ein Problem mit dem Random Mod. Habe die random.php in das Hauptverzeichnis meiner Webseite gelegt und unter \templates\meintemplate\index.html folgedes include eingefügt.
<?php
include("./random.php");
?>
In der random.php lautet der Rootpfad:
define('ROOT_PATH', './galerie/');
Die Galerie liegt also unter www.domain.de/galerie
Wenn ich das ganze nun ausführe erhalte ich folgenden Fehler:
Warning: include(../random.php) [function.include]: failed to open stream: No such file or directory in F:\apachefriends\xampp\htdocs\Homepage\includes\template.php(101) : eval()'d code on line 44
Warning: include() [function.include]: Failed opening '../random.php' for inclusion (include_path='.;F:\apachefriends\xampp\php\pear\') in F:\apachefriends\xampp\htdocs\Homepage\includes\template.php(101) : eval()'d code on line 44
PS: Wird noch eine Datei namens random_mod.php benötigt? Hierzu finden sich im ersten Beitrag dieses Threats keine weiteren Infos. Nutze MYSQL5
-
Liest hier niemand mehr ? :(
-
anscheinend nicht.....
ich bekomme es in zusammenhang mit dem wbblite nicht zum laufen. ich bekomm zwar ein bild angezeigt im portal,allerdings hängt dann press unter dem bild der kalender mit dran. wenn ich die random.php jedoch im browser aufrufe,dann kommt nur das bild an sich. vielleicht kann oder will ja mir jemand helfen.....
-
Okay, this is pretty much driving me crazy...
It works by itself: http://pink-pistol.net/random.php
It KIND OF works when i include it into my blog page as well - there are no errors, but it just shows the link and no image. It's obviously not getting the right url to the image... this should be a simple problem to fix, can anyone help?
My blog is on a subdomain. So right now I'm trying to include random.php that is in my main directory, into the /blog directory. Understand?
-
On top of the file insert:
define("URL", "http://yourdomain.com/4images/"); //full internet path to your 4images with trailing slash!
And then replace$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
With:$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
-
Servus,
vielleicht habe ich etwas übersehen. Vielleicht aber auch nicht..
Folgendes: Besteht die Möglichkeit, Zufallsbilder auf dem Main und einem externem Server anzeigen zu lassen.?
Zufallsbilder werden normal angezeigt. Der Pfad ist standart. MainServer/gallerie/
Nun greife ich auch auf externe Bilder durch ein plugin zu. Leider kann mir Random Picture diese nicht anzeigen. Gibt es vielleicht ein wenn/oder Funktion?
Gruß, Phil
-
i love this mod and it works great..i was wondering if theres one to show the 5 most recent photos on your blog?
-
hallo zusammen
also ich habs gestern fast 3 stunden verucht, aber leider ohne erfolg.
wp muss ich die random.php datei rein kopieren? in die 4images root oder in mein portal root?
und was steht im random_mod.php
vielen dank
gala
-
bei mir zeigt es leider nur die photos an zu denen auch jeder gast zutritt hat
all die photos in den kategorein wo nur angemeldete user zutritt haben werden nicht angezeigt
wie kann man das ändern ?!
aber da sind ziemlich komische fetzen in dem code
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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) fur *
* 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', './4images/'); // change this to your 4images dir.
include(ROOT_PATH.'global.php');
$new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
$sql = "SELECT IF(a.image_date >= $new_cutoff,RAND()+1,1) as random_no, a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_thumb_file, a.image_comments, a.user_id
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."
ORDER BY random_no DESC, RAND()
LIMIT 1";
$row = $site_db->query_firstrow($sql);
$image_extention = get_file_extension($row['image_media_file']);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
if (empty($row['image_thumb_file'])) {
$thumb_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
}
if (!check_thumb_type($image_extention)) {
$full_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
}
$full_src_link = ROOT_PATH."details.php?image_id=$image_id";
?>
-
Hi Leute,
ich habe es schon Lange mit dem Random-image aufgeben.Weil es nur Bilder zeig, die für alle User sichtbar sind.
Ich habe dafür ein kleines Bannerrottationsprogramm eingesetzt.
Gut, man muß alles Bilder per URL einschreiben, und wenn einer auf ein Bild klick, kommt er zur Galerie-Indes-Datei. Wo sich jeder Besucher Regestrieren kann bzw. Einlogen kann.
mfg Dom :D
-
@bayerns-elite:
A link to the post where you got that code from would be more helpfull ;)
-
@bayerns-elite:
A link to the post where you got that code from would be more helpfull ;)
i have already notified that post to the mods/admins
but here is it
http://www.4homepages.de/forum/index.php?topic=1020.msg17715#msg17715
on page 12
its your post
-
DOH! :oops:
anyways, the code is fixed now.
-
thanks,
but when i open the random.php , the page is only white
no pics..... :?:
-
can anybody test the code ?
-
http://4homepages.de/forum/index.php?topic=1020.msg12102#msg12102
-
Ich habe den Mod eingebaut und er funktioniert einwandfrei. Ich benutze das Random Image als Banner für andere User und habe es folgendermassen eingebunden.
Originaldateihttp://www.nicky.net/4images/random.txt
Suche in der Random.php
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
-------------------------------------------------------------------------------------------------------------------
Ersetze durch
echo "<img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"><br>\n";
?>
--------------------------------------------------------------------------------------------------------------------
Code zum einbinden in eine externe HP.
<a href="http://www.your-domain.com" target="_blank"><font face="tahoma" size="2" color="#000000"><u>Your Text</u></font></a><br>
<iframe src="http://www.your-domain.com/random.php" frameborder="0" marginheight="0" marginwidth="0" height="150px" scrolling="no" width="150px"></iframe>
-------------------------------------------------------------------------------------------------------------------------
Demo hier
http://www.fotogalerie-helgoland.de/linkliste/banner.html
--------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
I have installed this mod without problems. I use it for other Homepages banner linking to my page.
Originalfilehttp://www.nicky.net/4images/random.txt
Search in random.php
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
-------------------------------------------------------------------------------------------------------------------
Replace with
echo "<img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"><br>\n";
?>
--------------------------------------------------------------------------------------------------------------------
Code for external homepage
<a href="http://www.your-domain.com" target="_blank"><font face="tahoma" size="2" color="#000000"><u>Your Text</u></font></a><br>
<iframe src="http://www.your-domain.com/random.php" frameborder="0" marginheight="0" marginwidth="0" height="150px" scrolling="no" width="150px"></iframe>
-------------------------------------------------------------------------------------------------------------------------
Demo here
http://www.fotogalerie-helgoland.de/linkliste/banner.html
Done!
-
On top of the file insert:define("URL", "http://yourdomain.com/4images/"); //full internet path to your 4images with trailing slash!
And then replace$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
With:$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Just wanted to say thanks for the help. I finally checked back here and everything works great now :)
xoxo
-
so....ich versuche es nochmal....
habe nun erneuet versucht den mod zu integrieren in das portal meines wbblite.
mittlerweile finde ich den thread sehr unübersichtlich.
wäre es vielleicht möglich, dass jemand,der den mod schon erfolgreich eingebaut hat, mir seine lösung hier mal postet?! so richtig step by step mit allem was dazu gehört...
ich glaube das würde nicht nur mir sehr helfen....
sollte sich einer dazu aufraffen, dann danke ich im namen aller schonmal im voraus!!
-
Version 1.71! Der Mod läuft perfekt. Wo hakt es denn? :roll:
-
Version 1.71! Der Mod läuft perfekt. Wo hakt es denn? :roll:
hm,ich glaube ich habe ienfach die übersicht verloren in dem thread hier. deshalb ja die bitte, den funktionierenden code bitte nochmals übersichtlich schreiben.
**************************edit:
bekomme u.a. folgende fehlermeldung:
Warning: main(): URL file-access is disabled in the server configuration in /home/www/web2671/html/newgalerie/random.php on line 30
-
hilfe ich bin doch zu blöde, aus irgendeinem grunde werden bei mir nicht die cat´s ausgelesen, statt des zufallbildes findet er nix und zeigt an das er das bild dort sucht: http://www.kaihundacker.de/wbb/4images/data/thumbnails//
finde den fehler nicht, wer kann mir helfen ?
-
Wie kann ich die Klicks noch mit einfügen? Es hat zwar schon mal einer geschrieben, es wurde aber nur indirekt beantwortet. Und wie kann ich die Farbe und Schriftgröße ändern?
-
Hi,
hab mir jetzt alle 22 Seiten durchgelesen, aber ich find meinen Fehler einfach nicht ..bin wohl echt zu blöd :twisted:
Ich hab mir die register.php in mein Homepageverzeichnis gelegt und nach
include(ROOT_PATH.'includes/constants.php');
habe ich
define('SCRIPT_URL', 'http://leewicked.le.funpic.de/hp/4images/');
eingefügt, da die galerie auf einem anderem server liegt.
Den folgenden Code
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
hab ich durch diesen ersetzt
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
So und auf der Indexseite meiner Homepage habe ich an der gewünschten Stelle das
<?php
include("./random.php");
?>
eingefügt.
die index.php und random.php habe ich dann in das selbe verzeichnis auf meinem homepageserver geladen. an der galerie selber brauch ich ja nichts verändern oder?
Trotzdem bekomme ich immer folgende Fehlermeldungen:
Warning: main(./4images/config.php): failed to open stream: No such file or directory in /home/craving/public_html/leewicked/random.php on line 30
Warning: main(./4images/config.php): failed to open stream: No such file or directory in /home/craving/public_html/leewicked/random.php on line 30
Warning: main(): Failed opening './4images/config.php' for inclusion (include_path='.:') in /home/craving/public_html/leewicked/random.php on line 30
Warning: main(./4images/includes/db_mysql.php): failed to open stream: No such file or directory in /home/craving/public_html/leewicked/random.php on line 31
Warning: main(./4images/includes/db_mysql.php): failed to open stream: No such file or directory in /home/craving/public_html/leewicked/random.php on line 31
Warning: main(): Failed opening './4images/includes/db_mysql.php' for inclusion (include_path='.:') in /home/craving/public_html/leewicked/random.php on line 31
Warning: main(./4images/includes/constants.php): failed to open stream: No such file or directory in /home/craving/public_html/leewicked/random.php on line 32
Warning: main(./4images/includes/constants.php): failed to open stream: No such file or directory in /home/craving/public_html/leewicked/random.php on line 32
Warning: main(): Failed opening './4images/includes/constants.php' for inclusion (include_path='.:') in /home/craving/public_html/leewicked/random.php on line 32
Fatal error: Cannot instantiate non-existent class: db in /home/craving/public_html/leewicked/random.php on line 35
Wo liegt mein Fehler? 8O
Freu mich über jede Hilfe!
Danke!
-
Hi,
ich möchte unter dem Random-Image außer dem Bild-Namen noch die Unterkategorie mit Link anzeigen lassen. Die Kategorie bekomme ich angezeigt, aber nicht die Unterkategorie. Hier ist das Ganze zu sehen: http://www.mirandus.de
Und so sieht mein Code aus:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './gallery/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, b.cat_name
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
order by image_id desc limit 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$cat_name = $row['cat_name'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_blank\"><img src=\"".$thumb_src."\" alt=\"$image_name\"></a><br>~$image_name~<br>($cat_name)\n";
?>
Was muss ich da ändern ? Wäre klasse wenn mir da jemand helfen könnte :)
LG,
Miranda
-
*schieb* :lol:
kann mir wirklich niemand sagen wo in meinem Code der Fehler ist ? Ich habe inzwischen auch feststgestellt, dass zwar auch Unterkategorien angezeigt werden, aber die falschen. Ich habe eben noch ein Bild hochgeladen und darunter steht jetzt Portraits, dabei ist es Fantasy :roll:
Ich bin für jede Hilfe dankbar :)
LG,
Miranda
-
Hallo zusammen,
Ich bin nun auch schon den ganzen tred von vorn bis hinten durchgegangen aber nicht fündig geworden...
Und da hier ja noch nicht caos genug hersch geb ich nun auch noch einen zum besten...
Ich nutze phpkit mit 4images, habe mir eine navbox angelegt navbox.random.php
wenn ich die navbox nun in das kit mit einbinde erscheint auch ein bild aber oben links in der ecke und nicht in der navbox warum?!
nabox.random.php
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', '4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
// *echo "<b>$image_name</b><br>\n";/
// *echo "Comments: $image_comments<br>\n";/
?>
(http://slip4fight.de/pics/t_picfehler.jpg) (http://slip4fight.de/pics/picfehler.jpg)
Wo ist der fehler zu suchen ?! :?
MFG
Joki
-
Ich würde sagen du musst die Navbox erstmal mit einer Seite füllen und in diese Seite dann das Script includieren.
-
Hallo Amosnet,
Also mus ich in die navbox.random.php das script includen also selber inhalt in z.b. random.php?!
Aber was soll ich da dann noch rein machen damit es zu einer seite wird die dann das bild an der richtigen stelle anzeigt?!
Leider bin ich in php noch nicht so der held *g*
Danke für jede hilfe
mfg
Joki
-
Probier mal das Script in der navbox.random.php zu includieren, das sollte funktionieren.
-
habe ich versucht..
navbox.radom.php
<?php
include("randompic.php");
?>
randompic.php
das script
bekomme ich nur
Warning: main(randompicphp): failed to open stream: No such file or directory in /var/www/html/web81/html/slipHP/navigation/navbox.random.php on line 2
Warning: main(): Failed opening 'randompicphp' for inclusion (include_path='.') in /var/www/html/web81/html/slipHP/navigation/navbox.random.php on line 2
-
wo liegt denn dein Ramdom.php??
-
im selben ordner also /navigation/
-
OK bin schonmal ein stück weitergekommen...
durch die erweiterung/änderung
...
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
$boxlinks[]="<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
// *echo "<b>$image_name</b><br>\n";/
// *echo "Comments: $image_comments<br>\n";/
?>
ich habe das echo gegen $boxlinks[]= ersetzt...
Nun habe ich das Problem das zwar das bild angezwigt wird nur wenn einer in der shortbox was schreibt und abschickt bekommt er diese fehlermeldung:
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/web81/html/slipHP/navigation/navbox.random.php:3) in /var/www/html/web81/html/slipHP/navigation/navbox.laberecke.php on line 77
Kann mir einer sagen was das bedeutet also wo ich den fehler nun suchen mus?!
MFG
Joki
-
Wei keiner wie man den fehler entgegenwirken kann?! :(
-
Hallo,
bei mir laüft das Script einwandfrei. Jetzt möchte ich aber statt des Thumbnails das "große" Bild als Random-Image anzeigen lassen. Was muss ich im Script dafür ändern ?
Danke schonmal :)
LG,
Miranda
-
hi i want random image in 6 image but show 1 image please help me
-
Hallo,
ich habe mir jetzt den ganzen Thread von vorne bis hinten durchgelesen und alles mögliche ausprobiert, aber ich krieg das einfach nicht hin. Ich möchte die Zufallsbilder meiner 4images-Galerie in meinem phpkit anzeigen lassen. Kann mir bitte nochmal jemand erklären, was ich genau mit dem script machen muss, wohin ich es installieren muss, was ich angeben muss usw. ? In englisch bin ich nicht besonders gut.
LG Unipandra
-
ok, nach dem 5. mal durchlesen dieses Threads habe ich es hingekriegt. Aber weiß jemand, wie ich die Zufallsbilder in die Navbox vom phpkit kriege?
-
Könnte man unter dem Zufallsbild auh den User-Namen einblenden?
Is it possible to show the User-Name under the Random-Pic?
Dank und Gruß
Daniel
-
Hey, works fine, thanks :)
How can I get the username of the user who posted the image within that query? I'm using this to show random pics from my member gallery, but they sometimes don't use their names in the image titles, so it would be good to have a username to assign it to ;)
(Edit: Huch, jetzt fang ich schon an in deutschen Foren englisch zu schreiben, ich geb mich natürlich auch mit ner deutschen Antwort zufrieden :D)
-
Hallo, ich habe mal ne Frage zu dem Zufallsbild Mod.
Das Einrichten ist ja ziemlich einfach wenn man sich vorher alles genau durchliest.
Jedoch habe ich noch folgende Probleme bzw. Fragen.
Ich möchte das Zufallsbild nur auf einer externen Seite anzeigen lassen ohne das
darauf geklickt werden kann, da ich 4images in einem IFrame laufen habe und das
sonst bei mir nur Chaos gibt. Was muss also in der random.php gelöscht werden
ohne das ich sie zerstöre ?
Bei mir kann jedermann alle Vorschaubilder (Thumbs) sehen. Jedoch muß, wer das
vergrößerte Bild sehen will, eingeloggt also Registriertes Mitglied sein.
Bei dieser Einstellung kann ich aber kein Zufallsbild angezeigt bekommen.
Warum nicht ? Das Zufallsbild soll doch nur das Thumbnail Bild sein, welches doch
sowieso jeder sehen kann.
Gibt es hierfür eine Lösung ?
Vielen Dank schon mal im Vorraus
-
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Das solltest Du ändern...
-
So, habe die betreffende Stelle geändert und es funzt auch prima.
Jedoch ist da immer noch das Problem mit dem Registrierten Mitglied.
Kann man das nicht irgendwie umgehen, da ja nur die Thumbs angesprochen
werden sollen ohne Verlinkung auf das vollständige Bild.
-
AND b.auth_viewimage=".AUTH_ALL."
An beide Stellen löschen und dann sollte das funzen... Hoffe ich... (o:
-
Hat leider immer noch nicht geklappt. Funktioniert wohl nur wenn ich eine Kategorie für Alle freigebe.
Bei mir soll sich halt jeder vorher registrieren. Das Zufallsbild hatte ich für meine Startseite gedacht.
Sollte es da keine Möglichkeit geben dieses so zu ändern das man ein Zufalls Thumb sehen kann,
habe ich eben Pech gehabt. Sollte doch noch jemand ne Idee haben würde ich mich freuen. :D
-
Hi all, script Random Pic. is very useful for my site, I have integration vbulletin forum + 4images, but when i try 2 include file with your code, i get many error like "error on lin 217". Is it possible to make Rand Pic Mod without use 4images functions? THNKS
-
Hallo,
Das script an sich funtkioniert, als es zeigt bilder an, allerdings nimmt es nur bilder aus 2 bestimmten kategorieen.
Ist das normal, wie kann ich das ändern ?
-
Hallo,
Das script an sich funtkioniert, als es zeigt bilder an, allerdings nimmt es nur bilder aus 2 bestimmten kategorieen.
Ist das normal, wie kann ich das ändern ?
bitte als erstes, deine site anzeigen wo die bilder dargestellt werden.. und dann die galerie.. wäre ja vom vorteil. weil so, kann ich nur raten (vielleicht andere kategorien für die "öffentlichkeit" nicht sichtbar)..
-
ja wohl genau das wars *g* Vielen dank das hat mir sehr weitergeholfen :)
-
Masilius
-
Hallo!
Bei mir hat das Script immer einwandfrei funktioniert. Aber plötzlich wird einfach kein Bild mehr angezeigt bzw. nichts mehr von der Datenbank geholt scheint mir:
www.konradin.net holt sich die /galerie/random.php die wie folt aussieht (exkl. Copyright):
<?php
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', 'galerie/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<div style=\"float: left; background-color:#d3ca91;padding:1px\"><a href=\"".ROOT_PATH."img".$image_id.".htm\"><img src=\"".$thumb_src."\" border=\"0\" style=\"border: 6px solid white;\" alt=\"".$image_name."\" /></a></div><br style=\"clear:both;\"/>\n<br />\n";
echo "<b>".$image_name."</b><br />\n";
echo "Kommentare: ".$image_comments."<br />\n";
?>
Bitte helft mir - weiß keinen Lösungsansatz - vor allem weil ich nichts verändert habe und es einfach nicht mehr funktioniert. Als einzige Veränderung fällt mir der Einbau von Google Analytics ein aber weiß nicht ob der Fehler schon vorher war und kann ja eigentlich nichts zu bedeuten haben.
Vielen vielen Dank!
Gruß K,
-
da steht komischerweise >
<a href="galerie/img.htm"><img src="galerie/data/thumbnails//" border="0" style="border: 6px solid white;" alt="" /></a>
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
Registriere dich, um dieses Bild groß; anzuschauen!
wird vielleicht das der grund sein?
-
Du meinst, dass die Bilder gesperrt sind? Ich sehe das Zufallsbild auch nicht im eingeloggten Zustand und außerdem sind nur die Großansichten, nicht aber die Thumbs gesperrt. Hmm - was könnte noch die Möglichkeit sein? Kann auch noch andere Codes posten wenns hilft :-)
Bitte helfen! Danke! :-)
Gruß K
-
egal ob eingelogt oder ausgelogt, thumbnail oder nicht..
du verbietest das man auf die thumbnails klickt.. und damit zeigt random nichts.
-
Ich weiß allerdings nicht, woher du diesen Satz mit dem "Registriere dich, um ..." her hast - der kommt an diese Stelle der Galerie gar nicht vor - zumindest nicht bei mir?! Der sollte nur kommen, wenn ein Bild angezeigt wird, zu dem keine Berechtigung in der großen Version besteht - ich kann ihn auch nicht im Quellcode sehen..
Was müsste ich also tun, wenn du recht hast?
Vielen Dank nochmal!
Gruß
-
wenn das grosse bild nicht angezeigt werden darf, wird auch der thumbnail nicht in der random angezeigt.
probiere dies aus beiden queries zu löschen
AND b.auth_viewimage=".AUTH_ALL."
-
Vielen Dank! Es funktioniert tatsächlich :-) Freue mich, wie gut die Hilfe hier funktioniert :-)
Gruß
-
Please can any one upload this file again "random.txt"
becuase I'm in kuwait and here they blocked "www.Nicky.com"
So Please help, I need this command
-
I've attached the random.txt to the first post (http://www.4homepages.de/forum/index.php?topic=1020.msg4324#msg4324).
-
Thanks man
-
How it is possible to make to visualize alone photograph of a category?
Thanks
-
AND a.cat_id = b.cat_id replace this with the cat_id.... (2 times!!!)
-
I do not understand... my category is the 9 how I should put?
$sql = "SELECT COUNT(*) as total_images
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."
-
$sql = "SELECT COUNT(*) as total_images
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id = 9
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
Try this....
But don't forget to change the another query...
-
It does not work...
-
########################################
$sql = "SELECT COUNT(*) as total_images
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id = '80'
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id = '80'
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
########################################
Replace the 80 with your cat_id... (o:
so it works on my site:
http://www.picsforfree.de/random.php
-
I found the problem...
It introduces the id of the specific category and not of the category in general...
How it is possible to make to see more categories?
Thanks
-
I am using the random_more_pics mod.
What I would like to show along with the name and comments is the rating of the image.
Is this possible? If so what do I need to change?
Sorry if this was already answered in a different language, all i know is english.
-
Not sure if I gave enough info on last post.
Do I need to do something like what was posted in this post on the random_more_pics.php like so?
$image_hits = $row['image_hits'];
$image_rating = $row['image_rating'];
and
echo "Hits: $image_hits<br>\n";
echo "Bewertung: $image_rating<br>\n";
I tried to figure this out before I asked.
If adding ratings is not possible is it possible for hits?
-
@ CeJay
... try this ...
echo "Hits: ".$image_hits."<br>\n";
echo "Bewertung: ".$image_rating."<br>\n";
-
@ CeJay
... try this ...
echo "Hits: ".$image_hits."<br>\n";
echo "Bewertung: ".$image_rating."<br>\n";
Ok I added that. Here is what I have on the php:
while ($row = $site_db->fetch_array($result)){
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$image_hits = $row['image_hits'];
$image_rating = $row['image_rating'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<table border='0' width='213' Align=left>\n";
echo "<TR>\n";
echo "<TD><a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a></TD>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD><b>$image_name</b></TD>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD>Comments: $image_comments</TD>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "Hits: ".$image_hits."<br>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "Rating: ".$image_rating."<br>\n";
echo "</TR>\n";
echo "</table>\n";
The tables are set to have the rows horizontal so that is why you see that.
I do have the listing for the ratings and hits, however nothing (the count) shows up next to them.
I did double check the images that loaded to see if there was at least hits and there was.
-
Nevermind I got it, something I should have seen from the start :oops:
I had
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
and needed
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_hits, a.image_rating
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
@ mawenzi
Thanks for your help, I appreciate it :!:
-
Ok this is diffecult to explain for me but i give it a trie.
First it is a good mod :D
My question:
My database have more 4 images tables
So the table database looks like this:
test_4images_categories
test_4images_comments
test_4images_groupaccess
test_4images_groupmatch
test_4images_groups
test_4images_images
test_4images_images_temp
test_4images_lightboxes
test_4images_postcards
test_4images_sessions
test_4images_sessionvars
test_4images_settings
test_4images_users
test_4images_wordlist
test_4images_wordmatch
test2_4images_categories
test2_4images_comments
test2_4images_groupaccess
test2_4images_groupmatch
test2_4images_groups
test2_4images_images
test2_4images_images_temp
test2_4images_lightboxes
test2_4images_postcards
test2_4images_sessions
test2_4images_sessionvars
test2_4images_settings
test2_4images_users
test2_4images_wordlist
test2_4images_wordmatch
How can i do so that the random.php randomise all off the images from the different 4images databases.
I hope you will understand my english :roll:
-
how do i get this to work as a module on my vbadvanced homepage? can anyone help me with that?
-
how do i get this to work as a module on my vbadvanced homepage? can anyone help me with that?
I don't know vbadvanced, but if you know where you want the image the put in a tag on the home page
<?php
include("./random.php");
?>
or create it in iFrame and call the random image in there.
-
Ich habe nun schon einiges gelesen und gestet, allerdings wird bei mir das thumbnail nicht angezeigt. Statt der kompletten Bildadresse kommt nur das hier:
http://duesipixel.de/random_full.php
<a href="http://duesipixel.de/details.php?image_id=1240"><img src="http://duesipixel.de/data/thumbnails/36/" border="0" alt="Jahresabschluss05 in Speyer"></a><br>
$row['image_thumb_file'] wird nicht umgewandelt?
Hier die random.php
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_full.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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
define('ROOT_PATH', '/home/w11854/web/public_html/newgalerie/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
define('SCRIPT_URL', 'http://duesipixel.de/');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id IN (35, 36, 58, 59, 61, 66)
AND b.cat_id IN (35, 36, 58, 59, 61, 66)
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_comments, b.cat_name
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id IN (35, 36, 58, 59, 61, 66)
AND b.cat_id IN (35, 36, 58, 59, 61, 66)
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$cat_name = $row['cat_name'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$cat_name\"></a><br>\n";
?>
Weiß jemand woran das liegt??
-
For all who don´t see an image and source code looks like
<img src="http://.../data/thumbnails/36/" border="0" ...>
this works
http://www.4homepages.de/forum/index.php?topic=1020.msg12102#msg12102
-
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id=2
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."<br>
LIMIT $number, 1";
Also das klappt bei mir wunderbar!
Ich möchte es so: meine Kategorie "Dogs" hat die "ID=1", hat aber mehrere Unterkategorien. Wenn ich nun in meiner "random.php" "AND a.cat_id=1" eingebe, werden wirklich NUR die Dateien aus der direkten Hauptkategorie ausgelesen, aber nicht die aus den Subkategorien.
Wie kann ich es ändern, dass auch die zugehörigen Unterkategorien von "ID=1" ausgelesen werden?
Danke
-
... verwende z.B. ...
AND a.cat_id IN (1,2,3,4,5,6,7,8,9)
... in der Klammer die Kategorie_IDs aufzählen, die gezeigt werden sollen ... :wink:
-
Mein Provider stellt zum 01. März 2007 auf PHP 5.2.0 um. Die random.php funktioniert bis dato unter PHP 5.1.4.
Ich kann nun testen ob alles mit der neuen PHP-Version klappt.
Einzig das Zufallsbild wird jetzt nicht mehr angezeigt, auch nicht der Bildname und die Comments.
Hab extra nochmal die Datei vom ersten Post genommen, ist das selbe.
Hat schon wer die random.php auf PHP 5.2.0 laufen?
PHP-Info: PHP-Info Version 5.2.0 (http://www.alphaville.nu/php_info.php) => leere Ausgabe
PHP-Info: PHP-Info Version 5.1.4 (http://www.block-a.de/php_info.php) => korrekte Ausgabe
-
Nun ist der 01. März vorbei die neue Version PHP 5.2.0 läuft und auch das Vorschaubild funktioniert. Vielleicht gingen nicht alle Funktionen während des Testbetriebes. Naja auch Wurst, MOD funktioniert auch mit PHP 5.2.0
-
Nun ist der 01. März vorbei die neue Version PHP 5.2.0 läuft und auch das Vorschaubild funktioniert. Vielleicht gingen nicht alle Funktionen während des Testbetriebes. Naja auch Wurst, MOD funktioniert auch mit PHP 5.2.0
Dank für das Informieren wir.
Traurig für schlechte Sprache, benutztes google translater zum zu reagieren
-
Hallo,
ich konnte es nur als iframe in meinem portal_body.tpl einfügen, da ich es anders nicht einfügen konnte.
Code: den ich in mein portal_body.tpl eingefügt habe und auch funktioniert bis auf den weißen hintergrund (siehe Bild unten)
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th height="28"><b>:: {actualstats55} ::</b></th>
</tr>
<tr>
<td class="row1" align="center"><iframe name="I1" scrolling="no" valign="middle" border="0" frameborder="0" src="http://www.gibsy.com/dim/random.php" width="100%" height="100%">Ihr Browser unterstützt Inlineframes nicht oder zeigt sie in der derzeitigen Konfiguration nicht an.</iframe></center>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="tbl"><tr><td class="tbll"><img src="images/spacer.gif" alt="" width="8" height="4" /></td><td class="tblbot"><img src="images/spacer.gif" alt="" width="8" height="4" /></td><td class="tblr"><img src="images/spacer.gif" alt="" width="8" height="4" /></td></tr></table>
<br>
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
kann man es anders auch einfügen, außer als iframe :?: ich bekomme es nicht hin :cry:
wenn es anders auch geht, welchen link oder code muß ich in den unteren code da wo XXXX steht einfügen :!:
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th height="28"><b>:: {actualstats55} ::</b></th>
</tr>
<tr>
<td class="row1" align="center"><XXXXXXXXXXX></center>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="tbl"><tr><td class="tbll"><img src="images/spacer.gif" alt="" width="8" height="4" /></td><td class="tblbot"><img src="images/spacer.gif" alt="" width="8" height="4" /></td><td class="tblr"><img src="images/spacer.gif" alt="" width="8" height="4" /></td></tr></table>
<br>
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
als iframe funktioniert es schon wie unten abgebildet, aber wie bekomme ich den weißen hintergrund in meiner Seitenfarbe ---> #E1E9F2
(http://www.gibsy.com/dim/gibsy_files/Bild2.gif)
bin für jede Hilfe dankbar, by Gibsy
-
Kann mir da keiner einen rat geben :oops:
-
könnte es in der <td class= " row1 " sein?
kann nicht finden, welche Ursache das :oops:
-
ne, an dem liegt es bestimmt nicht:
alle boxen stehen auf row1
in der css datei steht auch: row1 --> background-color: #E1E9F2
ich glaube bei random.php muß man irgendwo Hintergrund farbe angeben können, es ist ja automatisch weiß.
ich brauche hilfe wie ich das weiße wegbekomme :oops:
hat noch jemand einen rat :cry:
-
Hallo,
ich würde das Bild in der random.php in eine tabelle mit gewünschter Hintergrundfarbe verfrachten. :wink:
z.B.
echo "<table border=\"0\" width=\"100%\" height=\"150\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#E1E9F2\">\n<tr>\n<td width=\"100%\" valign=\"middle\" align=\"center\">";
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "</td>\n</tr>\n</table>\n</center></div>\n";
Gruß
Kurt
-
Hallo Kurt danke für Dein bemühen.
ich habe es als iframe in meinem portal_body.tpl eingebunden.
kann ich das auch anders einfügen außer iframe :?:
wenn es anders auch geht, welchen link oder code muß ich in den unteren code da wo XXXX steht einfügen
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th height="28"><b>:: {actualstats55} ::</b></th>
</tr>
<tr>
<td class="row1" align="center"><XXXXXXXXXXX></center>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="tbl"><tr><td class="tbll"><img src="images/spacer.gif" alt="" width="8" height="4" /></td><td class="tblbot"><img src="images/spacer.gif" alt="" width="8" height="4" /></td><td class="tblr"><img src="images/spacer.gif" alt="" width="8" height="4" /></td></tr></table>
<br>
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
es klappt einfach nicht :cry:
nun sieht es so aus:
(http://www.gibsy.com/dim/gibsy_files/Bild3.gif)
so sollte es aussehen:
(http://www.gibsy.com/dim/gibsy_files/Bild4.gif)
vielen dank im voraus, by Gibsy
-
Hallo,
ja geht normalerweise auch mit:
<?php
include 'random.php';
?>
oder du änderst mal den oben genannten code in der random.php duch folgenden (dann klappts auch):
echo "<html>\n<head>\n</head>\n<body topmargin=\"0\" leftmargin=\"0\">";
echo "<table border=\"0\" width=\"100%\" height=\"150\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#E1E9F2\">\n<tr>\n<td width=\"100%\" valign=\"middle\" align=\"center\">";
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "</td>\n</tr>\n</table>\n</center></div>\n";
echo "</body>\n</html>\n";
Gruß
Kurt
-
Vielen Herzlichen Dank Kurt für Deine Zeite und Mühe die Du aufbringen mußtest :oops:
Jetzt ist es genau so wie ich es haben wollte :D klappt einwandfrei *juuhuu*
Danke nochmals Kurt schöne Grüße by Gibsy
-
Etwas kitzekleines wäre noch :oops:
Wenn ich auf den thumb klicke geht es in der kleinen box auf 8O
Besser wäre es wenn es auf der gleichen Seite aufgehen würde :oops:
Schöne Grüße by Gibsy
----------------------
edit:
so ging es:
das
<a href=\"".ROOT_PATH."details.php?image_id=$image_id\">
mit dem ersetzt
<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_parent\">
Toll jetzt ist es super
Schöne Grüße by Gibsy
-
Hallo,seit kurzem benutze ich auch 4images und möchte die Zufallsbilder ( oder auch Vorschaubild ) in einer Box meines Portals anzeigen. Ich habe das ganze Forum hier schon durchgearbeitet und kriegs einfach nicht hin.Ob ich jetzt die ganze php Datei in die Box schreibe oder Include ich hab immer den selben fehler und zwar macht es mir alle meine anderen boxen ( Dunkel ).Was mach ich da verkehrt?Kann mir jemand helfen?
www.michel-juergen.de
Viele Grüße
Jürgen
-
Hier mal so Beispiel.http://michel-juergen.de/shot/4im1.gif (http://michel-juergen.de/shot/4im1.gif)
undmichel-juergen.de/shot/4im2.gif (http://michel-juergen.de/shot/4im2.gif)
Im ersten Bild seht ihr wie das Script mir alles dunkel macht,
im zweiten seht ihr wie es normal aussieht.
Viele Grüße
Jürgen
-
Hallo yogi,
wie wolltest du das random einbauen. So wie im 1 Posting dieses Threads mit include?
Falls ja, bring mal die random.php zum Laufen, also richtige Pfade eintagen.
Gruß
Kurt
PS. Dann meld dich wieder. Möchte es mir mal mit Einau ansehen. :wink:
-
habs mit include probiert,dann sieht es so aus wie jetzt auch.
In dieser Dastellung die du gerade siehst ist die ganze random.php ( das Script ) in die box eingebaut.
Was für Pfade muß ich denn noch ändern.
Oder vielleicht hab ich die Random.php verkehrt auf dem webspace abgelegt?
Wo muß sie genau hin damit ich sie in einer box includen kann.
Gruß
Yogi
-
Hallo,
http://michel-juergen.de/4images/random.php (http://michel-juergen.de/4images/random.php)
Oder musstest du die Pfade ändern, damit die random images in deiner Page angezeigt werden?
Kurt
-
Die Pfade müssen ja stimmen,sonst würde es ja nicht in der Box angezeigt ( Screen Shot 1 ).
Nur drückt das Script ( egal so oder mit Include ) mir alles andere weg ( Screen Shot 2 )
Das Script ist im Original Zustand.
Bin ehrlich Ratlos,den es ist ja nicht das erste Script das ich einbaue.
Gruß
Yogi
-
Hallo
tja, hab ich ganz übersehen, das randombild ja schon angezeigt wurde.
Als stimmen die Pfade.
Vielleicht wurde include nicht mit ?>
geschlossen ?
Weiß nicht, obs dann möglich ist diese aufzurufen.
Wenns nicht anders klappt, würde ich die random in einen iframe laden.
Kurt
-
hier nochmal ein shot der die anzeige nach dem includen anzeigt.das hilft dir vielleicht weiter.
http://michel-juergen.de/shot/4im3.gif (http://michel-juergen.de/shot/4im3.gif)
da zeigt er mir jetzt das an.
Gruß
Yogi
ah, noch was: IFrame will er auch nicht oder ich machs verkehrt,was ich mir aber nicht vorstellen kann.
-
Normal hab ich nie Probleme so eine Datei in eine Box einzubauen.Woran kann dies liegen.Bitte helft mir?
-
Hasllo,
wie auch im Bild zu sehen, stimmen die Pfade nicht.
Da kann man das Ding auch nicht per iframe einbauen. :wink:
Aber da drauf hab ich auch schon 2 Posts vorher hingewiesen mit dem Direktlink auf die random.php
gruß
Kurt
-
So,nach langem hin und her hab ichs drin.
Mit IFrame.
Jetzt hab ich nur noch ein schönheitsproblem.
Das Bild sollte mittig angezeigt werden,habe ers schon mit <center><center>probiert aber mit keinem Erfolg.
Gruß
Yogi
www.michel-juergen.de
-
... ich sehe nur ... <div style="text-align:center;"></div><a href="./ ...
... und nicht ... <center><a href="./ ... </a></center> ....
... da kann dann auch nichts mittig angeordnet werden ... ;)
-
Danke,
jetzt bin ich zufrieden.
Nun such ich mir das nächste Mod. ( Herausforderung ).
Mich würde nur interessieren warum ich das Teil nicht INCLUDEN konnte.
Gruß
Yogi
-
Schlagt mich, aber ich habe nicht alle 27 Seiten komplett durchgelesen, nur 12. Mein Problem ist offenbar grundsätzlich ein Verständnisproblem. IUch habe die random.php, die funktioniert gut. Ich will das Bild auf der Startseite eines PHPBB-Forums anzeigen lassen. Wie binde ich das jetzt ein? Ein include wohin genau? Ich kapiers nicht. Könnt Ihr mir bitte auf die Sprünge helfen?
Danke Momo
-
@yogi
... includen geht nur bei der gleichen Root/Domain der Dateien ...
@Momo
... an die Stelle in deinem PHPBB-Template, wo das Zufallsbild erscheinen soll ...
-
Danke, aber das klappt gar nicht.
Dazu kommt: Ich stehe vor einem absoluten Rätsel. Ich habe es per iframe eingebunden, hat auch geklappt. Als ich die Position korrigieren wollte, ging nichts mehr. Es lässt sich nicht mehr ändern. Ich habe es jetzt rausgelöscht, in einem anderen Template eingefügt, meinen Cache gelöscht, verschiedene Browser ausprobiert, bin sogar an einen anderen rechner gegangen: Überall das gleiche. Die Anzeige ist drin obwohl der Befehl raus ist. Jetzt ist sie außerdem noch im Footer drin, weil ich es da testen wollte. An beiden Stellen kann ich es nicht mehr entfernen. Habe schon den Apachen vom Server neu gestartet, alles versucht. Es ist definitiv unmöglich, dass es noch angezeigt werden kann. Wird es aber. Werde ich jetzt verrückt?
-
@Momo
... ja, ein Link wäre ( wie immer und im "How to use" zu lesen...) sehr hilfreich ...
... und meine Info an yogi auch mal für dich durchdacht ... ?
-
Kurz nochmal einmischen.
Mit Includen bin ich auch nicht hingekommen.Das hat zwar funktioniert,hat mir aber alle anderen Boxen im Portal dunkel gemacht.Weiß ja auch nicht warum.
Mit IFrame hat es geklappt und mit dem zentrieren auch.
Im Normalfall nehme ich solche php scripte und Bau die so in die Boxen ein wie sie geschrieben sind und das funzt dann auch immer.Warum dieses Script nicht läuft - keine Ahnung.
Naja,mit dieser Lösung kann ich leben.
Gruß
Yogi
-
Oder musstest du die Pfade ändern, damit die random images in deiner Page angezeigt werden?
Ja, stimmt; this is what I changed:
define('ROOT_PATH', './');
dann geht es schon gans schön loss :-)
Jos
-
gerne, gerne..
ist ja selbstveständlich..
Nicky,
Ich habe schon etwat Bilder und Filmchen online. Konnen sie mir erzählen wie ich statt 'no thumbnail' der Icone von zB wmv.gif (icon Directory) dafür im Bild bekomme?
danke,
Jos
-
hey Jos,
try in english. because german translation have no sense for your question ;)
-
Hi@all
ich würde gerne statt Thumbnails 1 großes Bild anzeigen lassen. Ich habe die Frage schonmal in diesem Thread gelesen, aber noch keine Antowrt gefunden ( überlesen?)
Das ist sicher was ganz einfaches für euch :)
From Google Translator:
I would let 1 large picture indicate gladly instead of Thumbnails. I read the question already in this Thread, but found still no answer (overlooked?) That is reliably which completely simple for you
-
Hi guys,
I've been a browser of this forum for weeks now, but this happens to be my first post! Trust a newbie to put it into a not-so-help forum first! ;)
I have downloaded Nicky's text file (many thanks for making the MOD). But, the problem is trying to get it installed. The 'index' file I wish to get it on is here (it is just a test page for now):
http://www.tullamorelife.net/index2.html
I uploaded the 'random.php' file (from Nicky's text file) to the default directory, but I cannot make it work. In the file, doesn't it ask to designate the ROOT_PATH's? I've tried combinations but no luck.
Can anyone please steer me towards the right direction?
:?:
Seanie.
-
Hello, seanie, and welcome.
You put this, in your HTML code:
<?php
include("/random.php");
?>
as if your gallery is in the same directory than index2.html. >>:?:
The random.php file has to be at the root of your gallery.
You should then put this:
<?php
include("http://www.path/to/your/gallery/random.php");
?>
In an HTML page, prefer to use the IFRAME tags:
<IFRAME src="http://www.path/to/your/gallery/random.php" width=200 height=200 scrolling=no frameborder=0 > </IFRAME>
-
Hello, seanie, and welcome.
Thanks for the welcome manurom!
In an HTML page, prefer to use the IFRAME tags:
<IFRAME src="http://www.path/to/your/gallery/random.php" width=200 height=200 scrolling=no frameborder=0 > </IFRAME>
I am not having any success with this. the index2.html file is there to view still. What I have done is tried placing random.php in different folders on the server, and ammending the path accordingly each time in the document (and thus alsoupploading it too). On the server, all the 4Images content is in a "4images" folder or directory. I believe the gallery is in the "data" folder, and in there is a "thumbnails" folder (amongst others). So, unless I am doing something wrong, the lines of code in 'index2.html' should appear as:
<td valign="top"><p align="center" style="font-weight: bold; color: #990000; font-size: 12px">TL&C News!</p>
<p>Site updates and news go here. </p>
<p><IFRAME src="http://www.tullamorelife.net/4images/data/thumbnails/random.php" width=200 height=200 scrolling=no frameborder=0></IFRAME></p></td>
</tr>
</table></td>
As I said, I have tried placing "random.php" into different folders, but since your iFrames suggestion as well, I STILL can't get it to work!
:(
-
Hello again;
I use to put the "random.php" file at the root of my gallery.
So it should be, for you, assuming you put this file at there: http://www.tullamorelife.net/4images/random.php:
<td valign="top"><p align="center" style="font-weight: bold; color: #990000; font-size: 12px">TL&C News!</p>
<p>Site updates and news go here. </p>
<p><IFRAME src="http://www.tullamorelife.net/4images/random.php" width=200 height=200 scrolling=no frameborder=0></IFRAME></p></td>
</tr>
</table></td>
I also use to set the ROOT PATH in random.php as above:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './'); //because it is at the root of the gallery
In PHP environment I link to it like there:
<?php
include("http://path/to/my/gallery/random.php");
?>
and I use IFRAMES in HTML sites.
And it always work fine for me.
-
Manurom et all,
your help has worked, I can now get a random thumbnail to display. However, I need some further tips if anyone can guide me.
I have implemented the iFrame. However, as the thumbnail acts as a link to the larger picture, how do I change the link target path, either to go to e.g. the Gallery introduction page of my site, or even to the 4Images Gallery directly? I also wish to change the font type which appears as the caption under the thumbnail (it is currently defaulting to Times New Roman, size 12, which is not on my site).
I am sorry to pester you with such trivial problems, but I have not dabbled in iFrames before (just good old html so far for me!). Thanks for the help (and a great tool that is 4Images) so far.
Seanie.
-
Well, seanie morris;
try this:
- edit the file random.php and find:
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
and if you need to have a verdana font (I can't figure what font you use), change these last lines to:
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_blank\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\">$image_name</font></b><br>\n";
echo "<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\">Comments: $image_comments</font><br>\n";
?>
-
:oops: What a fool I am!
how do I change the link target path, either to go to e.g. the Gallery introduction page of my site, or even to the 4Images Gallery directly?
To change the target path, if you desire visitors to go to your gallery homepage, please search this line in the file "random.php":
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
and change it to:
echo "<a href=\"".ROOT_PATH."index.php\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Sorry again, I have forgotten this part of your question.
-
Manurom,
your help has been invaluable, thanks for the tips - they have all helped. I have learned a few more tricks thanks to you. If I could repay the favours, I would. Thanks again!
Seanie.
P.S. I am tweaking some of the templates in 4Images at the moment, but the rest of the site is now up and running -> www.tullamorelife.net.
:)
-
Hallo,
ich habe ein Problem.
Und zwar erscheint bei dem Internet Explorer ein weißer Hintergrund, beim Firefox allerdings nicht.
Siehe www.promillepics.de oben rechts.
Was muss geändert werden ?
-
Nicky dear thank for this mod, would you plz like to tell me how to control thumb size and number of thumbs to show in my other site, Assume my gallery thumb size is 130pixel and i wanna show random.php thumb in 150 pixel in other site.
-
Hallo,
ich habe ein Problem.
Und zwar erscheint bei dem Internet Explorer ein weißer Hintergrund, beim Firefox allerdings nicht.
Siehe www.promillepics.de oben rechts.
Was muss geändert werden ?
Du kannst in der random.php gleich den Hintergrund angeben, den deine Seite auch hat
z.B. immer vor dem <?php
<body bgcolor="425d9b">
<?php
Ich stelle anderen Seiten meine Box zur Verfügung, und so kann ich jede Seite individuell anpassen.
dann bekommt jede Random einen anderen Namen
-
Hallo,
How can I add my additional field to the Thumb of Random Image?
PS: I could add the additional field to the normal thumb and Mini top thumb but not under the thumb of Random Image.
Thank you for any help
-
Ok. I download random.txt file.
This is what need:
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
after - add:
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", a.".$key;
}
}
Find:
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
replace:
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments" . $additional_sql . "
[ Edit ]
-
Hello thunderstrike ,
Thank you for your support.
I tried what you said to me but it does not work.
Do you have another solution please?
Cheers
-
I tried what you said to me but it does not work.
What this does not work ? Is say ?
-
Nicky dear thank for this mod, would you plz like to tell me how to control thumb size and number of thumbs to show in my other site, Assume my gallery thumb size is 130pixel and i wanna show random.php thumb in 150 pixel in other site.
hi ashfaq,
use width=\"123456\" height=\"123456"\
in
<img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\">
-
Oh ! so see the mean now.
<img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\" width=\"123456\" height=\"123456\">
for:
$imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']);
<img src=\"".$thumb_src."\" border=\"0\" width=\"".$imgtable_width."\" alt=\"$image_name\">
;)
-
I have a stupid question, what to put in place here
define('ROOT_PATH', './4images/');
Shoul we have to put our site url here ? like
define('http://www.mydomain.com/');
-
define('ROOT_PATH', './4images/');
After <?php tag at top. ;)
-
define('ROOT_PATH', './4images/');
After <?php tag at top. ;)
Cant understand, plz explain little bit more, infact i am not good in php so plz help.
you mean put it here
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
Like
http://www.mydomain.com
-
Open PHP file.
<?php
add after:
define('ROOT_PATH', './4images/');
Easy. ;)
-
Thanks bro for help, plz just give an example by putting domain path, plz
-
Domain name - includes/constants.php file - 1st line: SCRIPT_URL (uncomment + add URL). After, use SCRIPT_URL in ROOT php file. ;)
-
I am totally confused, plz give an example by putting temporary domain like www.mydomain.com in code
I am using this random.php code.
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
-
In includes/constants.php file,
find:
// define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash
change:
define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash
and change http://www.yourdomain.com/4images for your full URL.
In random.php file,
find:
define('ROOT_PATH', './4images/');
change:
define('ROOT_PATH', SCRIPT_URL);
-
I did the same procedure.
First Open constants.php and put my domain path.
// define('SCRIPT_URL', 'http://www.mydomain.com'); //no trailing slash
Then in random.php also change like
define('ROOT_PATH', 'http://www.mydomain.com');
After make changes both files i upload constants.php in includes folder and random.php in root path But it is not working.
-
ashfaq,
where is your gallery? pls send url
where is random.php saved? send url
-
// define('SCRIPT_URL', 'http://www.mydomain.com'); //no trailing slash
Ok so do fine. Remove // at 1st after enter domain. ;)
-
I have removed the // but the problem is there.
Check Gallery Link:
http://www.deskbeauty.com/ (http://www.deskbeauty.com/)
Check random.php Link
http://www.deskbeauty.com/random.php (http://www.deskbeauty.com/random.php)
you wil see error at random wallpaper at right sidebar top and at page end, infact i am showing random wallpaper code of another site and that wallpaper site is down so it is giving error, you can see that i wanna show one random wallpaper at right side top and four random wallpapers at bottom. Plz tell me how to solve random wallpaper so i can add random wallpapers from my own site and also show on other sites.
One more thing plz observe that my site takes much time to load, can you give suggestion how to make a template for fast page load ?
-
hi,
ORIGINAL random.php
set
define('ROOT_PATH', './');
upload your ORIGINAL constants.php again into include folder.
that's all
and please add into your footer original 4images copyright content, thank you!
-
Thanks dear now its working. Just help me more in these issues.
1: How to get ride of wallpaper name and commnets ? i wanna show only thumbnail.
2: How to control thumbnail size.
3: How to increase or decrease number of thumbnails to show, as now we can only show one thumbnail.
and lastly this question is not related with random wallpaper but i hope you will also help in this issue, plz tell me how to show total number of wallpapers at my site and any other information about site.
Thanks Again.
-
Thanks dear now its working. Just help me more in these issues.
1: How to get ride of wallpaper name and commnets ? i wanna show only thumbnail.
2: How to control thumbnail size.
3: How to increase or decrease number of thumbnails to show, as now we can only show one thumbnail.
and lastly this question is not related with random wallpaper but i hope you will also help in this issue, plz tell me how to show total number of wallpapers at my site and any other information about site.
Thanks Again.
Will anyone plz help, specially nicky bro
-
Nicky dear i have solved all problems and using your code to show 4 random thumbnails on other site, plz tell me how to show thumbnails horizontally bcoz thumbnails appear vertically ?
When i try to open random.php in any other site by include command it show broken image but if i check it in 4images site, it works good so tell me how to show random thumbnails in other site ?
I think you told me to put ./
define('ROOT_PATH', './');
in random.php and in my opinion this thing show thumbnails in 4images site but prevent to appear in other sites and show a broken images.
Plz bro help me i will be very thankfull to you.
-
if you want to call random.php from http://www.deskbeauty.com/test77/
and from http://www.deskbeauty.com/
than you need to have 2 random files...
one with
define('ROOT_PATH', './');
define('ROOT_PATH', '../');
for horiz. thumbs... remove <br> from echo call..
and pls.. do not pm me ;)
just wait for the answer.
thx & have a nice day
-
Bro first of all sory that i pm you, inface no one was helping so i pm you.
Random.php works good if it is used in 4images directory but didnt work when we call in by include command in any other site.
I have also put ../ in random.php but it didnt work in 4images directory nor in any other site but ./ work in 4images directory but not work other site.
Check the site here: www.deskbeauty.com
Check the random file where i put ../: www.deskbeauty.com/random1.php
-
ok..
where you want that random pics should be showed?
exact urls...
and 2nd time.. please change 4images copyright notice in your footers..
-
Infact bro i dont want to show random images on a specific site but i want a link code that other webmaster can put in there sites and show my site random wallpapers, as you know this thing is good for site promotion, so i hope you will help as this is very important for 4homepages webmasters. Thanks
-
Infact bro i dont want to show random images on a specific site but i want a link code that other webmaster can put in there sites and show my site random wallpapers, as you know this thing is good for site promotion, so i hope you will help as this is very important for 4homepages webmasters. Thanks
Plz help someone with this issue.
-
http://www.4homepages.de/forum/index.php?topic=1020.msg4347#msg4347
and for other sites use something like this.. http://www.4homepages.de/forum/index.php?topic=1020.msg6794#msg6794
-
Dear thanks for reply but your given links most post or not in english so i cant understand, plz just tell me how to show random wallpaper on any other site ?
-
and for other sites use something like this.. http://www.4homepages.de/forum/index.php?topic=1020.msg6794#msg6794
most post or not in english so i cant understand
This english ... what is prob ?
-
ashfaq,
both posts are IN ENGLISH, look better :evil: :cry:
-
@Nicky:
http://www.4homepages.de/forum/index.php?topic=1020.msg4347#msg4347
post msg4347 is german.
-
@thunderstrike
... the post is also in englisch ...
... (E: try this) ...
... (E: in random.php) ...
... (E: after) ...
... (E: add this(ofcourse your own url)) ...
... (E: change) ...
... (E: to) ...
... Nicky say ... E: -> in english ... ;)
-
Ohh ! ok - thank.
-
okay
probier mal das(E: try this)
in der random.php (E: in random.php)
nach (E: after)
include(ROOT_PATH.'includes/constants.php');
füge dies ein (E: add this(ofcourse your own url))
define('SCRIPT_URL', 'http://www.brinkmann-online.de/umleitung/4images/');
dann ändere (E: change):
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
auf (E: to):
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Thanks bro this code works but it only works if we wanna show 1 thumb and it didnt work to show 4random thumbs code file "random_more_pics.txt " which i downloaded from nicky.net
How to implement code to show 4 random thumbs on other site ?
-
Ich habe mal eine allgemeine Frage zu dem Script:
Werden die Originalbilder oder die Thumbnails als "Random Images" agezeigt?
-
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Change for:
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : format_url($script_url . "/data/" . THUMB_DIR."/".$cat_id."/".$row['image_thumb_file']);
echo "<a href=\"". format_url($script_url ."/details.php?image_id=" . $image_id) . "\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"" . $image_name . "\"></a><br>\n";
-
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Change for:
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : format_url($script_url . "/data/" . THUMB_DIR."/".$cat_id."/".$row['image_thumb_file']);
echo "<a href=\"". format_url($script_url ."/details.php?image_id=" . $image_id) . "\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"" . $image_name . "\"></a><br>\n";
Ist das die Antwort auf die Frage ob und wie die Thumbnails statt den Originalbildern angezeigt werden?
-
Dieses antwort ist für dieses ein:
okay
probier mal das(E: try this)
in der random.php (E: in random.php)
nach (E: after)
include(ROOT_PATH.'includes/constants.php');
füge dies ein (E: add this(ofcourse your own url))
define('SCRIPT_URL', 'http://www.brinkmann-online.de/umleitung/4images/');
dann ändere (E: change):
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
auf (E: to):
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Thanks bro this code works but it only works if we wanna show 1 thumb and it didnt work to show 4random thumbs code file "random_more_pics.txt " which i downloaded from nicky.net
How to implement code to show 4 random thumbs on other site ?
-
Moin Moin!
Ich habe schon länger so ein Mod gesucht, habe diesen hier aber nicht gleich auf Anhieb gefunden. Nun ist er aber auf meiner HP eingebunden und ich bin begeistert.
Kleines Ding mit großer Wirkung - Supersache!
Und ich wollte einfach nur einmal > Vielen Dank < sagen!
und viele Grüße aus Hamburg
Kay
-
gerne :)
-
Hey guys,
nice MOD!
My "thumbnails_bit.html" looks like that:
<a href="{image_url}" onmouseover="popup1('<img src=http://myDOMAIN.de/data/thumbnails/{cat_id}/{thumbnail_file_name}>','0')"; onmouseout="kill()" target="_blank">{image_name}</a>
I show up my thumbnails when user "mouseover" the imagename.
Is there any possibility to include my "thumbnails_bit.html - code" in this part of script:
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_new\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Thanks a lot for your help!
-
hi FunnyUser
Hey guys,
nice MOD!
My "thumbnails_bit.html" looks like that:
<a href="{image_url}" onmouseover="popup1('<img src=http://myDOMAIN.de/data/thumbnails/{cat_id}/{thumbnail_file_name}>','0')"; onmouseout="kill()" target="_blank">{image_name}</a>
I show up my thumbnails when user "mouseover" the imagename.
Is there any possibility to include my "thumbnails_bit.html - code" in this part of script:
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_new\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
Thanks a lot for your help!
try this
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" onmouseover=\"popup1('<img src=".$thumb_src.">','0')\"; onmouseout=\"kill()\" target=\"_blank\">".$image_name."</a>\n";
-
$image_name = $row['image_name']
so
try this:
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" onmouseover=\"popup1('<img src=".$thumb_src.">','0')\"; onmouseout=\"kill()\" target=\"_blank\">".format_text(trim($image_name), 2)."</a>\n";
-
thunderstrike,
FYI
$image_name = $row['image_name'];
is on the 1st page from this MOD in random.txt file
no matter if you use now format_text or not.
-
FYI
$image_name = $row['image_name'];
is on the 1st page from this MOD in random.txt file
Ok so use:
$image_name = format_text(trim($row['image_name']), 2);
Please see includes/functions.php (show_image function of Jan)
-
FYI
$image_name = $row['image_name'];
is on the 1st page from this MOD in random.txt file
Ok so use:
$image_name = format_text(trim($row['image_name']), 2);
Please see includes/functions.php (show_image function of Jan)
I'm a bit confused now :roll: :roll: :roll:
Can anybody explain to me how I have to do the changes.
I have the original "random.php" from Nicky and want to showup my thumbsnails like in my "thumbnail_bit.html".
Thanks youuuu!!!!
-
did you try that
http://www.4homepages.de/forum/index.php?topic=1020.msg105488#msg105488
-
did you try that
http://www.4homepages.de/forum/index.php?topic=1020.msg105488#msg105488
Okay, I guess it works!
But where I have to put the <SCRIPT-CODE>. It looks like this:
<script language="JavaScript">
<!--
blink(0.7);
function blink(speed)
{
if (speed) {
if (document.all)
setInterval("blink()", speed*1000)
return;
}
var blink = document.all.tags("BLINK")
for (var i=0; i<blink.length; i++)
blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}
// -->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<SCRIPT TYPE="text/javascript">
<!--
Xoffset= 16; // modify these values to ...
Yoffset= 16; // change the popup position.
var old,skn,iex=(document.all),yyy=-1000;
var ns4=document.layers
var ns6=document.getElementById&&!document.all
var ie4=document.all
if (ns4)
skn=document.dek
else if (ns6)
skn=document.getElementById("dek").style
else if (ie4)
skn=document.all.dek.style
if(ns4)document.captureEvents(Event.MOUSEMOVE);
else{
skn.visibility="visible"
skn.display="none"
}
document.onmousemove=get_mouse;
function popup1(msg,bak){
var content="<TABLE WIDTH=70 BORDER=1 bordercolor=#000000 CELLPADDING=0 CELLSPACING=0><TD ALIGN=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></TABLE>";
yyy=Yoffset;
if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}
if(ie4){document.all("dek").innerHTML=content;skn.display=''}
}
function get_mouse(e){
var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
skn.left=x+Xoffset;
var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
skn.top=y+yyy;
}
function kill(){
yyy=-1000;
if(ns4){skn.visibility="hidden";}
else if (ns6||ie4)
skn.display="none"
}
//-->
</SCRIPT>
Or can I just do "<? include("http://www.domain.com/random.php") ?>" ??
At the moment my <SCRIPT-CODE> is in my "header.html".
...or has it do be in the "random.php" ??
Thanks
-
someone an idea how to NOT include a certain category in the random pictures ?
-
put this into both queries
example
AND a.cat_id NOT IN (4, 9, 15)
4,9,15 are only example, change it with your cat_id 's
-
Thank you for fast reply. I'm using 1.7.1 the original version and there is no such as random.php among the files... maybe in sessions??
-
hmm...
are you writing about the random pics MOD or general about 4images random?
-
{random_image} was standard with the template... don't think it was a MOD.
There was a topic about it long time ago but can't find it ... was 3 years ago i think.
-
;)
in this thread we talking about the MOD for external site
-
kk... will look further on the forum to find the topic :)
-
HI
hat super geklappt und bin happy damit
Gut gefallen würde es mir noch, wenn die bilder per javascript von rechts nach link oder umgekehrt langsam wandern würden.
hat jemand eine idee?
lg
glitzer
-
put this into both queries
example
AND a.cat_id NOT IN (4, 9, 15)
4,9,15 are only example, change it with your cat_id 's
Hi Nicky, where and how exactly I have to code this to exclude categories. Which file, which place?
And who to exlude categories internal? I won't to show media-thumbs in random.
Thanks Chris.
-
This is what I need I think. I'd like to put a random thumbnail of my 1.74 gallery into my wordpress 2.31 blog in the new k2 template sidebar. I have random.php working
http://www.maui-tropica.com/maui-tropica-gallery/random.php
but when I insert:
<?php
include("http://www.maui-tropica.com/maui-tropica-gallery/random.php");
?>
into the sidebar I get these errors:
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/bigwave/public_html/hawaii-agriculture/hawaii-agriculture-blog/wp-content/themes/k2/app/modules/php.php(7) : eval()'d code on line 2
Warning: include(http://www.maui-tropica.com/maui-tropica-gallery/random.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/bigwave/public_html/hawaii-agriculture/hawaii-agriculture-blog/wp-content/themes/k2/app/modules/php.php(7) : eval()'d code on line 2
Warning: include() [function.include]: Failed opening 'http://www.maui-tropica.com/maui-tropica-gallery/random.php' for inclusion (include_path='.:/usr/lib/php') in /home/bigwave/public_html/hawaii-agriculture/hawaii-agriculture-blog/wp-content/themes/k2/app/modules/php.php(7) : eval()'d code on line 2
I'm very new at this. Is there something I should change in php.php to get this mod functioning or is it just not happy? This mod is obviously the result of lots of hard work--thanks for the effort! Here is my php.php code I case sombody knows the fix for my situation:
<?php
function php_sidebar_module($args) {
extract($args);
echo($before_module . $before_title . $title . $after_title);
eval(' ?>' . sbm_get_option('code') . '<?php ');
echo($after_module);
}
function php_sidebar_module_control() {
if(isset($_POST['php_module_code'])) {
sbm_update_option('code', stripslashes($_POST['php_module_code']));
} ?>
<p>
<label for="php-module-code"><?php _e('Module\'s code:', 'k2_domain'); ?></label><br />
<textarea id="php-module-code" name="php_module_code" rows="6" cols="30"><?php echo(wp_specialchars(htmlspecialchars(sbm_get_option('code'), ENT_QUOTES), 1)); ?></textarea>
</p>
<?php
}
register_sidebar_module('Text, HTML and PHP', 'php_sidebar_module', 'sb-php');
register_sidebar_module_control('Text, HTML and PHP', 'php_sidebar_module_control');
?>
Thanks very much!
-
hi bigwave.
you are trying to include with a URL not with PATH = wrong.
this is PATH: /home/bigwave/public_html/hawaii-agriculture/hawaii-agriculture-blog/
this is URL: http://www.maui-tropica.com/maui-tropica-gallery/
if both domains are on same server try this to include into wordpress
example (i don't know your structure)
<?php
include("/home/bigwave/public_html/maui-tropica/maui-tropica-gallery/random.php");
?>
-
put this into both queries
example
AND a.cat_id NOT IN (4, 9, 15)
4,9,15 are only example, change it with your cat_id 's
Hi Nicky, where and how exactly I have to code this to exclude categories. Which file, which place?
And who to exlude categories internal? I won't to show media-thumbs in random.
Thanks Chris.
hi Chris,
under both
AND b.auth_viewimage=".AUTH_ALL."
and offcourse in random.php ;)
-
Hey Nicki, Thanks!
Its down to 2 errors from three and I think it will be happy soon!
http://hawaii-agriculture.com/hawaii-agriculture-blog/
Using :
<?php
include("/public_html/maui-tropica/maui-tropica-gallery/random.php");
?>
I get just these errors:
Warning: include(/public_html/maui-tropica/maui-tropica-gallery/random.php) [function.include]: failed to open stream: No such file or directory in /home/bigwave/public_html/hawaii-agriculture/hawaii-agriculture-blog/wp-content/themes/k2/app/modules/php.php(7) : eval()'d code on line 2
Warning: include() [function.include]: Failed opening '/public_html/maui-tropica/maui-tropica-gallery/random.php' for inclusion (include_path='.:/usr/lib/php') in /home/bigwave/public_html/hawaii-agriculture/hawaii-agriculture-blog/wp-content/themes/k2/app/modules/php.php(7) : eval()'d code on line 2
With everything else I get a ton of errors
Thanks again!
-
okay. i will look on that after 2nd of january... going to sleep now, and tomorrow i'm out of home...
-
@bigwave:
If use this version for include random.php (with your projek) - is show error ? (See attach file).
-
Hey Tunderstrike—thanks for jumping in!
Yes I get the same errors with your new random.php file.
I’m worried about my path in the word press include but don’t know what to do about it or if it is even an issue:
As suggested by Nicky
<?php
include("/home/bigwave/public_html/maui-tropica/maui-tropica-gallery/random.php");
?>
gives me 13 errors
<?php
include("/public_html/maui-tropica/maui-tropica-gallery/random.php");
?>
only gives me the 2 errors:
http://hawaii-agriculture.com/hawaii-agriculture-blog/
but my root path to phpinfo is:
/home/bigwave/public_html/maui-tropica/maui-tropica-gallery/admin/phpinfo.php
and the complete path is mentioned in the error messages:
Warning: include(/public_html/maui-tropica/maui-tropica-gallery/random.php) [function.include]: failed to open stream: No such file or directory in /home/bigwave/public_html/hawaii-agriculture/hawaii-agriculture-blog/wp-content/themes/k2/app/modules/php.php(7) : eval()'d code on line 2
Warning: include() [function.include]: Failed opening '/public_html/maui-tropica/maui-tropica-gallery/random.php' for inclusion (include_path='.:/usr/lib/php') in /home/bigwave/public_html/hawaii-agriculture/hawaii-agriculture-blog/wp-content/themes/k2/app/modules/php.php(7) : eval()'d code on line 2
php.php seems to be in the correct place
Anyway, thanks for the help and HAPPY NEW YEAR!
Brian
-
Hallo
Kann evtl. jemand mal seine unter 1.7.4 lauffähige random,php posten? Hab die ersten 20 Seiten gelesen aber nichts gefunden was hilft. Ich bekomme beim Aufruf der random.php nur "Comments" angezeigt, keine Bilder.
Wäre Nett wenn das jemand posten könnte.
Danke.
Gruß Micha
-
Hallo,
hier ist die Random.php im Anhang.
Es ist das Original ohne Veränderungen, ich habe sie nie Benutzt.
nobby
-
Danke, aber leider das selbe Problem. Es wird kein Bild angezeigt. Vermute mal das es daran liegt:
Scriptversion: 1.0 for 4images 1.6.1
Bräuchte sowas was auch unter der 1.7.4 läuft.
Gruß Micha
-
durch geschaut hast Du in diesem Thread schon?
nobby
-
Hab wie geschrieben 20 Seiten durch und nachdem ich alle Änderungen eingebaut und probiert habe sah das ganze mehr aus wie die Bewohner im Dschungel Camp als wie ein Script :) Aber wie gesagt, den Fehler hab ich nicht wegbekommen.
Gruß Micha
-
Nee, ich habe auch mal auf der schnelle geschaut.
Keine Anpassung an 1.7.4 :|
Da ich kein PHP-Coder bin, musst Du ein bisschen warten bis @Nicky diese
Zeilen liest und Dir dann auch helfen kann.
nobby
edit
Ich hatte noch mal in http://www.4homepages.de/forum/index.php?board=17.0 geschaut, aber auch nichts
Hilfreich wäre auch noch mal eine genaue Fehlerbeschreibung!
edit ende
-
Hilfreich wäre auch noch mal eine genaue Fehlerbeschreibung!
Wie geschrieben, es wird nur das Wort "Comments" angezeigt, keine weitere Fehlermeldung.
-
hi rubberduck,
eigentlich funktioniert das ganze auch unter 1.7.4.
zeige mir die url zur random.php
und wo hast es eingebunden
per
<?php
include("./random.php");
?>
und wie genau
-
Ok, dann mal los :)
Die random.php (die aus dem .zip vom ersten Beitrag) liegt unter
http://www.reptilienmanager.de/gallery/random.php
Eingebunden ist es so:
<?php
include("gallery/random.php");
?>
Root_Path ist:
define('ROOT_PATH', '/var/www/vhosts/reptilienmanager.de/httpdocs/gallery/');
Testdatei unter:
http://www.reptilienmanager.de/test.php
-
@rubberduck
... Root_Path sollte sein ...
define('ROOT_PATH', './');
... SCRIPT_URL sollte sein ...
define('SCRIPT_URL', 'http://www.reptilienmanager.de/gallery/');
-
okay... fangen wir mal an...
so kann es nicht funkionieren ;)
1.) du verbietest in deiner gallery das man sich die bilder in details anschauen kann (AND c.auth_viewimage = '".AUTH_ALL."'), ausser man ist registrierter user.
also kategorien müssen auch so eingestellt sein das die Gäste die details bilder sehen können, sonnst sind die random bilder nicht "click"-bar bzw. es werden keine in der random.php angezeigt (wie in deinem fall gerade).
wenn du nur die bilder in der test.php/random.php zeigen willst ohne es anklicken zu können
mach folgendens
AND c.auth_viewimage = '".AUTH_ALL."'
in beiden abfragen löschen.
und dies von
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
auf
echo "<img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"><br>\n";
ändern.
du hast die qual der wahl ;)
2.) in der random.php root path so einstellen
define('ROOT_PATH', './');
3.) test.php so einstellen
<?php
include("./gallery/random.php");
?>
-
Wenn es ein Gast ist und der dann auf den Link klicken würde, dann würde er doch auf die index.php umgeleitet, oder ? Also könnte man ja grundsätzlich alle Bilder anzeigen lassen.
Wenn ich
define('ROOT_PATH', './');
in die random.php schreibe dann kommt der Fehler das er ./config.php nicht finden kann, obwohl die random.php ja im Hauptverzeichnis der Gallerie liegt, also da wo auch die config.php ist.
Trage ich
define('ROOT_PATH', './gallery/');
ein, dann geht es.
-
@rubberduck
... wenn deine Galerie tiefer im Verzeichnis liegt, dann ist das natürlich bei der 'SCRIPT_URL' zu berücksichtigen ...
define('SCRIPT_URL', 'http://www.reptilienmanager.de/gallery/');
... 'ROOT_PATH' bleibt dann wie bereits angegeben ... (siehe auch Nicky)
-
@rubberduck
... wenn deine Galerie tiefer im Verzeichnis liegt, dann ist das natürlich bei der 'SCRIPT_URL' zu berücksichtigen ...
define('SCRIPT_URL', 'http://www.reptilienmanager.de/gallery/');
... 'ROOT_PATH' bleibt dann wie bereits angegeben ... (siehe auch Nicky)
Wo soll das denn rein? In die random.php? Wie gesagt ich hab die originale aus dem 1. Posting und da ist das nicht mit drin.
-
Wenn ich das
AND c.auth_viewimage = '".AUTH_ALL."'
aus der Abfrage rausnehme wird bei Klick auf das Bild nach
http://www.reptilienmanager.de/gallery/test.php
umgeleitet. Sollte doch aber eigentlich dann die index.php der Gallery sein, oder?
-
Wenn es ein Gast ist und der dann auf den Link klicken würde, dann würde er doch auf die index.php umgeleitet, oder ? Also könnte man ja grundsätzlich alle Bilder anzeigen lassen.
kann man :)
Wenn ich
define('ROOT_PATH', './');
in die random.php schreibe dann kommt der Fehler das er ./config.php nicht finden kann, obwohl die random.php ja im Hauptverzeichnis der Gallerie liegt, also da wo auch die config.php ist.
Trage ich
define('ROOT_PATH', './gallery/');
ein, dann geht es.
jau habs auch gerade mitbekommen..
na jut die random.php wird sowieso nicht aufgerufen :)
-
Wenn ich das
AND c.auth_viewimage = '".AUTH_ALL."'
aus der Abfrage rausnehme wird bei Klick auf das Bild nach
http://www.reptilienmanager.de/gallery/test.php
umgeleitet. Sollte doch aber eigentlich dann die index.php der Gallery sein, oder?
poste deine random.php
-
Hier ist sie. Hab die (c) Vermerke mal entfernt fürs Posting.
<?php
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', './gallery/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
-
hmm..
also jetzt muss ich aufgeben.. weiss jetzt nicht genau warum es auf diese seite geleitet wird.
sorry daweil
-
Kein Problem, ich muss da sowieso noch was ändern, dann kann ich das auch gleich so umbauen das es von der Hauptseite aus die DB direkt ausliesst und mit den direkten URLs arbeiten.
Trotzdem vielen Dank für Deine Mühe.
-
Also ich kann manchen was ich will, ich bekomme diese komische Umleitung nicht weg. Scheint so als wenn es was mit der details.php zu tun hat.
Hat evtl. jemand noch eine Idee?
-
Leere mal den Cache.
-
Leere mal den Cache.
Alles schon gemacht. Habs auch schon über einen anderen Rechner probiert :( Der hängt dann sogar noch ne Session ID dran :)
http://www.reptilienmanager.de/test.php
-
die einfachste variante:
die test.php in gallery verzeichnis erstellen mit redirect zur index.php :mrgreen:
-
Habs jetzt so gemacht, das wenn auth_viewimage = 0 ist, dann wird der Link mit eingebunden, ansonsten nur das Bild.
Zusätzlich wird die Kategorie mit verlinkt und die anderen Daten wie z.B. Views/Downloads/Stimmen werden auch noch mit angezeigt.
-
All in German, perphas have it answer to my question, bit I don't speak Grerman.
I try random.php (1st page post), but isn't work.
I want take random image (like index.php) from my galleries, and put it in my portal index. I use mxbb2, and isn't problem for include random.php to my portal page.
Can you help me please.
ok I find it here http://www.4homepages.de/forum/index.php?topic=1020.msg109998#msg109998
but confusion
An unexpected error occured. Please try again later.
An unexpected error occured. Please try again later.
non display image -> albums/thumbs//
Comments:
-- ok --
I insert random.php with iframe is ok
-
alright I dont wanna read through all these posts so I'm gonna ask. I put this code on my site and all that shows up is a blank image. heres the url to my site, http://www.ffbte.net
-
Hi,
put the random.php in the main folder from 4images.
:!: And rebuild the copyright text on your page:
http://www.ffbte.net/ffgallery/
Your changes are not allowed :!:
KurtW
-
alright, thanks 8)
alright it works..
I just copy and pasted a code that someone else posted up on the page before this one.
-
I have uploaded the random.php into my gallery directory. I get a blank page. Any ideas?
-
Hallo All,
ich habe die random.php eingebuat, mit der Erweiterung, dass angezeigte Bilder bei anklicken im neuen Fenster öffnen.
Soweit, so gut.
Nun habe ich noch ein paar Fragen:
1. Wie kann ich die Schriftgrösse verändern? (zum Beispiel: Bildname und Comments = in kleinerer Schrift anzeigen)
2. Wie kann ich das angezeigte Bild proportional verkleinert anzeigen lassen, da ich es in meiner Homepage anzeigen möchte, wo allerdings nur 90% des Bildes Platz hätten?
3. Gibt es eine Möglichkeit, dass ich verschiedene Kategorien NICHT anzeigen lasse?
Dank im Voraus an alle "Tüftler" und solche, die mir vielleicht helfen können.
Sonja
.
-
2. ControlPanel > Bilder verwalten > Auto-Image-Resizer Bilder proportional verkleinern
1. style.css in den jeweilgen zeilen, Tabellen font-size: xxxpx; einfügen
oder im jeweilgen Template <font-size="xxx"> </font> besser wäre style="font-size: xxxpx;"
3. ControlPanel Kategorien bearbeiten: wer darf was? z.B. sehen nur Administartoren oder ....
werd ich jetzt zum Clubbesuch eingeladen? :wink: :lol:
-
@ honda2000
Herzlichen Dank für die prompte Antwort.
Siehste, ich bin doch schusselig blond :-(
auf die Einstellungen per css hätte ich auch selbst kommen können...
Nur ... ich möchte ja die Thumbs proportional verkleinern und NICHT die Thumbs in der Original-Plattform verändern!
Das gleiche gilt bei den angezeigten Thumbs im externen Web. Dort sollen gewisse Kategorien NICHT angezeigt werden, aber den Usern in der Original-Plattform soll der Zugang zu allen Bereichen (nach Möglichkeit) ohne Registrierung möglich sein.
Puuuuh... das war hoffentlich verständlich geschrieben ???
*grins* zum Thema Clubbesuch... ist leider etwas weit von hier aus (Costa del Sol) ... hi hi, sonst, "Warum nicht?" *lach*
Sonnige Grüße an alle hier, Sonja
.
-
Moin Nicki,
hab jetzt die random.php integriert mit Iframe und als Beispiel 4 Thumbs...
Ist es möglich, die Thumbs horizontal statt vertikal anzuzeigen?
Weil das sieht echt ein wenig doof aus :roll:
http://emmelsbuell.net/cms/html/modules.php?name=Content&pid=2
Gruß Dieter
-
wenn du name und comments ausgelassen hast ist es einfach
ändere
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
auf
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a> \n";
-
Danke Nicky,
klappt :D
Gruß Dieter
-
welll i want to show more than one images plz help
and how can i shopw images of specific catagory i had try this
AND a.cat_id=4
but it is not working Sad
-
Hi,
thanks for this great mod!
I would like to ask you, if its possible to add an "slideshow" feature with fade-in - fade-out effect for new pictures everyl ~30 minute?
Thanks!
Pat
this is my script without slideshow and fade-in/fade-out:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_full.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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
define('ROOT_PATH', '../4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
$bgcolor1 = "#e5e5e5";
$bgcolor2 = "#e5e5e5";
$bgcolor3 = "#e5e5e5";
$bgcolor4 = "#e5e5e5";
$textcolor1 = "#000000";
$textcolor2 = "#000000";
//echo "<body bgcolor=\"#e5e5e5\" text=\"#000000\"
//echo "<style="background-color:#e5e5e5">
echo "<body bgcolor=\"#e5e5e5\"><a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$full_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
?>
-
welll i want to show more than one images plz help
and how can i shopw images of specific catagory i had try this
AND a.cat_id=4
but it is not working Sad
*handsome* use this:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 4;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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.cat_id = 4
ORDER BY RAND()
LIMIT $num_images";
$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_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<hr>\n";
}
?>
-
welll i want to show more than one images plz help
and how can i shopw images of specific catagory i had try this
AND a.cat_id=4
but it is not working Sad
*handsome* use this:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 4;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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.cat_id = 4
ORDER BY RAND()
LIMIT $num_images";
$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_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<hr>\n";
}
?>
thanks for help..
but is it possible to open image in new window... forexample when visitor click on random image its open in new window
i try to add blank tag but it is not working (givving some errors
-
Hi*handsome*,
use this:
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_blank\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br />\n";
or
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" onclick=\"opendetailwindow()\" target=\"detailwindow\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br />\n";
Kurt
-
Hi,
I want to publish random picture on my server www.stacho.cz
The gallery is located at gallery.rammstein-europe.com
I get this error:
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /pub/stachowa/stacho.cz/web/test/random.php on line 30
Warning: include(http://gallery.rammstein-europe.com/config.php) [function.include]: failed to open stream: no suitable wrapper could be found in /pub/stachowa/stacho.cz/web/test/random.php on line 30
Warning: include() [function.include]: Failed opening 'http://gallery.rammstein-europe.com/config.php' for inclusion (include_path='.:/usr/local/lib/php:/pub/stachowa/stacho.cz/include') in /pub/stachowa/stacho.cz/web/test/random.php on line 30
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /pub/stachowa/stacho.cz/web/test/random.php on line 31
Warning: include(http://gallery.rammstein-europe.com/includes/db_mysql.php) [function.include]: failed to open stream: no suitable wrapper could be found in /pub/stachowa/stacho.cz/web/test/random.php on line 31
Warning: include() [function.include]: Failed opening 'http://gallery.rammstein-europe.com/includes/db_mysql.php' for inclusion (include_path='.:/usr/local/lib/php:/pub/stachowa/stacho.cz/include') in /pub/stachowa/stacho.cz/web/test/random.php on line 31
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /pub/stachowa/stacho.cz/web/test/random.php on line 32
Warning: include(http://gallery.rammstein-europe.com/includes/constants.php) [function.include]: failed to open stream: no suitable wrapper could be found in /pub/stachowa/stacho.cz/web/test/random.php on line 32
Warning: include() [function.include]: Failed opening 'http://gallery.rammstein-europe.com/includes/constants.php' for inclusion (include_path='.:/usr/local/lib/php:/pub/stachowa/stacho.cz/include') in /pub/stachowa/stacho.cz/web/test/random.php on line 32
Fatal error: Class 'Db' not found in /pub/stachowa/stacho.cz/web/test/random.php on line 35
What I did was that i edited only one line in the php file you provide, it looks now like this:
define('ROOT_PATH', 'http://gallery.rammstein-europe.com/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$full_src."\" border=\"1\" alt=\"$image_name\"></a><br>\n";
?>
-
Hello and welcome to 4images forum.
You cannot use full internet path in ROOT_PATH. This script must be on the same server as 4images.
-
versuche mal dieses
define('ROOT_PATH', './');
Harald
-
Hi External and welcome to the 4images forum
try it so:
random.php (place it there where your 4images config.php is)
define('ROOT_PATH', './');
define('SCRIPT_URL', 'http://gallery.rammstein-europe.com/');
instead off:
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$full_src."\" border=\"1\" alt=\"$image_name\"></a><br>\n";
use this
print("
document.write('<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$full_src."\" border=\"1\" alt=\"$image_name\"></a>');
");
on www.stacho.cz try to add this into your html
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php'></SCRIPT>
hope this will work for you
-
Hi Nicky,
I used the code you provided but it is not working yet. Here is the code:
random.php uploaded to root in gallery.rammstein-europe.com:
define('ROOT_PATH', './');
define('SCRIPT_URL', 'http://gallery.rammstein-europe.com/');
include(ROOT.'/config.php');
include(ROOT.'/includes/db_mysql.php');
include(ROOT.'/includes/constants.php');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
print("
document.write('<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$full_src."\" border=\"1\" alt=\"$image_name\"></a>');
");
?>
and this index.htm file in test.stacho.cz:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title></title>
</head>
<body>
LOL
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php'></SCRIPT>
</body>
</html>
As you can see, test.stacho.cz doesn't show any images.
-
hab es mal bei mir als Iframe eingebunden, da kommt diese Fehlermeldung
Warning: include(ROOT/config.php) [function.include]: failed to open stream: No such file or directory in /pub/stachowa/rammstein-europe.com/web/gallery/random.php on line 30
Warning: include() [function.include]: Failed opening 'ROOT/config.php' for inclusion (include_path='.:/usr/local/lib/php:/pub/stachowa/rammstein-europe.com/include') in /pub/stachowa/rammstein-europe.com/web/gallery/random.php on line 30
Warning: include(ROOT/includes/db_mysql.php) [function.include]: failed to open stream: No such file or directory in /pub/stachowa/rammstein-europe.com/web/gallery/random.php on line 31
Warning: include() [function.include]: Failed opening 'ROOT/includes/db_mysql.php' for inclusion (include_path='.:/usr/local/lib/php:/pub/stachowa/rammstein-europe.com/include') in /pub/stachowa/rammstein-europe.com/web/gallery/random.php on line 31
Warning: include(ROOT/includes/constants.php) [function.include]: failed to open stream: No such file or directory in /pub/stachowa/rammstein-europe.com/web/gallery/random.php on line 32
Warning: include() [function.include]: Failed opening 'ROOT/includes/constants.php' for inclusion (include_path='.:/usr/local/lib/php:/pub/stachowa/rammstein-europe.com/include') in /pub/stachowa/rammstein-europe.com/web/gallery/random.php on line 32
Fatal error: Class 'Db' not found in /pub/stachowa/rammstein-europe.com/web/gallery/random.php on line 35
Bin jetzt nicht der Profi, aber kann es sein, das man bei deinem Hoster, nicht von ausserhalb auf die DB zugreifen kann ??
-
hi all..
http://www.siteshot.at/nicky.htm
your examples can't work.. if you don' use correct code like descriped in the MOD file..
ROOT != ROOT_PATH :roll: :lol: :P 8)
use EXACT following code:
<?php
define('ROOT_PATH', './');
define('SCRIPT_URL', 'http://gallery.rammstein-europe.com/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : SCRIPT_URL.ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
print("
document.write('<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$full_src."\" border=\"1\" alt=\"$image_name\"></a>');
");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title></title>
</head>
<body>
LOL
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php'></SCRIPT>
</body>
</html>
[EDIT by V@no]
corrected index.html to avoid confusion ;) their original code was correct.
-
Und auch hier heisst es immer "Augen auf beim coden" :mrgreen:
ist mir auch nicht aufgefallen, aber bin ja auch kein Profi
LG Harald
-
[EDIT by V@no]
corrected index.html to avoid confusion ;) their original code was correct.
oha :)
i think i forgot my site inside.
thank you V@no!
Harald,
kein problem.. ich habs auch zufällig gesehen... ;)
-
Thank you very much, I was little bit blind.
One more question...instead of resizing random generated picture by width and height attribute, is it possible to generate random thumbnail instead of full image?
That would safe a lot of traffic (gigabites per day)
-
replace image_media_file with image_thumb_file
-
I replaced it on 4 places in the code, it looks now like this:
<?php
define('ROOT_PATH', './');
define('SCRIPT_URL', 'http://gallery.rammstein-europe.com/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$full_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_thumb_file'];
print("
document.write('<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$full_src."\" border=\"1\" alt=\"$image_name\"></a>');
");
?>
But somohow it is still displaying original size pictures. Any ideas?
-
ops..forgot one more change...
replace MEDIA_DIR with THUMB_DIR
but I must warn you, if image doesn't have thumbnail, it'll show a broken image.
-
Now it is working just excellent. Thanx a lot people!
-
OK, the very last thing (I hope :wink: ) is what to do if I want to display 3 images instead of one?
I mean 3 different images. I tried some modification by myself but it was not working
-
use in your index.html:
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php?1'></SCRIPT>
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php?2'></SCRIPT>
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php?3'></SCRIPT>
note, ?1 ?2 and ?3 is just any numbers or strings to prevent browser from caching these scripts.
-
Hallo,
gibt es hier in diesem Script die Möglichkeit, dass man nur die Zufallsbilder angezeigt bekommt, die im Querformat aufgenommen wurden? Demnach müssten über einen Filter alle Bilder im Hochformat ausgefiltert werden.
Bei der Anordnung der Zufallsbilder auf meiner Startseite der Homepage www.keylight-pictures.com sieht es sonst ziemlich blöd aus... :(
Da die Abmessungen der Bilder im System vorhanden sind, müsste es doch eigentlich möglich sein, den Wert der Bildhöhe bzw. Bildbreite zu verarbeiten. Da ich mich aber mit php nicht auskenne, weiss ich auch nicht, wie man dies machen kann? :?
Würde mich über einen Ratschlag riesig freuen.
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
Vermutlich ist das doch ein grösseres Problem - deswegen habe ich eine andere Lösung ausprobiert.
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
Viele Grüße
Klaus
-
okie i've read many post but i still can't make it work. please help me here.
my random.php file
<?php
define('ROOT_PATH', './hinhanh/');
define('SCRIPT_URL', 'http://www.domainame.com/hinhanh/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$full_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_thumb_file'];
print("
document.write('<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$full_src."\" border=\"1\" alt=\"$image_name\"></a>');
");
?>
and this is my test.html file that will be intergrated into my main index.php page... here is the code i put in there..
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title></title>
</head>
<body>
LOL
<SCRIPT language='JavaScript' src='http://domainame.com/hinhanh/random.php?1'></SCRIPT>
<SCRIPT language='JavaScript' src='http://domainame.com/hinhanh/random.php?2'></SCRIPT>
<SCRIPT language='JavaScript' src='http://domainame.com/hinhanh/random.php?3'></SCRIPT>[/quote]
</body>
</html>
but then i still can't make it works.
it still showing this error
it only show the word LOL when i view the test.html file... wont show those 3 images
-
change
define('ROOT_PATH', './hinhanh/');
to
define('ROOT_PATH', './');
and place the random.php where your 4images config.php is.. then it will work..
-
i did - my 4images dir is in ./hinhanh, the config.php is in that root too... i already take off the ./hinhanh/ now only define('ROOT_PATH', './');
but still not working ... i view the random.php file and it's shown these error.
Warning: include(ROOT/config.php) [function.include]: failed to open stream: No such file or directory in /home1/chuahuon/public_html/hinhanh/random.php on line 29
Warning: include() [function.include]: Failed opening 'ROOT/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home1/chuahuon/public_html/hinhanh/random.php on line 29
Warning: include(ROOT/includes/db_mysql.php) [function.include]: failed to open stream: No such file or directory in /home1/chuahuon/public_html/hinhanh/random.php on line 30
Warning: include() [function.include]: Failed opening 'ROOT/includes/db_mysql.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home1/chuahuon/public_html/hinhanh/random.php on line 30
Warning: include(ROOT/includes/constants.php) [function.include]: failed to open stream: No such file or directory in /home1/chuahuon/public_html/hinhanh/random.php on line 31
Warning: include() [function.include]: Failed opening 'ROOT/includes/constants.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home1/chuahuon/public_html/hinhanh/random.php on line 31
Fatal error: Class 'Db' not found in /home1/chuahuon/public_html/hinhanh/random.php on line 34
-
Hallo,
gibt es hier in diesem Script die Möglichkeit, dass man nur die Zufallsbilder angezeigt bekommt, die im Querformat aufgenommen wurden? Demnach müssten über einen Filter alle Bilder im Hochformat ausgefiltert werden.
Bei der Anordnung der Zufallsbilder auf meiner Startseite der Homepage www.keylight-pictures.com sieht es sonst ziemlich blöd aus... :(
Da die Abmessungen der Bilder im System vorhanden sind, müsste es doch eigentlich möglich sein, den Wert der Bildhöhe bzw. Bildbreite zu verarbeiten. Da ich mich aber mit php nicht auskenne, weiss ich auch nicht, wie man dies machen kann? :?
Würde mich über einen Ratschlag riesig freuen.
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
Vermutlich ist das doch ein grösseres Problem - deswegen habe ich eine andere Lösung ausprobiert.
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
Viele Grüße
Klaus
hi & sorry, hab diesen post übersehen...
wenn die abmessung in deiner mysql DB drinnen sind, was normalerweise nicht der fall ist, dann ist es ja kein problem :)
wenn doch nicht.. dann wird das wohl nichts..
ausser jemand schreibt ein script der die bilder abmessungen in die datenbank reinbekommt.. danach, ist es kein problem mehr :)
-
are you sure that you have this inside
define('ROOT_PATH', './');
define('SCRIPT_URL', 'http://www.domainame.com/hinhanh/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
?
and not
define('ROOT', './');
define('SCRIPT_URL', 'http://www.domainame.com/hinhanh/');
include(ROOT.'config.php');
include(ROOT.'includes/db_mysql.php');
include(ROOT.'includes/constants.php');
-
i got it. thanks alot.
but then i put this code into my index.php on main main page...
. "<SCRIPT language='JavaScript' src='http://domainname.com/hinhanh/random.php?1' border='0' width='73' height='83'></SCRIPT>"
. "<SCRIPT language='JavaScript' src='http://domainname.com/hinhanh/random.php?2' border='0' width='73' height='83'></SCRIPT>"
. "<SCRIPT language='JavaScript' src='http://domainname.com/hinhanh/random.php?3' border='0' width='73' height='83'></SCRIPT>"
. "<SCRIPT language='JavaScript' src='http://domainname.com/hinhanh/random.php?4' border='0' width='73' height='83'></SCRIPT>"
. "<SCRIPT language='JavaScript' src='http://domainname.com/hinhanh/random.php?5' border='0' width='73' height='83'></SCRIPT>"
. "<SCRIPT language='JavaScript' src='http://domainname.com/hinhanh/random.php?6' border='0' width='73' height='83'></SCRIPT>"
. "<SCRIPT language='JavaScript' src='http://domainname.com/hinhanh/random.php?7' border='0' width='73' height='83'></SCRIPT>"
i got this and it's working now... but i seted the size of these images to be the same size.. like that ... but how come when it's shown it's not the same size.. so how do i make them all to be shown in one size.
please help.
thanks
-
morning,
1st at all.
get back our 4images copyright into your templates. :evil:
you know what i mean... clickable link to 4homepages.de below "Powered by 4images 1.7.6" ;)
THANK YOU!
2nd:
don't use width and height in your example.
edit your random.php to following:
document.write('<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$full_src."\" border=\"0\" width=\"73\" height=\"83\" alt=\"$image_name\"></a>');
-
let say i want to make this random image switches every 3 seconds, make it like flash.. how do you do this.
-
Ich habe da mal eine Frage. Was muss ich wo verändern, damit das Vorschaubild aus der Galerie auf meiner HP größer wird? Wo kann ich die Werte verändern?
Link zur HP:
http://www.german-spotter-network.de/ (http://www.german-spotter-network.de/)
Viele Grüße
Dipi
-
... das Vorschaubild ist halt so groß wie deine Thumbnails in deiner Galerie ...
... du müsstest also die Thumbnail-Größe in deiner Galerie ändern ... via ACP ...
... denn das Vorschaubild größer zerren als es ist ... macht wohl keinen Sinn ... ;)
-
Wenn das jetzt wirklich so einfach ist..... ich probier das gleich mal aus.
-
Sauber, hat geklappt. Gibt es im ACP eine Funktion mit der ich alle bisher (zu kleinen) Thumbs löschen kann?
-
... eine Löschfunktion für die Thumbs im ACP gibt es nur über die Bild-bearbeiten-Seite ...
... sollte dir das zu mühselig sein, dann via FTP ... /data/media/thumbnails/ ... in den einzelnen Nr.-Ordnern die Thumbnails löschen ...
... und dann via ACP -> Auto-Thumbnailer die neuen, größeren Thumbnails erzeugen ...
... soweit zur Theorie ... und jetzt bist du dran ... ;)
-
... eine Löschfunktion für die Thumbs im ACP gibt es nur über die Bild-bearbeiten-Seite ...
... sollte dir das zu mühselig sein, dann via FTP ... /data/media/thumbnails/ ... in den einzelnen Nr.-Ordnern die Thumbnails löschen ...
... und dann via ACP -> Auto-Thumbnailer die neuen, größeren Thumbnails erzeugen ...
... soweit zur Theorie ... und jetzt bist du dran ... ;)
Auch das habe ich geschafft. Jetzt sieht das auf jeden Fall viel besser aus. Danke für deine Hilfe!
Gruss
Dipi
-
... tatsächlich ... die Thumbs sind alle größer ... ;)
... nun solltest du aber noch dein Galerie-Template anpassen ...
... so dass die großen Thumbs dir nicht das Layout sprengen ...
-
hi, ich hab auch ne Frage zum Random:
random.php
Zeile 66
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img
src=\"".$thumb_src."\" border=\"1\" alt=\"$image_name\"></a><br>\n";
jetzt liegt aber die Galerie in einem Frame mit .htaccess,
siehe:
http://www.4homepages.de/forum/index.php?topic=19882.0
letzte Antwort
wie aber, bekomm eich es hin, das bei www.suppenlaender.de
rechts beim Random-Image, die Galerie innerhalb des Frames öffnet, oben in der reinen Navi, Fotogalerie, klappts ja auch
-
denke mal das nur der header fehlt...
-
???
dann würde ja: http://www.suppenlaender.de/fotogalerie/index.php
nicht funktionieren, klar ist der header da!
guckste: http://www.suppenlaender.de/galerie/index.php
der Inhalt wird per .htaccess geladen, somit siehtst du im Quelltext keinen Frame oder iFrame
-
Hi everybody
I use Version 1.7.6! I need help with the indication of rondom pictures on an external site! I don´t understand a lot php! I read almost all about the rondom picture in this forum in ahead! But..... :roll:
I want 3 rondom pictures underneath on www.oldtimers-im-fokus.ch
I saved the script mentioned on http://www.nicky.net/4images/random.txt under rondom.php
During the instructions, they talk about a file called rondom_mod.php ......................I cannot find any file like this??
And in what root to I have to save rondom.php ?? In the 4image gallery level, or in the root level of the page where I want the rondom image to show up?
Thanks a lot
Oldie
-
well when i show more than 1 image like 5 it show from up to down is it possible that it show images from left to right or right to left?
-
Ist es möglich ein Zufallsbild von nur EINER Kategorie zu erzeugen? So, dass ich auf einer externen Seite 5 Zufallsbilder habe von 5 bestimmten Kategorien?
Is it possible a random-image from ONE categorie to create? So that i have at an external page five random-pictures from five defined categories?
-
Hi everybody
I use Version 1.7.6! I need help with the indication of rondom pictures on an external site! I don´t understand a lot php! I read almost all about the rondom picture in this forum in ahead! But..... :roll:
I want 3 rondom pictures underneath on www.oldtimers-im-fokus.ch
I saved the script mentioned on http://www.nicky.net/4images/random.txt under rondom.php
During the instructions, they talk about a file called rondom_mod.php ......................I cannot find any file like this??
And in what root to I have to save rondom.php ?? In the 4image gallery level, or in the root level of the page where I want the rondom image to show up?
Thanks a lot
Oldie
hi,
create a blank file with the name, as example for the test, random_mod.php (normaly you can add the below to your php script)
<?php
include("./random.php");
?>
place random.php into the root of 4images..
BUT you have to define PATH of random.php in random_mod.php or in your php file
-
well when i show more than 1 image like 5 it show from up to down is it possible that it show images from left to right or right to left?
change
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
to
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a>\n";
but you will not have image name and number of comments.
-
Ist es möglich ein Zufallsbild von nur EINER Kategorie zu erzeugen? So, dass ich auf einer externen Seite 5 Zufallsbilder habe von 5 bestimmten Kategorien?
Is it possible a random-image from ONE categorie to create? So that i have at an external page five random-pictures from five defined categories?
hmm.... zuerst schreibst du von "EINER" und dann von "5 bestimmten Kategorien".
wie möchtest du es genau?
jeweils ein bild aus einer bestimmten kategorie und das ganze 5 mal so?
-
Quasi ein Zufallsbild wo mir nur Bilder einer bestimmten Kategorie anzeigt. Ich meinte dann dass ich 5 Zufallsbilder auf ne andere Seite machen kann. Aber nur von EINER bestimmten Ketegorie die ich frei wählen kann. Es sollte aber variable sein, d.h. ich mache zwei Zufallsbilder nebeneinander und das linke zeigt dann nur Fußballbilder und das rechte nur Handballbilder.
Verstanden?
Gruß Christian
-
Hi Christian,
nachdem ich ein lebender ausländer in österreich bin ist deutsch nicht meine muttersprache :mrgreen:
und habs überhaupt nicht geschnallt was du vor hast.. :oops:
vielleicht versuchst du es mit bildern 8)
nichts für ungut
LG
-
------------------------------- ------------------------------- ------------------------------- -------------------------------
- - - - - - - -
- Zufallsbild 1 - - Zufallsbild 2 - - Zufallsbild 1 - - Zufallsbild 2 -
- nur - - nur - - nur - - nur -
- Kategorie Fussball - - Kategorie Tennis - - Kategorie Tiere - - Kategorie Konzert -
- - - - - - - -
- - - - - - - -
- - - - - - - -
- - - - - - - -
------------------------------- ------------------------------- ------------------------------- -------------------------------
So jetzt verstanden? In jedem Zufallsbild sollen nur die Bilder der bestimmten Kategorie erscheinen.
Gruß Christian
-
------------------------------- ------------------------------- ------------------------------- -------------------------------
- - - - - - - -
- Zufallsbild 1 - - Zufallsbild 2 - - Zufallsbild 1 - - Zufallsbild 2 -
- nur - - nur - - nur - - nur -
- Kategorie Fussball - - Kategorie Tennis - - Kategorie Tiere - - Kategorie Konzert -
- - - - - - - -
- - - - - - - -
- - - - - - - -
- - - - - - - -
------------------------------- ------------------------------- ------------------------------- -------------------------------
So jetzt verstanden? In jedem Zufallsbild sollen nur die Bilder der bestimmten Kategorie erscheinen.
Gruß Christian
ich hoffe ich hab es jetzt verstanden:
http://wallp.ape.rs/random.php
zufalls bilder aus 5 verschiedenen kategorien
code dafür
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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.cat_id = 1 /* KATEGORIE ID */
ORDER BY RAND()
LIMIT 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
$sql2 = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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.cat_id = 478 /* KATEGORIE ID */
ORDER BY RAND()
LIMIT 1";
$row2 = $site_db->query_firstrow($sql2);
$image_id2 = $row2['image_id'];
$cat_id2 = $row2['cat_id'];
$image_name2 = $row2['image_name'];
$image_comments2 = $row2['image_comments'];
$thumb_src2 = (is_remote($row2['image_thumb_file'])) ? $row2['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id2."/".$row2['image_thumb_file'];
$sql3 = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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.cat_id = 557 /* KATEGORIE ID */
ORDER BY RAND()
LIMIT 1";
$row3 = $site_db->query_firstrow($sql3);
$image_id3 = $row3['image_id'];
$cat_id3 = $row3['cat_id'];
$image_name3 = $row3['image_name'];
$image_comments3 = $row3['image_comments'];
$thumb_src3 = (is_remote($row3['image_thumb_file'])) ? $row3['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id3."/".$row3['image_thumb_file'];
$sql4 = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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.cat_id = 248 /* KATEGORIE ID */
ORDER BY RAND()
LIMIT 1";
$row4 = $site_db->query_firstrow($sql4);
$image_id4 = $row4['image_id'];
$cat_id4 = $row4['cat_id'];
$image_name4 = $row4['image_name'];
$image_comments4 = $row4['image_comments'];
$thumb_src4 = (is_remote($row4['image_thumb_file'])) ? $row4['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id4."/".$row4['image_thumb_file'];
$sql5 = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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.cat_id = 477 /* KATEGORIE ID */
ORDER BY RAND()
LIMIT 1";
$row5 = $site_db->query_firstrow($sql5);
$image_id5 = $row5['image_id'];
$cat_id5 = $row5['cat_id'];
$image_name5 = $row5['image_name'];
$image_comments5 = $row5['image_comments'];
$thumb_src5 = (is_remote($row5['image_thumb_file'])) ? $row5['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id5."/".$row5['image_thumb_file'];
echo "<table border=\"1\"><tr><td><a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a></td><td><a href=\"".ROOT_PATH."details.php?image_id=$image_id2\"><img src=\"".$thumb_src2."\" border=\"0\" alt=\"$image_name2\"></a></td><td><a href=\"".ROOT_PATH."details.php?image_id=$image_id3\"><img src=\"".$thumb_src3."\" border=\"0\" alt=\"$image_name3\"></a></td><td><a href=\"".ROOT_PATH."details.php?image_id=$image_id4\"><img src=\"".$thumb_src4."\" border=\"0\" alt=\"$image_name4\"></a></td><td><a href=\"".ROOT_PATH."details.php?image_id=$image_id5\"><img src=\"".$thumb_src5."\" border=\"0\" alt=\"$image_name5\"></a></td></tr>\n";
echo "<tr><td><b>$image_name</b><br>Kommentare: $image_comments</td><td><b>$image_name2</b><br>Kommentare: $image_comments2</td><td><b>$image_name3</b><br>Kommentare: $image_comments3</td><td><b>$image_name4</b><br>Kommentare: $image_comments4</td><td><b>$image_name5</b><br>Kommentare: $image_comments5</td></tr></table>\n";
?>
suche nach /* KATEGORIE ID */
die zahlen deinen cat_id's anpassen
-
@Harry,
here is it:
http://www.nicky.net/4images/random_more_pics.txt
for certain category add this: http://www.4homepages.de/forum/viewtopic.php?p=4360#4360
hi nicky,
vielen dank für deinen hinweis wie man mehrere bilder extern anzeigen kann... so wie es aktuell ist werden 4 bilder untereinander extern angezeigt ... wie kann ich 4 bilder nebeneinander angezeigt bekommen?
gruss, bergblume
-
ok, problem solved by myself...
if anyone should need it, here is the code:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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');
define('SCRIPT_URL', 'http://www.YOUR-DOMAIN-NAME.com/');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 4;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
ORDER BY RAND()
LIMIT $num_images";
$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_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<table border='0' width='133' bgcolor='#FFFFFF' Align=left>\n";
echo "<TR>\n";
echo "<TD><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <img src=\"".SCRIPT_URL.$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD bgcolor='#FFFFFF'> <a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <b>$image_name</b></a><br>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD bgcolor='#FFFFFF'>Kommentare: $image_comments</TD>\n";
echo "</TR>\n";
echo "</table>\n";
}
?>
-
ich habe doch noch ne kurze frage:
was muss ich einstellen, damit ich
a) alle bilder ausgegeben bekomme
b) die bilder in einer tabelle mit je 5 bildern pro zeile ausgegeben werden??
hier den code, den ich bisher verwende (zur darstellung der tabelle)
echo "<table border='0' width='133' bgcolor='#FFFFFF' Align=left>\n";
echo "<TR>\n";
echo "<TD><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <img src=\"".SCRIPT_URL.$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD bgcolor='#FFFFFF'> <a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <b>$image_name</b></a><br>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD bgcolor='#FFFFFF'>Kommentare: $image_comments</TD>\n";
echo "</TR>\n";
echo "</table>\n";
c) ich habe ein zusätzliches image field bei mir eingebaut --- z.b. image_fotostandort --- wie kann ich die bilder extern nur zu diesem thema angezeigt bekommen=?
folgendes habe ich schon probiert leider ohne erfolg:
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_photostandort
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_photostandort = ort1
ORDER BY RAND()
LIMIT $num_images";
$result = $site_db->query($sql);
-
Also bei dem Riesenthema blickt ja niemand mehr durch
Habe jetzt per Suchfunktion versuch etwas brauchbares herauszufinden, leider nicht !
Bin mit Php überhaupt nicht Vertraut habe es nun so eingerichtet:
die random.php liegt in meinem Galerie verzeichnis habe es auf der Hauptseite per
<?php
include("./galerie/random.php");
?>
einbinden können - Es funktioniert
Nun zu meinem Problem :
Ich möchte es nun auf einer Unterseite einbinden Befindlich im Ordner /blog//wp-content/themes/Girl-Grafixx
Wie muss nun der korrekte Include-Befehl lauten ?
-
am sichersten (wenn du keine php-kenntnisse hast) ist, wenn du den absoluten pfad á la
<?php
include("http://www.dein-domain.de/galerie/random.php");
?>
eingibst. probier´s mal so...
-
am sichersten (wenn du keine php-kenntnisse hast) ist, wenn du den absoluten pfad á la
<?php
include("http://www.dein-domain.de/galerie/random.php");
?>
eingibst. probier´s mal so...
nur zur euer info
bergblume: dies ist eine URL.. kein PFAD
http://de.wikipedia.org/wiki/URL
http://de.wikipedia.org/wiki/Pfad#Dateisystem
-
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /mnt/web7/52/08/51792108/htdocs/blog/wp-content/themes/Girl-Grafixx/sidebar.php on line 56
Schade, so wirds nicht gehen
-
Niemand eine Idee ? :(
-
Hi all, hope you are fine !
I downloaded the random-image mod and would like to know:
how can I set this up to show the category of the picture?
Here is my code:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_full.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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
define('ROOT_PATH', './4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
echo "<img src=\"".$full_src."\" height=\"125\" width=\"150\" border=\"2\" alt=\"$image_name\"></a><br>\n";
echo '<font size="-2" face="Arial, Helvetica, sans-serif"><br>';
echo "$image_name\n";
?>
Thanks a lot
Trev
-
Ich habe noch immer folgendes Problem:
4images läuft auf meinem Webspace im Ordner galerie , desweiteren nutze ich einen Wordpress-Blog, dieser befindet sich im Ordner Blog.
Nun möchte ich das Zufallsbild auf der Sidebar einbinden.
Der Pfad zu dieser Datei ist folgender : /blog/wp-content/themes/Girl-Grafixx/sidebar.php
Nun habe ich versucht das Script so einzubinden:
<?php
include("./../../../galerie/random.php");
?>
Leider funktioniert das so nicht.
Kann mir jemand den passenden include Befehl nennen oder hat eine Problemlösung parat ?
-
Hmmm,
hat keiner eine Antwort auf meine Frage (siehe oben) ???
Bidde.... :oops:
LG
-
Hmmm,
hat keiner eine Antwort auf meine Frage (siehe oben) ???
Bidde.... :oops:
LG
hi,
probier es so
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_full.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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
define('ROOT_PATH', './4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_comments, b.cat_name
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_name = $row['cat_name'];
$image_name = $row['image_name'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
echo "<img src=\"".$full_src."\" height=\"125\" width=\"150\" border=\"2\" alt=\"$image_name\"></a><br>\n";
echo '<font size="-2" face="Arial, Helvetica, sans-serif"><br>';
echo "$image_name<br/>\n";
echo "$cat_name\n";
?>
-
Niemand hat eine Ahnung wegen dem Include Befehl :cry:
-
Niemand hat eine Ahnung wegen dem Include Befehl :cry:
hi Ninimaus,
würde dir gerne helfen aber hab kein wordpress installiert.
wenn mir die zeit zulässt gucke ich die nächsten paar tage.
-
Hab jetzt wie wild rumprobiert und es geschafft
-
na perfect ;)
lass sehen.
-
Hallo Nicky,
vielen Dank für den Kategorie Namen, dieser wird angezeigt, doch leider wird der Thumbnail nicht angezeigt!
Könntest Du mal schauen?
Dankeschön.
(Gelöst, es fehlte das
$cat_id = $row['cat_id'];)
-
Hallo
ich habe anstatt die Thumbnails zu benutzen, die eigentlichen Bilder als Vorscheu genommen. Meine Bilder sind nicht sehr groß (400px breit und so 6okb)
Momentan werden die Fotos ja skaliert (150x125 oder so).
Aber ich habe ja auch breite und hohe Bilder und mit dem Randomimage Script wird ja das Bild dann verzerrt - zu breit oder zu hoch.
Wie kann ich es ändern?
Danke
-
hi Trev,
hmm...
du hast es doch selber so eingestellt:
echo "<img src=\"".$full_src."\" height=\"125\" width=\"150\" border=\"2\" alt=\"$image_name\"></a><br>\n";
nehme halt
height=\"125\" width=\"150\"
wieder raus.. dann hast es in der original grösse
-
Hi Nicky
Ja, das weiß ich :-)
Kann ich es evtl prozentual ausgeben?
Grüße von
Trev
Hey Du magst wohl auch Basketball?
-
i have a problem using this random images javascript... i tried to make these thumbnails expando when mouseover while it's marquee from the right to left... will stop and expand the image to a bigger size when mouseover ... the crawler script is working but the expando is still not working... can anyone please help me with this ....
<?php
if ((!defined('NV_SYSTEM')) AND (!defined('NV_ADMIN'))) {
Header("Location: ../index.php");
exit;
}
$content .= "<head>\n";
$content .= "<style type=\"text/css\">\n";
$content .= "img.expando{ /*sample CSS for expando images. Not required but recommended*/\n";
$content .= "border: none;\n";
$content .= "vertical-align: top; /*top aligns image, so mouse has less of a change of moving out of image while image is expanding*/\n";
$content .= "}\n";
$content .= "</style>\n";
$content .= "</head>\n";
$content .= "<script type=\"text/javascript\" src=\"../js/expando.js\"></script>\n";
$content .= "<script type=\"text/javascript\" src=\"../js/crawler.js\"></script>\n";
$content .= "<div class=\"marquee\" id=\"mycrawler2\">\n";
$content .= "<p><p align=\"center\"> <SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?1\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content .= " <SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?2\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content .= " <SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?3\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content .= " <SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?4\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content .= " <SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?5\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content .= " <SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?6\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content .= " <SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?7\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content .= "</div></p>\n";
$content .= "<script type=\"text/javascript\">\n";
$content .= "marqueeInit({\n";
$content .= " uniqueid: 'mycrawler2',\n";
$content .= " style: {\n";
$content .= " 'padding': '2px',\n";
$content .= " 'width': '600px',\n";
$content .= " 'height': '180px'\n";
$content .= " },\n";
$content .= " inc: 3, //speed - pixel increment for each iteration of this marquee's movement\n";
$content .= " mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)\n";
$content .= " moveatleast: 2,\n";
$content .= " neutral: 150,\n";
$content .= " savedirection: true\n";
$content .= "});\n";
$content .= "</script>\n";
?>
this is the image expando script site... http://www.dynamicdrive.com/dynamicindex4/expandoimage.htm
-
@Harry,
here is it:
http://www.nicky.net/4images/random_more_pics.txt
for certain category add this: http://www.4homepages.de/forum/viewtopic.php?p=4360#4360
@ Nicky, sorry for pulling out an old post as a Quote reference
but i would like to ask for a little help, since by applying your code we get multi images in a vertical column, could you please just make a tweak and change it to horizontal position.
the current positions of images are like this
image1
image2
image3
i want them to be like .... image1 image2 image3
...........
Edited: Oops i didnt know a guy named bergblume already solved this issue (http://www.4homepages.de/forum/index.php?topic=1020.msg130514#msg130514) on the previous page(i saw it lately and i had to translate his post lolz, i dont know German, hope to learn it from benny some day :P )
anyways. i made it to work with the help of Nicky and bergblume
and i am now able to show 4 random images on a different Domain powered by Wordpress
example: http://www.pashtosms.com (http://www.pashtosms.com) see the front page
-
Ich liebe den Mod, aber ich habe eine Problem.
Bei Zirkelbilder.de haben wir zwei Galerien.
Einmal eine für die großen Bilder, einmal eine für die Avatare (unsere Avatarbase).
Ich möchte auf dem Blog von beiden Galerien die Zufallbilder zeigen.
Von der Hauptgalerie macht er es perfekt, so wie ich möchte.
Nun hab ich das ganze versucht zusätzlich mit der "Avatarbase" einzubauen und da haut er mir immer diese Fehlermeldung raus:
Warning: main(../galerie/includes/db_mysql_new.php) [function.main]: failed to open stream: No such file or directory in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 33
Warning: main(../galerie/includes/db_mysql_new.php) [function.main]: failed to open stream: No such file or directory in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 33
Warning: main() [function.include]: Failed opening '../galerie/includes/db_mysql_new.php' for inclusion (include_path='.:/usr/share/php:..') in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 33
Fatal error: Cannot redeclare is_remote() (previously declared in /www/htdocs/w0090b99/zirkelbilder/random.php:37) in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 38
Irgendwie versteh ich nicht, warum er immer auf die Galerie versucht zuzugreifen bei der db_mysql_new.php.
Denn schließlich gebe ich in der avatar.php (umbenannte random.php) vor, dass er auf die avatare zugreifen soll.
Trotzdem verweigert sich das System und ich verzweifel.
Kann mir jemand helfen?
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', '../avatars/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql_new.php');
include(ROOT_PATH.'includes/constants.php');
define('SCRIPT_URL', 'http://avatare.zirkelbilder.de/');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_new\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>
-
I've seen modification how to make random.php work with sertan categories, but is that possible use all categories and filter the ones I dont want to use?
if I have 200+ categories this way:
AND a.cat_id IN (4, 9, 15)
would be just pain...if I dont want use 2 categories...
or it would be easier if I creat a new group, then set witch categories that group can access and use this code?:
AND b.auth_viewimage=2
or that code only works as 'guest','registered', or 'admin'? (sry, dont speak german)
Hi Vano, Did you make it work?
sorry for digging out an old post as reference, but i am also looking for a way that a specific category is excluded in the random images on external pages.
-
hi yousaf,
if you want to exlude some categories, then use insteaf of
AND a.cat_id IN (4, 9, 15)
this
AND a.cat_id NOT IN (4, 9, 15)
-
Ich liebe den Mod, aber ich habe eine Problem.
Bei Zirkelbilder.de haben wir zwei Galerien.
Einmal eine für die großen Bilder, einmal eine für die Avatare (unsere Avatarbase).
Ich möchte auf dem Blog von beiden Galerien die Zufallbilder zeigen.
Von der Hauptgalerie macht er es perfekt, so wie ich möchte.
Nun hab ich das ganze versucht zusätzlich mit der "Avatarbase" einzubauen und da haut er mir immer diese Fehlermeldung raus:
Warning: main(../galerie/includes/db_mysql_new.php) [function.main]: failed to open stream: No such file or directory in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 33
Warning: main(../galerie/includes/db_mysql_new.php) [function.main]: failed to open stream: No such file or directory in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 33
Warning: main() [function.include]: Failed opening '../galerie/includes/db_mysql_new.php' for inclusion (include_path='.:/usr/share/php:..') in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 33
Fatal error: Cannot redeclare is_remote() (previously declared in /www/htdocs/w0090b99/zirkelbilder/random.php:37) in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 38
Irgendwie versteh ich nicht, warum er immer auf die Galerie versucht zuzugreifen bei der db_mysql_new.php.
Denn schließlich gebe ich in der avatar.php (umbenannte random.php) vor, dass er auf die avatare zugreifen soll.
Trotzdem verweigert sich das System und ich verzweifel.
Kann mir jemand helfen?
hi CorFie,
schick mal deine FTP daten, per PN, an mich und wohin die avatar randoms gezeigt werden.
-
hi yousaf,
if you want to exlude some categories, then use insteaf of
AND a.cat_id IN (4, 9, 15)
this
AND a.cat_id NOT IN (4, 9, 15)
Thanks Nicky
i will give it a try when i get back home. you are always there with a solution :D
-
Kurze Frage:
Funktioniert das Random-Script auch dann, wenn das Zufallsbild auf einer externen Seite angezeigt werden soll, also auf einem anderen Webspace?
Wenn ja, müsste ich dann ganz oben im Script an dieser Stelle die vollständige Webadresse mit http://www. ... angeben?
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', './bilder/');
-
Hi Nicky,
Your mod works great, if I run the random.php from the web browser.
Problem is when I include it in my html page using <?php include("./random.php"); ?> .... It won't link it the random.php file. My webhost has disabled the use of php code in html files. Is there another way of making the random.php work with my html file.
Thanks, Wayne
-
@waynenort
... then use a iframe with random.php as content in your html-file ...
-
cheers
-
Ich verstehe hier nur noch Bahnhof, nachdem ich hier ungefähr 20 seiten durchgelesen habe. Ich habe den code hier
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_full.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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. *
* *
*************************************************************************/
[color=red]// http://meine_homepage/unterordner/4images[/color]
define('ROOT_PATH', './4images/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$full_src."\" border=\"1\" alt=\"$image_name\"></a><br>\n";
?>
genommen und als random_php auf meinen Server geladen, so jetzt setzt es bei mir aus, habe den pfad zur 4images galerie eingegeben , aber es funktioniert nicht (rot gekennzeichnet)? Was mache ich falsch?Habe den pfad auch schon woanders eingefügt aber es klappt einfach nicht.
Danke für die hilfe
-
Is there anyway that when using this mod. . . . . When the thumbnail is clicked the page opens up in a New/blank window? Setting the Target for the link to blank ?
I am guessing setting the target to blank in this line somewhere. . . Just not sure where. . Any thoughts?
document. write('<a href=\"". SCRIPT_URL. "details. php?image_id=$image_id\"><img src=\"". $full_src. "\" border=\"1\" alt=\"$image_name\"></a>');
-
Is there anyway that when using this mod. . . . . When the thumbnail is clicked the page opens up in a New/blank window? Setting the Target for the link to blank ?
I am guessing setting the target to blank in this line somewhere. . . Just not sure where. . Any thoughts?
document. write('<a href=\"". SCRIPT_URL. "details. php?image_id=$image_id\"><img src=\"". $full_src. "\" border=\"1\" alt=\"$image_name\"></a>');
hi Horvath,
document. write('<a href=\"". SCRIPT_URL. "details. php?image_id=$image_id\" target=\"_blank\"><img src=\"". $full_src. "\" border=\"1\" alt=\"$image_name\"></a>');
@MoXxinator
ich verstehe auch leider nur bahnhof ;)
bitte link zu deiner gallery und zu der random.php
und denn link wo du es einfügen willst.
dann könnten wir abfahren ;)
-
I think I fixed the script when it chose non picture file and shows red X.
I modified it so now it wont return full <img code, but will return full path with filename. Plus now u can show thumbnail and/or full picture.
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './4images/'); // change this to your 4images dir.
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/default/icons/"); // path to your template icons.
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
function get_file_extension($file_name) {
ereg("(.+)\.(.+)", basename($file_name), $regs);
return strtolower($regs[2]);
}
function check_thumb_type($file_name) {
return (preg_match('#(gif|jpg|jpeg|png)$#is', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_thumb_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_extention = get_file_extension($row['image_media_file']);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
if (empty($row['image_thumb_file'])) {
$thumb_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
}
if (!check_thumb_type($image_extention)) {
$full_src = ICON_PATH."/".$image_extention.".gif";
}
else {
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
}
$full_src_link = ROOT_PATH."details.php?image_id=$image_id";
?>
Now u'll need call random. php file just ones
<?php include("random.php"); ?>
after that u can show thumbnail:
<img src="<?php echo $thumb_src; ?>" border="1">
or show full picture:
<img src="<?php echo $full_src; ?>" border="1">
if u need add link to the image, use like this:
<a href="<?php echo $full_src_link; ?>">
<img src="<?php echo $thumb_src; ?>" border="1">
</a>
well iam getting this error . . plz help me out :idea:
Warning: include(./wallzz/config.php) [function.include]: failed to open stream: No such file or directory in /home/wallpapr/public_html/wallzz/random.php on line 29
Warning: include(./wallzz/config.php) [function.include]: failed to open stream: No such file or directory in /home/wallpapr/public_html/wallzz/random.php on line 29
Warning: include() [function.include]: Failed opening './wallzz/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/wallpapr/public_html/wallzz/random.php on line 29
Warning: include(./wallzz/includes/db_mysql.php) [function.include]: failed to open stream: No such file or directory in /home/wallpapr/public_html/wallzz/random.php on line 30
Warning: include(./wallzz/includes/db_mysql.php) [function.include]: failed to open stream: No such file or directory in /home/wallpapr/public_html/wallzz/random.php on line 30
Warning: include() [function.include]: Failed opening './wallzz/includes/db_mysql.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/wallpapr/public_html/wallzz/random.php on line 30
Warning: include(./wallzz/includes/constants.php) [function.include]: failed to open stream: No such file or directory in /home/wallpapr/public_html/wallzz/random.php on line 31
Warning: include(./wallzz/includes/constants.php) [function.include]: failed to open stream: No such file or directory in /home/wallpapr/public_html/wallzz/random.php on line 31
Warning: include() [function.include]: Failed opening './wallzz/includes/constants.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/wallpapr/public_html/wallzz/random.php on line 31
Fatal error: Class 'Db' not found in /home/wallpapr/public_html/wallzz/random.php on line 33
-
@ ahsancharming
... "No such file or directory ... random.php" ...
... where is your random.php ... ?
-
i uploaded in my 4images gallery root
thats what inside my random. php
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './wallzz/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
define('SCRIPT_URL', 'http://www.wallpaperspecial.com/wallzz');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 4;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
ORDER BY RAND()
LIMIT $num_images";
$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_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<table border='0' width='133' bgcolor='#FFFFFF' Align=left>\n";
echo "<TR>\n";
echo "<TD><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <img src=\"".SCRIPT_URL.$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD bgcolor='#FFFFFF'> <a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <b>$image_name</b></a><br>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD bgcolor='#FFFFFF'>Kommentare: $image_comments</TD>\n";
echo "</TR>\n";
echo "</table>\n";
}
?>
is it correct?
-
if random.php is in your 4images ROOT
then
define('ROOT_PATH', './wallzz/');
should be
define('ROOT_PATH', './');
and change
define('SCRIPT_URL', 'http://www.wallpaperspecial.com/wallzz');
to
define('SCRIPT_URL', 'http://www.wallpaperspecial.com/wallzz/');
after changes call
http://www.wallpaperspecial.com/wallzz/random.php
and ADD ASAP 4images copyright back.
-
thx but i want few changes
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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');
define('SCRIPT_URL', 'http://www.wallpaperspecial.com/wallzz/');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 4;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
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."
ORDER BY RAND()
LIMIT $num_images";
$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_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<table border='0' width='133' bgcolor='#FFFFFF' Align=left>\n";
echo "<TR>\n";
echo "<TD><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <img src=\"".SCRIPT_URL.$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD bgcolor='#FFFFFF'> <a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <b>$image_name</b></a><br>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD bgcolor='#FFFFFF'>Views: $image_hits</TD>\n";
echo "</TR>\n";
echo "</table>\n";
}
?>
i've added ($image_hits) but its not working and i want USER FRIENDLY URLS. solve theze 2 lil probs. . rest all f9.
-
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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');
define('SCRIPT_URL', 'http://www.wallpaperspecial.com/wallzz/');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 4;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_hits
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."
ORDER BY RAND()
LIMIT $num_images";
$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_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
$image_hits = $row['image_hits'];
echo "<table border='0' width='133' bgcolor='#FFFFFF' Align=left>\n";
echo "<TR>\n";
echo "<TD><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <img src=\"".SCRIPT_URL.$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD bgcolor='#FFFFFF'> <a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <b>$image_name</b></a><br>\n";
echo "</TR>\n";
echo "<TR>\n";
echo "<TD bgcolor='#FFFFFF'>Views: $image_hits</TD>\n";
echo "</TR>\n";
echo "</table>\n";
}
?>
about: USER FRIENDLY URLS
rightnow this is not possible from my side.
-
ok Copyright Tag Added on all pages of http://www.wallpaperspecial.com/wallzz/
now please solve the issue?
..
[EDIT]
i edited my previous post.
-
HELP NEEDED BADLY..!
http://www.wallpaperspecial.com/wallzz/random.php
i have changed the background colour but "image name" and "VIEWS" bg colour is still showing WHITE.. how can i edit the font n bg colour by my needs and also can i change the thumbnail size?
please help me out regarding this..
-
hi,
change you colors here
echo "<TD bgcolor='#FFFFFF'> <a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <b>$image_name</b></a><br>\n";
echo "<TD bgcolor='#FFFFFF'>Views: $image_hits</TD>\n";
thumnails are in original size, but you can add width and height to your html code at
<img src=\"".SCRIPT_URL.$thumb_src."\" border=\"0\" alt=\"$image_name\">
and thank you for added 4images copyright back
-
well thanx alot but i still want it to be perfect
1) i want a hyperlink of category on category name.
2) i wont the font in "CENTER" , "VERDENA" and "Size.2".
3) is it possile to use friendly urls ?
-
Hallo!
Ich habe noch eine kurze Frage bezüglich Sicherheit:
Sollte bei "$image_name = $row['image_name'];" nicht eine Sicherheits-Funktion, wie "format_text(..." oder "safe_htmlspecialchars(..." oder so änlich eingebaut/berücksichtigt werden?
Danke & Gruss
-
Hallo!
Ich habe noch eine kurze Frage bezüglich Sicherheit:
Sollte bei "$image_name = $row['image_name'];" nicht eine Sicherheits-Funktion, ........ eingebaut/berücksichtigt werden?..
$row['image_name'] kommt aus der datenbank, ich denke da braucht man so etwas nicht, und dort sollte der image name schon bereinigt sein.
sollte der image name nicht bereinigt hinneingeschrieben werden, können man mit einer sql injektion die DB manipulieren.
mfg Andi
-
Hallo!
Ich habe noch eine kurze Frage bezüglich Sicherheit:
Sollte bei "$image_name = $row['image_name'];" nicht eine Sicherheits-Funktion, wie "format_text(..." oder "safe_htmlspecialchars(..." oder so änlich eingebaut/berücksichtigt werden?
Danke & Gruss
i dont understand this language ..please explain me in english
thnx
-
@ ahsancharming
1. this language is German ( you are on a .de-domain ) ...
2. for this case we have the translation feature on the top on each site ...
-
well thanx alot but i still want it to be perfect
1) i want a hyperlink of category on category name.
2) i wont the font in "CENTER" , "VERDENA" and "Size.2".
3) is it possile to use friendly urls ?
1.) i will create an query for you
2.) use html codes like for the background color in my previons post
3.) no, it is not possible rightnow
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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');
define('SCRIPT_URL', 'http://www.wallpaperspecial.com/wallzz/');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
echo "<body bgcolor=\"#5D8FB5\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n";
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 1;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_hits, b.cat_name
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."
ORDER BY RAND()
LIMIT $num_images";
$result = $site_db->query($sql);
echo "<table border='0' width='133' bgcolor='#5D8FB5' align='left'>\n";
while ($row = $site_db->fetch_array($result)){
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
$image_hits = $row['image_hits'];
$cat_name = $row['cat_name'];
echo "<tr>\n";
echo "<td><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <img src=\"".SCRIPT_URL.$thumb_src."\" border=\"0\" alt=\"$image_name\"></a></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><font face='Verdana' size='2'><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"><b>$image_name</b></a></font></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><font face='Verdana' size='2'>Views: $image_hits</font></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><font face='Verdana' size='2'><a href=\"".SCRIPT_URL."categories.php?cat_id=$cat_id\" target=\"_blank\">$cat_name</a></font></td>\n";
echo "</tr>\n";
}
echo "</table>\n";
?>
-
well thanx alot but i still want it to be perfect
1) i want a hyperlink of category on category name.
2) i wont the font in "CENTER" , "VERDENA" and "Size.2".
3) is it possile to use friendly urls ?
1.) i will create an query for you
2.) use html codes like for the background color in my previons post
3.) no, it is not possible rightnow
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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');
define('SCRIPT_URL', 'http://www.wallpaperspecial.com/wallzz/');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
echo "<body bgcolor=\"#5D8FB5\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n";
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 1;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_hits, b.cat_name
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."
ORDER BY RAND()
LIMIT $num_images";
$result = $site_db->query($sql);
echo "<table border='0' width='133' bgcolor='#5D8FB5' align='left'>\n";
while ($row = $site_db->fetch_array($result)){
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
$image_hits = $row['image_hits'];
$cat_name = $row['cat_name'];
echo "<tr>\n";
echo "<td><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <img src=\"".SCRIPT_URL.$thumb_src."\" border=\"0\" alt=\"$image_name\"></a></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><font face='Verdana' size='2'><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"><b>$image_name</b></a></font></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><font face='Verdana' size='2'>Views: $image_hits</font></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><font face='Verdana' size='2'><a href=\"".SCRIPT_URL."categories.php?cat_id=$cat_id\" target=\"_blank\">$cat_name</a></font></td>\n";
echo "</tr>\n";
}
echo "</table>\n";
?>
sorry iam asking u small small things..im not gud into php ..
i tried 2-3 times to to make the text in center.. :)
may i know where to add this "p align='center"</p> ?
-
<td align='center'>
those are NOT PHP basic :P
-
Hi!
..
sorry iam asking u small small things..im not gud into php ..
i tried 2-3 times to to make the text in center.. :)
may i know where to add this "p align='center"</p> ?
its not valide.
test it:
echo "<table style=\"background-color:#5D8FB5;border-style:none;width:133px;text-align:center;\" summary=\"randomtable\">\n";
while ($row = $site_db->fetch_array($result)){
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
$image_hits = $row['image_hits'];
$cat_name = $row['cat_name'];
echo "<tr>\n";
echo "<td><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" onclick=\"void(window.open(this.href, '', '')); return false;\"><img src=\"".SCRIPT_URL.$thumb_src."\" style=\"border-style:none;\" alt=\"$image_name\"></a></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td style=\"font-family:Verdana,Arial;font-size:12px;font-weight:bold;\"><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" onclick=\"void(window.open(this.href, '', '')); return false;\">$image_name</a></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td style=\"font-family:Verdana,Arial;font-size:12px;\">Views: $image_hits</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td style=\"font-family:Verdana,Arial;font-size:12px;\"><a href=\"".SCRIPT_URL."categories.php?cat_id=$cat_id\" onclick=\"void(window.open(this.href, '', '')); return false;\">$cat_name</a></td>\n";
echo "</tr>\n";
}
echo "</table>\n";
?>
mfg Andi
-
<td align='center'>
those are NOT PHP basic :P
ok thx alot..finally it works all the way right that i want.
-
Ich bekomme nun folgende Fehlermeldung wenn ich meine exterene index.php aufrufe.....Warning: include(4images/random.php) [function.include]: failed to open stream: No such file or directory in /var/www/web58/html/index.php on line 23
Warning: include() [function.include]: Failed opening '4images/random.php' for inclusion (include_path='.') in /var/www/web58/html/index.php on line 23
-
Ich bekomme nun folgende Fehlermeldung wenn ich meine exterene index.php aufrufe.....Warning: include(4images/random.php) [function.include]: failed to open stream: ....
hast du die random.txt im eingangspost, auch als random.php in deinem root abgespeichert?
-
Moin,
wollte diese Modifikation gerade mal angehen ... leider kommt bei mir ne hässliche Fehlermeldung - http://galerie.jmsfoto.net/random.php (http://galerie.jmsfoto.net/random.php)
Wo liegt der Fehler? Kann mir jemand weiterhelfen?
Grüße jms
PS: das ganze soll in ein wordpress-Blog eingebunden werden: http://blog.jmsfoto.net
-
...
wollte diese Modifikation gerade mal angehen ... leider kommt bei mir ne hässliche Fehlermeldung - ...
dein provider, oder du selbst wenn du zugriff auf die php.ini hast, hat in der php.ini "allow_url_include" auf off gestellt.
das heist es ist nicht erlaubt über eine URL eine datei einzubinden.
mfg Andi
-
Bin einen Schritt weiter ....
der erste link funktioniert nun http://galerie.jmsfoto.net/random.php
Wenn ich das aber in wordpress einfüge (mit diesem Code):
<?php
include("../4images/random.php");
?>
Dann kommt immer noch die Fehlermeldung :(
(wo würde ich denn die php.ini finden? Ich finde keine ;(
ABER: ich habe das ganze nun etwas anders gelöst ... und zwar mit dem Plugin iFrame ;)
Grüße jms
-
If i look in page http://www.mydomain.ru/gallery/random.php then i see random picture.
But what i need to do if i want see random picture in http://www.mydomain.ru/index.html ? I try to add this in index.html , but i didn't see anything:
<SCRIPT language='JavaScript' src='http://www.mydomain.ru/gallery/random.php'></SCRIPT>
My random.php:
// 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');
define('SCRIPT_URL', 'http://www.mydomain.ru/gallery/');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
echo "<body bgcolor=\"#5D8FB5\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n";
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 1;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_hits, b.cat_name
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."
ORDER BY RAND()
LIMIT $num_images";
$result = $site_db->query($sql);
echo "<table border='0' bgcolor='#5D8FB5' align='center'>\n";
echo "<tr>\n";
while ($row = $site_db->fetch_array($result)){
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
$image_hits = $row['image_hits'];
$cat_name = $row['cat_name'];
echo "<td width='133' align='center'><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <img src=\"".SCRIPT_URL.$thumb_src."\" border=\"0\" alt=\"$image_name\"></a></td>\n";
}
echo "</tr>\n";
echo "</table>\n";
Please, help me
-
@ Sun ...
... for random images on your own index.php trying better this ...
... http://www.4homepages.de/forum/index.php?topic=4259.msg17513#msg17513 ...
-
... for random images on your own index.php trying better this ...
Mawenzi, i use index.html, but not index.php. My index.html is not in the folder with gallery. I can't undestand how you link can help me (especially, i can't undestand how i can use {random_images} in my index.html)?
-
@ Sun ...
... ok, my fault ... I suggested it because I thought it was your index.php ... sorry ...
... why you use a java script for inserting ...
... and why you don't use the following in your html-file (if both files are on the same server) ...
<?php
include("./random.php");
?>
-
I am not coder and i don't know what code is better for use :oops:
But i try this php code before i try java and there is no any picture too.
-
@ Sun ...
... and for php including you use the right path ... from your index.html to your random.php ... ? ...
-
I think that i have error becouse i have wrong path, but i don't know how to write right path. I try different combination, but nothing didn't help.
How will be look right path if i have my files here:
http://www.mydomain.ru/index.html
http://www.mydomain.ru/gallery/random.php ?
-
@ Sun ...
... here some informations for including php-files in templates : http://www.4homepages.de/forum/index.php?topic=4295.0
... in includes/constants.php use this ...
// Allow execution of PHP code in templates
define('EXEC_PHP_CODE', 1);
... and in your index.html use this ...
<?php
include("./gallery/random.php");
?>
-
My constants.php is already had this change and this changes in index.html didn't work.
But i found that this code is work:
<iframe src="/gallery/random.php" width="150" height="450" scrolling="no" frameborder="0"></iframe>
May it work whithout <iframe>?
-
Bei mir wird irgendwie kein Thumbnail angezeigt
Der Code der ausgegeben wird sieht so aus:
<div class="widget widget_archive">
<h3>Zufalls Sub</h3>
<a href="./wp-gallerie/details.php?image_id=6"><img src="./wp-gallerie/data/thumbnails/6/" alt="454545" border="0"></a><br>
<b>454545</b><br>
Comments: 0<br>
</div>
-
schon versucht wenn du die komplette Url eingibst ?
LG
-
Wenn ich das mache, bekomme ich folgende Meldung:
Security violationSecurity violation
Fatal error: Class 'Db' not found in /www/htdocs/w00b2576/gn/ex-random-images.php on line 34
-
Weis da niemand was?
Ich hab es versucht mit der kompletten URL!
Und wenn ich nicht die komplette URL verwende, dann wird das Bild nicht angezeigt!
-
hi Benny,
irgendwo auf diesen 43 :mrgreen: seiten ist ein javascript code welchen du beliebig auf anderen seiten (nicht 4images) einbauen kannst...
-
Meinst du etwa das?
document. write('<a href=\"". SCRIPT_URL. "details. php?image_id=$image_id\" target=\"_blank\"><img src=\"". $full_src. "\" border=\"1\" alt=\"$image_name\"></a>');
oder das?
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php?1'></SCRIPT>
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php?2'></SCRIPT>
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php?3'></SCRIPT>
bzw. das?
http://www.4homepages.de/forum/index.php?topic=1020.msg126326#msg126326
Warum geht es mit dem normalen Code nicht? Und warum editierst du deinen #1 Post nicht und verlinkst dort hin? Das ist echt doof wenn man sich durch paar Seiten lesen muss weil IRGENDWO Lösungen stehen. Darum wollte ich eine Art DB erstellen wo alle Mods zu finden sind, in denen auch die Fehler und Lösungen gefixt und eingebaut wurden. Aber direkt waren alle dagegen!?
-
Meinst du etwa das?
document. write('<a href=\"". SCRIPT_URL. "details. php?image_id=$image_id\" target=\"_blank\"><img src=\"". $full_src. "\" border=\"1\" alt=\"$image_name\"></a>');
oder das?
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php?1'></SCRIPT>
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php?2'></SCRIPT>
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php?3'></SCRIPT>
bzw. das?
http://www.4homepages.de/forum/index.php?topic=1020.msg126326#msg126326
Warum geht es mit dem normalen Code nicht? Und warum editierst du deinen #1 Post nicht und verlinkst dort hin? Das ist echt doof wenn man sich durch paar Seiten lesen muss weil IRGENDWO Lösungen stehen. Darum wollte ich eine Art DB erstellen wo alle Mods zu finden sind, in denen auch die Fehler und Lösungen gefixt und eingebaut wurden. Aber direkt waren alle dagegen!?
warum es nicht geht... ka. hab wordpress nicht installiert..
ich würde dies nehmen..
http://www.4homepages.de/forum/index.php?topic=1020.msg126303#msg126303
oder halt dies http://www.4homepages.de/forum/index.php?topic=1020.msg126326#msg126326
für grosse bilder..
zu deinen äusserungen werde ich kein kommentar abgeben, sonnst würde ich ein roman schreiben... und mir ist zu heiss ;)
ersten post editiere ich gleich..
LG
-
Kalte Dusche und dann sollte es doch klappen mit dem Antworten :D
ben88b@googlemail.com :P
B2t:
Danke dir!
-
Kalte Dusche und dann sollte es doch klappen mit dem Antworten :D
ben88b@googlemail.com :P
B2t:
Danke dir!
nutzt ja nichts, wenn man 2 minuten später wieder switzt...
was soll ich mit der email?
-
Wo du Recht hast, hast du Recht!
Mail = Mir bei Gelegenheit schreiben oder via PN! Würde gerne wissen, was Du mir dazu zusagen hast!
-
Hallo,
Edit: sorry didn't work at work. on home browser it works lol
;)
-
gibts eine möglichkeit, dass sich das Bild alle "5" sekunden ändern oder ähnliches ?
-
Does this look right ?
<?php
define('ROOT_PATH', './gallery/');
define('SCRIPT_URL', 'http://mydomain.com/gallery/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
-
yes thats right
-
Thanks for the answer
I wasn't sure if i had got it right, but this is the whole code i have in the random.php file, but it fails to display anything, is there any other files i need to edit. I am using 1.7.7
<?php
define('ROOT_PATH', './gallery/');
define('SCRIPT_URL', 'http://mydomain.com/gallery/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : SCRIPT_URL.ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
print("
document.write('<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$full_src."\" border=\"1\" alt=\"$image_name\"></a>');
");
?>
-
your code have to work.
how do you start it ?
if you start it with browser so:
http://www.domain.com/gallery/random.php ?
it don't work!
write a test.php with
<?php
include('gallery/random.php')
?>
and save it under www.domain.com/test.php it work :D
or define('ROOT_PATH', './');
you can use www.domain/gallery/random.php
-
.
I now have random.php file working but i can't get my test.php file to work.
The code in my test.php points to the folder i have the random.php file in, along with the config file.
Any ideas
<?php
include(' gallery/random.php')
?>
UPDATE!
Now I have test.php working correctly but the random.php file does not.
random.php file does not show anything when i directly access it in the browser
to get the test.php to work i have this in my code
<?php
define('ROOT_PATH', './gallery/');
define('SCRIPT_URL', 'http://mydomain.com/gallery/');
AND I removed ROOT_PATH. from this line.
$full_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
Now that my test.php works, is it possible to create a java script so that i can run random images on another web site using the test.php genereated images?
-
Latest.
I followed these instructions and now have it working, thanks for this forum and pointing me in the right direction,, thanks again !! :lol:
hi all..
http://www.siteshot.at/nicky.htm
your examples can't work.. if you don' use correct code like descriped in the MOD file..
ROOT != ROOT_PATH :roll: :lol: :P 8)
use EXACT following code:
<?php
define('ROOT_PATH', './');
define('SCRIPT_URL', 'http://gallery.rammstein-europe.com/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$sql = "SELECT COUNT(*) as total_images
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."
";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_media_file, a.image_comments
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."
LIMIT $number, 1";
$row = $site_db->query_firstrow($sql);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : SCRIPT_URL.ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];
print("
document.write('<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$full_src."\" border=\"1\" alt=\"$image_name\"></a>');
");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title></title>
</head>
<body>
LOL
<SCRIPT language='JavaScript' src='http://gallery.rammstein-europe.com/random.php'></SCRIPT>
</body>
</html>
[EDIT by V@no]
corrected index.html to avoid confusion ;) their original code was correct.
-
Hallo zusammen,
bei mir werden die Umlaute leider nicht korrekt (als Kästchen) angezeigt.
Ich probiere jetzt schon seit Stunden herum, finde aber leider keine Lösung.
Bin in dem Themen auch nicht so fit :cry:
Ich hoffe das mir jemand von Euch helfen kann.
Besten Gruß
Michael
-
da bist du aber hier im falschen bereicht ?
Umlaut probleme hab ich in letzter zeit auch ab und zu liegt daran, dass Browser eventuell nicht auf UTF-8 umgestellt ist bzw wenn UTF 8 eingestellt ist homepage vieleicht nicht auf UTF-8 lauft ^^ dadurch kommen umlaut fehler.
-
Moin,
wie kann man die random.php so umbauen, das sie nicht "random", sondern alle Thumbs einer Kategorie anzeigt?
Habe das testweise mal auf http://www.unser-kleiner-zoo.eu/wordpress/testseite2/ und http://www.unser-kleiner-zoo.eu/wordpress/testseite/ probiert, aber wenn ich alle Thumbs (oder auch weniger) einsetze, werden viele doppelt gezeigt...
Hatte deshalb die Anzeige von den vorhandenen 20 auf 15 reduziert, trotzdem werden doppelte angezeigt.
Gruß Dieter
jetzt unter http://www.unser-kleiner-zoo.eu/wordpress/pony-frieda-ist-wieder-da/ zu sehen!
-
Moin,
wie kann man die random.php so umbauen, das sie nicht "random", sondern alle Thumbs einer Kategorie anzeigt?
Habe das testweise mal auf http://www.unser-kleiner-zoo.eu/wordpress/testseite2/ und http://www.unser-kleiner-zoo.eu/wordpress/testseite/ probiert, aber wenn ich alle Thumbs (oder auch weniger) einsetze, werden viele doppelt gezeigt...
Hatte deshalb die Anzeige von den vorhandenen 20 auf 15 reduziert, trotzdem werden doppelte angezeigt.
Gruß Dieter
hi Dieter,
poste dein code, mal sehen.
-
Moin Nicky,
hi Dieter,
poste dein code, mal sehen.
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', '../fotos/');
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);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 15;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id = 61
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
ORDER BY RAND()
LIMIT $num_images";
$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_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_new\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a> \n";
}
?>
Gruß Dieter
-
Moin,
wie kann man die random.php so umbauen, das sie nicht "random", sondern alle Thumbs einer Kategorie anzeigt?
Habe das testweise mal auf http://www.unser-kleiner-zoo.eu/wordpress/testseite2/ und http://www.unser-kleiner-zoo.eu/wordpress/testseite/ probiert, aber wenn ich alle Thumbs (oder auch weniger) einsetze, werden viele doppelt gezeigt...
Hatte deshalb die Anzeige von den vorhandenen 20 auf 15 reduziert, trotzdem werden doppelte angezeigt.
Gruß Dieter
hi dieter,
ersetze deine abfrage:
für alle aus der kategorie:
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
FROM (".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b)
WHERE a.image_active=1
AND a.cat_id = b.cat_id
AND a.cat_id = 61
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL;
$result = $site_db->query($sql);
oder wenn du es doch limitieren willst, dann doch mit dem sql "LIMIT"
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 20;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
FROM (".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b)
WHERE a.image_active=1
AND a.cat_id = b.cat_id
AND a.cat_id = 61
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
LIMIT $num_images";
$result = $site_db->query($sql);
funkts?
-
sehr schön :D
Danke Nicky
-
sehr schön :D
Danke Nicky
perfekt, gern geschehen :)
-
Hallo, das hat auch mir sehr geholfen.
Ich habe aber noch eine Frage:
Wie muss der Code aussehen wenn ich unterhalb der Bilder noch den Bildnamen stehen haben möchte?
Gruß
Michael
-
Hallo, das hat auch mir sehr geholfen.
Ich habe aber noch eine Frage:
Wie muss der Code aussehen wenn ich unterhalb der Bilder noch den Bildnamen stehen haben möchte?
Gruß
Michael
hi Michael,
mit den breaks für den bildnamen in der nächsten zeile würdest dann auch nur die bilder untereinander haben.
hier der test mit den tables (4 bilder pro zeile, style für die zeilen, alle bilder aus der kategorie, siehe oben bei Dieters post wenn du doch den Limit einführen willst)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<style type="text/css">
<!--
body {
margin: 10px;
color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
background:#FFFFFF;
}
.imagerow1 {
background: #0984f7;
}
.imagerow2 {
background: #b3cfe8;
}
-->
</style>
</head>
<body>
<?php
// 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');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 0;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
FROM (".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b)
WHERE a.image_active=1
AND a.cat_id = b.cat_id
AND a.cat_id = 1450
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL;
$result = $site_db->query($sql);
$new_images = "<table align=\"center\" border=\"0\">\n";
$count = 0;
$bgcounter = 0;
while ($row = $site_db->fetch_array($result)){
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
if ($count == 0) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
$new_images .= "<td valign=\"top\">";
$new_images .="<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_new\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br />$image_name";
$new_images .= "</td>\n";
$count++;
if ($count == 4) {
$new_images .= "</tr>\n";
$count = 0;
}
}
if ($count > 0) {
$leftover = (4 - $count);
if ($leftover >= 1) {
for ($f = 0; $f < $leftover; $f++) {
$new_images .= "<td> </td>\n";
}
$new_images .= "</tr>\n";
}
}
$new_images .= "</table>\n";
echo $new_images;
unset($new_images);
?>
</body>
</html>
-
Hallo Nicky,
Perfekt, vielen Dank für Deine Hilfe. :D
Ich habe den Code noch ein wenig auf meine Website angepasst.
Funktioniert echt gut: http://www.ul-piloten.de/index.php?page=Portal
Jetzt muss ich mal suchen, ob es noch eine Möglichkeit gibt meine Thumbnails neu zu erzeugen.
Im Laufe der Zeit hatte ich die Größen geändert, so das jetzt bis zu 3 unterschiedliche Formate in der Tabelle habe.
Wenn die Thumbs alle die gleiche Größe haben sieht das bestimmt besser aus.
Oder hast Du ne Ahnung wie ich das richten kann?
Besten Gruß
Michael
-
....Oder hast Du ne Ahnung wie ich das richten kann?
...
bin zwar nicht Nicky aber du kannst es ja mit dem versuchen:
ACP/ auto_image_resizer
-
Hallo und Danke für das Feedback,
mit dem Auto-Image-Resizer kann ich die bestehenden Thumbs doch nur verkleinern, oder?
Ich möchte aber das bereits "zu kleine" Thumbs neu erzeugt werden und alle Thumbs danach eine Bildhöhe von 119 px. haben.
Besten Gruß und allen einen schönen 4. Advent.
Michael
-
dann lösche doch die thumbnails vom FTP und erstelle sie neu.
-
Hallo und Danke für das Feedback,
mit dem Auto-Image-Resizer kann ich die bestehenden Thumbs doch nur verkleinern, oder?
Ich möchte aber das bereits "zu kleine" Thumbs neu erzeugt werden und alle Thumbs danach eine Bildhöhe von 119 px. haben.
Besten Gruß und allen einen schönen 4. Advent.
Michael
V@no hat ein schönes [Plugin] Rebuild Thumbnails v1.1.1 (2010-07-10) (http://www.4homepages.de/forum/index.php?topic=7059.0) dafür.. man braucht nichts am server löschen... macht alles für dich :)
und btw. gern geschehen.
-
Perfekt Nicky,
genau das habe ich gebraucht :mrgreen:
Echt toll das mir hier so spitze geholfen wird.
1.000 Dank
Michael
-
Hallo, habe mir das ganze mal durchgelesen, was ich bräuchte wenn es machbar ist, das auf einer externen Homepage ein Zufallsbild aus einer bestimmten Kategorie angezeigt wird.
Also Beispiel: Kategorie Blumen soll auf der homepage www.domain.ltd dargestellt werden. Die Galerie befindet sich jedoch auf galerie.domain.ltd.
Das heißt will auf der www.domain.ltd ein Bild darstellen was zufällig aus der Kategorie ausgewählt wird. Am liebsten pro Tag eines, so das jeden Tag ein anderes Bild auf der Seite erscheint.
Wäre so was auch machbar?
Danke schon mal für die Antwort.
-
i want random image thumbnails in home page. i try this http://www.4homepages.de/forum/index.php?topic=1020.0 but it doesnt work.
-
Habe es nach langem tüfteln hingekriegt das mir die Zufallsbilder angezeigt werden.
Jetzt ist es so das trotz der Ziel zuweisung die Gallery in dem Iframe angezeigt wird.
Wie kann ich das ändern?
Link zum Blog : Bountyhunters (http://www.bountyhunters.de)
Random.php
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: random_more_pics.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.0 for 4images 1.6.1 *
* *
* 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', './gallery/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
define('SCRIPT_URL', 'http://www.bountyhunters.de/gallery/');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images = 4;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, b.cat_name
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."
ORDER BY RAND()
LIMIT $num_images";
$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_comments = $row['image_comments'];
$cat_name = $row['cat_name'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<a href=\"".ROOT_PATH."details.php?image_id=$image_id\" target=\"_self\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
//echo "Comments: $image_comments<hr>\n";
echo "Kategorie:<br><a href=\"".ROOT_PATH."categories.php?cat_id=$cat_id\">\n";
echo "$cat_name<br></a>\n";
}
?>
Iframecode
<p align="center">
<iframe name="I1" scrolling="no" align="middle" border="0" frameborder="0" src="http://www.bountyhunters.de/random_mod.php" " width="133" height="600>
Ihr Browser unterstützt Inlineframes nicht oder zeigt sie in der derzeitigen Konfiguration nicht an.
</iframe></p>
Ein großes Danke an Nicky und Jan für diesen Mod.