I found the problem after just 4 hours of my time..:D

This is the problem here:

<div class="block">
        <h2 class="block2"><span>Top 10 Posts</span></h2>
        <div class="box">
            <div class="inbox">
                <ul>    
                   <?php
$trunc_len = 20; // Fill this in

$result = $db->query('SELECT subject, id FROM '.$db_prefix.'topics ORDER BY last_post DESC LIMIT 10') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

while($cur_topics = $db->fetch_assoc($result))
{
    
?>
<li><img style="vertical-align: middle;" src="img/icon_dot.gif" alt="" /> <a href="viewtopic.php?id=<?php echo $cur_topics['id']; ?>"><?php echo substr($cur_topics['subject'], 0, $trunc_len); ?>...</a></li>
<?php
}
?>
    </ul></div>
</div>
</div>

The above code resides in a file called: recenttopics.inc.php and you will notice that I have changed "topic" to "topics". I had to do this because there was a conflict using $cur_topic so I had to make it $cur_topics instead. Once logged into the site it works great. However, it messes with quite a bit of options, such as maoderate.php (viewing users ip) and logging in as well. Does anyone know how I can resolve this issue?

Thanks
Bingiman

I am having a problem. When I click on the user ip address from the topic I get the following error:

An error was encountered
Error: Unable to fetch post info.

Here is the link so you can see what it is exactly.

http://shednotes.com/moderate.php?get_host=14

Please let me know if you can help me and I will give you admin access.

I even copied a fresh copy of moderate.php and it still doesn't work

Thanks for the help

Bingiman

I had to change any call for $cur_topic to $cur_topic2 and it now works.

Well, I tried adding every language file possible and it still doesn't work right

This works fine for me but when I am in my forums viewing a post the text at the top disappears. Here is an example:


* Index     *  » missing text    *  » missing text

The names should be displayed where it says missing text but it is not there. Once I remove the code it works normal. Any ideas?

Thanks
Bingiman

hmm...very nice idea. I think I shall try this.

All fixed Dr. Jeckyl

MattF wrote:

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

I wish I could take credit for the script but it was originally Quaker's idea and we just shared ideas and sort of enhanced it from it's original state. Well, it was also possible by your work as well. As for not doing any updates, I understand. I myself have been very busy at work but I do look forward to seeing what you have in store for it.

Bingiman

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

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

Well, can someone please help modify Quaker's code to truncate the subject lines?

Thakns

What is cURL?

I;'ve asked my host to turn on: allow_url_include

Actually it is set to on. I checked the PHP info and it definitely on. I also tried everything else and nothing works.

I added it to my production site and I am getting the following errors?

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/ztunavmk/public_html/shednotes/include/user/recenttopics.inc.php on line 7

Thank you so much kierownik. I was dying to get this. It works great.

Bingiman

I knew I was going to get that exact response. The problem is I do not know how to include this as a seperate file for example <pun_newtopics> in main.tpl which in turn calls a file in the user folder. Can you tell me how I can do it? The extern file really doesn't' tell me how this could be done.

Thanks

I think I've asked this question before but I am not 100% sure. Anyway, what I would like to know is if I can show the latest topics on my frontpage like this site

http://www.powelly.com/index.php

I would like to call it from the main.tpl file. If someone can point me in the right direction to a mod, that would be great.

Bingiman

519

(5 replies, posted in PunBB 1.2 show off)

You site looks great. Is that menu a mod?

Yes, that's exactly correct. I didn't realize that it would also need modifying in other files as well.I thought it was just in forum.php. I've tried to do it myself but had no luck. Another member of this site said he would post the code but I never heard from him. sad

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

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

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

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>';

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?