PHP Web Host - Quality Web Hosting For All PHP Applications
  Inloggen or Registreer
 • Startpagina • Nieuwe download • Je instellingen • Forums • 
Navigation
 Home
· Search
· Recommend Us
· Feedback
· Top 10
· Web Links
· Statistics
 News
· Topics
· Stories Archive
· Submit News
 Members
· Your Account
· Private Messages
· Members List
 Downloads
· Downloads
· Most popular
 Forum
· Forums
· Forum Search
· Forum FAQ
· Forum Rules
 Documentation
 Site Info
· Legal Notices
· Disclaimer
· Privacy
· Terms of Use
 
Languages
Kies interface taal:

Dutch English
 
Sentinel
· 213.175.197.*
· 99.231.72.*
· 85.236.48.*
· 72.232.85.*
· 69.163.150.*
· 69.251.10.*
· 195.2.241.*
· 91.121.71.*
· 72.55.133.*
· 78.43.14.*

NukeSentinel(tm)
 
Caught by Sentinel
You have been warned!
We have caught 2799 shameful hackers.

NukeSentinel(tm)
 
Kalender
<< maart 2010 >>

z m d w d v z
  123456
78910111213
14151617181920
21222324252627
28293031     

 
PHP-Nuke Nederland: Forums


View next topic
View previous topic
Post new topic   Reply to topic
Author Message
wobly
Gevorderd
Gevorderd



Joined: May 24, 2005
Posts: 36

PostPosted: Fri 27 May 2005 18:39 Reply with quote Back to top

eigenlijk een makkelijke vraag lijkt me, maar ik kom er niet uit.....

ik wil een block maken waar random plaatjes uit een folder worden vertoond.

...verder, als het mogelijk is, wil ik dan ook nog op dat plaatje kunnen klikken en dan de vergroting zien.

ben benieuwd of het mogelijk is...
View user's profile Send private message Visit poster's website
BlueLion
Administrator
Administrator



Joined: Aug 21, 2004
Posts: 2838

PostPosted: Sun 29 May 2005 8:41 Reply with quote Back to top

Sla het volgende op als block-RandomPicture.php

[php:1:527e020c53]<?php

/************************************************************************/
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* please credit me, it's my only block */
/* Copyright Robert J. Sori, Las Vegas Nevada */
/************************************************************************/

if (stristr($_SERVER['SCRIPT_NAME'], "block-RandomPicture.php")) {
Header("Location: index.php");
die();
}

mt_srand((double)microtime()*1000000);
$imgs = dir('pictures');
while ($file = $imgs->read()) {
if (eregi("gif", $file) || eregi("jpg", $file)) {
$imglist .= "$file ";
}
}
closedir($imgs->handle);
$imglist = explode(" ", $imglist);
$a = sizeof($imglist)-2;
$random = mt_rand(0, $a);
$image = $imglist[$random];
$asin = explode(".", $image);
$content .= "<center><a href=\"picshow.php?show=pictures/$image\">";
$content .= "<img src=\"pictures/$image\" border=\"0\" width=\"120\" alt=\"\"><br><br></center>";

?>[/php:1:527e020c53]

En plaats dit in de map root/blocks.

Sla het volgende op als picshow.php:

[php:1:527e020c53]<?php

if (!isset($mainfile)) {
include("mainfile.php");
}

$index = 0;
include("header.php");
OpenTable();
$sl = $show;
echo "
<center><h3><a href=\"javascript:history.back()\">Go back!<br><br>
<img src=$sl border=\"2\" width=\"100%\"></a></h3>
</center>";
Closetable();
include("footer.php");

?>[/php:1:527e020c53]

En upload dit naar root/

Maak een map pictures in root/ en zet hierin een leeg index.html bestand. Upload jouw plaatjes naar deze map. Via je admin panel activeer je het block.


BL


Last edited by BlueLion on Mon 30 May 2005 0:58; edited 1 time in total
View user's profile Send private message Send e-mail Visit poster's website
wobly
Gevorderd
Gevorderd



Joined: May 24, 2005
Posts: 36

PostPosted: Sun 29 May 2005 23:00 Reply with quote Back to top

tja, geprobeerd......

- mijn block wordt niet herkend, dus ik maak het block aan in de admin.
daar krijg ik dit:

read()) { if (eregi("gif", $file) || eregi("jpg", $file)) { $imglist .= "$file "; } } closedir($imgs->handle); $imglist = explode(" ", $imglist); $a = sizeof($imglist)-2; $random = mt_rand(0, $a); $image = $imglist[$random]; $asin = explode(".", $image); $content .= "
"; $content .= "

"; ?>

ik heb phpnuke 7.5

bij 6.5 heeft het ooit wel gewerkt.....
View user's profile Send private message Visit poster's website
BlueLion
Administrator
Administrator



Joined: Aug 21, 2004
Posts: 2838

PostPosted: Mon 30 May 2005 1:02 Reply with quote Back to top

Het werkt wel degelijk. Zie de testsite rechtsbovenaan (PHP-Nuke 7.7). Je moet alleen wel opletten bij het knippen en plakken van bovenstaande code. Het is nu aangepast maar de PHP syntax code geeft zo nu en dan problemen.

