Archive for myfreeforum.org Before posting please check the "stickies" in the support forums.
Please ask questions in real English and not "txt". You will get a better response.
Please do not ask support questions via PMs.
 



       myfreeforum.org Forum Index -> Portal components
admin (no pm's please)

a roll your own NEWS FADER

Okay, this one is not built into the system, but is an example of how you can make you own components.

The news fader will display a fade in fade out list of one line news items. First we ask ourselves have we a portal component logically similar?

Yes we do We have a menu component.

So we in OPTIONS in the control panel mould our component on menu, by entering:

[FADER]
title=News
component=MENU
name=FADER
item1=News fader
item2=looking good

next in the admin panel we create a template cms_fader.tpl

Note this code has been updated to show links, so the additional edit mentioned later in the thread is not needed.

Code:

<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
<!--BEGIN switch_fader_title -->
   <tr>
        <th height="25" class="thCornerL" nowrap="nowrap">{FADER_TITLE}</th>
     </tr>
<!--END switch_categories_title -->     
 
<tr>
<td align="center">


<div id="fscroller" style="font-size: 12; font-family: Verdana,Arial; font-weight: bold; width: 100%; height: 15px; padding: 2px; filter: alpha(opacity=0); -moz-opacity: 0.0;"></div><script language="JavaScript1.2" type="text/javascript">
<!--
var iDelay = 2000;var txtColor = "000000";var fContent = [];
<!-- BEGIN fader_row -->
if ("{fader_row.U_VIEW_MENU}"=="")
{
fContent[{fader_row.MENU_NUMBER}-1] = "{fader_row.MENU_NAME}"
}else
{
fContent[{fader_row.MENU_NUMBER}-1] = "<a href=\"{fader_row.U_VIEW_MENU}\">{fader_row.MENU_NAME}<\/a>"
}
<!-- END fader_row -->
var isIE = (document.all)? true : false;var frame = 60;var st = 1;var wait = iCur = 1;var index = iCurMoz = 0;var iDir = false;var frameHalf = frame / 2;var iTimer;var frame_m = frame;var wait_m = wait;document.getElementById("fscroller").style.color = txtColor;function fade(){   if(index >= fContent.length){      index = 0;   }   document.getElementById("fscroller").innerHTML = fContent[index];   index ++;   opacityFade();}function opacityFade(){   var fScroll = document.getElementById("fscroller");   if(frame > 0){      if(frame == frameHalf && wait > 0){         if(isIE){            fScroll.style.filter = "alpha(opacity=" + iCur + ")";         } else {            fScroll.style.MozOpacity = iCurMoz;         }         wait --;         setTimeout("opacityFade()", iDelay);      } else {         if(iDir){            iCur -= 3;            iCurMoz -= 0.03;         } else {            iCur += 3;            iCurMoz += 0.03;         }         if(isIE){            fScroll.style.filter = "alpha(opacity=" + iCur + ")";         } else {            fScroll.style.MozOpacity = iCurMoz;         }         if(frame == (frameHalf + 1)){            if(isIE){               fScroll.style.filter = "alpha(opacity=" + iCur + ")";            } else {               fScroll.style.MozOpacity = iCurMoz;            }            iDir = true;         }         frame --;         setTimeout("opacityFade()", st);      }   } else {      fScroll.innerHTML = " ";      frame = frame_m;      wait = wait_m;      iDir = false;      setTimeout("fade()", st);   }}// -->
</script>
</td></tr>
</table>


<script language="JavaScript" type="text/javascript"><!--
fade();
// -->
</script>


then we slap the component into overall_header.tpl in the case of the example shown on this forum the line was:

<tr><td colspan="3">{MYFF.FADER}</td></tr>


and Bobs your Aunty.
Bravo

I tried this on my smallest forum, I actually got it to work

How would I centralise the text?
admin (no pm's please)

I just edited in align="center" to the table column the fader div is in. See above.
Bravo

Wuhoo, I did it

I even improved it (by making it less than 100%)

If I can do it, anyone can!
admin (no pm's please)

I might make this an official component in which case all people will need to do is to add:


[FADER]
item1=News fader
item2=looking good

In options and add {MYFF.FADER} appropriately to overall_header.tpl.

In essence an official component is one with predefined values and a default template already on the system.
But the idea here is to help illustrate the way you can do it for yourself, and that there is probably lots that can be done in the portal system as it stands without myff having to add any more.
CodyT07

admin wrote:
I might make this an official component in which case all people will need to do is to add:


[FADER]
item1=News fader
item2=looking good

In options and add {MYFF.FADER} appropriately to overall_header.tpl.

In essence an official component is one with predefined values and a default template already on the system.
But the idea here is to help illustrate the way you can do it for yourself, and that there is probably lots that can be done in the portal system as it stands without myff having to add any more.

is their a way to make it clickable for links?
As i have one at thre bottom of my Link Exchnage Forum
And i want it to say click here to leanr how to add oneto your site and i added the links like the links menu and main but no luck.
admin (no pm's please)

Whilst it is tempting to leave that as a class exercise

Spoiler:


<!-- BEGIN fader_row -->
if ("{fader_row.U_VIEW_MENU}"=="")
{
fContent[{fader_row.MENU_NUMBER}-1] = "{fader_row.MENU_NAME}"
}else
{
fContent[{fader_row.MENU_NUMBER}-1] = "<a href={fader_row.U_VIEW_MENU}>{fader_row.MENU_NAME}</a>"
}
<!-- END fader_row -->



can replace the previous code segment.
Nick(NR)

I really don't like this one, way too ugly, kinda makes me wanna put the adverts into their own table just so it don't look as bad.
admin (no pm's please)

Well it is all a matter of providing choices and by the nature of the template system it is possible to change the cosmetics. It could be quite happy in the left hand column and not at the top.
Symon

Its nice but i prefer what i have which is a stop start ticker bar, using marquee tag

see HERE
Pariah

I dont have the template cms_fader.tpl in my template. Any solutions? How can I add it?
admin (no pm's please)

Add the stuff to options and the file appears automatically, look at the bottom of the template editing screen. cms files are not part of the other files editing dialog.
Pariah

Now when editing fader.tpl do I add this code onto it
Code:
<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
<!--BEGIN switch_fader_title -->
   <tr>
        <th height="25" class="thCornerL" nowrap="nowrap">{FADER_TITLE}</th>
     </tr>
<!--END switch_categories_title -->     
 
<tr>
<td align="center">


<div id="fscroller" style="font-size: 12; font-family: Verdana,Arial; font-weight: bold; width: 100%; height: 15px; padding: 2px; filter: alpha(opacity=0); -moz-opacity: 0.0;"></div><script language="JavaScript1.2" type="text/javascript">
<!--
var iDelay = 2000;var txtColor = "000000";var fContent = [];
<!-- BEGIN fader_row -->
fContent[{fader_row.MENU_NUMBER}-1] = "{fader_row.MENU_NAME}"
  <!-- END fader_row -->
var isIE = (document.all)? true : false;var frame = 60;var st = 1;var wait = iCur = 1;var index = iCurMoz = 0;var iDir = false;var frameHalf = frame / 2;var iTimer;var frame_m = frame;var wait_m = wait;document.getElementById("fscroller").style.color = txtColor;function fade(){   if(index >= fContent.length){      index = 0;   }   document.getElementById("fscroller").innerHTML = fContent[index];   index ++;   opacityFade();}function opacityFade(){   var fScroll = document.getElementById("fscroller");   if(frame > 0){      if(frame == frameHalf && wait > 0){         if(isIE){            fScroll.style.filter = "alpha(opacity=" + iCur + ")";         } else {            fScroll.style.MozOpacity = iCurMoz;         }         wait --;         setTimeout("opacityFade()", iDelay);      } else {         if(iDir){            iCur -= 3;            iCurMoz -= 0.03;         } else {            iCur += 3;            iCurMoz += 0.03;         }         if(isIE){            fScroll.style.filter = "alpha(opacity=" + iCur + ")";         } else {            fScroll.style.MozOpacity = iCurMoz;         }         if(frame == (frameHalf + 1)){            if(isIE){               fScroll.style.filter = "alpha(opacity=" + iCur + ")";            } else {               fScroll.style.MozOpacity = iCurMoz;            }            iDir = true;         }         frame --;         setTimeout("opacityFade()", st);      }   } else {      fScroll.innerHTML = " ";      frame = frame_m;      wait = wait_m;      iDir = false;      setTimeout("fade()", st);   }}// -->
</script>
</td></tr>
</table>


<script language="JavaScript" type="text/javascript"><!--
fade();
// -->
</script>


Or replace the whole thing?
admin (no pm's please)

replace it all.
Pariah

I have done everything you said yet it is not showing up. Any suggestions?
Nick(NR)

Pariah wrote:
I have done everything you said yet it is not showing up. Any suggestions?


my guess is add {MYFF.FADER} to where you want it to appear

I haven't tried this so no garruntee, but worth a try.
Comkidwizzer3

My news fader isn't working it only says News just check if you don't understand.
1-18-08

Where do you put the <tr><td colspan="3">{MYFF.FADER}</td></tr> bit???
Pariah

How do I make it at the very top where it spreads all across like on this forum? Take a look at mine and see what im talking about: http://anythingforums.myfastforum.org
Sukisue

The_Black_Smoke_Monster wrote:
Where do you put the <tr><td colspan="3">{MYFF.FADER}</td></tr> bit???


Overall_header.tpl. I just did mine. Am going to start messing around with colours etc now!

Edit: I moved mine to index_body.tpl - it wasn't looking good in the header. It looks better here! (I think!)
deandre81

Index

Yeah, i moved mine to the index.tpl too

i like it there better

check it out

http://forum.dadli-scene.com
deandre81

multiple

Question,

Can i create more than one of these things
like if i want a whole new one on a nother page in my forum
can i do that?
admin (no pm's please)

You can have as many as you want, just name them differently. We are showing three currently! e.g. two menus and the fader.
The fader is afterall a MENU component.
deandre81

all

And that means making them all say what i want them to say individually
deandre81

I tried

Ok, i tried duplicating the code and everything else, execpt putting 2 at the end

i went to thje control and added


Code:

[FADER2]
title=News and Info
component=MENU2
name=FADER2
item1=Welcome to Dadli-Scene.com Message Board


then i copied the entire cms_fader.tpl to the newly created, cms_fader2.tpl

i then added my code to where i wanted it but one again, i added 2 at the end

Code:
<tr><td colspan="3">{MYFF.FADER2}</td></tr>


now all i get it "undefined"
admin (no pm's please)

why are you using MENU2 as a base for FADER2 there is no such thing as MENU2
deandre81

right

That's the thing

I was just playing around and wanted to create a duplicate of the fader but i dont think its possible

i want it to say a different thing on what ever pages i put i on
like a reminder about something in the viewforumbody.tpl while it's saying something else in the indexbody.tpl


is that possible?
dnangelgirl

umm.......i know this may sound like a stupid question, but how do put text into it? right now all i have is a bar at the top that says news & info....take a look.....

http://dnangelgirl.myfreeforum.org
admin (no pm's please)

Re: right

deandre81 wrote:
That's the thing

I was just playing around and wanted to create a duplicate of the fader but i dont think its possible

i want it to say a different thing on what ever pages i put i on
like a reminder about something in the viewforumbody.tpl while it's saying something else in the indexbody.tpl


is that possible?


yes, but use MENU which is the component a FADER must be based on.
admin (no pm's please)

dnangelgirl wrote:
umm.......i know this may sound like a stupid question, but how do put text into it? right now all i have is a bar at the top that says news & info....take a look.....

http://dnangelgirl.myfreeforum.org


What is in your "OPTIONS" in the control panel?
dnangelgirl

[FADER]
title=News & Info
component=MENU
name=FADER
item1=news fader
item2=Lookin good


when i tried to change it, something wierd happened to my forum, so changed it back......
admin (no pm's please)

but without a link where we can see the issue what can we do, and you are unclear as to what your OPTIONs currently is
dnangelgirl

ooohh.....can you help me out, then?
deandre81

Re: right

admin wrote:
deandre81 wrote:
That's the thing

I was just playing around and wanted to create a duplicate of the fader but i dont think its possible

i want it to say a different thing on what ever pages i put i on
like a reminder about something in the viewforumbody.tpl while it's saying something else in the indexbody.tpl


is that possible?


yes, but use MENU which is the component a FADER must be based on.


I figured it out
Thanks for the help
but let me post what i did incase someone else develops the same idea as me

I simply added this to the OPTIONS
Code:
[FADER2]
title=News and Info
component=MENU
name=FADER
item1=Welcome to Message Board


Then as we know, it creates a new cms_fader.tpl but this time it's cms_fader2.tpl since the heading or title=[FADER2] after which i copied the exact code thats in cms_fader.tpl.

Last, i just added

Code:
<tr><td colspan="3">{MYFF.FADER2}</td></tr>
to where ever i wanted this to be displayed

Somethings are really simple once you take time to think it out and follow instructions

working example here
http://forum.dadli-scene.com
you will see my intro on the main page, then if you click on a topic, you will see another one at the top saying something else.
dnangelgirl

Do you remember my problem? If not I was asking how to insert text into my fader. If you take a look, it's just an empty fader at the moment. Until i know how to insert text, it will stay that way. Last night I tried to insert Text, but it didn't work very well. Do I have to insert it in the code or in the owner's panel? here is my forum: http://dnangelgirl.myfreeforum.org

By the way, thanks for the redirect!! I think I'll read everything again in the how to do it forum and then I'll start REALLY twieking my forum a bit
deandre81

Yes

Yes you do this in the owners control panel by changing

item1=news fader
item2=Lookin good

to anything you want...

item1=Welcome to my Forum
item2=Please Read Rules


you can also add more text

item1=news fader
item2=Lookin good
item3=Hey, check out blah blah
item4= etc etc
dnangelgirl

i did that, but i cant see the text....how do i change the font?
deandre81

You change it in the cms_fader.tpl via you admin login section of your forum

look for
Code:
var iDelay = 4500;var txtColor = "000000";var fContent = [];


and change it the txtColor = "000000" to what ever you want.
dnangelgirl

ok thanks!!!!
deandre81

No problem
CodyT07

lets see if i can explain this cleary.
When the fader changes to another line of text, all the animated banners stop for a moment then when it fully changes the move again, least through I.E.
See this thread. http://linkexchange.myfastforum.org/ftopic167.php
when it changes youll notice the banner tends to stop and go.
dnangelgirl

I see...
Master Mathandal

This is a really stupid question I know, but I have played around and can't figure it out. How do I make one of the things a link?

I want the link to be to the Rules of the Forum and it say "Be sure to read the rules"

I also cant get the second Fader to work.
Ganon

Master Mathandal wrote:
This is a really stupid question I know, but I have played around and can't figure it out. How do I make one of the things a link?


Same 'problem' here.

I sure it's self explanatory but I'm tired and frankly would like to be spoon fed this one time.

Where EXACTLY do I place the link, and how.

Cheers.
admin (no pm's please)

Have you added this bit?

Code:

<!-- BEGIN fader_row -->
if ("{fader_row.U_VIEW_MENU}"=="")
{
fContent[{fader_row.MENU_NUMBER}-1] = "{fader_row.MENU_NAME}"
}else
{
fContent[{fader_row.MENU_NUMBER}-1] = "<a href={fader_row.U_VIEW_MENU}>{fader_row.MENU_NAME}</a>"
}
<!-- END fader_row -->


Which was needed to show links, and is shown on page 2 of the thread.
Ganon

admin wrote:
Have you added this bit?

Code:

<!-- BEGIN fader_row -->
if ("{fader_row.U_VIEW_MENU}"=="")
{
fContent[{fader_row.MENU_NUMBER}-1] = "{fader_row.MENU_NAME}"
}else
{
fContent[{fader_row.MENU_NUMBER}-1] = "<a href={fader_row.U_VIEW_MENU}>{fader_row.MENU_NAME}</a>"
}
<!-- END fader_row -->


Which was needed to show links, and is shown on page 2 of the thread.


Sir! Yes Sir!
admin (no pm's please)

In which case where you add:

item1=blah

you should add

link1=http://....
Ganon

Thank you.
Master Mathandal

Thank You Admin
Master Mathandal

Ok so now my forum has the Fader2 template and I put {MYFF.FADER2} where I want it, but it says Undefined. What is wrong with it?

http://darksideoftheforce.myfreeforum.org
kingz4dragon

NEWS FADER

Ok i have the fader installed how does one change the text that is in there right now?
1-18-08

You have to go to the owners control panel.
Master Mathandal

Master Mathandal wrote:
Ok so now my forum has the Fader2 template and I put {MYFF.FADER2} where I want it, but it says Undefined. What is wrong with it?

http://darksideoftheforce.myfreeforum.org


Does anyone know what the problem may be?
Comkidwizzer3

I don't under stand how to post a link on the news fader.
Comkidwizzer3

admin wrote:
Whilst it is tempting to leave that as a class exercise

Spoiler:


<!-- BEGIN fader_row -->
if ("{fader_row.U_VIEW_MENU}"=="")
{
fContent[{fader_row.MENU_NUMBER}-1] = "{fader_row.MENU_NAME}"
}else
{
fContent[{fader_row.MENU_NUMBER}-1] = "<a href={fader_row.U_VIEW_MENU}>{fader_row.MENU_NAME}</a>"
}
<!-- END fader_row -->



can replace the previous code segment.


I don't understand by "Previous Code Segment".
admin (no pm's please)

The code there has delimiters <begin..> <end...> so does the earlier code posted. The new code replaces the old.
blakelives0312

Quote:
next in the admin panel we create a template cms_fader.tpl


Sorry, but I don't seem to see where to add a template file (tpl)...
Comkidwizzer3

you go to the bottom of the page and go to the scroll menu all the way down and click on cms_fader.tpl and press submit
blakelives0312

tis non-existent, my friend, thanks for trying.

what i am asking is how to make it existent, not where it is, for i know where it isn't.

I may be a newb, but you dont have to treat me like one, I have readily searched the entire admin panel and found nothing of adding .tpl files.
Master Mathandal

When you add the stuff to the owners panel

[Fader]
blah
blah
blah

It will create the template for you. If you follow the instructions on how to do it then you will easily realize your mistake. Even the instructions here will help you.

(I was not trying to make it sound like you are dumb, so please dont take offense. If that didn't help please state so and I will get the correct code that goes into the owners panel and show you a little more examples.
blakelives0312

[b][color=green]Heres the problem: I've already done that. it still isnt showing up.


i think i figured it out...il edit this in a minute if i was wrong on this idea.



okay you were right in making me sound like an idiot. I have two forums, the one i should delete (which i dont know how to do just yet) is spelled almost the same as another... (thesbian4970 vs thespian4970) and i had logged onto the wrong one... sorry for all the fuss.

and i wasnt all that offended, it just stuck in my mind.
Master Mathandal

The code may be wrong, or it may be there and you are just missing it. I really couldn't tell you because you aren't really giving us a full description of the problem. I mean you are probably giving the best description you can, or even I could, but it is a lot harder not actually seeing everything.
CodyT07

You really havent told us What you done. Saying you read it and did it believe it or not doesnt help us. We ask you tell us in detail what you have done.
blakelives0312

I signed in the wrong forum in the control panel. There's my mistake. Everything works now, thanks to this forum.
CodyT07

blakelives0312 wrote:
I signed in the wrong forum in the control panel. There's my mistake. Everything works now, thanks to this forum.

It happens
Comkidwizzer3

it's happens because you forget things
Brandon7

my fader doesn't work!

http://horsecommunity.myfreeforum.org

can you help me?
CodyT07

We can Help you IF you help us!
Tell us what you have done step by step.
Brandon7

help

ok!

I put in the cms_menu.tpl
Code:
[FADER]
title=News
component=MENU
name=FADER
item1=News fader
item2=looking good


heres how it was put:

Code:
<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
<!--BEGIN switch_categories_title -->
   <tr>
        <th colspan="1" width="150" height="25" class="thCornerL" nowrap="nowrap">{TITLE}</th>
     </tr>
<!--END switch_categories_title -->     
  <!-- BEGIN catrow -->
  <tr>
   <td class="row2"><span class="topictitle"><a href="{catrow.U_VIEW_CATEGORY}" class="topictitle">{catrow.CAT_NAME}</a></span></td>
  </tr>
  <!-- END catrow -->
</table>
[FADER]
title=News
component=MENU
name=FADER
item1=News fader
item2=looking good


In the overall_header I put:

Code:
<script language="JavaScript" type="text/javascript"><!--
fade();
// -->
</script>


the code in the overall_header is:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="Author" content="http://www.phpbbstyles.com" />
{META}
{NAV_LINKS}
<title>{SITENAME} :: {PAGE_TITLE}</title>
<link rel="stylesheet" href="{T_TEMPLATE_PATH}/style_{TPL_COLOR}.css" type="text/css" />
<style type="text/css">
<!--

<!-- BEGIN ca_normal -->
.forumdiv {   background: url({T_TEMPLATE_PATH}/images/{TPL_COLOR}/hdr_bg.gif) top left repeat-x; }
<!-- END ca_normal -->
<!-- BEGIN ca_rounded -->
.hdr-table-rounded { background: url({T_TEMPLATE_PATH}/images/{TPL_COLOR}/hdr_bg2.gif) top left repeat-x; }
<!-- END ca_rounded -->

<!-- BEGIN tpl_browser_safari -->
/* workaround for safari bugs */
.hdr-table, hdr-table-rounded { width: auto; }
html>body .postbody { overflow: visible; }
<!-- END tpl_browser_safari -->
-->
</style>
<!-- BEGIN switch_enable_pm_popup -->
<script language="Javascript" type="text/javascript">
<!--
{CA_XS_COMMENT_JS_START}
   if ( {PRIVATE_MESSAGE_NEW_FLAG} )
   {
      window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
   }
{CA_XS_COMMENT_JS_END}
//-->
</script>
<!-- END switch_enable_pm_popup -->
<script language="javascript" type="text/javascript">
<!--

var PreloadFlag = false;
var expDays = 90;
var exp = new Date();
var tmp = '';
var tmp_counter = 0;
var tmp_open = 0;

exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function SetCookie(name, value)
{
   var argv = SetCookie.arguments;
   var argc = SetCookie.arguments.length;
   var expires = (argc > 2) ? argv[2] : null;
   var path = (argc > 3) ? argv[3] : null;
   var domain = (argc > 4) ? argv[4] : null;
   var secure = (argc > 5) ? argv[5] : false;
   document.cookie = name + "=" + escape(value) +
      ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
      ((path == null) ? "" : ("; path=" + path)) +
      ((domain == null) ? "" : ("; domain=" + domain)) +
      ((secure == true) ? "; secure" : "");
}

function getCookieVal(offset)
{
   var endstr = document.cookie.indexOf(";",offset);
   if (endstr == -1)
   {
      endstr = document.cookie.length;
   }
   return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie(name)
{
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen)
   {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)
         return getCookieVal(j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0)
         break;
   }
   return null;
}

function ShowHide(id1, id2, id3)
{
   var res = expMenu(id1);
   if (id2 != '') expMenu(id2);
   if (id3 != '') SetCookie(id3, res, exp);
}
   
function expMenu(id)
{
   var itm = null;
   if (document.getElementById)
   {
      itm = document.getElementById(id);
   }
   else if (document.all)
   {
      itm = document.all[id];
   }
   else if (document.layers)
   {
      itm = document.layers[id];
   }
   if (!itm)
   {
      // do nothing
   }
   else if (itm.style)
   {
      if (itm.style.display == "none")
      {
         itm.style.display = "";
         return 1;
      }
      else
      {
         itm.style.display = "none";
         return 2;
      }
   }
   else
   {
      itm.visibility = "show";
      return 1;
   }
}

//-->
</script>
</head>
<body>
<a name="top"></a>


<table class="border-over" cellspacing="0" cellpadding="0" width="100%">
<tr>
   <td class="logo"><a href="{U_INDEX}"><img src="templates/myff_horsecommunity1/images/lang_english/red/av-12.gif" width="125" height="89" alt="{L_INDEX}" /><img src="{T_TEMPLATE_PATH}/images/{TPL_COLOR}/logo.gif" height="77" alt="{L_INDEX}" /></a></td>
</tr>
<tr>
   <td class="buttons" nowrap="nowrap" valign="top"><div>
      <!-- BEGIN switch_user_logged_out -->
      <a href="{U_REGISTER}">{L_REGISTER}</a>
      <img src="{T_TEMPLATE_PATH}/images/buttons_spacer.gif" alt="" width="10" height="11" />
      <!-- END switch_user_logged_out -->
      <a href="{U_FAQ}">{L_FAQ}</a>
      <img src="{T_TEMPLATE_PATH}/images/buttons_spacer.gif" alt="" width="10" height="11" />
      <a href="{U_SEARCH}">{L_SEARCH}</a>
      <img src="{T_TEMPLATE_PATH}/images/buttons_spacer.gif" alt="" width="10" height="11" />
      <a href="{U_MEMBERLIST}">{L_MEMBERLIST}</a>
      <img src="{T_TEMPLATE_PATH}/images/buttons_spacer.gif" alt="" width="10" height="11" />
      <a href="{U_GROUP_CP}">{L_USERGROUPS}</a>
      <img src="{T_TEMPLATE_PATH}/images/buttons_spacer.gif" alt="" width="10" height="11" />
      <!-- BEGIN switch_user_logged_in -->
      <a href="{U_PROFILE}">{L_PROFILE}</a>
      <img src="{T_TEMPLATE_PATH}/images/buttons_spacer.gif" alt="" width="10" height="11" />
      <a href="{U_PRIVATEMSGS}">{L_PRIVATEMSGS}{C_PM}</a>
      <img src="{T_TEMPLATE_PATH}/images/buttons_spacer.gif" alt="" width="10" height="11" />
      <!-- END switch_user_logged_in -->
      <a href="{U_LOGIN_LOGOUT}">{CA_L_LOGIN_LOGOUT}</a>
   </div></td>
</tr>
<tr>
   <td class="buttons1"><table border="0" cellspacing="0" cellpadding="0" width="100%">
   <tr>
      <td width="50%" align="left"><img src="{T_TEMPLATE_PATH}/images/buttons_left2.gif" width="5" height="6" alt="" /></td>
      <td width="50%" align="right"><img src="{T_TEMPLATE_PATH}/images/buttons_right2.gif" width="5" height="6" alt="" /></td>
   </tr>
   </table></td>
</tr>
</table>

<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" class="forum">
<tr>
   <td width="10" class="border-left"><img src="{T_TEMPLATE_PATH}/images/spacer.gif" width="10" height="1" alt="" /></td>
   <td class="content" valign="top" width="100%" height="100%">
   

   <!-- BEGIN switch_xs_enabled -->
   <?php if($this->vars['CA_NEW_MSGS'] && $this->vars['PRIVATE_MESSAGE_INFO'] !== $this->vars['CA_L_NO_MSG'] && !defined('CA_POPUP_SHOWED')) { ?>
   <div id="newmsgs"><a href="{U_PRIVATEMSGS}" class="newmsgs">{PRIVATE_MESSAGE_INFO}</a></div>
   <?php define('CA_POPUP_SHOWED', true); } ?>
   <!-- END switch_xs_enabled -->

   <!-- BEGIN ca_new_privmsgs -->
   {CA_XS_COMMENT_START}<div id="newmsgs"><a href="{U_PRIVATEMSGS}" class="newmsgs">{ca_new_privmsgs.TEXT}</a></div>{CA_XS_COMMENT_END}
   <!-- END ca_new_privmsgs -->
<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
<!--BEGIN switch_fader_title -->
   <tr>
        <th height="25" class="thCornerL" nowrap="nowrap">{FADER_TITLE}</th>
     </tr>
<!--END switch_categories_title -->     
 
<tr>
<td align="center">


<div id="fscroller" style="font-size: 12; font-family: Verdana,Arial; font-weight: bold; width: 100%; height: 15px; padding: 2px; filter: alpha(opacity=0); -moz-opacity: 0.0;"></div><script language="JavaScript1.2" type="text/javascript">
<!--
var iDelay = 2000;var txtColor = "000000";var fContent = [];
<!-- BEGIN fader_row -->
if ("{fader_row.U_VIEW_MENU}"=="")
{
fContent[{fader_row.MENU_NUMBER}-1] = "{fader_row.MENU_NAME}"
}else
{
fContent[{fader_row.MENU_NUMBER}-1] = "<a href={fader_row.U_VIEW_MENU}>{fader_row.MENU_NAME}</a>"
}
<!-- END fader_row -->
var isIE = (document.all)? true : false;var frame = 60;var st = 1;var wait = iCur = 1;var index = iCurMoz = 0;var iDir = false;var frameHalf = frame / 2;var iTimer;var frame_m = frame;var wait_m = wait;document.getElementById("fscroller").style.color = txtColor;function fade(){   if(index >= fContent.length){      index = 0;   }   document.getElementById("fscroller").innerHTML = fContent[index];   index ++;   opacityFade();}function opacityFade(){   var fScroll = document.getElementById("fscroller");   if(frame > 0){      if(frame == frameHalf && wait > 0){         if(isIE){            fScroll.style.filter = "alpha(opacity=" + iCur + ")";         } else {            fScroll.style.MozOpacity = iCurMoz;         }         wait --;         setTimeout("opacityFade()", iDelay);      } else {         if(iDir){            iCur -= 3;            iCurMoz -= 0.03;         } else {            iCur += 3;            iCurMoz += 0.03;         }         if(isIE){            fScroll.style.filter = "alpha(opacity=" + iCur + ")";         } else {            fScroll.style.MozOpacity = iCurMoz;         }         if(frame == (frameHalf + 1)){            if(isIE){               fScroll.style.filter = "alpha(opacity=" + iCur + ")";            } else {               fScroll.style.MozOpacity = iCurMoz;            }            iDir = true;         }         frame --;         setTimeout("opacityFade()", st);      }   } else {      fScroll.innerHTML = " ";      frame = frame_m;      wait = wait_m;      iDir = false;      setTimeout("fade()", st);   }}// -->
</script>
</td></tr>
</table>


<script language="JavaScript" type="text/javascript"><!--
fade();
// -->
</script>




Now can you help me?
That is all I have done & cms_fader hasn't showed up!
CodyT07

Yikes! Could you reload the template without losing anything?
Brandon7

I will try!
kingz4dragon

Is there away to have your news fader scroll instead of fade in and out?
admin (no pm's please)

Short answer yes, but this is touted as a "roll your own" component, e.g. we are showing you what can be done with the portal system and a bit of JavaScript, not promising to write all combinations of possibilities.

If someone does want to write a similar NEWSSCROLLER we could publish it.
kingz4dragon

Well i was just wondering as how to do it just to give it a bit of a change and if some one does come up with it would like to see it.
blakelives0312

Brandon7 wrote:
Quote:
heres how it was put:

Code:

<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
<!--BEGIN switch_categories_title -->
   <tr>
        <th colspan="1" width="150" height="25" class="thCornerL" nowrap="nowrap">{TITLE}</th>
     </tr>
<!--END switch_categories_title -->     
  <!-- BEGIN catrow -->
  <tr>
   <td class="row2"><span class="topictitle"><a href="{catrow.U_VIEW_CATEGORY}" class="topictitle">{catrow.CAT_NAME}</a></span></td>
  </tr>
  <!-- END catrow -->
</table>
[FADER]
title=News
component=MENU
name=FADER
item1=News fader
item2=looking good




okay: I'm not so sure that everything after "[FADER]" (including it) is supposed to be there. replace it with: "{MYFF.FADER}" and see what happens.
CodyT07

All the wrong code he/she added, that wont help.
Hardcoregamer

admin (no pm's please) wrote:
Whilst it is tempting to leave that as a class exercise

Spoiler:


<!-- BEGIN fader_row -->
if ("{fader_row.U_VIEW_MENU}"=="")
{
fContent[{fader_row.MENU_NUMBER}-1] = "{fader_row.MENU_NAME}"
}else
{
fContent[{fader_row.MENU_NUMBER}-1] = "<a href={fader_row.U_VIEW_MENU}>{fader_row.MENU_NAME}</a>"
}
<!-- END fader_row -->



can replace the previous code segment.


Can u just explain where this goes. I got mine up and running but I want links enabled. Any help. I know this was answered but I didn't understand what the Admin meant!
admin (no pm's please)

That code is now incorperated in the example at the start anyway.
archers-rest

Installed and working spot on..................untill I try to change the items in my control pannel, then the forum crashes and I get the old

Quote:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/httpd/vhosts/zaphod.myfineforum.org/httpdocs/freeforums/includes/template.php(148) : eval()'d code on line 72


message Any ideas
admin (no pm's please)

What have you put in the control panel? It may be that ' needs to be written \' in items, which would be a bug, but would explain things.
archers-rest

Sorted it - one of the items read
Quote:
January's
changed it to
Quote:
Januarys
problem solved - forgot portals dont like 's.


Next problem though, Ive changed the text colour, but how do I change the background colour where the 'items' appear to match the rest of my portals?
admin (no pm's please)

On that one I don't have a clue Might be a good time to learn a little JavaScript!
archers-rest

OK then, how do I change the text colour of a link? or is that the same answer?
archers-rest

Any one got a clue before I go and bury my head in javascript for dummies
CodyT07

archers-rest wrote:
Any one got a clue before I go and bury my head in javascript for dummies

When you get done with it let me read it. Wink
itsawomansthing

Re: a roll your own NEWS FADER

admin (no pm's please) wrote:
Okay, this one is not built into the system, but is an example of how you can make you own components.

The news fader will display a fade in fade out list of one line news items. First we ask ourselves have we a portal component logically similar?

Yes we do We have a menu component.

So we in OPTIONS in the control panel mould our component on menu, by entering:

[FADER]
title=News
component=MENU
name=FADER
item1=News fader
item2=looking good

next in the admin panel we create a template cms_fader.tpl

Note this code has been updated to show links, so the additional edit mentioned later in the thread is not needed.

Code:

<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
<!--BEGIN switch_fader_title -->
   <tr>
        <th height="25" class="thCornerL" nowrap="nowrap">{FADER_TITLE}</th>
     </tr>
<!--END switch_categories_title -->     
 
<tr>
<td align="center">


<div id="fscroller" style="font-size: 12; font-family: Verdana,Arial; font-weight: bold; width: 100%; height: 15px; padding: 2px; filter: alpha(opacity=0); -moz-opacity: 0.0;"></div><script language="JavaScript1.2" type="text/javascript">
<!--
var iDelay = 2000;var txtColor = "000000";var fContent = [];
<!-- BEGIN fader_row -->
if ("{fader_row.U_VIEW_MENU}"=="")
{
fContent[{fader_row.MENU_NUMBER}-1] = "{fader_row.MENU_NAME}"
}else
{
fContent[{fader_row.MENU_NUMBER}-1] = "<a href={fader_row.U_VIEW_MENU}>{fader_row.MENU_NAME}</a>"
}
<!-- END fader_row -->
var isIE = (document.all)? true : false;var frame = 60;var st = 1;var wait = iCur = 1;var index = iCurMoz = 0;var iDir = false;var frameHalf = frame / 2;var iTimer;var frame_m = frame;var wait_m = wait;document.getElementById("fscroller").style.color = txtColor;function fade(){   if(index >= fContent.length){      index = 0;   }   document.getElementById("fscroller").innerHTML = fContent[index];   index ++;   opacityFade();}function opacityFade(){   var fScroll = document.getElementById("fscroller");   if(frame > 0){      if(frame == frameHalf && wait > 0){         if(isIE){            fScroll.style.filter = "alpha(opacity=" + iCur + ")";         } else {            fScroll.style.MozOpacity = iCurMoz;         }         wait --;         setTimeout("opacityFade()", iDelay);      } else {         if(iDir){            iCur -= 3;            iCurMoz -= 0.03;         } else {            iCur += 3;            iCurMoz += 0.03;         }         if(isIE){            fScroll.style.filter = "alpha(opacity=" + iCur + ")";         } else {            fScroll.style.MozOpacity = iCurMoz;         }         if(frame == (frameHalf + 1)){            if(isIE){               fScroll.style.filter = "alpha(opacity=" + iCur + ")";            } else {               fScroll.style.MozOpacity = iCurMoz;            }            iDir = true;         }         frame --;         setTimeout("opacityFade()", st);      }   } else {      fScroll.innerHTML = " ";      frame = frame_m;      wait = wait_m;      iDir = false;      setTimeout("fade()", st);   }}// -->
</script>
</td></tr>
</table>


<script language="JavaScript" type="text/javascript"><!--
fade();
// -->
</script>


then we slap the component into overall_header.tpl in the case of the example shown on this forum the line was:

<tr><td colspan="3">{MYFF.FADER}</td></tr>



and Bobs your Aunty.
just not getting this bit
archers-rest

Add this bit

Code:
<tr><td colspan="3">{MYFF.FADER}</td></tr>


into your overall header where you want it to appear
itsawomansthing

i want it to come across my forum page just under memebr list, search .... ? thanks by the way
Brandon7

My forum is: http://vgcommunity.myfreeforum.org



I put this in the cms_menu.tpl

Spoiler:

[FADER]
title=News
component=MENU
name=FADER
item1=News fader
item2=looking good



so the whole thing in cms_menu

Spoiler:

<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
<!--BEGIN switch_categories_title -->
<tr>
<th colspan="1" width="150" height="25" class="thCornerL" nowrap="nowrap">{TITLE}</th>
</tr>
<!--END switch_categories_title -->
<!-- BEGIN catrow -->
<tr>
<td class="row2"><span class="topictitle"><a href="{catrow.U_VIEW_CATEGORY}" class="topictitle">{catrow.CAT_NAME}</a></span></td>
</tr>
<!-- END catrow -->
</table>

[FADER]
title=News
component=MENU
name=FADER
item1=News fader
item2=looking good





I also put this in the overall_header:

Spoiler:

<tr><td colspan="3">{MYFF.FADER}</td></tr>




This is the whole code in the overall_header is:

Spoiler:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
<meta http-equiv="Content-Style-Type" content="text/css">
{META}
{NAV_LINKS}
<title>{SITENAME} :: {PAGE_TITLE}</title>
<link rel="stylesheet" href="templates/myff_vgcommunity1/{T_HEAD_STYLESHEET}" type="text/css">
<script language="javascript" type="text/javascript" src="templates/myff_vgcommunity1/scripts.js"></script>
<script language="javascript" type="text/javascript" src="templates/myff_vgcommunity1/formStyle.js"></script>
<link rel="icon" href="templates/myff_vgcommunity1/images/favicon.ico" />
<!-- BEGIN switch_enable_pm_popup -->
<script language="Javascript" type="text/javascript">
<!--
if ( {PRIVATE_MESSAGE_NEW_FLAG} )
{
/* window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400'); */
}
//-->
</script>
<!-- END switch_enable_pm_popup -->
</head>
<body>
<a name="top"></a>

<table width="{T_BODY_BACKGROUND}" cellspacing="0" cellpadding="0" border="0" align="center" id="maintable">
<tr>
<td valign="top" class="content-row"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="logotable">
<tr>
<td align="center" class="logorow1"><div class="logorow2"><a href="{U_INDEX}">{L_INDEX}</a></div></td>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0" id="buttonstable">
<tr>
<td align="center" valign="middle" width="100%" id="header-buttons">
<!-- BEGIN switch_user_logged_out -->
<a href="{U_REGISTER}">{L_REGISTER}</a> •
<!-- END switch_user_logged_out -->
<!-- BEGIN switch_user_logged_in -->
<a href="{U_PROFILE}">{L_PROFILE}</a> •
<a href="{U_PRIVATEMSGS}">{L_PRIVATEMSGS}</a> •
<!-- END switch_user_logged_in -->
<a href="{U_SEARCH}">{L_SEARCH}</a> •
<a href="{U_FAQ}">{L_FAQ}</a> •
<a href="{U_MEMBERLIST}">{L_MEMBERLIST}</a> •
<a href="{U_GROUP_CP}">{L_USERGROUPS}</a> •
<a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a>
</td>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="content">
<tr>
<td class="content" valign="top">

<!-- BEGIN switch_user_logged_in -->
<div class="pm-{PRIVMSG_IMG}"><a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a></div>

<!-- END switch_user_logged_in -->

<tr><td colspan="3">{MYFF.FADER}</td></tr>






can you help?



I can't find the fadder component!
itsawomansthing

oh i need help i done my news fader yes yes yes (not really that thick) but.... now my home page and gallery is massive how do i sort this out. please can you help before my members come on line




thank you jay


can anyone help its driving me nuts
admin can you help me?
moondood

Hiya guys , any ideas as to why mynewsfader loooks like this??

www.leedspeeps.co.uk

Cheers

Steve
admin (no pm's please)

What is wrong with it?
moondood

well I have corrected it since my last post , but I need to change the colour ,so its fits in with the rest of our forum:-)
admin (no pm's please)

Then you get to play with the JavaScript

I am actually about to look at it myself as it does give errors in firefox.
moondood

Quote:
Then you get to play with the JavaScript
oh dear , I think I would be happier if you had said i get to play footie on the M! , laffin , I await your next post with fear Wink
BookwormUK

could ya have a look at my steve irwin one please?? it worked fine on my bookworm forum
http://steveirwin.myfanforum.org/index.php
admin (no pm's please)

Error: missing ; before statement
Source File: http://steveirwin.myfanforum.org/index.php
Line: 301, Column: 31
Source Code:
fContent[4-1] = "and remember "Crocs Rule""


Your quotes are breaking the system \" may work.
BookwormUK

admin (no pm's please) wrote:
Error: missing ; before statement
Source File: http://steveirwin.myfanforum.org/index.php
Line: 301, Column: 31
Source Code:
fContent[4-1] = "and remember "Crocs Rule""


Your quotes are breaking the system \" may work.
oh ok ty
BookwormUK

thank you admin, your a star
admin (no pm's please)

bumped as the code in the first post has been improved to properly validate as html.

       myfreeforum.org Forum Index -> Portal components Goto page 1, 2  Next
Page 1 of 2
Create your own free forum | Buy a domain to use with your forum