collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 51
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • ♦ Ninja ZX-10RR ♦: I'm not admin nor a staff member... I tried connecting with a different IP and via proxy. No errors...
    Yesterday at 01:15:06 pm
  • SeeingBlue: You've just been lucky, Ninja. There is a problem. Check your stats and see how many 500 error hits you've been getting.
    Yesterday at 08:08:56 am
  • ♦ Ninja ZX-10RR ♦: The server might be have a high load but it still works here...
    December 17, 2014, 03:13:51 pm
  • sanb: i cant post a reply(
    December 17, 2014, 01:36:59 pm
  • SeeingBlue: It's intermittent. I bet if the admin logs into the cpanel they'll find either CPU or Ram hitting it's limit.
    December 17, 2014, 09:11:07 am
  • ♦ Ninja ZX-10RR ♦: The site works fine here...
    December 16, 2014, 11:01:27 am
  • SeeingBlue: I was finally able to make 1 post, but I can't edit it or make another. I'm frustrated, I give up.
    December 16, 2014, 08:49:37 am
  • SeeingBlue: I even tried a different browser. I'm just getting a 500 Internal Server Error.
    December 16, 2014, 08:30:15 am
  • SeeingBlue: When I "hit" post, sorry.
    December 16, 2014, 08:26:04 am
  • SeeingBlue: I'm trying to reply to my thread "Loading custom JS files" and when I get post it just loads a blank page.
    December 16, 2014, 08:25:43 am
  • Eliana Tamerin: Let's kick this over to his support topic, folks.
    December 03, 2014, 10:16:21 pm
  • Underdog: what is the issue with it? the naviagtion links? look here: [link]
    December 03, 2014, 09:54:07 pm
  • [SiNaN]: Oh! I didn't even see that. The author seems to have posted some instructions at the theme support topic at sm.org: [link]
    December 03, 2014, 02:11:58 pm
  • WhiteEagle: No the menu on top... the one that comes down when you mouse over it. ;)
    December 03, 2014, 02:02:35 pm
  • [SiNaN]: I already posted it!
    December 03, 2014, 01:51:11 pm
  • WhiteEagle: Any idea what I can do with the menu on top in that theme [SiNaN]?
    December 03, 2014, 01:28:25 pm
  • [SiNaN]: It's a pity that the theme author did that unusual thing for a rare good looking theme.
    December 03, 2014, 12:37:47 pm
  • WhiteEagle: *growls* It's annoying... I can't get SP working with my current theme at LS (Pulse) :(
    December 02, 2014, 10:48:34 pm
  • ♦ Ninja ZX-10RR ♦: SiNaN ftw :)
    November 29, 2014, 06:40:31 pm
  • k1mo0o: hi
    November 28, 2014, 08:54:15 pm

* Recent Posts

Re: New Staff Block by WhiteEagle
[Yesterday at 06:23:44 pm]


Re: php code by Oldcrow
[December 17, 2014, 10:12:38 pm]


Re: php code by Underdog
[December 17, 2014, 09:55:54 pm]


Re: [Block] Advanced Who's Online by stanyy
[December 17, 2014, 03:50:13 pm]


Re: php code by Oldcrow
[December 17, 2014, 03:45:50 pm]

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 13754 times)

0 Members and 1 Guest are viewing this topic.

Offline zapiy

  • Semi Newbie
  • *
  • Posts: 34
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Slideshow or Image rotator
« on: October 10, 2009, 11:33:53 am »
I use a php slideshow on my smf1.1.10 and tp 1.03 site and i want to use a similar thing on my next site..

Which is smf 2.0 and simple portal (latest ver)

Cheers

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5226
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Slideshow or Image rotator
« Reply #1 on: October 11, 2009, 12:41:53 am »
Put the code below into a custom PHP block.
Code: [Select]
$images = array(
    'image1_url',
    'image2_url',
    'image3_url',
    'image4_url',
);

$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>';

Change the $delay variable to change the ammount of time between slides, change the $images variable to the list of image urls that you want to show.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Offline zapiy

  • Semi Newbie
  • *
  • Posts: 34
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: Slideshow or Image rotator
« Reply #2 on: October 11, 2009, 10:58:45 am »
Nice one, works a treat.

