Fading last messages on header

Support for PhpBB3. Post here to get help with any phpBB3 related issue here
There is no support here! Only Read Access!
Forum rules
In order the get any support, you will have to do following:
1. Use a describing title!
2. Describe your problem and what happened when the problem occured
3. Tell us what version of phpBB3 you are currently using.
Else your topic may be ignored or locked!
User avatar
Oliver
BBCoder III
BBCoder III
Posts: 120
Joined: 07 Mar 2010, 11:55

Fading last messages on header

Post by Oliver »

http://www.boardtalk.net/forum/viewtopic.php?f=7&t=67

Open forum/include/functions.php

Find:

Code: Select all

// The following assigns all _common_ variables that may be used at any point in a template
Add before:

Code: Select all

    // Recent Posts

      $query1= $db->sql_query("SELECT posts.post_id, posts.topic_id, posts.poster_id, posts.post_time, posts.post_subject, users.username, users.user_avatar_type
               FROM posts LEFT JOIN users ON posts.poster_id = users.user_id
               ORDER BY posts.post_id DESC LIMIT 10");

      $n=0;
        while ($row1 = $db->sql_fetchrow($query1))
      {

      $gon_id      =   $row1['poster_id'];
      $gon      =   $row1['username'];
      $konu_id    =   $row1['topic_id'];
      $mesaj_id   =   $row1['post_id'];
      $header   =   $row1['post_subject']."</a>";
      $date      =   date("d F G:i", $row1['post_time']);


      $template->assign_block_vars('mesajlar', array(
       'N'       => $n,
       'GON'      => $gon,
       'GON_ID'      => $gon_id,
       'KONU_ID'     => $konu_id,
       'MESAJ_ID'   => $mesaj_id,
       'HEADER'      => $header,
       'DATE'       => $date,
        ));
      $n=$n+1;
      }
       $db->sql_freeresult($query1);
Open forum/styles/your_template/template/overall_header.html

Find:

Code: Select all

<a name="start_here"></a>
Add before:

Code: Select all

      <script type="text/javascript">

      /***********************************************
      * fading last messages
      * relased by sifirforum.com
      ***********************************************/

      var delay = 3000; //set delay between message change (in miliseconds)
      var maxsteps=40; // number of steps to take to change from start color to endcolor
      var stepdelay=60; // time in miliseconds of a single step
      //**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
      var startcolor= new Array(255,255,255); // start color (red, green, blue)
      var endcolor=new Array(0,0,0); // end color (red, green, blue)

      var fcontent=new Array();
      begintag='<div style="font: normal 12px Arial; padding: 5px; text-align:center;">'; //set opening tag, such as font declarations

      <!-- BEGIN mesajlar -->
      fcontent[{mesajlar.N}]="<a href=\"/forum/memberlist.php?mode=viewprofile&u={mesajlar.GON_ID}\" > <b>{mesajlar.GON}, </a> <a    href=\"/forum/viewtopic.php?t={mesajlar.KONU_ID}&p={mesajlar.MESAJ_ID}#p{mesajlar.MESAJ_ID}\"> {mesajlar.HEADER} </b></a>. ({mesajlar.DATE}, Last {mesajlar.N}. Message) ";
      <!-- END mesajlar -->   

      closetag='</div>';

      var fwidth='80px'; //set scroller width
      var fheight='30px'; //set scroller height

      var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

      ///No need to edit below this line/////////////////

      var ie4=document.all&&!document.getElementById;
      var DOM2=document.getElementById;
      var faderdelay=0;
      var index=0;


      /*Rafael Raposo edited function*/
      //function to change content
      function changecontent(){
      if (index>=fcontent.length)
        index=0
      if (DOM2){
        document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
        document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
        if (fadelinks)
          linkcolorchange(1);
        colorfade(1, 15);
      }
      else if (ie4)
        document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
      index++
      }

      // colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
      // Modified by Dynamicdrive.com

      function linkcolorchange(step){
      var obj=document.getElementById("fscroller").getElementsByTagName("A");
      if (obj.length>0){
        for (i=0;i<obj.length;i++)
          obj[i].style.color=getstepcolor(step);
      }
      }

      /*Rafael Raposo edited function*/
      var fadecounter;
      function colorfade(step) {
      if(step<=maxsteps) {   
        document.getElementById("fscroller").style.color=getstepcolor(step);
        if (fadelinks)
          linkcolorchange(step);
        step++;
        fadecounter=setTimeout("colorfade("+step+")",stepdelay);
      }else{
        clearTimeout(fadecounter);
        document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
        setTimeout("changecontent()", delay);
       
      }   
      }

      function getstepcolor(step) {
      var diff
      var newcolor=new Array(3);
      for(var i=0;i<3;i++) {
        diff = (startcolor[i]-endcolor[i]);
        if(diff > 0) {
          newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
        } else {
          newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
        }
      }
      return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
      }

      if (ie4||DOM2)
      document.write('<div id="fscroller" style="border:1px solid black;width:'+fwidth+';height:'+fheight+'"></div>');

      if (window.addEventListener)
      window.addEventListener("load", changecontent, false)
      else if (window.attachEvent)
      window.attachEvent("onload", changecontent)
      else if (document.getElementById)
      window.onload=changecontent

      </script>


Is that Prosilver or Subsilver2 installation?
How do I change the code so that it displays only their regions, the messages that I want to show?
Last edited by Oliver on 13 May 2010, 17:15, edited 1 time in total.
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

Re: Fading last messages on header

Post by cisco007 »

did he give you permission to post it here? boardtalk.net is a member here! if so I will let him answer you when they come by!
User avatar
Oliver
BBCoder III
BBCoder III
Posts: 120
Joined: 07 Mar 2010, 11:55

Re: Fading last messages on header

Post by Oliver »

There is link in his site ;)
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

