I'm sure the config file is setup right becuase the store and the admin panel both work great, I'm sure it's this mod that I'm working on.
The following code that is the script from a file called "testimonials_display.php".
PHP Code:
<?PHP
@mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD) or die("Unable to connect");
@mysql_select_db(DB_DATABASE) or die("Unable to select database DB_DATABASE");
$query=("SELECT image, business_name, location, LEFT(quote,300) AS quote FROM " . DB_PREFIX . "testimonials")or die(@mysql_error());
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$image=mysql_result($result,$i,"image");
$quote=mysql_result($result,$i,"quote");
$business_name=mysql_result($result,$i,"business_name");
$location=mysql_result($result,$i,"location");
if (empty($image)){$image = "default.gif";}
$quotes[] = '
<div><img src="'. DIR_WS_ADMIN .'includes/modules/testimonials/testimonial_images/' . $image . '" alt="" /></div>
<div style="font-size:10px; padding-right:8px;">"<em>' . $quote . '</em>"... <a href="index.php?main_page=testimonials&session=display" style="white-space:nowrap;">Read More »</a></div>
<div /><p><strong>' . $business_name . '</strong><br />
' . $location . '</p>';
$i++;
};
srand ((double) microtime() * 1000000);
$testimonials = rand(0,count($quotes)-1);
echo $quotes[$testimonials];
?>
That is the only code that I have in the file I'm not sure but I may be missing something that needs to include the right config file.
This testimonials mod has tools for the admin panel and it's own page and sidebox for the front end, so there is a lot going on with a lot of diffrent files.
I was playing around with
PHP Code:
(dirname(__FILE__) . '/testimonial_images/')
And it seems to work for the files in the admin but it’s not going to work for the files that are in the includes folder, so to save some time I’m just going to change the image folder to be in includes/modules/testimonials/images/ folder