Jump to content

Scrolling banner


Go to solution Solved by joallen,

Recommended Posts

Have a feature on our cart that allows a scrolling banner, but since upgrade to php5, the images aren't showing.  Here is scrollinghead file which is followed by main php file, any suggestions would greatly help!

 

<script type="text/javascript" src="includes/carousel/jquery.js"></script>
 <script type="text/javascript" src="includes/carousel/jquery.carouFredSel.js"></script>
<script type="text/javascript" language="javascript">
  $(document).ready(function(){
$("#image_carousel2").carouFredSel({
    circular: true,
    infinite: true,
    auto     : true,
    height  : <?echo ($brands_image_size);?>,
    items: {
        width  : <?echo ($brands_image_size+4);?>,
        height  : <?echo ($brands_image_size);?>,
    },
    scroll: {
        items: <?echo ceil( (1/($brands_image_size+4))*1000);?>,
        fx: "<?echo $brands_box_effect;?>",
        duration: 750,
        pauseOnHover: 3000
    },
});   
 });
</script>
<STYLE>
.image_carousel2 {
    padding: 15px 0 15px 40px;
    position: relative;
}
.image_carousel2 img {
    border: 1px solid #ccc;
    background-color: white;
    padding: 9px;
    margin: 7px;
    display: block;
    float: left;
}
.clearfix {
    float: none;
    clear: both;
}
</STYLE>

 

------------------------- BELOW IS OTHER MAIN FILE

 

<?
    $brands_image_size= 80;
    $brands_box_bkcolor = "#EEEEEE";
    $brands_box_effect = "scroll";
    require(DIR_WS_INCLUDES . 'scrollingbrandshead.php');
    $num_brands_query = "select `manufacturers_id` from `manufacturers`;";
    $num_brands_result = mysql_query($num_brands_query);
    $num_brands = mysql_num_rows($num_brands_result);
    $display_brands_query = "select manufacturers_id,manufacturers_name,manufacturers_image from manufacturers where manufacturers_image != '' ORDER BY RAND() Limit 18;";
    $display_brands_result = mysql_query($display_brands_query);
    $num_brands_with_images = mysql_num_rows($display_brands_result);
?>
<?php if($num_brands_with_images >3){
?>
<div class="ui-widget-content ui-corner-all infoBoxContents">
<table cellspacing=4 cellpadding=4 height=<?echo ($brands_image_size+4);?> width=100% align=center style="background-color:<?echo $brands_box_bkcolor;?>">
    <tr>
        <td>
            <a href=allmanufacturers.php?<?echo tep_session_name().'='. tep_session_id();?>><span style="color:<? echo MENU_ITEM_COLOR;?>; font-size:17px; font-weight:bold;">Shop by<br />Brand</span></a>
        </td>
        <td align=center>
            <div class="image_carousel">
                <div id="image_carousel2" style="background-color:#<?echo $brands_box_bkcolor;?>">
                    <?
                        while($display_brands_row = mysql_fetch_array($display_brands_result)){
                            if(file_exists(DIR_WS_IMAGES . $display_brands_row['manufacturers_image']) && $display_brands_row['manufacturers_image'] != ""){
                                echo  "<span style='background-color:#FFFFFF; border:1px solid #BBBBBB; ;height:".($brands_image_size-2)."px; width:".($brands_image_size+2)."px; float: left; display:inline-block; vertical-align:middle;'>";
                                    //div content
                                    echo "<a HREF=index.php?manufacturers_id=" . $display_brands_row['manufacturers_id'] . "><table valign=center align=center width=100% height=100%><tr><Td align=center>";
                                        echo tep_image(DIR_WS_IMAGES . $display_brands_row['manufacturers_image'], $display_brands_row['manufacturers_name'], ($brands_image_size-4),($brands_image_size- 8),'style=" float:left; display:inline-block vertical-align:middle"' );
                                    echo "</td></tr></table></a>";
                                echo "</span>";
                            }
                        }
                    ?>
                </div>
                <div class="clearfix"></div>
            </div>
        </td>
    </tr>
</table>
</div>
<? }?>

Edited by NicePHP77
Link to comment
https://forums.phpfreaks.com/topic/284546-scrolling-banner/
Share on other sites

Use the full <?php code tags and not the short <?

 

There are unquoted href attributes.

echo "<a href='index.php'>HOME</a>";

 

As of php version 5.5.0 you should be using mysqli and not mysql

http://www.php.net/manual/en/function.mysqli-connect.php

Link to comment
https://forums.phpfreaks.com/topic/284546-scrolling-banner/#findComment-1461379
Share on other sites

  • Solution

Your query:

$display_brands_query = "select manufacturers_id,manufacturers_name,manufacturers_image from manufacturers where manufacturers_image != '' ORDER BY RAND() Limit 18;"; 

Change To:

$display_brands_query = "select manufacturers_id,manufacturers_name,manufacturers_image from manufacturers where manufacturers_image IS NOT NULL ORDER BY RAND() Limit 18;";

Just noticed your select statement was correct....could potentially be the smiley face in your script?????....lol. Can you edit your post and ensure your script is placed between the script tag in the forum?? 

 

It would help us help you... Thank you! =0)

 

Cheers!

Edited by joallen
Link to comment
https://forums.phpfreaks.com/topic/284546-scrolling-banner/#findComment-1461860
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.