Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   [SOLVED] Strange problem with PHP Code plugin widget (http://forum.bytesforall.com/showthread.php?t=3676)

paulae Oct 1, 2009 07:36 AM

[SOLVED] Strange problem with PHP Code plugin widget
 
Juggledad, any idea on this one? I had the PHP Code plugin working, and had a widget in the right sidebar to show a different real estate image each day. It was fine, but I was trying to figure out what was causing the site to be so slow, so I was deactivating plugins one by one. When I deactivated that one, I started seeing this in the right sidebar where the ad used to be:
Code:

Parse error: syntax error, unexpected $end in /usr/home/web/users/xxxxxx/html/wp27/wp-content/plugins/php-code-widget/execphp.php(38) : eval()'d code on line 20
I reactivated the plugin, and the ad is now showing up again as before, but so is this error message. I've dumped my browser cache but it is still there. Help!?

juggledad Oct 1, 2009 08:19 AM

What was the php in the widget?

paulae Oct 1, 2009 08:21 AM

I didn't change the code itself while messing with whether the plugin was active or not....

Code:

<?php
$totalPics="30";                    // Total photos in folder

$photoOfTheDay = Array (          // Add up to 31 photos below

  '1' => '/ads/weichert/0701Janet.jpg',    // Name of or Path to image
  '2' => '/ads/weichert/0620Rita.jpg',    // Name of or Path to image
  '3' => '/ads/weichert/0621JenMarsh.jpg',
  '4' => '/ads/weichert/0615Mary.jpg',
  '5' => '/ads/weichert/0705Jay.jpg',
  '6' => '/ads/weichert/0706Barbara.jpg',
  '7' => '/ads/weichert/0707Dottie.jpg',
  '8' => '/ads/weichert/0620Rita.jpg',
  '9' => '/ads/weichert/0621JenMarsh.jpg',
  '10' => '/ads/weichert/0615Mary.jpg',
  '11' => '/ads/weichert/0705Jay.jpg',
  '12' => '/ads/weichert/0706Barbara.jpg',
  '13' => '/ads/weichert/0707Dottie.jpg',
  '14' => '/ads/weichert/0914Dottie.jpg',
  '15' => '/ads/weichert/0915Barbara.jpg',
  '16' => '/ads/weichert/0916Jay.jpg',
  '17' => '/ads/weichert/0917Rita.jpg',
  '18' => '/ads/weichert/0918Mary.jpg',
  '19' => '/ads/weichert/0919Janet.jpg',
  '20' => '/ads/weichert/0920Jen.jpg',
  '21' => '/ads/weichert/0914Dottie.jpg',
  '22' => '/ads/weichert/0915Barbara.jpg',
  '23' => '/ads/weichert/0916Jay.jpg',
  '24' => '/ads/weichert/0917Rita.jpg',
  '25' => '/ads/weichert/0918Mary.jpg',
  '26' => '/ads/weichert/0919Janet.jpg',
  '27' => '/ads/weichert/0920Jen.jpg',
  '28' => '/ads/weichert/0914Dottie.jpg',
  '29' => '/ads/weichert/0915Barbara.jpg',
  '30' => '/ads/weichert/0916Jay.jpg',
);

$linkOfTheDay = Array (

  '1' => 'http://rosejanetdemasi.weichertagentpages.com/',    // Name of or Path to image
  '2' => 'http://ritamarsh.weichertagentpages.com/',          // Name of or Path to image
  '3' => 'http://www.larchmont-homes.com/about-jennifer-marsh.htm',
  '4' => 'http://www.larchmontmanorhomes.com/',
  '5' => 'http://jaydollinger.weichertagentpages.com/',
  '6' => 'http://barbarabarber.weichertagentpages.com/',
  '7' => 'http://www.weichert.com/NY/Westchester/Larchmont/',
  '8' => 'http://ritamarsh.weichertagentpages.com/',
  '9' => 'http://www.larchmont-homes.com/about-jennifer-marsh.htm',
  '10' => 'http://www.larchmontmanorhomes.com/',
  '11' => 'http://jaydollinger.weichertagentpages.com/',
  '12' => 'http://barbarabarber.weichertagentpages.com/',
  '13' => 'http://www.larchmontgazette.com/',
  '14' => 'http://www.larchmontgazette.com/',
  '15' => 'http://barbarabarber.weichertagentpages.com/',
  '16' => 'http://jaydollinger.weichertagentpages.com/',
  '17' => 'http://ritamarsh.weichertagentpages.com/',
  '18' => 'http://www.larchmontmanorhomes.com/',
  '19' => 'http://rosejanetdemasi.weichertagentpages.com/',
  '20' => 'http://www.larchmont-homes.com/about-jennifer-marsh.htm',
  '21' => 'http://www.larchmontgazette.com/',
  '22' => 'http://barbarabarber.weichertagentpages.com/',
  '23' => 'http://jaydollinger.weichertagentpages.com/',
  '24' => 'http://ritamarsh.weichertagentpages.com/',
  '25' => 'http://www.larchmontmanorhomes.com/',
  '26' => 'http://rosejanetdemasi.weichertagentpages.com/',
  '27' => 'http://www.larchmont-homes.com/about-jennifer-marsh.htm',
  '28' => 'http://www.larchmontgazette.com/',
  '29' => 'http://barbarabarber.weichertagentpages.com/',
  '30' => 'http://jaydollinger.weichertagentpages.com/',
);

//  published at: scripts.tropicalpcsolutions.com

// Place day of month in variable 'x'
//$x=date("d");
// A website vistor made a suggestion to change the date function to use j
// instead of d. This causes the date to be read without leading zeros.
$x=date("j");  //Thanks for the suggestion Andrew

// If value of date exceeds the amount of photos then pick a random photo to display
if($x > $totalPics) { $x=rand(1,$totalPics); }

$ad_image = '';
$ad_image = '<a href=' . $linkOfTheDay[$x] . '><img src=' . $photoOfTheDay[$x] . '></a>';

// Display image
//echo "potd=" . $photoOfTheDay[$x] . "</ br>";
//echo "lotd=" . $linkOfTheDay[$x] . "</ br>";
//echo "x=" . $x . "</ br>";
echo "<center> " . $ad_image . " </center>" ;
?>


juggledad Oct 1, 2009 08:54 AM

Where is the error message showing up.

Also you have an ',' after the last photo of the day - array item 30.

paulae Oct 1, 2009 09:14 AM

http://www.larchmontgazette.com
Right sidebar

Wait a minute! The problem is with another PHP code widget, the one for the obits list. Let me try removing that and redoing it.

EDIT:

Well. I deleted the cached files from WP-Cache, then dumped the Safari and Firefox caches, and reloaded. Now the problem widget is not showing up. I'll try to rebuild it now. This caching thing can cause problems!

paulae Oct 1, 2009 09:43 AM

All cleared up now. Sorry for the bother!

I still think my site takes to long to load, especially for anything at all to appear as the rest of the page loads.


All times are GMT -6. The time now is 09:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.