Elxis CMS Forum

Extensions => Components => Topic started by: xmanhattan on February 10, 2009, 09:23:39

Title: ad ticker - a code fix
Post by: xmanhattan on February 10, 2009, 09:23:39
If any of you are seeing a css error, then a correction for this can be made to this file,
mod_ads_ticker.php
which is in the modules directory.

Lines 63 - 67 show
Code: [Select]
<style type="text/css">
overflow: hidden;
width: <?php echo $ads_ticker_width?>px;
font-weight: bold;
}

Unless Datahell missed something here, these lines can be remarked as follows:
Code: [Select]
/*
<style type="text/css">
overflow: hidden;
width: <?php //echo $ads_ticker_width; ?>px;
font-weight: bold;
}
*/

The css error shows up using firefox webdeveloper.

Title: Re: ad ticker - a code fix
Post by: Farhad Sakhaei on February 10, 2009, 11:09:15
Even if there is any problem in there , This is not a good fix for it  :)
Title: Re: ad ticker - a code fix
Post by: Coursar on February 10, 2009, 14:22:42
try:

Code: [Select]
<style type="text/css">
elemenet {
overflow: hidden;
width: <?php echo $ads_ticker_width?>px;
font-weight: bold;
}
Title: Re: ad ticker - a code fix
Post by: Coursar on February 10, 2009, 14:23:22
where element is p, div or another...
Title: Re: ad ticker - a code fix
Post by: datahell on February 10, 2009, 14:29:06
Sorry, this is the components section and what is this "ads ticker"? I don't know such a module.
Title: Re: ad ticker - a code fix
Post by: CREATIVE Options on February 10, 2009, 14:47:58
xmanhattan this is J module !!
Title: Re: ad ticker - a code fix
Post by: xmanhattan on February 10, 2009, 20:00:00
This is the original code on lines 62 - 77 of mod_ads_ticker.php v1.11:

Code: [Select]
?>
<style type="text/css">
overflow: hidden;
width: <?php echo $ads_ticker_width?>px;
font-weight: bold;
}

.<?php echo &#39;ads_ticker_main&#39; . $id; ?>{
overflow: hidden;
width: <?php echo $ads_ticker_width?>px;
height: <?php echo $ads_ticker_height?>px;
border: 0px solid black;
background-color: white;
padding: 0px;
display:block;
}

</style>

It's not a problem with the above not in use, I just thought that you would all like to know.

Title: Re: ad ticker - a code fix
Post by: ks-net on February 10, 2009, 20:21:03
1st elxis is not responsible for third party extensions including templates...
2nd elxis can't check the issues or the comparability of every third party extension out there

this css file in not elxis's but a dynamic-updated file thought module's php code... it is owned by this ticker(?) module...
this module seems to be incompatible with elxis... if everything else working , thing that is rather impossible...
manual fix -fill css values
?>
<style type="text/css">
overflow: hidden;
width: <?php echo $ads_ticker_width; ?>px; ... remove and manual add width:200px;  or what ever dimension!
font-weight: bold;
}
Title: Re: ad ticker - a code fix
Post by: xmanhattan on February 10, 2009, 20:36:40
I never said that it was.  The point of this post is for information purposes only.
Title: Re: ad ticker - a code fix
Post by: datahell on February 10, 2009, 22:35:38
Adding "style" inside your html's body section will make the page XHTML invalid.
The solution is to use inline CSS or javascript:

<script type="text/javascript">
/*   <![CDATA[ */
var tickercss = '<style type="text/css">';
tickercss += '.ads_ticker_main<?php echo $id; ?> {';
tickercss += 'overflow: hidden; width: <?php echo intval($ads_ticker_width); ?>px; ';
tickercss += 'height: <?php echo intval($ads_ticker_height); ?>px; border: none;';
tickercss += 'background-color: white; padding: 0; display:block;';
tickercss += '}</style>';
document.write(tickercss);
/* ]]> */
</script>

The "$id" if it is not used inside a php function will overwrite Elxis's or third party's component $id and this can generate serious problems..
Title: Re: ad ticker - a code fix
Post by: Coursar on February 10, 2009, 23:25:40
if you're using css in that way, you need marked your css rules in block with {}.

See
.<?php echo 'ads_ticker_main' . $id; ?>{
overflow: hidden;
width: <?php echo $ads_ticker_width; ?>px;
height: <?php echo $ads_ticker_height; ?>px;
border: 0px solid black;
background-color: white;
padding: 0px;
display:block;
}

in first block you're are missing first {, just add it.