126

Re: New frontpage index mod!

that kewl.. i like the box over...
ok ok it will never finally be finished due to people wanting more added to it....lol.


Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

127 (edited by Dr.Jeckyl 2007-06-24 15:15)

Re: New frontpage index mod!

is that style public bingiman?

edit: i'm liking the new features. big_smile

~James
FluxBB - Less is more

128

Re: New frontpage index mod!

not yet, but it will be for sure.

129 (edited by quaker 2007-06-24 17:18)

Re: New frontpage index mod!

<?php echo $is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong>'.$lang_topic['Online'].'</strong>' : $lang_topic['Offline']; ?>
My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

130

Re: New frontpage index mod!

quaker wrote:
<?php echo $is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong>'.$lang_topic['Online'].'</strong>' : $lang_topic['Offline']; ?>

Is that a suggestion or alteration? (Can't be arsed checking the code at the 'mo). big_smile Why do I get the feeling this will practically be a full blown mod by the time it's finished. big_smile big_smile

Btw, Bingiman, is this going to be incorporated into Megapun? If so, would creating config vars for the DB be okay, instead of some of the variables that require editing? I assume you'd be able to adapt the installer and admin sheets to cover that occasion?

Re: New frontpage index mod!

bingiman wrote:

not yet, but it will be for sure.

glad to hear. big_smile

~James
FluxBB - Less is more

132

Re: New frontpage index mod!

MattF wrote:
quaker wrote:
<?php echo $is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong>'.$lang_topic['Online'].'</strong>' : $lang_topic['Offline']; ?>

Is that a suggestion or alteration? (Can't be arsed checking the code at the 'mo). big_smile Why do I get the feeling this will practically be a full blown mod by the time it's finished. big_smile big_smile

Btw, Bingiman, is this going to be incorporated into Megapun? If so, would creating config vars for the DB be okay, instead of some of the variables that require editing? I assume you'd be able to adapt the installer and admin sheets to cover that occasion?

mattf i was looking at the code for online off line for bing. seeing how to add that for him...

Might as well start working on a install_mod.php now..hahaha....

Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

133

Re: New frontpage index mod!

Hi MattF,

I really wasn't going to add it to Mega Pun. This mod was basically for a new site I am putting together. I may however add it if users wanted it I guess. However, creating config vars would be great. I am assuming that you meant it would be able to be changed in the admin panel, or am I wrong here?

134

Re: New frontpage index mod!

How would I convert this line:

<?php echo $is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong>'.$lang_topic['Online'].'</strong>' : $lang_topic['Offline']; ?>

to work with this:

$user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img title="header=[<font class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<font class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</font>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' alt="'.$cur_post['poster'].'\'s Avatar" /></a>';

135 (edited by MattF 2007-06-25 12:05)

Re: New frontpage index mod!

bingiman wrote:

However, creating config vars would be great. I am assuming that you meant it would be able to be changed in the admin panel, or am I wrong here?

That's correct. smile The $trunc_chars, for example. If that was added to pun_config, it would remove any need for editing of the index.php file manually. Something like o_news_chars = (admin defined integer) in pun_config would be lovely. big_smile

Edit: Btw, I'll get that online/offline bit added sometime over the next day or so.

136

Re: New frontpage index mod!

Thanks MattF,

I would think that it would be better for the stuff to be placed in the user profile, this way a member can set how many items will be displayed on the front page, but the forums to be displayed on the front page would be set by the admin in the ACP. Just my idea...I could be wrong. big_smile

137

Re: New frontpage index mod!

bingiman wrote:

Thanks MattF,

I would think that it would be better for the stuff to be placed in the user profile, this way a member can set how many items will be displayed on the front page, but the forums to be displayed on the front page would be set by the admin in the ACP. Just my idea...I could be wrong. big_smile

I'll have a peek. big_smile Can you make a list of which configuration options want to be where, i.e: profile or admin sheets. Cheers. smile

Btw, I'll have a few questions on that latest posts/multiple forums/individual forum counts thing later. That thing becomes more of a nightmare each time I think about it. big_smile big_smile

138

Re: New frontpage index mod!

mattf i was looking at it.. i might be wrong but does that need a new query from the user db tables?

Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

139

Re: New frontpage index mod!

quaker wrote:

mattf i was looking at it.. i might be wrong but does that need a new query from the user db tables?

