EzPortal - Portal Software for Forums

EzPortal - Made to Fit Your SMF Forum - Glad You Found Us!
+- +-

UserBox

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Recent Posts

Re: SMF-ezportal_column_5.cache): failed to open stream: No such file or directory by EzPortal
June 04, 2022, 11:40:13 am

SMF-ezportal_column_5.cache): failed to open stream: No such file or directory by Shades
June 04, 2022, 11:29:37 am

Re: Arcade block error: failed to open stream: No such file or directory by Shades
May 20, 2022, 02:47:13 pm

Re: ezPortal 5.5 by EzPortal
May 20, 2022, 09:59:30 am

Re: ezPortal 5.5 by tigez
May 20, 2022, 08:46:15 am

Re: Undefined index: href by Shades
May 16, 2022, 02:58:21 pm

Re: Image/Attachment display issue by Shades
May 16, 2022, 02:28:35 pm

Re: Undefined index: href by Shades
May 16, 2022, 02:27:16 pm

+- HTML Menu


Sample HTML Block Usage - You May Custom Code it, as needed!

Recent Topics ezBlock

SMF-ezportal_column_5.cache): failed to open stream: No such file or directory by EzPortal
June 04, 2022, 11:40:13 am

Arcade block error: failed to open stream: No such file or directory by Shades
May 20, 2022, 02:47:13 pm

ezPortal 5.5 by EzPortal
May 20, 2022, 09:59:30 am

Undefined index: href by Shades
May 16, 2022, 02:58:21 pm

Image/Attachment display issue by Shades
May 16, 2022, 02:28:35 pm

Can't delete custom actions by Shades
April 13, 2022, 12:53:28 pm

Newest Member ezblock by Shades
March 23, 2022, 12:48:32 pm

Random Download Block by Shades
March 22, 2022, 10:37:47 am

BBC Pages by EzPortal
March 21, 2022, 10:36:41 pm

Recent Topics Blocks are different from left side to right side by Shades
March 21, 2022, 02:42:38 pm

Author Topic: Random Image Block  (Read 12077 times)

0 Members and 1 Guest are viewing this topic.

Offline krice

  • Posts: 16
  • Karma: 0
  • Gender: Male
    • Norcal Wheelers
Random Image Block
« on: April 09, 2010, 11:40:35 am »
Hope this is the place to ask??

I would like to pull a random image from the forums "attached images" that users have uploaded and placed in their post. I believe they are all stored in the same folder.

Could this be done with a php script loaded into a php ezblock?

It would be great if the image would be random every time the page was reloaded.

Thanks, Ken

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1289
  • Karma: 67
Re: Random Image Block
« Reply #1 on: April 09, 2010, 11:43:46 am »
I don't have anything premade for fetching image attachments from posts in a forum yet.
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline krice

  • Posts: 16
  • Karma: 0
  • Gender: Male
    • Norcal Wheelers
Re: Random Image Block
« Reply #2 on: April 12, 2010, 07:56:18 pm »
Does anyone know of a code to be put in a php block or possible html block that would accomplish this without having a premade ez block?

Offline krice

  • Posts: 16
  • Karma: 0
  • Gender: Male
    • Norcal Wheelers
Re: Random Image Block
« Reply #3 on: April 13, 2010, 09:28:25 am »
Thanks Jake, I have seen some html scripts but have not had much success as I don't know it well. Will keep looking. If I find anything I will post up.

Offline thellie

  • Posts: 8
  • Karma: 0
Re: Random Image Block
« Reply #4 on: August 02, 2010, 03:35:01 am »
if people are uploading, does that mean there's a database table storing information?

if so, and you have access to the database (mine is a MySQL db, accessed via phpMyAdmin), then you can run a mysql query, put in in some php code and drop it into the ezblock...

in the query, set it to 'Order by rand()' (leave out the ticks)

i do this already on our site, and am now upgrading it to run everything through smf - inc our admin pages. i have tested dropping in full page php/mysql/html coded pages into ezblocks, and they work fine... do remember to leave out the initial <?php and the final ?> in the ezblock

Offline Eddy Matthews

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 1
  • Gender: Male
Re: Random Image Block
« Reply #5 on: December 01, 2010, 02:34:50 am »
I use the following php file to display a random image.... Just follow the instructions given in the file to set it up for your system.

SMF stores uploaded images in smf/attachments

Regards
Eddy

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
8844 Views
Last post April 13, 2009, 02:38:51 pm
by Pierre Desjardins
0 Replies
3921 Views
Last post April 12, 2010, 07:53:40 pm
by krice
0 Replies
6041 Views
Last post February 21, 2011, 05:33:33 pm
by MartinB
4 Replies
19955 Views
Last post February 16, 2018, 09:40:48 am
by EzPortal
5 Replies
2738 Views
Last post March 22, 2022, 10:37:47 am
by Shades

+-SMF Gallery

Quick Menu


Powered by EzPortal