Re: Fading last messages on header

Post by cisco007 »

yeah, but if you put a link to his site, you shouldn't have posted the edits for that mod, unless you had permission!
User avatar
boardtalk.net
BBCoder II
BBCoder II
Posts: 35
Joined: 05 Mar 2010, 13:55
Favourite MOD: Default Random 'No Avatar
Location: Éire
Contact:

Re: Fading last messages on header

Post by boardtalk.net »

That mod is by BlacksunTR and is a mod in development. I only changed it very, very slightly for my database. This is the topic: http://www.phpbb.com/community/viewtopi ... &t=2087645

Boardtalk.net is mostly a place where i keep notes on mods i'm using, where i've found them etc. Humm, I must go through the topics to make sure this is made clearer. I hope I haven't done anything wrong by doing that.

Thanks guys,
Boardtalk.net
User avatar
boardtalk.net
BBCoder II
BBCoder II
Posts: 35
Joined: 05 Mar 2010, 13:55
Favourite MOD: Default Random 'No Avatar
Location: Éire
Contact:

Re: Fading last messages on header

Post by boardtalk.net »

Oliver wrote:Is that Prosilver or Subsilver2 installation?
How do I change the code so that it displays only their regions, the messages that I want to show?
First, can you change in the first post;
Open forum/styles/your_template/template/overall_header.html
Find:

Code: Select all

      var fwidth='80px'; //set scroller width
      var fheight='30px'; //set scroller height
Replace the '80px' with

Code: Select all

'100%'

Its Prosilver

If you wish to select only specific forums from your board to display;

1. Find out the required forum id number or numbers you wish to display.
For example on this forum we will use,
Stokers Site Announcement is 14 - posts.forum_id=14
and Missing Stuff is 15 - posts.forum_id=15
On the forum index, place your mouse over the forum and in Firefox it will be displayed on the bottom left of the browser.


2. Open forum/include/functions.php
Find:

Code: Select all

      $query1= $db->sql_query("SELECT posts.post_id, posts.topic_id, posts.poster_id, posts.post_time, posts.post_subject, users.username, users.user_avatar_type
               FROM posts LEFT JOIN users ON posts.poster_id = users.user_id
               ORDER BY posts.post_id DESC LIMIT 10");
Replace with:

Code: Select all

     $query1= $db->sql_query("SELECT posts.post_id, posts.topic_id, posts.poster_id, posts.post_time, posts.post_subject,  users.username, users.user_colour
                       FROM posts LEFT JOIN users ON posts.poster_id = users.user_id
                       WHERE posts.forum_id=14 or posts.forum_id=15
                       ORDER BY posts.post_id DESC LIMIT 10");
Save, ftp back, Purge the cache

********************

To change the quantity of recent messages showing:

2. Open forum/include/functions.php
Find:

Code: Select all

ORDER BY posts.post_id DESC LIMIT 10");
Change 10 to what ever number of posts you want to display.

Save, ftp back, Purge the cache

******************

To change the Size and with:

Open forum/styles/your_template/template/overall_header.html
Find:

Code: Select all

      var fwidth='100%'; //set scroller width
      var fheight='30px'; //set scroller height
Change the 100 and 30 to what ever works for you.

Save, ftp back, Purge the cache and refresh your styles template

********************

Hope I've answered your questions
;)
User avatar
neptune
BBCoder II
BBCoder II
Posts: 35
Joined: 09 Mar 2010, 12:23

Re: Fading last messages on header

Post by neptune »

demo?
Image
User avatar
boardtalk.net
BBCoder II
BBCoder II
Posts: 35
Joined: 05 Mar 2010, 13:55
Favourite MOD: Default Random 'No Avatar
Location: Éire
Contact:

Re: Fading last messages on header

Post by boardtalk.net »

User avatar
Oliver
BBCoder III
BBCoder III
Posts: 120
Joined: 07 Mar 2010, 11:55

Re: Fading last messages on header

Post by Oliver »

Thank you.

I have the Forum, two areas which I do not want to display all messages, advice?


You put it in that example, showing how the desired area, how to change the code so I get out of the two areas that, but that all the other shows?

Code: Select all

     $query1= $db->sql_query("SELECT posts.post_id, posts.topic_id, posts.poster_id, posts.post_time, posts.post_subject,  users.username, users.user_colour
                       FROM posts LEFT JOIN users ON posts.poster_id = users.user_id
                       WHERE posts.forum_id=14 or posts.forum_id=15
                       ORDER BY posts.post_id DESC LIMIT 10");
Last edited by Oliver on 16 May 2010, 11:59, edited 2 times in total.
User avatar
Oliver
BBCoder III
BBCoder III
Posts: 120
Joined: 07 Mar 2010, 11:55

Re: Fading last messages on header

Post by Oliver »

I would like to take only two regions out of sight, how will it succeed?
Locked