Offline dang2k

  • Newbie
  • Posts: 3
  • SMF Version: 1.1.11
  • SP Version: 2.0
Re: Slideshow or Image rotator
« Reply #3 on: June 24, 2010, 08:28:02 am »
Dear sir,
I don't no how to insert image url  'image1_url' , please help me, Thanks you.

I have insert on Help.template.php file
$images = array(
$settings['image_url'] = "'/Big_set/b-picture1.jpg'",
$settings['image_url'] = "'/Big_set/b-picture1.jpg'",
$settings['image_url'] = "'/Big_set/b-picture1.jpg'",
$settings['image_url'] = "'/Big_set/b-picture1.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 Maarten

  • Jr. Member
  • **
  • Posts: 50
  • Gender: Male
  • My website has almost 3k members.
    • NHFans
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Slideshow or Image rotator
« Reply #4 on: June 24, 2010, 09:31:36 am »
Dear sir,
I don't no how to insert image url  'image1_url' , please help me, Thanks you.

I have insert on Help.template.php file
$images = array(
$settings['image_url'] = "'/Big_set/b-picture1.jpg'",
$settings['image_url'] = "'/Big_set/b-picture1.jpg'",
$settings['image_url'] = "'/Big_set/b-picture1.jpg'",
$settings['image_url'] = "'/Big_set/b-picture1.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>';
Eey, I found the mistake?
$images = array(
$settings['image_url'] = "'/Big_set/b-picture1.jpg'",
$settings['image1_url'] = "'/Big_set/b-picture1.jpg'",
$settings['image2_url'] = "'/Big_set/b-picture1.jpg'",
$settings['image3_url'] = "'/Big_set/b-picture1.jpg'",
);


Idk what the script does, but you forgot to insert the numbers???

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5226
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Slideshow or Image rotator
« Reply #5 on: June 24, 2010, 09:43:45 am »
Try:
Code: [Select]
$images = array(
    '/Big_set/b-picture1.jpg',
    '/Big_set/b-picture1.jpg',
    '/Big_set/b-picture1.jpg',
    '/Big_set/b-picture1.jpg',
);

for the images array part of the code.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Offline dang2k

  • Newbie
  • Posts: 3
  • SMF Version: 1.1.11
  • SP Version: 2.0
Re: Slideshow or Image rotator
« Reply #6 on: June 25, 2010, 10:59:33 am »
Dear Sir,
       I have alreday put the code follow your suggestion and it abnormal working because it not found image to display. In my opinion(not sure), the url in form of php is wrong?

note:
-I use SMF 10.1.11 and put the code on index.themplate.php
C:\AppServ\www\telemusic\Themes\ciziksehir\images\Big_set    -> image url
C:\AppServ\www\telemusic\Themes\ciziksehir\index.template.php  -> file script to insert

Please advice me how to correct. Thanks you.  (Sorry, I'm not advance in english)

$images = array(  '/Big_set/b-picture1.jpg', '/Big_set/b-picture2.jpg', '/Big_set/b-picture3.jpg', '/Big_set/b-picture4.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 Nathaniel

  • Comrade
  • *
  • Posts: 5226
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Slideshow or Image rotator
« Reply #7 on: June 25, 2010, 08:55:16 pm »
"C:\AppServ\www\telemusic\Themes\ciziksehir\images\Big_set" is not a url, that is a file path.

A url looks like this 'http://www.site.com/Big_set/b-picture1.jpg' (which is what you currently have for the images array).
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Offline dang2k

  • Newbie
  • Posts: 3
  • SMF Version: 1.1.11
  • SP Version: 2.0
Re: Slideshow or Image rotator
« Reply #8 on: June 26, 2010, 01:08:28 am »
Dear Nathaniel,

     Thanks you for your response. I'm just understand for the url is 'http://www.site.com/Big_set/b-picture1.jpg'.
So, if I would like to use image path how could I perform that?

Note: For the array(  '/Big_set/b-picture1.jpg', '/Big_set/b-picture2.jpg', '/Big_set/b-picture3.jpg', '/Big_set/b-picture4.jpg', ); is not work now.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5226
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Slideshow or Image rotator
« Reply #9 on: June 26, 2010, 01:15:56 am »
Try using the exact url for those images, like 'http://www.site.com/Big_set/b-picture1.jpg' instead of '/Big_set/b-picture1.jpg'. Make sure that the url for each image is correct. (you should be able to put that url into your browser and view the image with your browser)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Offline Ares

  • Jr. Member
  • **
  • Posts: 50
  • Gender: Male
  • World Of Mass Distruction
    • [SoW] Spoils of War
  • SMF Version: 2.0.5
  • SP Version: 2.3.5
Re: Slideshow or Image rotator
« Reply #10 on: January 08, 2011, 09:41:37 pm »
could this code be change to get random images from a file basically set a file url not image url

Offline andy

  • Support
  • *
  • Posts: 659
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: Slideshow or Image rotator
« Reply #11 on: December 03, 2011, 01:03:53 am »
Think this would make a good feature addition. At the moment there are only old posts with bits of pieces of code and references to outside links and files. I had to spend quite a bit of time to find a php script that would rotate images in a block for me. Edits and php files in folders - better if an easier setup via a standard block with options.

Would be nice to see a standard block for this as it is a very common feature of websites. Not just for the front page but thats the main one people want to use images to attract people to stay on the site.

Almost all CMSs offer a variety of mods for this - Joomla, Wordpress etc, but not much for SMF and they dont look so good. One portal I think comes with what looks like a sliding front page image banner. Also as an introduction for pages with categories like Joomla K2.

Block with options for:

Folder the files are in.
Type of rotation - refresh or time interval.
Rotation effect (if easy to implement - simple swap, slide, fade etc)


Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running


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 #12 on: April 10, 2012, 08:24:52 am »
I know this is an old topic, but I use this block at my site  . How can I center the images ?
Any guidance will be highly appreciated.

Offline andy

  • Support
  • *
  • Posts: 659
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: Slideshow or Image rotator
« Reply #13 on: April 10, 2012, 09:13:23 am »
I use a php script for rotating images every time the page loads. You can find it in many locations on the internet - tiny portal, another smf portal also had an old topic about it.

Images go in a 'FOLDER-NAME' with the rotator.php script.
In the block all you need to do is this:
Code: [Select]
<p align="center"><img src="http://yourwebsite.com/FOLDER-NAME/rotate.php" alt="OCJ Photo" /></p>
The html  alignment tag centers everything.
There are settings that can be changed for the rotator - need to look for that. And there are many others out there you can try.
« Last Edit: April 10, 2012, 09:15:33 am by igirisjin »
Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running


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 #14 on: April 10, 2012, 09:32:47 am »
Thanks igirisjin,
  Couldnt find the rotator.php ( tiny portal etc.) .  Can you pls attach the one you use ?

Offline andy

  • Support
  • *
  • Posts: 659
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: Slideshow or Image rotator
« Reply #15 on: April 10, 2012, 10:05:04 am »
TPortal was a topic about it but if you search online you will find the same one with the script.

Here is my copy but you may need to search online for the settings details.

Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running


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 #16 on: April 10, 2012, 10:32:54 am »
Thanks.  Download link is not  working at tportal.

Offline AngelinaBelle

  • Support
  • *
  • Posts: 4885
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Slideshow or Image rotator
« Reply #17 on: April 10, 2012, 11:06:56 am »
There is an article on it, and the download available, at marcofolio.net
http://www.marcofolio.net/webdesign/php_random_image_rotation.html
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 #18 on: April 10, 2012, 11:46:58 am »
Thanks for the info Angelinabelle,
 Actually, I need the code here, because without refreshing I need to show several images.
Only problem with this code is to center the images in the block.
Can you help ?
 

Offline AngelinaBelle

  • Support
  • *
  • Posts: 4885
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Slideshow or Image rotator
« Reply #19 on: April 10, 2012, 11:52:59 am »
The rotator only shows one image at a time.
How did you get it to show two?
What does your block look like now?
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?