Q

Which bit? big_smile

No idea until I have a look later, but the user tables are already accessed during the db lookup, so adding an extra field or two to the existing lookup shouldn't be a problem.

140 (edited by bingiman 2007-06-25 12:29)

Re: New frontpage index mod!

For the User Profile:
* Set amount of news to be displayed (5, 10, 15)
* Set Forums to be displayed (This will *only* show what the administrator has set in the ACP)
* Full view or Partial view (Just an idea. Full view of course will not truncate post etc...) (...or set the amount of words to be displayed before truncation)
* Set order of News Display (Oldest first, Newest first)

Admin Options:
* Set forums to be displayed on Front Page
* Turn on/off Boxover feature (just an idea)
* Display user avatar (Yes/No)
* Set user avatar to left or right (getting carried away here) big_smile

These are just ideas.

Bingiman

141

Re: New frontpage index mod!

* Set Forums to be displayed (This will *only* show what the administrator has set in the ACP)

That part above. Would that use checkboxes for each forum available?

Also, the boxover thing, is that part of the css stylesheet only? Can't say as I've noticed that in the script.

142 (edited by bingiman 2007-06-25 19:37)

Re: New frontpage index mod!

I just added it in the script. If you look a few post up you'll see the image attached. As for the Set Forums to be displayed. Checkboxes are fine.

UPDATE: Here is the image showing the boxover feature.

http://shedrockonline.com/filedump/boxed.jpg

143

Re: New frontpage index mod!

ok now where is the FINAL realease with the all added features. ... by the way ... Great Mod

MyFootballCafe.com  is Now Online!

144 (edited by bingiman 2007-06-28 01:47)

Re: New frontpage index mod!

Here is the index.php file.

<?php
 
define('PUN_ROOT', './');
require_once PUN_ROOT.'include/common.php';
 
//Set the page title here
$page_title = pun_htmlspecialchars($pun_config['o_board_title']);

define('PUN_ALLOW_INDEX', 1);
require_once PUN_ROOT.'header.php';
require_once PUN_ROOT.'include/parser.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';

//----------------------------------------------------------------------//

//These are the forums from which the news is retrieved
$forumids = array(1,3);

//This is the overall limit for how many news items will be displayed
$master_limit = '5';

//This is the amount of characters above which truncation will occur
$trunc_chars = '350';

//----------------------------------------------------------------------//

function close_tags($string)
{
    if (preg_match_all ('/<([a-z]+)[ >]/', $string, $start_tags))
    {
        $start_tags = $start_tags[1];

        if (preg_match_all ('/<\/([a-z]+)>/', $string, $end_tags))
        {
            $complete_tags = array();
            $end_tags = $end_tags[1];

            foreach ($start_tags as $key => $val)
            {
                $posb = array_search ($val, $end_tags);
                if (is_integer ($posb))
                {
                    unset ($end_tags[$posb]);
                }
                else
                {
                    $complete_tags[] = $val;
                }
            }
        }
        else
        {
            $complete_tags = $start_tags;
        }

        $complete_tags = array_reverse ($complete_tags);
        for ($i = 0; $i < count ($complete_tags); $i++)
        {
            $string .= '</' . $complete_tags[$i] . '>';
        }
    }

        // Removes irrelevant tags
    $xhtml_tags = array ('</img>', '</hr>', '</br>');
    $string = str_replace ($xhtml_tags, '', $string);
    return $string;
}

//----------------------------------------------------------------------//

function truncate($string)
{
global $pun_config;
$trunc_chars = '350';
$length = $trunc_chars;
$append = '...';

    if (strlen ($string) <= $length)
    {
        return $string;
    }
    else if ($length > 0)
    {
        preg_match ('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$length.',}\b#U', $string, $matches);
        $string = $matches[0];
        $string = close_tags (preg_replace ('#\s*<[^>]+>?\s*$#', '', $string).$append);
        return $string;
    }
}

//----------------------------------------------------------------------//

$result = $db->query('SELECT t.id, t.subject, t.num_replies, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.forum_id, u.use_avatar, u.num_posts, u.registered, u.title, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted, g.g_title, f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON p.topic_id=t.id AND p.posted=t.posted INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE t.forum_id IN ('.implode(',', $forumids).') AND t.moved_to IS NULL AND f.redirect_url IS NULL ORDER BY t.posted DESC LIMIT '.$master_limit) or error('Unable to fetch announcements', __FILE__, __LINE__, $db->error());

if ($db->num_rows($result))
{
    while($cur_post = $db->fetch_assoc($result))
    {
        echo '<div class="block">';
        if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
        {
            if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
            {
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img title="header=[<span class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<span class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</span>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
            }
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
            {
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img title="header=[<span class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<span class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</span>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
            }
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
            {
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img title="header=[<span class=\'box_username\'> '.pun_htmlspecialchars($cur_post['poster']).'] body=[<span class=\'box_info\'> Title: '.$cur_post['g_title'].'<br /> Total Post: '.$cur_post['num_posts'].'<br /> Registered Date: '. format_time($cur_post['registered'], true).']</span>" src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
            }
        }
        else
        {
            $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="img/noimage.gif" alt=""/></a>';
        }

        $news_message = parse_message($cur_post['message'], $cur_post['hide_smilies']);

        if (pun_strlen($news_message) > $trunc_chars)
        {
            $news_message = truncate($news_message);
            $read_more = ' | <a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_post['id'].'">Read More</a> | ';
        }
        else
        {
            $read_more = ' | ';
        }

        if ($cur_post['num_replies'] != '0')
        {
            $replies = ' <a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_post['id'].'#p'.$cur_post['last_post_id'].'">Replies</a>: '.$cur_post['num_replies'].' ';
        }
        else
        {
            $replies = ' Replies: '.$cur_post['num_replies'].' ';
        }

        echo "\t\t\t\t\t\t\t".'<h2><strong><a href="forum.php">Forum</a> » <a href="viewforum.php?id='.$cur_post['forum_id'].'">'.pun_htmlspecialchars($cur_post['forum_name']).'</a>'.'</strong></h2>'."\n";
?>
    <div class="box">
        <div class="inbox">
        <ul><li>
        <table width="100%" border="0">
            <tr>
            <td style="border: 0px; padding: 0px 10px 7px 7px;"><a class="news_subject" href="viewtopic.php?id=<?php echo $cur_post['id']; ?>"><?php echo $cur_post['subject']; ?></a></td>
            </tr>
        </table> 
        <table width="100%" border="0">
            <tr>
            <td align="left" style="white-space: nowrap; width: 8em; padding-left: 7px; padding-top: 6px; padding-bottom: 30px; border: 0px;" valign="top"><?php echo $user_avatar ?></td>
            <td style="text-align: left; border: 0px; padding-top: 0px;" valign="top"><?php echo $news_message."\n" ?></td>
            </tr>
        </table>
        <table class="news_footer" width="100%">
            <tr>
            <td>
<?php
                echo "\t\t\t\t\t\t\t".'<span class="user" style="float:left">Posted: '.format_time($cur_post['posted']).' by:<span class="user'.(isset($cur_post['g_title']) ? ' '.strtolower(str_replace(' ', '', $cur_post['g_title'])) : '').'"> <a class="poster" href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['poster']).'</a>'.$read_more.'Views: '.$cur_post['num_views'].' |'.$replies.'</span></span>'."\n";

                if ($cur_post['poster_id'] == $pun_user['id'] || $pun_user['g_id'] < PUN_GUEST)
                {
                    echo "\t\t\t\t\t\t\t".'<a href="viewtopic.php?id='.$cur_post['id'].'">'.pun_htmlspecialchars($lang_portal['Visit_Topic']).'</a>'.'<span style="white-space: nowrap; float:right">'.'<a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.' | <a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a> | <a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.' | <a href="post.php?tid='.$cur_post['id'].'">'.'Reply'.'</a>'.' | <a href="post.php?tid='.$cur_post['id'].'&qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>'.'</span>'."\n\n\n\n";
                }
?>
            </td>
            </tr>
        </table>       
        </li></ul>
        </div>
    </div>
</div>
<?php
    }
}


require PUN_ROOT.'footer.php';

?>

Add the following to your stylesheet_cs.css file and change the colors to suit your own taste.

/* News Links on index page */

.news_subject {
    background-color: inherit;
    color: #A8B055;
    font: 1.6em/1.7em Georgia, "Times New Roman", serif;
    text-decoration:none; 
}

a.news_subject:hover {
    background-color: inherit; 
    color: #ECA205;
    text-decoration: none;
    border-bottom:1px dotted #ECA205
}

.news_footer {
    background-color: #1D2435;
    color: inherit;
    border-top: 0px solid #313A50;
    border-left: 0px solid #313A50;
    border-bottom: 1px solid #313A50;
    border-right: 1px solid #313A50;
}

.byuser {
    font-weight: normal; 
    color: #A58B02; 
    background-color: inherit
}

.user {
    font-weight: normal; 
    color: #6C695D; 
    background-color: inherit
}

.poster {background-color: inherit; color: #8E94A3 }
a.poster {background-color: inherit; text-decoration: none; color: #8E94A3 }
a.poster:visited {background-color: inherit; text-decoration: none; color: #8E94A3 }
a.poster:hover {background-color: inherit; color: #FFFFFF; text-decoration: none; border-bottom: 1px solid #6C7283 }

Paste the following to a file called: boxover.js and save it to your /include/ folder:

/* --- BoxOver ---
/* --- v 2.1 17th June 2006
By Oliver Bryant with help of Matthew Tagg
http://boxover.swazz.org */

if (typeof document.attachEvent!='undefined') {
   window.attachEvent('onload',init);
   document.attachEvent('onmousemove',moveMouse);
   document.attachEvent('onclick',checkMove); }
else {
   window.addEventListener('load',init,false);
   document.addEventListener('mousemove',moveMouse,false);
   document.addEventListener('click',checkMove,false);
}

var oDv=document.createElement("div");
var dvHdr=document.createElement("div");
var dvBdy=document.createElement("div");
var windowlock,boxMove,fixposx,fixposy,lockX,lockY,fixx,fixy,ox,oy,boxLeft,boxRight,boxTop,boxBottom,evt,mouseX,mouseY,boxOpen,totalScrollTop,totalScrollLeft;
boxOpen=false;
ox=10;
oy=10;
lockX=0;
lockY=0;

function init() {
    oDv.appendChild(dvHdr);
    oDv.appendChild(dvBdy);
    oDv.style.position="absolute";
    oDv.style.visibility='hidden';
    document.body.appendChild(oDv);    
}

function defHdrStyle() {
    dvHdr.innerHTML='<img  style="vertical-align:middle"  src="info.gif">  '+dvHdr.innerHTML;
    dvHdr.style.fontWeight='bold';
    dvHdr.style.width='200px';
    dvHdr.style.fontFamily='arial';
    dvHdr.style.border='1px solid #313A50';
    dvHdr.style.padding='3';
    dvHdr.style.fontSize='11';
    dvHdr.style.color='#4B7A98';
    dvHdr.style.background='#182034';
    dvHdr.style.filter='alpha(opacity=85)'; // IE
    dvHdr.style.opacity='0.85'; // FF
}

function defBdyStyle() {
    dvBdy.style.borderBottom='1px solid #313A50';
    dvBdy.style.borderLeft='1px solid #313A50';
    dvBdy.style.borderRight='1px solid #313A50';
    dvBdy.style.width='200px';
    dvBdy.style.fontFamily='arial';
    dvBdy.style.fontSize='11';
    dvBdy.style.padding='3';
    dvBdy.style.color='#1B4966';
    dvBdy.style.background='#1D2435';
    dvBdy.style.filter='alpha(opacity=85)'; // IE
    dvBdy.style.opacity='0.85'; // FF
}

function checkElemBO(txt) {
if (!txt || typeof(txt) != 'string') return false;
if ((txt.indexOf('header')>-1)&&(txt.indexOf('body')>-1)&&(txt.indexOf('[')>-1)&&(txt.indexOf('[')>-1)) 
   return true;
else
   return false;
}

function scanBO(curNode) {
      if (checkElemBO(curNode.title)) {
         curNode.boHDR=getParam('header',curNode.title);
         curNode.boBDY=getParam('body',curNode.title);
            curNode.boCSSBDY=getParam('cssbody',curNode.title);            
            curNode.boCSSHDR=getParam('cssheader',curNode.title);
            curNode.IEbugfix=(getParam('hideselects',curNode.title)=='on')?true:false;
            curNode.fixX=parseInt(getParam('fixedrelx',curNode.title));
            curNode.fixY=parseInt(getParam('fixedrely',curNode.title));
            curNode.absX=parseInt(getParam('fixedabsx',curNode.title));
            curNode.absY=parseInt(getParam('fixedabsy',curNode.title));
            curNode.offY=(getParam('offsety',curNode.title)!='')?parseInt(getParam('offsety',curNode.title)):10;
            curNode.offX=(getParam('offsetx',curNode.title)!='')?parseInt(getParam('offsetx',curNode.title)):10;
            curNode.fade=(getParam('fade',curNode.title)=='on')?true:false;
            curNode.fadespeed=(getParam('fadespeed',curNode.title)!='')?getParam('fadespeed',curNode.title):0.04;
            curNode.delay=(getParam('delay',curNode.title)!='')?parseInt(getParam('delay',curNode.title)):0;
            if (getParam('requireclick',curNode.title)=='on') {
                curNode.requireclick=true;
                document.all?curNode.attachEvent('onclick',showHideBox):curNode.addEventListener('click',showHideBox,false);
                document.all?curNode.attachEvent('onmouseover',hideBox):curNode.addEventListener('mouseover',hideBox,false);
            }
            else {// Note : if requireclick is on the stop clicks are ignored               
               if (getParam('doubleclickstop',curNode.title)!='off') {
                   document.all?curNode.attachEvent('ondblclick',pauseBox):curNode.addEventListener('dblclick',pauseBox,false);
               }    
               if (getParam('singleclickstop',curNode.title)=='on') {
                   document.all?curNode.attachEvent('onclick',pauseBox):curNode.addEventListener('click',pauseBox,false);
               }
           }
            curNode.windowLock=getParam('windowlock',curNode.title).toLowerCase()=='off'?false:true;
            curNode.title='';
            curNode.hasbox=1;
       }
       else
          curNode.hasbox=2;   
}


function getParam(param,list) {
    var reg = new RegExp('([^a-zA-Z]' + param + '|^' + param + ')\\s*=\\s*\\[\\s*(((\\[\\[)|(\\]\\])|([^\\]\\[]))*)\\s*\\]');
    var res = reg.exec(list);
    var returnvar;
    if(res)
        return res[2].replace('[[','[').replace(']]',']');
    else
        return '';
}

function Left(elem){    
    var x=0;
    if (elem.calcLeft)
        return elem.calcLeft;
    var oElem=elem;
    while(elem){
         if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderLeftWidth)))&&(x!=0))
             x+=parseInt(elem.currentStyle.borderLeftWidth);
         x+=elem.offsetLeft;
         elem=elem.offsetParent;
      } 
    oElem.calcLeft=x;
    return x;
    }

function Top(elem){
     var x=0;
     if (elem.calcTop)
         return elem.calcTop;
     var oElem=elem;
     while(elem){        
          if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderTopWidth)))&&(x!=0))
             x+=parseInt(elem.currentStyle.borderTopWidth); 
         x+=elem.offsetTop;
             elem=elem.offsetParent;
      } 
      oElem.calcTop=x;
      return x;
      
}

var ah,ab;
function applyStyles() {
    if(ab)
        oDv.removeChild(dvBdy);
    if (ah)
        oDv.removeChild(dvHdr);
    dvHdr=document.createElement("div");
    dvBdy=document.createElement("div");
    CBE.boCSSBDY?dvBdy.className=CBE.boCSSBDY:defBdyStyle();
    CBE.boCSSHDR?dvHdr.className=CBE.boCSSHDR:defHdrStyle();
    dvHdr.innerHTML=CBE.boHDR;
    dvBdy.innerHTML=CBE.boBDY;
    ah=false;
    ab=false;
    if (CBE.boHDR!='') {        
        oDv.appendChild(dvHdr);
        ah=true;
    }    
    if (CBE.boBDY!=''){
        oDv.appendChild(dvBdy);
        ab=true;
    }    
}

var CSE,iterElem,LSE,CBE,LBE, totalScrollLeft, totalScrollTop, width, height ;
var ini=false;

// Customised function for inner window dimension
function SHW() {
   if (document.body && (document.body.clientWidth !=0)) {
      width=document.body.clientWidth;
      height=document.body.clientHeight;
   }
   if (document.documentElement && (document.documentElement.clientWidth!=0) && (document.body.clientWidth + 20 >= document.documentElement.clientWidth)) {
      width=document.documentElement.clientWidth;   
      height=document.documentElement.clientHeight;   
   }   
   return [width,height];
}


var ID=null;
function moveMouse(e) {
   //boxMove=true;
    e?evt=e:evt=event;
    
    CSE=evt.target?evt.target:evt.srcElement;
    
    if (!CSE.hasbox) {
       // Note we need to scan up DOM here, some elements like TR don't get triggered as srcElement
       iElem=CSE;
       while ((iElem.parentNode) && (!iElem.hasbox)) {
          scanBO(iElem);
          iElem=iElem.parentNode;
       }       
    }
    
    if ((CSE!=LSE)&&(!isChild(CSE,dvHdr))&&(!isChild(CSE,dvBdy))){        
       if (!CSE.boxItem) {
            iterElem=CSE;
            while ((iterElem.hasbox==2)&&(iterElem.parentNode))
                    iterElem=iterElem.parentNode; 
            CSE.boxItem=iterElem;
            }
        iterElem=CSE.boxItem;
        if (CSE.boxItem&&(CSE.boxItem.hasbox==1))  {
            LBE=CBE;
            CBE=iterElem;
            if (CBE!=LBE) {
                applyStyles();
                if (!CBE.requireclick)
                    if (CBE.fade) {
                        if (ID!=null)
                            clearTimeout(ID);
                        ID=setTimeout("fadeIn("+CBE.fadespeed+")",CBE.delay);
                    }
                    else {
                        if (ID!=null)
                            clearTimeout(ID);
                        COL=1;
                        ID=setTimeout("oDv.style.visibility='visible';ID=null;",CBE.delay);                        
                    }
                if (CBE.IEbugfix) {hideSelects();} 
                fixposx=!isNaN(CBE.fixX)?Left(CBE)+CBE.fixX:CBE.absX;
                fixposy=!isNaN(CBE.fixY)?Top(CBE)+CBE.fixY:CBE.absY;            
                lockX=0;
                lockY=0;
                boxMove=true;
                ox=CBE.offX?CBE.offX:10;
                oy=CBE.offY?CBE.offY:10;
            }
        }
        else if (!isChild(CSE,dvHdr) && !isChild(CSE,dvBdy) && (boxMove))    {
            // The conditional here fixes flickering between tables cells.
            if ((!isChild(CBE,CSE)) || (CSE.tagName!='TABLE')) {               
               CBE=null;
               if (ID!=null)
                      clearTimeout(ID);
               fadeOut();
               showSelects();
            }
        }
        LSE=CSE;
    }
    else if (((isChild(CSE,dvHdr) || isChild(CSE,dvBdy))&&(boxMove))) {
        totalScrollLeft=0;
        totalScrollTop=0;
        
        iterElem=CSE;
        while(iterElem) {
            if(!isNaN(parseInt(iterElem.scrollTop)))
                totalScrollTop+=parseInt(iterElem.scrollTop);
            if(!isNaN(parseInt(iterElem.scrollLeft)))
                totalScrollLeft+=parseInt(iterElem.scrollLeft);
            iterElem=iterElem.parentNode;            
        }
        if (CBE!=null) {
            boxLeft=Left(CBE)-totalScrollLeft;
            boxRight=parseInt(Left(CBE)+CBE.offsetWidth)-totalScrollLeft;
            boxTop=Top(CBE)-totalScrollTop;
            boxBottom=parseInt(Top(CBE)+CBE.offsetHeight)-totalScrollTop;
            doCheck();
        }
    }
    
    if (boxMove&&CBE) {
        // This added to alleviate bug in IE6 w.r.t DOCTYPE
        bodyScrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;
        bodyScrollLet=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;
        mouseX=evt.pageX?evt.pageX-bodyScrollLet:evt.clientX-document.body.clientLeft;
        mouseY=evt.pageY?evt.pageY-bodyScrollTop:evt.clientY-document.body.clientTop;
        if ((CBE)&&(CBE.windowLock)) {
            mouseY < -oy?lockY=-mouseY-oy:lockY=0;
            mouseX < -ox?lockX=-mouseX-ox:lockX=0;
            mouseY > (SHW()[1]-oDv.offsetHeight-oy)?lockY=-mouseY+SHW()[1]-oDv.offsetHeight-oy:lockY=lockY;
            mouseX > (SHW()[0]-dvBdy.offsetWidth-ox)?lockX=-mouseX-ox+SHW()[0]-dvBdy.offsetWidth:lockX=lockX;            
        }
        oDv.style.left=((fixposx)||(fixposx==0))?fixposx:bodyScrollLet+mouseX+ox+lockX+"px";
        oDv.style.top=((fixposy)||(fixposy==0))?fixposy:bodyScrollTop+mouseY+oy+lockY+"px";        
        
    }
}

function doCheck() {    
    if (   (mouseX < boxLeft)    ||     (mouseX >boxRight)     || (mouseY < boxTop) || (mouseY > boxBottom)) {
        if (!CBE.requireclick)
            fadeOut();
        if (CBE.IEbugfix) {showSelects();}
        CBE=null;
    }
}

function pauseBox(e) {
   e?evt=e:evt=event;
    boxMove=false;
    evt.cancelBubble=true;
}

function showHideBox(e) {
    oDv.style.visibility=(oDv.style.visibility!='visible')?'visible':'hidden';
}

function hideBox(e) {
    oDv.style.visibility='hidden';
}

var COL=0;
var stopfade=false;
function fadeIn(fs) {
        ID=null;
        COL=0;
        oDv.style.visibility='visible';
        fadeIn2(fs);
}

function fadeIn2(fs) {
        COL=COL+fs;
        COL=(COL>1)?1:COL;
        oDv.style.filter='alpha(opacity='+parseInt(100*COL)+')';
        oDv.style.opacity=COL;
        if (COL<1)
         setTimeout("fadeIn2("+fs+")",20);        
}


function fadeOut() {
    oDv.style.visibility='hidden';
    
}

function isChild(s,d) {
    while(s) {
        if (s==d) 
            return true;
        s=s.parentNode;
    }
    return false;
}

var cSrc;
function checkMove(e) {
    e?evt=e:evt=event;
    cSrc=evt.target?evt.target:evt.srcElement;
    if ((!boxMove)&&(!isChild(cSrc,oDv))) {
        fadeOut();
        if (CBE&&CBE.IEbugfix) {showSelects();}
        boxMove=true;
        CBE=null;
    }
}

function showSelects(){
   var elements = document.getElementsByTagName("select");
   for (i=0;i< elements.length;i++){
      elements[i].style.visibility='visible';
   }
}

function hideSelects(){
   var elements = document.getElementsByTagName("select");
   for (i=0;i< elements.length;i++){
   elements[i].style.visibility='hidden';
   }
}

open header.php and look for:

<script type="text/javascript" src="include/global.js"></script>

add after:

<script type="text/javascript" src="include/boxover.js"></script>

Lastly, save an image called noimage.gif and place it in your img folder.

NOTE: To change colors of the boxover script, you will need to open boxover.js and look for the appropriate color that you want to change.

That's it! You're all done.

Bingiman

145

Re: New frontpage index mod!

Looks like your script is gathering a following, Bingiman. big_smile Btw, apologies for not doing any updates on it over the last day or two. Got a tad sidetracked with another article/news cms I've been trying out. big_smile big_smile

146

Re: New frontpage index mod!

thanks bingiman .. i hope you intregrate it with mega pun ... it will be ausome thanks again

MyFootballCafe.com  is Now Online!

Re: New frontpage index mod!

bingiman wrote:

open header.php and look for:

<script type="text/javascript" src="include/global.js"></script>

is that in header.php? if it is i can't find it.

~James
FluxBB - Less is more

148

Re: New frontpage index mod!

Dr.Jeckyl wrote:
bingiman wrote:

open header.php and look for:

<script type="text/javascript" src="include/global.js"></script>

is that in header.php? if it is i can't find it.

It may be specific to his installation. Just add that boxover line with the other script/link/style lines near the top of header.php.

149 (edited by Dr.Jeckyl 2007-06-28 09:09)

Re: New frontpage index mod!

it must be since there isn't any global.js either. wink

that bit of css is a nice tease to the style it belongs to. wink

~James
FluxBB - Less is more

150

Re: New frontpage index mod!

If you guys want to see the style those classes are from, please take a look at my new website: http://shednotes.com - I spent a lot of time on it and modded it a bit, nothing like mega pun, just minor stuff. I will release that theme this weekend to everyone. I just wanted to make sure I got the site up and running. I am still fine tuning it but give me your opinion on it.

Bingiman