TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 344
  • Total: 344

Can't find this Div, Code

Started by starcad, August 24, 2009, 01:05:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

starcad

http://www.starcadplans.net
SMF 1.1.10
TinyPortal v0.9.8
Airy_Midnight
Firefox 3.0.12
Several including Gallery Lite/b]
Not really an error just look for this code

Not really looking for an error just looking for some code the div for the news fader feature it looks like this in FireBug.

background: transparent url(http://www.starcadplans.net/Themes/Airymidnight98/images/machine.jpg) repeat-x scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; height: 60px;

I just need to change the height to 70px but for the life of me I can't seem to find the div anywhere and Firebug as good as it is can't seem to give me the information I need.  

Could someone point me in the right direction?  Thanks -  Guy


IchBin

Haven't a clue really on what you're talking about. Your sentence didn't make much sense to me. If you're trying to find the news code, have you search for the word "news" in the index.template.php file?

starcad

Thanks IchBin at least that is a start as I've been all over the code in almost every folder.   If I find it I'll report back.

Thanks again for looking. 

Guy

starcad

OK I give.  For the life of me I cannot seem to find where this code is generated.  I renamed BoardIndex.tmeplate.php in the default theme. I even renamed BoardIndex.tmeplate.php in the template I'm using.  I've removed the fader section in the theme I'm using.  But for the life of me I still see the fader in operation.  All I need to do is find where that little table/cell piece of code is coming from but no joy. So, I guess I will just have to live with it. 

mc

Is the newsfader a block controlled by TP?

If it is, then you'll be able to edit the block code via the block manager in TP admin.

If it's not a block, then it's most likely located within index.template.php, since it seems to appear on all pages (index.template.php is the only file common to all pages).

Or is there a newsfader as part of the basic SMF package?

ZarPrime

starcad,

Have a look at this code.  This is a News Fader block that I have used on one of my sites since TP 0.98 was out.  For TP 0.98, I used this in a center block, and once TP 1.x came out I switched to using it in an upper block.  At this time, I'm using it in a Top block.

I don't remember if I found this code somewhere or whether I just copied the News Fader code from the SMF install at that time but the important thing to note about it is that if you look at the first div in the code, I have put a height in there.  This code may help you to figure out what you're trying to do, but I no longer have TP 0.98 installed on a test site, so I have no way to help you solve this issue at this time.  If the News Fader you are using is the built in SMF fader, you might be better off asking about this at SMF.  Otherwise you could try this code in a block (a center block since you're using TP 0.98).  You'll need to have the SMF News Fader in "Current Theme" turned on for this to work.


global $context, $settings, $options, $txt, $scripturl, $modSettings;

// Show the news fader?  (assuming there are things to show...)
if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
echo '
<div style="height: 50px; background: url('.$settings['images_url'].'/machine.jpg) repeat-x;">';

// Prepare all the javascript settings.
echo '
<div id="smfFadeScroller" style="text-align: center; width: 90%; padding: 2px;"><b>', $context['news_lines'][0], '</b></div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// The fading delay (in ms.)
var smfFadeDelay = ', empty($settings['newsfader_time']) ? 3000 : $settings['newsfader_time'], ';
// Fade from... what text color? To which background color?
var smfFadeFrom = {"r": 155, "g": 185, "b": 255}, smfFadeTo = {"r": 0, "g": 0, "b": 0};
// Surround each item with... anything special?
var smfFadeBefore = "<b>", smfFadeAfter = "</b>";

var foreColor, backEl, backColor;

if (typeof(document.getElementById(\'smfFadeScroller\').currentStyle) != "undefined")
{
foreColor = document.getElementById(\'smfFadeScroller\').currentStyle.color.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

backEl = document.getElementById(\'smfFadeScroller\');
while (backEl.currentStyle.backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined")
backEl = backEl.parentNode;

backColor = backEl.currentStyle.backgroundColor.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeTo = {"r": eval("0x" + backColor[1]), "g": eval("0x" + backColor[2]), "b": eval("0x" + backColor[3])};
}
else if (typeof(window.opera) == "undefined" && typeof(document.defaultView) != "undefined")
{
foreColor = document.defaultView.getComputedStyle(document.getElementById(\'smfFadeScroller\'), null).color.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

backEl = document.getElementById(\'smfFadeScroller\');
while (document.defaultView.getComputedStyle(backEl, null).backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
backEl = backEl.parentNode;

backColor = document.defaultView.getComputedStyle(backEl, null).backgroundColor.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeTo = {"r": parseInt(backColor[1]), "g": parseInt(backColor[2]), "b": parseInt(backColor[3])};
}

// List all the lines of the news for display.
var smfFadeContent = new Array(
"', implode('",
"', $context['fader_news_lines']), '"
);
// ]]></script><script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/fader.js"></script></div>';
}


Let us know if this solves your issue.

ZarPrime

Zetan

It doesn't work with Google Chrome browser and so far SMF refuse to acknowledge Chrome and so they won't fix it. It doesn't fade using Chrome.. possibly some other browsers. Just a heads up.

starcad

First, Ichbin, or G6 please mark this as solved.

Zarprime:  Two things in your post rang a bell.  I saw in my searches from the last several day the code you posted as it kept coming up over and over again.  So, after reading your post several times that little bell went off again in my head.  Two thing you pointed out solved the issue.  "...you could try this code in a block (a center block since you're using TP 0.98)." ,  and this part of code, <div style="height: 50px; background: url('.$settings['images_url'].'/machine.jpg) repeat-x;">';  The machine.jpg was the real head bang.  I had forgotten I had put the "Fader" code in a "Center Block"  After looking up the block there was the code and a simple edit to change the 50px to 60px solve the problem.  Thanks you for your post.

Zetan:  Humm! Chrome seems to have a following but the market share for it is still low with IE and FF being the dominate forces in the browser  wars.  MS seems to have lost again with the release of IE8 not meeting there expectations along with consumer expectations, while FF seems to have pulled it off again.  One of the up and coming is Safari and the latest release seems to be growing in popularity in both Mac world and PC use.  Nice browser but does lack some functionality in the way I like to use in a browser.  There is another one out there that is real junk and tries to emulate IE and take over your computer.  Some "script kiddie" at work downloaded it and it tried to take over our entire system.  IT had to work an over nighter to get rid of it.  

I think as people get use to Chrome it will become more popular and thus more support for it.  But, I don't think that will happen with in the next year or maybe more until MS really messes up again.  

Hold your breath with the up and coming Windows 7 release as I fear MS will unleash yet another "Beta" release on the unsuspecting public and tech support will again be swamped with calls.

Ahh!  Job security.

G6Cad


This website is proudly hosted on Crocweb Cloud Website Hosting.