The same code in 2 areas showing different. HELP

This is the script i am using i two areas , but the goal is not the same :frowning:

Code:

[php]


<?php echo app()->locale->dateFormatter->formatDateTime(
utime($data->start,false),‘medium’,false); ?>


<?php
echo CHtml::link($data->name,url(’/deal/view’,array(‘url’=>$data->url)));
?>




<?php echo $data->stats && $data->stats->bought?$data->stats->bought:'0'; ?>

<?php echo $this->t('Coupons Bought'); ?>



<?php echo $this->t('Price').':'; ?>
<?php echo m('payment')->format($data->price); ?>


<?php echo $this->t('Value').':'; ?>
<?php echo m('payment')->format($data->value); ?>


<?php echo $this->t('Savings').':'; ?>
<?php echo m('payment')->format($data->value-$data->price); ?>



<?php
if($data->imageBin)
echo CHtml::link(
CHtml::image(app()->storage->bin($data->imageBin)->getFileUrl(‘original’)),
url(’/deal/view’,array(‘url’=>$data->url))
);
?>


<?php if($index && ($index+1)%2==0) { ?>
<?php }[/php]

Only change:
div class=‘allDeal’ to div class=‘recentDeal’

This is the good:

http://kupon.woano.lv/deal/recent

and the same code in other place looks ugly :frowning:

http://kupon.woano.lv/deal/all

What i am doing wrong

Well, assuming, since “CLASS=” means you are setting up CSS classes. If you change a class name in HTML code, you would have to change it in the CSS code. My guess is that you changed the class name and left the CSS code pointing to the old class name.

Are you using CSS or am I missing something else?

This was the orginal code for the orginal uggly theme :confused:

[php]


<?php
if($data->imageBin)
echo CHtml::link(
CHtml::image(app()->storage->bin($data->imageBin)->getFileUrl(‘original’)),
url(’/deal/view’,array(‘url’=>$data->url))
);
?>

<?php
echo CHtml::link($data->name,url(’/deal/view’,array(‘url’=>$data->url)));
?>


<?php echo CHtml::link($this->t('View this deal'),url('/deal/view',array('url'=>$data->url))); ?>
<?php
if($data->start < time()) {
?>
<?php echo $this->t(’{time} left’, array(
‘{time}’ => CHtml::tag(‘span’, array(‘id’ => ‘timer_’.$data->id))
)); ?>
<?php
} else {
?>
<?php echo app()->locale->dateFormatter->formatDateTime(
utime($data->start,false),‘medium’,false); ?>
<?php
}
?>
<?php if($data->start < time()) { $layout = $data->end-time() > 86400 ? '{dn} {dl} {hn}:{mn}:{sn}' : '{hn}:{mn}:{sn}'; cs()->registerScript('timelefttimer.'.$data->id, '$("#timer_'.$data->id.'").countdown({until: new Date('.($data->end * 1000).'),layout: "'.$layout.'"});'); } if($index && ($index+1)%2==0) { ?>
<?php }[/php]

and orginal CSS

.allDeal { float: left; margin: 0 1em 1.5em 1em; width: 415px; padding: 10px; border: 1px solid #ccc; } .allDeal .image img {width: 415px;}

This EDITED CSS

.allDeal {float: left; margin: 0 1em 1.5em 1em; width: 435px;} .allDeal .name {height: 50px; overflow: hidden;} .allDeal .prepend-top {margin-top: 1em} .allDeal .data {width: 150px;} .allDeal .date {font-weight: bold;} .allDeal .content {border: 2px solid #ddd; padding: .5em} .allDeal .image img {height: 170px;} .allDeal .stats {border: 1px solid #ddd; padding: .5em; line-height: 1;} .allDeal .stats .num {font-weight: bold; font-size: 250%} .allDeal .info {border: 1px solid #ddd;} .allDeal .info .price {background-color: #ddd;} .allDeal .info .row {padding: .5em; margin: 0; font-size: 110%;} .allDeal .info label {text-align: left; width: 50%;}}

Well, maybe you didn’t understand. You answered your own question…

You use a CLASS named ALLDEAL. You have CSS pointing to ALLDEAL.

You change ALLDEAL to RECENTDEAL. You have CSS pointing to ALLDEAL.

Where’s the CSS for RECENTDEAL???

I would just copy the code and leave it ALLDEAL. The class is ONLY for the CSS not any programming, right? If you have other code that uses the CLASS of a DIV or something, then you have to duplicate your CSS. Otherwise, just change the class back.

Hope that helps…

Sponsor our Newsletter | Privacy Policy | Terms of Service