Eerst was $imgs nl. $img s in de regel

[php:1:16a633ec51]$imgs = dir('pictures'); [/php:1:16a633ec51]


BL
View user's profile Send private message Send e-mail Visit poster's website
wobly
Gevorderd
Gevorderd



Joined: May 24, 2005
Posts: 36

PostPosted: Mon 30 May 2005 19:01 Reply with quote Back to top

hmmm...verdorie...

het wil maar niet lukken...zal het liggen dat ik een subfolder als root heb?
ik laat het even staan op wobly.nl, wellicht iemand (BL?) die kan zien waar het aan ligt?
View user's profile Send private message Visit poster's website
bas1286
Moderator
Moderator



Joined: Dec 03, 2004
Posts: 517

PostPosted: Mon 30 May 2005 22:44 Reply with quote Back to top

als ik naar http://www.wobly.nl/picshow.php ga, dan geeft hij deze fout

Code:

Warning: main(footer.php ): failed to open stream: No such file or directory in /home/woblynl/public_html/picshow.php on line 16


wat staat daar?

[php:1:79e8a642fa]include("footer.php "); [/php:1:79e8a642fa]

en volgens mij moet daar geen spatie staan...toch
dus vervang hem door door dit

[php:1:79e8a642fa]include("footer.php"); [/php:1:79e8a642fa]

_________________
Te Lezen: Forum Regels | Te Gebruiken:[/b:161cfc8cd3
View user's profile Send private message
kenwood
Moderator
Moderator



Joined: Sep 07, 2004
Posts: 246

PostPosted: Tue 31 May 2005 4:57 Reply with quote Back to top

Soms geeft hij die fout hier ook en soms weer niet .
View user's profile Send private message
megazone
Gevorderd
Gevorderd



Joined: Oct 01, 2004
Posts: 90

PostPosted: Tue 31 May 2005 5:43 Reply with quote Back to top

BlueLion wrote:
Het werkt wel degelijk. Zie de testsite rechtsbovenaan (PHP-Nuke 7.7). Je moet alleen wel opletten bij het knippen en plakken van bovenstaande code. Het is nu aangepast maar de PHP syntax code geeft zo nu en dan problemen.

Eerst was $imgs nl. $img s in de regel

[php:1:28cbea461c]$imgs = dir('pictures'); [/php:1:28cbea461c]


BL


BL,

Het block werkt wel op de index pagina, maar als ik op dat random plaatje klik, in het volgende scherm de grote versie zie, mis ik ook op jouw test site de footer (die wel op de index pagina staat).

Lijkt dat niet op zijn probleem?
View user's profile Send private message
bas1286
Moderator
Moderator



Joined: Dec 03, 2004
Posts: 517

PostPosted: Tue 31 May 2005 6:54 Reply with quote Back to top

bas1286 wrote:
als ik naar http://www.wobly.nl/picshow.php ga, dan geeft hij deze fout

Code:

Warning: main(footer.php ): failed to open stream: No such file or directory in /home/woblynl/public_html/picshow.php on line 16


wat staat daar?

[php:1:e702b94983]include("footer.php "); [/php:1:e702b94983]

en volgens mij moet daar geen spatie staan...toch
dus vervang hem door door dit

[php:1:e702b94983]include("footer.php"); [/php:1:e702b94983]


Dan is het toch mijn aangegeven oplossing of niet soms, wel raar dat hij op de testsite geen fouten laat zien...

_________________
Te Lezen: Forum Regels | Te Gebruiken:[/b:161cfc8cd3
View user's profile Send private message
bas1286
Moderator
Moderator



Joined: Dec 03, 2004
Posts: 517

PostPosted: Tue 31 May 2005 7:09 Reply with quote Back to top

Ik heb effe alles getest, en als je effe die spatie weghaalt bij footer.php, dan werkt alles naar behoren.

edit: een opmerking...ik vind het een beetje jammer dat de plaatjes, met een kleine resolutie, helemaal worden uitgerekt, is daar geen oplossing voor, zodat de kleine plaatjes hun eigen formaat blijven hebben.

_________________
Te Lezen: Forum Regels | Te Gebruiken:[/b:161cfc8cd3
View user's profile Send private message
ferry
Gevorderd
Gevorderd



Joined: Oct 08, 2004
Posts: 33

PostPosted: Fri 15 Jul 2005 23:48 Reply with quote Back to top

is het ook mogelijk om de plaatjes te laten scrollen om hoog of naar beneden
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2008 phpBB Group
:: Theme & Graphics by Daz :: Ported for PHP-Nuke by nukemods.com ::
All times are GMT + 10 Hours
Forums ©
 
Web site powered by PHP-Nuke

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © 2004-2009 by BlueLion.
SEO enhanced with the Sitemapper script
You can syndicate our news using the file backend.php or ultramode.txt
Powered by PHP Powered by MySQL Apache Webserver Valid robots.txt
PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Pagina rendering: 0.11 seconden
_RN_FOOTER_CREDITS