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: 795
  • 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]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: HTML in categoriy image field?  (Read 6386 times)

0 Members and 1 Guest are viewing this topic.

Offline Tiribulus

  • Semi Newbie
  • *
  • Posts: 36
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
HTML in categoriy image field?
« on: May 12, 2009, 10:09:05 PM »
Does the image field for categories support anything beyond simple url's? Not that I'm bummed if it doesn't but I was trying to figure out a simple way to have the images rotate.
Thanks

Offline ???1031

  • ... feel not as a dev at the moment ...
  • Comrade
  • *
  • Posts: 789
  • Gender: Male
  • Overworked <<
  • SMF Version: None
  • SP Version: None
Re: HTML in categoriy image field?
« Reply #1 on: May 13, 2009, 12:38:03 AM »
Normal it should not work.
Again... I'm having time problems...Normal Monday to Friday I'm at office from 6:00-16:00 (On my local time ;P).

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: HTML in categoriy image field?
« Reply #2 on: May 13, 2009, 05:29:51 PM »
If that's the case, you could create a .php script as the image and link to it.

Open your FTP client, make a new folder named "rotate_images" and place all the images you want to rotate between in there, numbered (such as 1.png, 2.png, 3.png) and ensure they're of the .png extension (all lower-cased).

Then make a file named image.php, and put:

Code: [Select]
<?php
// Rotate between the images.

// Make sure to have a slash at the end.
$path 'this/is/the/local/path/to/the/rotate_images/directory/';

@
header('Content-type: image/png');
@
header('Cache-Control: no-cache, must-revalidate');
@
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

// Replace the # with the number of images you have in the directory.
$number mt_rand(1#);

// Creating the image path...
$image $path '/' $num '.png';

// Generating the image.
@readfile($image);

?>

Offline Tiribulus

  • Semi Newbie
  • *
  • Posts: 36
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: HTML in categoriy image field?
« Reply #3 on: May 13, 2009, 09:15:38 PM »
Thank you so much guys. I will try that as soon as I get a chance and let you know how it goes.

Will it work with gifs if I change the instances of png in your code to gif. Or maybe I could just change the extension of the gif files to .png.
« Last Edit: May 13, 2009, 11:50:32 PM by Tiribulus »

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: HTML in categoriy image field?
« Reply #4 on: May 14, 2009, 03:16:24 PM »
Here;

Code: [Select]
<?php
// Rotate between the images.

// Make sure to have a slash at the end.
$path 'this/is/the/local/path/to/the/rotate_images/directory/';

// The format of the images
$format 'png';

@
header('Content-type: image/' $format);
@
header('Cache-Control: no-cache, must-revalidate');
@
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

// Replace the # with the number of images you have in the directory.
$number mt_rand(1#);

// Creating the image path...
$image $path '/' $num '.' $format;

// Generating the image.
@readfile($image);

?>

Offline Tiribulus

  • Semi Newbie
  • *
  • Posts: 36
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: HTML in categoriy image field?
« Reply #5 on: May 14, 2009, 10:09:52 PM »
Don't ask me what I'm doin wrong here.

I created a folder in the docroot named rotate_images .

Created a file name image.php with this code:

Code: [Select]
<?php
// Rotate between the images.

// Make sure to have a slash at the end.
$path '/srv/www/htdocs/rotate_images/';

// The format of the images
$format 'png';

@
header('Content-type: image/' $format);
@
header('Cache-Control: no-cache, must-revalidate');
@
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

// Replace the # with the number of images you have in the directory.
$number mt_rand(14);

// Creating the image path...
$image $path '/' $num '.' $format;

// Generating the image.
@readfile($image);

?>

and put it in that rotate_images directory.

I put 4 gif files named 1.gif, 2.gif, 3.gif and 4.gif in there as well.

This might be where I'm missing it. I tried linking it with http://localhost/rotate_images/image.php, http://localhost:8080/rotate_images/image.php, and http://gregnmary.gotdns.com:8080/rotate_images/image.php and it doesn't want to display the images.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: HTML in categoriy image field?
« Reply #6 on: May 15, 2009, 01:54:40 AM »
Try changing this:
Code: [Select]
$format = 'png';
To this:
Code: [Select]
$format = 'gif';
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy 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 Tiribulus

  • Semi Newbie
  • *
  • Posts: 36
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: HTML in categoriy image field?
« Reply #7 on: May 15, 2009, 11:22:18 AM »
I actually did try that and forgot to mention it last night. I did again just now and it still doesn't want to do it.
Thanks for the response though.

If it's any clue, it doesn't work when I try to run the file directly in a browser either.
« Last Edit: May 15, 2009, 11:36:59 AM by Tiribulus »

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: HTML in categoriy image field?
« Reply #8 on: May 15, 2009, 03:23:26 PM »
Show me what you put, and link me to it.

Offline Tiribulus

  • Semi Newbie
  • *
  • Posts: 36
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: HTML in categoriy image field?
« Reply #9 on: May 15, 2009, 05:39:47 PM »
Code: [Select]
<?php
// Rotate between the images.

// Make sure to have a slash at the end.
$path '/srv/www/htdocs/rotate_images/';

// The format of the images
$format 'gif';

@
header('Content-type: image/' $format);
@
header('Cache-Control: no-cache, must-revalidate');
@
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

// Replace the # with the number of images you have in the directory.
$number mt_rand(14);

// Creating the image path...
$image $path '/' $num '.' $format;

// Generating the image.
@readfile($image);

?>

That is the present code in the image.php file which is here:

http://gregnmary.gotdns.com:8080/rotate_images/image.php

If that's what you mean. This is no pressing thing for me BTW, It was just something I got a bug in my butt about because I couldn't figure it out myself having a grand total of about 2 months coding experience.
Thanks again

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: HTML in categoriy image field?
« Reply #10 on: May 15, 2009, 06:37:16 PM »
Hm, it appears to be loading and not loading.

It is perhaps a link problem. Are you sure that is the path to the correct folder? There is no 'home' in the URL?

Perhaps try making the path just /rotate_images/

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: HTML in categoriy image field?
« Reply #11 on: May 16, 2009, 03:23:25 AM »
Change your images.php script codes with these ones:

Code: [Select]
<?php
header
('Content-Type: image/gif');
@
readfile(mt_rand(14) . '.gif');
?>
And slowly, you come to realize... It's all as it should be...

Offline Tiribulus

  • Semi Newbie
  • *
  • Posts: 36
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: HTML in categoriy image field?
« Reply #12 on: May 16, 2009, 09:50:35 AM »
Change your images.php script codes with these ones:

Code: [Select]
<?php
header
('Content-Type: image/gif');
@
readfile(mt_rand(14) . '.gif');
?>

That did it!!! 

 Yer a scary dood.

Thanks a bunch

Thanks also to everybody else for your time and help

Offline Tiribulus

  • Semi Newbie
  • *
  • Posts: 36
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: HTML in categoriy image field?
« Reply #13 on: April 07, 2010, 09:38:01 PM »
This is really a great tweak. It took me a about a minute to adapt it to a second forum.  I think some other people may like this as well

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: HTML in categoriy image field?
« Reply #14 on: April 08, 2010, 12:49:24 AM »
Hey Tiribulus.

Can ya point me in the direction of where on ya portal this is being used please bud.
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast