Jump to content


Photo

PHP script that controls daily rotation on Windows server also on Linux server


  • Please log in to reply
6 replies to this topic

#1 dinrock

dinrock

    Newbie

  • New Members
  • Pip
  • 7 posts

Posted 05 January 2013 - 11:03 PM

I currently have this site where you'll notice that daily image there. It's controlled by a custom PHP script to auto-rotate to a new image, every 24/7/365 at 2AM NYC time....works perfect. That script was uploaded and resides on the actual Windows server of my web host.This site is on a Windows server. The same hosting company reserved Linux space so I can rebuild the site in WordPress (obviously for better SEO, CSS etc.). I was told the same script works in the WP site (here's temp domain URL) and the only problem is, I wanted it to perform the same functionality in the body of the WP page.....looks like that won't happen. Aside from altering or modifying the script, not even touching it, are there other ways the image can be made to appear in the page? Keep in mind, I am not a PHP'er, only an artist....and a web designer. Any info, help, feedback, comments, constructive criticism would be greatly appreciated.

#2 DavidAM

DavidAM

    Advanced Member

  • Gurus
  • 1,972 posts
  • LocationSpring, TX USA

Posted 05 January 2013 - 11:33 PM

Can you put a static image tag on the page, i.e. <IMG src="images/imageOfTheDay.png">? Then have a cron job run at 2AM that copies a new image over top of the "imageOfTheDay.png" file.
-- I haven't lost my mind, it's backed up on tape ... somewhere!

#3 dinrock

dinrock

    Newbie

  • New Members
  • Pip
  • 7 posts

Posted 06 January 2013 - 10:35 AM

Not certain on that DavidAM. Reason being, is I did not author the script. However, there were other variants of the code devised, so that interested web designers could also embed a specific line of code in their own HTML in order to show / rotate the cartoon on their own page(s). In essence, all I need to do, is give them this:

<a href="http://danscartoons....oons.com/"><img border="2" src="http://danscartoons....lycartoon.php">

...and once added, the image would be begin it's journaey, changes of course at 2AM tomorrow morning to another image I uploaded 365 toons in a specific folder of images. I include a total of one year's worth, once per year so it's a "set-it-and-forget-it" type of script. As I say, this is all currently happening on my web host's Windows server. They reserved my hosting space for my future WordPress them on their Linux server and notified me the same script will work there....but like I mentioned, it won't display in "BODY" when it was looked at. So see attached screenshot and I am left wondering about a work-around and if it could be made to appear in other parts of the WordPress page, i.e. SIDEBAR, FOOTER or HEADER?

This has me stumped....but I feel offering a different image every day adds more "value" or return visitors and would hate to lose this functionality.

#4 dinrock

dinrock

    Newbie

  • New Members
  • Pip
  • 7 posts

Posted 06 January 2013 - 06:04 PM

Sorry the file I intended to attach to my last post did not take....this may hel to understand better

Attached Files



#5 Christian F.

Christian F.

    Advanced Member

  • Staff Alumni
  • 3,106 posts
  • LocationNorway

Posted 06 January 2013 - 06:20 PM

Why not just use the same source for your picture, or did I misunderstand something?
Keeping it simple.

#6 dinrock

dinrock

    Newbie

  • New Members
  • Pip
  • 7 posts

Posted 06 January 2013 - 07:17 PM

The same source for my daily image that appears on my index pagenow (which is on a Windows server) will also work on the same web hosting company's Linux server. However, I was told by someone with PHP knowledge that the image won't display in that BODY area of WordPress. So was wondering then, could it be displayed in the HEADER area perhaps? In essence, the script works on both server sides....so curious if WordPress will allow it to display elsewhere? As mentioned, I am not a PHP'er. Here is another way to see the day's current image in your browser. Click here

Edited by dinrock, 06 January 2013 - 07:18 PM.


#7 Christian F.

Christian F.

    Advanced Member

  • Staff Alumni
  • 3,106 posts
  • LocationNorway

Posted 07 January 2013 - 08:09 AM

This link should work in a Wordpress page as well, it's just plain HTML after all:
<img border="2" src="http://danscartoons.com/cotd/dailycartoon.php" title="CARTOON PICTURES">

So without actually seeing the Wordpress page in action, I can't say anything on why it doesn't work.

Though, that said, you best bet would be to hire someone who knows what they're doing. Not only with the PHP code, and Wordpress, but also the HTML code. To say it mildly, it's quite obvious that this site was made in Front Page; Both design and code-wise; And that's not a good thing, I'm afraid.
Keeping it simple.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com