collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 442
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Author Topic: Slideshow or Image rotator  (Read 47143 times)

0 Members and 1 Guest are viewing this topic.

Offline teos

  • Jr. Member
  • **
  • Posts: 57
  • Gender: Male
    • Cultural Heritage photographer
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Slideshow or Image rotator
« Reply #20 on: April 10, 2012, 02:00:34 PM »
I dont mean the rotate.php
I want to use the php code at the top of this topic. It does what I want. Only missing part is centering the image. Can you help ?

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Slideshow or Image rotator
« Reply #21 on: April 10, 2012, 02:55:14 PM »
There are several ways to center an image tag.
http://w3schools.com/html/default.asp
http://w3schools.com/css/default.asp

Here is one way you could do it:
http://lmgtfy.com/?q=center+img+tag
www.netmechanic.com/news/vol7/html_no10.htm

Code: (find) [Select]
echo '
<img id="slideshow" src="" />
Code: (replace) [Select]
echo '
<img style="text-align:center;" id="slideshow" src="" />
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline teos

  • Jr. Member
  • **
  • Posts: 57
  • Gender: Male
    • Cultural Heritage photographer
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Slideshow or Image rotator
« Reply #22 on: April 10, 2012, 03:19:23 PM »
    Hoping that the solution you've provided will solve my problem, unfortunately no effect.
Cleared cache, refreshed browser. Tried with different browsers .. No :-(


Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Slideshow or Image rotator
« Reply #23 on: April 10, 2012, 03:42:35 PM »
You could try surrounding it with <center><img ...... /> </center>
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline teos

  • Jr. Member
  • **
  • Posts: 57
  • Gender: Male
    • Cultural Heritage photographer
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Slideshow or Image rotator
« Reply #24 on: April 10, 2012, 03:52:18 PM »
Great!  worked this time :-)
Thanks alot AngelinaBelle, as always ...

Offline Colton3310

  • Just Registered
  • Posts: 1
Re: Slideshow or Image rotator
« Reply #25 on: July 02, 2013, 02:43:35 AM »
Hi, thanks all. The code may be useful, but I cannot understand it. Maybe you can use Kvisoft Image Slideshow Creator to do slideshows. It can also rotate.
« Last Edit: July 02, 2013, 02:45:44 AM by Colton3310 »

Offline ibirtual

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: 1.1.13
  • SP Version: 2.3.3
Re: Slideshow or Image rotator
« Reply #26 on: August 24, 2013, 02:13:40 PM »
hi there
 i want to add a link in any image .. is this posible ?
thanks in advance

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Slideshow or Image rotator
« Reply #27 on: August 25, 2013, 03:36:25 AM »
Which exact code are you using? And can you elaborate what you want to do? Do you want to add links to the rotating images?
And slowly, you come to realize... It's all as it should be...

Offline ibirtual

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: 1.1.13
  • SP Version: 2.3.3
Re: Slideshow or Image rotator
« Reply #28 on: August 25, 2013, 05:01:11 AM »
Hello

thanks for your reply

i use the code of this post, all work fine with the images  but yes i want to  add links to the rotating images

if this action posible ?

here is my code

Code: [Select]
$images = array(
    'image1.jpg',
    'image2.jpg',
    'image3.jpg',
    'image5.jpg',
);

$delay = 1;

$num_images = count($images);
echo '
<img id="slideshow" src="" />
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
    var images = [';

for ($i = 0; $i < $num_images; $i++)
    echo '["', $images[$i], '"]', ($i == $num_images - 1) ? '' : ',';
   
echo '];
    var current_image = 0;
    var num_images = ', $num_images, ';
    var timer;

    function changeImage()
    {
        if (current_image == num_images)
            current_image = 0;
        document.getElementById("slideshow").src = images[current_image];
        current_image = current_image + 1;
        var timer = setTimeout("changeImage();", ', $delay * 1000, ');
    }

    changeImage();
    // ]]></script>';

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Slideshow or Image rotator
« Reply #29 on: August 25, 2013, 06:06:10 AM »
Try this:

Code: [Select]
$images = array(
'image1_url',
'image2_url',
'image3_url',
'image4_url',
);
$links = array(
'image1_link',
'image2_link',
'image3_link',
'image4_link',
);

$delay = 1;

$num_images = count($images);
echo '
<a id="slideshowa" href=""><img id="slideshowimg" src="" alt="" /></a>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var images = [';

for ($i = 0; $i < $num_images; $i++)
echo '["', $images[$i], '"]', ($i == $num_images - 1) ? '' : ',';

echo '];
var links = [';

for ($i = 0; $i < $num_images; $i++)
echo '["', $links[$i], '"]', ($i == $num_images - 1) ? '' : ',';

echo '];
var current_image = 0;
var num_images = ', $num_images, ';
var timer;

function changeImage()
{
if (current_image == num_images)
current_image = 0;
document.getElementById("slideshowimg").src = images[current_image];
document.getElementById("slideshowa").href = links[current_image];
current_image = current_image + 1;
var timer = setTimeout("changeImage();", ', $delay * 1000, ');
}

changeImage();
// ]]></script>';
« Last Edit: August 26, 2013, 08:08:45 AM by [SiNaN] »
And slowly, you come to realize... It's all as it should be...

Offline ibirtual

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: 1.1.13
  • SP Version: 2.3.3
Re: Slideshow or Image rotator
« Reply #30 on: August 25, 2013, 10:12:09 AM »
Hello [SiNaN]

Thanks for the code

i try several times but is not posible for me to add the image and link

i see the image have a link but after click is direct to the image in big size

for example i want to link this image to this link

http://www.zonarave.com/forum/img/nop.jpg

http://www.zonarave.com/forum/index.php/board,48.0.html

can you try to include in the code please ?

to show me how look it

thanks again


Offline ibirtual

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: 1.1.13
  • SP Version: 2.3.3
Re: Slideshow or Image rotator
« Reply #31 on: August 25, 2013, 01:27:39 PM »
i try this

Code: [Select]
$images = array(
'http://www.zonarave.com/forum/img/nop.jpg',
'image2_url',
'image3_url',
'image4_url',
);
$links = array(
        'http://www.zonarave.com/forum/index.php/board,48.0.html',
'image2_link',
'image3_link',
'image4_link',
);

$delay = 10;

$num_images = count($images);
echo '
<a id="slideshowa" href=""><img id="slideshowimg" src="" alt="" /></a>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var images = [';

for ($i = 0; $i < $num_images; $i++)
echo '["', $images[$i], '"]', ($i == $num_images - 1) ? '' : ',';

echo '];
var links = [';

for ($i = 0; $i < $num_images; $i++)
echo '["', $images[$i], '"]', ($i == $num_images - 1) ? '' : ',';

echo '];
var current_image = 0;
var num_images = ', $num_images, ';
var timer;

function changeImage()
{
if (current_image == num_images)
current_image = 0;
document.getElementById("slideshowimg").src = images[current_image];
document.getElementById("slideshowa").href = links[current_image];
current_image = current_image + 1;
var timer = setTimeout("changeImage();", ', $delay * 1000, ');
}

changeImage();
// ]]></script>';

and the link go to the image ...

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Slideshow or Image rotator
« Reply #32 on: August 26, 2013, 08:09:10 AM »
Sorry. There was a mistake in my code. I've fixed it now. Can you try the code here again?:

http://simpleportal.net/index.php?topic=3592.msg63760#msg63760
And slowly, you come to realize... It's all as it should be...

Offline ibirtual

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: 1.1.13
  • SP Version: 2.3.3
Re: Slideshow or Image rotator
« Reply #33 on: August 26, 2013, 09:41:49 AM »
 ;D
work perfect ¡¡

thanks for share and help

 :applause:


Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Slideshow or Image rotator
« Reply #34 on: August 26, 2013, 09:58:00 AM »
That's great to hear. You're welcome! :)
And slowly, you come to realize... It's all as it should be...

Offline jtc442

  • Semi Newbie
  • *
  • Posts: 5
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Re: Slideshow or Image rotator
« Reply #35 on: April 15, 2014, 08:43:13 PM »
I hope I dont get in trouble for posting in this old of a post, but, I had a question. I used this PHP code and inserted it into a simple portal block. Added my pics, and the links to their sites, and all works great!! My question is, and I saw it mentioned above, but no solution for SINANS code. I just want to center my images. I have the portal block on the bottom of my forum, and all pics are aligned left. Will it be hard to add PHP code to center them? I can start a new thread if I need to.
« Last Edit: April 15, 2014, 08:47:29 PM by jtc442 »

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: Slideshow or Image rotator
« Reply #36 on: April 15, 2014, 10:53:18 PM »
jtc442,

  Edit the block and look to the bottom right where it has an input titled custom body class, put the following into that input: centertext

Offline jtc442

  • Semi Newbie
  • *
  • Posts: 5
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Re: Slideshow or Image rotator
« Reply #37 on: April 16, 2014, 09:17:23 AM »
jtc442,

  Edit the block and look to the bottom right where it has an input titled custom body class, put the following into that input: centertext
Underdog, I appreciate the help! Wow, that was too easy. I am very new to this, but learning. I have never messed with those blocks before. I guess I need to learn more about all of that. Thanks a ton!!
« Last Edit: April 16, 2014, 09:29:19 AM by jtc442 »

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Slideshow or Image rotator
« Reply #38 on: April 16, 2014, 12:09:17 PM »
I am glad that everybody on this topic is learning and getting their site to do what they want it to do.

Please consider finding some nice online tutorials to make your learning process quicker and more fun.
I have found w3schools.com useful for HTML and CSS, but there are tons more tutorial sites out there.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline jtc442

  • Semi Newbie
  • *
  • Posts: 5
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Re: Slideshow or Image rotator
« Reply #39 on: April 16, 2014, 02:19:42 PM »
I did search, very extensively. Looked at the sites you posted in post 21 as well. Nothing I tried worked, and with me being a total newbie at this and have just been learning as I go, I ran out of options other than to post here.

Little did I know that all I had to do was add that text to the box that underdog mentioned.

I will read up more on the links you posted and hopefully they will help me in the future. Thank you for your help as well!

(Im actually going to jump on right now and look at that site again)
« Last Edit: April 16, 2014, 02:22:55 PM by jtc442 »