any help for a little script :)

6 posts by 2 authors in: Forums > CMS Builder
Last Post: August 10, 2010   (RSS)

By jimmy.g - August 7, 2010

Hi so to make it short this is the website im working on it
www.equipegalvan.com so as you can see on the main there's a dernieres inscription block.
this is my script
<!-- ************* feature script ************** -->

<!--webbot bot="HTMLMarkup" startspan -->
<div id="slider2" class="sliderwrapper">
<?php

require_once "init.php";

list($listingRecords, $listingDetails) = getRecords(array(
'tableName' => 'listings',
'limit' => '6',
'orderBy' => 'createdDate DESC',

));
$listing = @$listingRecords[0];
?>
<?php foreach ($listingRecords as $listing): ?>
<?php if ($listing['featured'] == 'oui'):?>
<!-- ************* PICTURE 1 ************** -->
<div class="contentdiv">
<div style="z-index:5;position:absolute;margin-left:192px;">
<?php if ($listing['vendu'] == '1'): ?>
<a href="<?php echo $listing['_link'] ?>"><img src="img/vendu.png" alt="vendu" width="134px" height="97px" border="0"/></a>
<?php endif; ?>
<?php if ($listing['prix_reviser'] == '1'): ?>
<a href="<?php echo $listing['_link'] ?>"><img src="img/prix_reviser.png" alt="vendu" width="134px" height="97px" border="0"/></a>
<?php endif; ?>
</div>
<div style="z-index:1;">
<?php foreach ($listing['photo_pour_accueil'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<a href="<?php echo $listing['_link'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" border="0" alt="" /></a>
<?php endif; ?>
<?php endforeach ?>
</div>
<div class="nom_maison" style="z-index:1;"><?php echo $listing['adresse'] ?>, <?php echo $listing['ville'] ?></div>
</div>
<?php endif; ?>
<?php endforeach ?>
</div>
<div class="pagination" id="paginate-slider2"></div>
<script type="text/javascript" src="flowplayer-3.1.2.min.js"></script>
<script type="text/javascript" src="contentslider.js"></script>
<script type="text/javascript" src="jquery-1.2.6.pack.js"></script>
<script type="text/javascript">

featuredcontentslider.init({
id: "slider2", //id of main slider DIV
contentsource: ["inline", ""], //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
toc: ["1", "2", "3", "4", "5", "6"], //Valid values: "#increment", "markup", ["label1", "label2", etc]
nextprev: ["Pr&eacute;c&eacute;dente", "Suivante"], //labels for "prev" and "next" links. Set to "" to hide.
enablefade: [true, 0.1], //[true/false, fadedegree]
autorotate: [true, 4000], //[true/false, pausetime]
onChange: function(previndex, curindex){ //event handler fired whenever script changes slide
//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
}
})


</script>
<!-- ************* feature script ************** -->
there's probably alot of error but my request that when agent choose to don't show house on accueil i want a "else" or whatever that can work to make nothing on the main page

so when the show house on my page is on it show it on main page and when its off it not i don't know if you understand but i request some help because im really weak in php :\ so if someone can help me :)

Cya thanks in advance

Re: [jimmy.g] any help for a little script :)

By Jason - August 9, 2010

Hi,

I'm not sure if I understand. You want agents to be able to choose if a property displays in the slideshow or not? What field are you using to make this decision?

If you could clarify the problem some more I can take a look.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [jimmy.g] any help for a little script :)

By Jason - August 9, 2010

Hi,

You don't need an else statement. From what I can tell from the code you posted, the only listings that will be displayed are the ones that have the featured field selected. Otherwise nothing will happen.

Do you have non featured listings showing up in the slideshow? I think the blank slides you're seeing are because there are no images associated with those records.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] any help for a little script :)

By jimmy.g - August 9, 2010

I fix the problem that was the
'orderBy' => 'createdDate DESC',

I changed it for
'orderBy' => 'featured2 DESC, createdDate DESC',


and it's fixed :D

thanks for your help ^^

Re: [jimmy.g] any help for a little script :)

By Jason - August 10, 2010

Great! I'm glad everything is working for you.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/