Page 2 of 2 FirstFirst 12
Results 21 to 39 of 39

Thread: I am getting database error after changing my cmps_index.php to index.php

  1. #21
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Can you post your current news.php file here again?

  2. #22
    Join Date
    Nov 2006
    Posts
    27

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Certainly Sir,
    Here it is

    PHP Code:
    <?php
    // ++=========================================================================++
    // || vBadvanced CMPS v2.2.0 (vB 3.6) - 40190
    // || © 2003-2004 vBadvanced.com & PlurPlanet, LLC - All Rights Reserved
    // || This file may not be redistributed in whole or significant part.
    // || [url]http://www.vbadvanced.com[/url]
    // || Downloaded 09:05, Mon Oct 2nd 2006
    // || 
    // ++ ========================================================================++

    $newsmod $mods;

    if (!empty(
    $modules))
    {
        foreach (
    $modules AS $omods)
        {
            if (
    $omods['parent'] == $mods['identifier'])
            {
                
    $archivemod $omods;
                
    $mod_options array_merge($cmps_options["adv_portal_$omods[identifier]"], $mod_options);
                
    $donenewsids[] = $omods['modid'];
            }
        }
    }

    unset(
    $omods);

    $vbulletin->templatecache['postbit_attachmentthumbnail'] = str_replace('"attachment.php''"' $vbulletin->options['bburl'] . '/attachment.php'$vbulletin->templatecache['postbit_attachmentthumbnail']);

    if (
    $newsmod['modid'] == $mods['modid'] OR $archivemod['modid'] == $mods['modid'])
    {
        if (
    $mod_options['portal_news_maxposts'] OR $mod_options['portal_news_enablearchive'])
        {
            
    $newslimit 'LIMIT ' . ($mod_options['portal_news_maxposts'] + $mod_options['portal_news_enablearchive']);
        }

        
    $mod_options['portal_threadids'] = unserialize($mod_options['portal_threadids']);

        if (!empty(
    $mod_options['portal_threadids']))
        {
            
    $newstids array_keys($mod_options['portal_threadids']);
            
    $newspids array_values($mod_options['portal_threadids']);

            if (!empty(
    $adv_forumperms) AND $mod_options['portal_applypermissions'])
            {
                
    $mods['exforums'] = 'AND thread.forumid NOT IN(' implode(','$adv_forumperms) . ')';
            }
        }
        else
        {
            
    // Get postids
            
    $newstids = array();
            
    $newspids = array();

            if (
    $mod_options['portal_news_forumid'])
            {
                
    $mods['inforums'] = explode(','$mod_options['portal_news_forumid']);

                if (
    $mod_options['portal_applypermissions'])
                {
                    
    $mods['inforums'] = array_diff($mods['inforums'], $adv_forumperms);
                }
            }

            if (!empty(
    $mods['inforums']))
            {
                
    $getnewsids $db->query_read("
                        SELECT threadid, firstpostid FROM " 
    TABLE_PREFIX "thread AS thread
                        WHERE visible = 1 AND open != 10 AND thread.forumid IN(" 
    implode(','$mods['inforums']) . ")
                        " 
    iif($mod_options['portal_news_cutoffdate'], 'AND thread.dateline > ' . (TIMENOW $mod_options['portal_news_cutoffdate'] * 86400)) . "
                        ORDER BY " 
    iif($mod_options['portal_news_sticky'], 'sticky DESC,') . iif($mod_options['portal_news_orderby'] == 'postdateline''dateline'$mod_options['portal_news_orderby']) . $mod_options[portal_news_direction]
                        
    $newslimit
                "
    );
                while (
    $ids $db->fetch_array($getnewsids))
                {
                    
    $newstids[] = $ids['threadid'];
                    
    $newspids[] = $ids['firstpostid'];
                }
            }
        }

        if (!empty(
    $newstids))
        {
            
    // Attachments
            
    if ($mod_options['portal_news_showattachments'])
            {
                
    $nattachcache = array();
                
    $getnattach $db->query_read("
                        SELECT attachmentid, filename, filesize, visible, postid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, counter, attachment.thumbnail, LENGTH(attachment.thumbnail) AS thumbnailsize, newwindow
                        FROM " 
    TABLE_PREFIX "attachment AS attachment
                        LEFT JOIN " 
    TABLE_PREFIX "attachmenttype AS attachmenttype ON (attachment.extension = attachmenttype.extension)
                        WHERE postid IN(" 
    implode(','$newspids) . ")
                        ORDER BY attachmentid
                "
    );
                while (
    $nattach $db->fetch_array($getnattach))
                {
                    
    $nattachcache["$nattach[postid]"]["$nattach[attachmentid]"] = $nattach;
                }
            }

            
    $newscount 0;

            
    $show['lastpost'] = $mod_options['portal_newsarchive_lastpost'];

            
    $getnews $db->query_read("
                    SELECT " 
    iif($mod_options['portal_news_showrating'] OR $mod_options['portal_news_orderby'] == 'voteavg''IF(votenum >= ' $vbulletin->options['showvotes'] . ', votenum, 0) AS numbvote, IF(votenum >= ' $vbulletin->options['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . "
                    thread.threadid, post.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, thread.lastposter, thread.lastpost, IF(views<=thread.replycount, thread.replycount+1, views) AS views, thread.forumid, post.postid, pagetext, allowsmilie
                    " 
    iif ($mod_options['portal_news_showsignature'], ', showsignature, sigparsed.signatureparsed, sigparsed.hasimages AS sighasimages, sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight') . "
                    " 
    iif ($mod_options['portal_news_showicon'] , ',thread.iconid AS threadiconid, iconpath AS threadiconpath') . "
                    " 
    iif ($mod_options['portal_news_showavatar'] , ', avatarpath, NOT ISNULL(customavatar.filedata) AS hascustom, customavatar.dateline AS avatardateline, avatarrevision') . "
                    " 
    iif ($mod_options['portal_news_showsubscribed'] AND $vbulletin->userinfo['userid'] , ', NOT ISNULL(subscribethread.subscribethreadid) AS subscribed ') . "
                    FROM " 
    TABLE_PREFIX "thread AS thread
                    LEFT JOIN " 
    TABLE_PREFIX "post AS post ON (post.postid = thread.firstpostid)

                    LEFT JOIN " 
    TABLE_PREFIX "postparsed AS postparsed ON (postparsed.postid = post.postid AND postparsed.styleid = " intval(STYLEID) . " AND postparsed.languageid = " intval(LANGUAGEID) . ")

                    " 
    iif ($mod_options['portal_news_showicon'] , 'LEFT JOIN ' TABLE_PREFIX 'icon AS icon ON (icon.iconid = thread.iconid)') . "
                    " 
    iif ($mod_options['portal_news_showavatar'] OR $mod_options['portal_news_showsignature'],
                        
    'LEFT JOIN ' TABLE_PREFIX 'user AS user ON (user.userid = post.userid)
                    '
    ) . "
                    " 
    iif ($mod_options['portal_news_showsignature'], 
                            
    'LEFT JOIN ' TABLE_PREFIX 'sigparsed AS sigparsed ON (sigparsed.userid = user.userid AND sigparsed.styleid = ' intval(STYLEID) . ' AND sigparsed.languageid = ' intval(LANGUAGEID) . ')
                            LEFT JOIN ' 
    TABLE_PREFIX 'sigpic AS sigpic ON (sigpic.userid = post.userid)') .
                    
    iif ($mod_options['portal_news_showavatar'] , '
                        LEFT JOIN ' 
    TABLE_PREFIX 'avatar as avatar ON (avatar.avatarid = user.avatarid)
                        LEFT JOIN ' 
    TABLE_PREFIX 'customavatar as customavatar ON (customavatar.userid = user.userid)
                    '
    ) . "
                    " 
    iif ($mod_options['portal_news_showsubscribed'] AND $vbulletin->userinfo['userid'] , ' LEFT JOIN ' TABLE_PREFIX 'subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = \'' $vbulletin->userinfo['userid'] . '\')') . "
                    WHERE thread.threadid IN(" 
    implode(','$newstids) . ")
                    " 
    iif($ignusers'AND thread.postuserid NOT IN(' $ignusers ')') . "
                    
    $mods[exforums]
                    GROUP BY post.postid
                    ORDER BY " 
    iif($mod_options['portal_news_sticky'], 'sticky DESC,') . iif($mod_options['portal_news_orderby'] == 'postdateline''thread.dateline'$mod_options['portal_news_orderby']) . $mod_options[portal_news_direction]
                    
    $newslimit
            "
    );
            while (
    $news $db->fetch_array($getnews))
            {
                
    $newscount++;

                if (
    $mod_options['portal_news_archivepreview'])
                {
                    
    $news['preview'] = $news['pagetext'];
                }

                
    $news process_thread_array($news''$mod_options['portal_news_showicon']);

                
    $news['reply_noformat'] = $news['replycount'];

                
    $news['dateposted'] = vbdate($mod_options['portal_news_dateformat'], $news['postdateline'], '''');

                if (
    $newscount <= $mod_options['portal_news_maxposts'] AND $newsmod['modid'])
                {
                    
    // Signature
                    
    $show['signature'] = false;
                    if (
    $mod_options['portal_news_showsignature'] AND $news['showsignature'] AND trim($news['signatureparsed']))
                    {
                        
    $show['signature'] = true;

                        if (!
    $cachedsigs[$news['userid']])
                        {
                            
    $cachedsigs[$news['userid']] = $bbcode_parser->parse($news['signature'], 'signature'truefalse$news['signatureparsed'], $news['sighasimages'], true);
                        }

                        
    $news['signature'] =& $cachedsigs[$news['userid']];
                    }

                    
    // News Avatar
                    
    if ($mod_options['portal_news_showavatar'])
                    {
                        if (
    $news['avatarpath'])
                        {
                            
    $news['avatarpath'] = $vbulletin->options['bburl'] . '/' $news['avatarpath'];
                        }
                        else if (
    $news['hascustom'])
                        {
                            if (
    $vbulletin->options['usefileavatar'])
                            {
                                
    $news['avatarpath'] = $vbulletin->options['bburl'] . '/' $vbulletin->options['avatarurl'] . '/avatar' $news['postuserid']. '_' $news['avatarrevision'] . '.gif';
                            }
                            else
                            {
                                
    $news['avatarpath'] = $vbulletin->options['bburl'] . '/image.php?' $session['sessionurl'] . 'u=' $news['postuserid'] . '&amp;dateline=' $news['avatardateline'];
                            }
                        }
                    }

                    if (!
    $mod_options['portal_news_enablesmilies'])
                    {
                        
    $news['allowsmilie'] = 0;
                    }

                    
    // Parse bb code if necessary
                    
    if ($news['pagetext_html'])
                    {
                        
    $news['message'] = $news['pagetext_html'];
                    }
                    else
                    {
                        
    $news['message'] = $bbcode_parser->do_parse($news['pagetext'], $mod_options['portal_news_enablehtml'], $news['allowsmilie'], $mod_options['portal_news_enablevbcode'], $mod_options['portal_news_enablevbimage']);
                    }

                    
    // Strip characters and add "read more"
                    
    if ($mod_options['portal_news_maxchars'] AND strlen($news['message']) > $mod_options['portal_news_maxchars'])
                    {
                        
    $news['message'] = substr($news['message'], 0strrpos(substr($news['message'], 0$mod_options['portal_news_maxchars']), ' ')) . '...' construct_phrase($vbphrase['read_more'], $vbulletin->options['bburl'], $news['threadid'], $session['sessionurl']);
                    }

                    if (empty(
    $newsforumperms["$news[forumid]"]))
                    {
                        
    $newsforumperms["$news[forumid]"] = fetch_permissions($news['forumid']);
                    }

                    
    $show['editbutton'] = false;

                    if (((
    $newsforumperms["$news[forumid]"] & $vbulletin->bf_ugp_forumpermissions['caneditpost']) AND $vbulletin->userinfo['userid'] == $news['userid']) OR can_moderate($news['forumid'], 'caneditposts'))
                    {
                        
    $show['editbutton'] = true;
                    }

                    
    $show['replybutton'] = iif(($newsforumperms["$news[forumid]"] & $vbulletin->bf_ugp_forumpermissions['canreplyothers']) AND $mod_options['portal_news_allowreplies'], true);

                    
    // Rating
                    
    $news['votenum'] = $news['numbvote'];
                    if (
    $mod_options['portal_news_showrating'] OR $mod_options['portal_news_orderby'] == 'voteavg'
                    {
                        
    $news['rating'] = intval(round($news['voteavg']));
                    }

                    
    // News Attachments
                    
    if ($nattachcache["$news[postid]"])
                    {
                        foreach (
    $nattachcache["$news[postid]"] AS $attachid => $attachment)
                        {
                            if (
    $attachment['hasthumbnail'] AND $vbulletin->options['attachthumbs'] AND ($newsforumperms["$news[forumid]"] & $vbulletin->bf_ugp_forumpermissions['cangetattachment']))
                            {
                                
    $show['newwindow'] = $attachment['newwindow'];
                                eval(
    '$news[\'attachment\'] .= "' fetch_template('postbit_attachmentthumbnail') . '";');
                            }
                            else
                            {
                                
    $attachment['attachmentextension'] = file_extension($attachment['filename']);
                                
    $news['attachment'] .= '<img class="inlineimg" src="' $stylevar['imgdir_attach'] . '/' $attachment['attachmentextension'] . '.gif" alt="' construct_phrase($vbphrase['file_type_x'], $attachment['attachmentextension']) . '" width="16" height="16" border="0" style="vertical-align:baseline" /> <a href="' $vbulletin->options['bburl'] . '/attachment.php?' $session['sessionurl'] . 'attachmentid=' $attachment['attachmentid'] . '">' $attachment['filename'] . '</a> (' vb_number_format($attachment['filesize'], 1true) . ', ' construct_phrase($vbphrase['x_views'], $attachment['counter']) . ')';
                            }
                        }
                    }

                    
    $blockbullet $vba_style['portal_blockbullet'];
                    if (
    $mod_options['portal_news_showicon'])
                    {
                        
    $vba_style['portal_blockbullet'] = '';
                        if (
    $news['threadiconpath'])
                        {
                            
    $vba_style['portal_blockbullet'] = '<img alt="" border="0" src="' $news['threadiconpath'] . '" title="' $news['threadicontitle'] . '" />';
                        }
                    }

                    if (
    $mod_options['portal_news_legacy'])
                    {
                        
    $mods['title'] = '<a href="' $vbulletin->options['bburl'] . '/showthread.php?' $session['sessionurl'] . 't=' $news['threadid'] . '">' $news['title'] . '</a>';

                        
    $mods['collapse'] = $newsmod['modid'] . '_' $news['threadid'];
                        
    $modcollapse $vbcollapse["collapseobj_module_" $mods['collapse'] . ""];
                        
    $modimgcollapse $vbcollapse["collapseimg_module_" $mods['collapse']. ""];

                        eval(
    '$modulehtml = "' fetch_template('adv_portal_newsbits') . '";');

                        if (
    $newsmod['useshell'])
                        {
                            eval(
    '$home[$newsmod[\'modid\']][\'content\'] .= "' fetch_template('adv_portal_module_shell') . '";');
                        }
                        else
                        {
                            
    $home["$newsmod[modid]"]['content'] .= $modulehtml;
                        }
                    }
                    else
                    {
                        eval(
    '$newsbits .= "' fetch_template('adv_portal_newsbits') . '";');
                    }

                    
    $vba_style['portal_blockbullet'] = $blockbullet;
                }
                else if (
    $archivemod['modid'])
                {
                    
    $mods['modcol'] = $archivemod['modcol'];
                    if (
    $mods['modcol'] != 1)
                    {
                        
    $bgclass exec_switch_bg();
                    }

                    if (
    $archivemod['useshell'])
                    {
                        eval(
    '$newsarchivebits .= "' fetch_template('adv_portal_news_archivebits') . '";');
                    }
                    else
                    {
                        eval(
    '$home[$archivemod[\'modid\']][\'content\'] = "' fetch_template('adv_portal_news_archivebits') . '";');
                    }
                }
            }

            
    $db->free_result($getnews);

            if (
    $newsarchivebits)
            {
                
    $modulehtml '';
                if (
    $mods['modcol'] == 1)
                {
                    eval(
    '$modulehtml = "' fetch_template('adv_portal_news_archive_head') . '";');
                }

                
    $mods['link'] = '';
                if (
    $archivemod['link'])
                {
                    eval(
    '$mods[\'link\'] = "' addslashes($archivemod['link']) . '";');
                }

                
    $modulehtml .= $newsarchivebits;
                
    $mods['modid'] = $archivemod['modid'];
                
    $mods['colspan'] = $archivemod['colspan'];
                
    $mods['title'] = $archivemod['title'];
                
    $modcollapse $vbcollapse["collapseobj_module_" $archivemod['modid'] . ""];
                
    $mods['collapse'] = $archivemod['modid'];
                
    $modimgcollapse $vbcollapse["collapseimg_module_" $archivemod['modid'] . ""];
                eval(
    '$home[$archivemod[\'modid\']][\'content\'] = "' fetch_template('adv_portal_module_shell') . '";');
            }

            if (
    $newsbits AND !$mod_options['portal_news_legacy'])
            {
                
    $modulehtml $newsbits;
                
    $mods['modid'] = $newsmod['modid'];
                
    $mods['colspan'] = $newsmod['colspan'];
                
    $mods['title'] = $newsmod['title'];
                
    $mods['collapse'] = $newsmod['modid'];
                
    $modcollapse $vbcollapse["collapseobj_module_" $newsmod['modid'] . ""];
                
    $modimgcollapse $vbcollapse["collapseimg_module_" $newsmod['modid'] . ""];
                if (
    $newsmod['useshell'])
                {
                    eval(
    '$home[$newsmod[\'modid\']][\'content\'] = "' fetch_template('adv_portal_module_shell') . '";');
                }
                else
                {
                    
    $home["$newsmod[modid]"]['content'] = $modulehtml;
                }
            }
        }

        unset(
    $news$newsarchivebits$attachment$newscount$newsforumbits$newsmod$archivemod$newsbits);
    }

    $mods['noshell'] = true;

    ?>
    Thanks!
    Last edited by Brian; 01-09-2007 at 05:35 PM.

  3. #23
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Try replacing the contents of that file with this and it should take care of the problem.

    PHP Code:
    <?php 
    // ++=========================================================================++ 
    // || vBadvanced CMPS v2.2.0 (vB 3.6) - 40190 
    // || © 2003-2004 vBadvanced.com & PlurPlanet, LLC - All Rights Reserved 
    // || This file may not be redistributed in whole or significant part. 
    // || [url]http://www.vbadvanced.com[/url] 
    // || Downloaded 09:05, Mon Oct 2nd 2006 
    // ||  
    // ++ ========================================================================++ 

    $newsmod $mods

    if (!empty(
    $modules)) 

        foreach (
    $modules AS $omods
        { 
            if (
    $omods['parent'] == $mods['identifier']) 
            { 
                
    $archivemod $omods
                
    $mod_options array_merge($cmps_options["adv_portal_$omods[identifier]"], $mod_options); 
                
    $donenewsids[] = $omods['modid']; 
            } 
        } 


    unset(
    $omods); 

    $vbulletin->templatecache['postbit_attachmentthumbnail'] = str_replace('"attachment.php''"' $vbulletin->options['bburl'] . '/attachment.php'$vbulletin->templatecache['postbit_attachmentthumbnail']); 

    if (
    $newsmod['modid'] == $mods['modid'] OR $archivemod['modid'] == $mods['modid']) 

        if (
    $mod_options['portal_news_maxposts'] OR $mod_options['portal_news_enablearchive']) 
        { 
            
    $newslimit 'LIMIT ' . ($mod_options['portal_news_maxposts'] + $mod_options['portal_news_enablearchive']); 
        } 

        
    $mod_options['portal_threadids'] = unserialize($mod_options['portal_threadids']); 

        if (!empty(
    $mod_options['portal_threadids'])) 
        { 
            
    $newstids array_keys($mod_options['portal_threadids']); 
            
    $newspids array_values($mod_options['portal_threadids']); 

            if (!empty(
    $adv_forumperms) AND $mod_options['portal_applypermissions']) 
            { 
                
    $mods['exforums'] = 'AND thread.forumid NOT IN(' implode(','$adv_forumperms) . ')'
            } 
        } 
        else 
        { 
            
    // Get postids 
            
    $newstids = array(); 
            
    $newspids = array(); 

            if (
    $mod_options['portal_news_forumid']) 
            { 
                
    $mods['inforums'] = explode(','$mod_options['portal_news_forumid']); 

                if (
    $mod_options['portal_applypermissions']) 
                { 
                    
    $mods['inforums'] = array_diff($mods['inforums'], $adv_forumperms); 
                } 
            } 

            if (!empty(
    $mods['inforums'])) 
            { 
                
    $getnewsids $db->query_read(
                        SELECT " 
    iif($mod_options['portal_news_showrating'] OR $mod_options['portal_news_orderby'] == 'voteavg''IF(votenum >= ' $vbulletin->options['showvotes'] . ', votenum, 0) AS numbvote, IF(votenum >= ' $vbulletin->options['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . " threadid, firstpostid FROM " TABLE_PREFIX "thread AS thread 
                        WHERE visible = 1 AND open != 10 AND thread.forumid IN(" 
    implode(','$mods['inforums']) . ") 
                        " 
    iif($mod_options['portal_news_cutoffdate'], 'AND thread.dateline > ' . (TIMENOW $mod_options['portal_news_cutoffdate'] * 86400)) . 
                        ORDER BY " 
    iif($mod_options['portal_news_sticky'], 'sticky DESC,') . iif($mod_options['portal_news_orderby'] == 'postdateline''dateline'$mod_options['portal_news_orderby']) . $mod_options[portal_news_direction] 
                        
    $newslimit 
                "
    ); 
                while (
    $ids $db->fetch_array($getnewsids)) 
                { 
                    
    $newstids[] = $ids['threadid']; 
                    
    $newspids[] = $ids['firstpostid']; 
                } 
            } 
        } 

        if (!empty(
    $newstids)) 
        { 
            
    // Attachments 
            
    if ($mod_options['portal_news_showattachments']) 
            { 
                
    $nattachcache = array(); 
                
    $getnattach $db->query_read(
                        SELECT attachmentid, filename, filesize, visible, postid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, counter, attachment.thumbnail, LENGTH(attachment.thumbnail) AS thumbnailsize, newwindow 
                        FROM " 
    TABLE_PREFIX "attachment AS attachment 
                        LEFT JOIN " 
    TABLE_PREFIX "attachmenttype AS attachmenttype ON (attachment.extension = attachmenttype.extension) 
                        WHERE postid IN(" 
    implode(','$newspids) . ") 
                        ORDER BY attachmentid 
                "
    ); 
                while (
    $nattach $db->fetch_array($getnattach)) 
                { 
                    
    $nattachcache["$nattach[postid]"]["$nattach[attachmentid]"] = $nattach
                } 
            } 

            
    $newscount 0

            
    $show['lastpost'] = $mod_options['portal_newsarchive_lastpost']; 

            
    $getnews $db->query_read(
                    SELECT " 
    iif($mod_options['portal_news_showrating'] OR $mod_options['portal_news_orderby'] == 'voteavg''IF(votenum >= ' $vbulletin->options['showvotes'] . ', votenum, 0) AS numbvote, IF(votenum >= ' $vbulletin->options['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . 
                    thread.threadid, post.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, thread.lastposter, thread.lastpost, IF(views<=thread.replycount, thread.replycount+1, views) AS views, thread.forumid, post.postid, pagetext, allowsmilie 
                    " 
    iif ($mod_options['portal_news_showsignature'], ', showsignature, sigparsed.signatureparsed, sigparsed.hasimages AS sighasimages, sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight') . 
                    " 
    iif ($mod_options['portal_news_showicon'] , ',thread.iconid AS threadiconid, iconpath AS threadiconpath') . 
                    " 
    iif ($mod_options['portal_news_showavatar'] , ', avatarpath, NOT ISNULL(customavatar.filedata) AS hascustom, customavatar.dateline AS avatardateline, avatarrevision') . 
                    " 
    iif ($mod_options['portal_news_showsubscribed'] AND $vbulletin->userinfo['userid'] , ', NOT ISNULL(subscribethread.subscribethreadid) AS subscribed ') . 
                    FROM " 
    TABLE_PREFIX "thread AS thread 
                    LEFT JOIN " 
    TABLE_PREFIX "post AS post ON (post.postid = thread.firstpostid) 

                    LEFT JOIN " 
    TABLE_PREFIX "postparsed AS postparsed ON (postparsed.postid = post.postid AND postparsed.styleid = " intval(STYLEID) . " AND postparsed.languageid = " intval(LANGUAGEID) . ") 

                    " 
    iif ($mod_options['portal_news_showicon'] , 'LEFT JOIN ' TABLE_PREFIX 'icon AS icon ON (icon.iconid = thread.iconid)') . 
                    " 
    iif ($mod_options['portal_news_showavatar'] OR $mod_options['portal_news_showsignature'], 
                        
    'LEFT JOIN ' TABLE_PREFIX 'user AS user ON (user.userid = post.userid) 
                    '
    ) . 
                    " 
    iif ($mod_options['portal_news_showsignature'],  
                            
    'LEFT JOIN ' TABLE_PREFIX 'sigparsed AS sigparsed ON (sigparsed.userid = user.userid AND sigparsed.styleid = ' intval(STYLEID) . ' AND sigparsed.languageid = ' intval(LANGUAGEID) . ') 
                            LEFT JOIN ' 
    TABLE_PREFIX 'sigpic AS sigpic ON (sigpic.userid = post.userid)') . 
                    
    iif ($mod_options['portal_news_showavatar'] , 
                        LEFT JOIN ' 
    TABLE_PREFIX 'avatar as avatar ON (avatar.avatarid = user.avatarid) 
                        LEFT JOIN ' 
    TABLE_PREFIX 'customavatar as customavatar ON (customavatar.userid = user.userid) 
                    '
    ) . 
                    " 
    iif ($mod_options['portal_news_showsubscribed'] AND $vbulletin->userinfo['userid'] , ' LEFT JOIN ' TABLE_PREFIX 'subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = \'' $vbulletin->userinfo['userid'] . '\')') . 
                    WHERE thread.threadid IN(" 
    implode(','$newstids) . ") 
                    " 
    iif($ignusers'AND thread.postuserid NOT IN(' $ignusers ')') . 
                    
    $mods[exforums] 
                    GROUP BY post.postid 
                    ORDER BY " 
    iif($mod_options['portal_news_sticky'], 'sticky DESC,') . iif($mod_options['portal_news_orderby'] == 'postdateline''thread.dateline'$mod_options['portal_news_orderby']) . $mod_options[portal_news_direction] 
                    
    $newslimit 
            "
    ); 
            while (
    $news $db->fetch_array($getnews)) 
            { 
                
    $newscount++; 

                if (
    $mod_options['portal_news_archivepreview']) 
                { 
                    
    $news['preview'] = $news['pagetext']; 
                } 

                
    $news process_thread_array($news''$mod_options['portal_news_showicon']); 

                
    $news['reply_noformat'] = $news['replycount']; 

                
    $news['dateposted'] = vbdate($mod_options['portal_news_dateformat'], $news['postdateline'], ''''); 

                if (
    $newscount <= $mod_options['portal_news_maxposts'] AND $newsmod['modid']) 
                { 
                    
    // Signature 
                    
    $show['signature'] = false
                    if (
    $mod_options['portal_news_showsignature'] AND $news['showsignature'] AND trim($news['signatureparsed'])) 
                    { 
                        
    $show['signature'] = true

                        if (!
    $cachedsigs[$news['userid']]) 
                        { 
                            
    $cachedsigs[$news['userid']] = $bbcode_parser->parse($news['signature'], 'signature'truefalse$news['signatureparsed'], $news['sighasimages'], true); 
                        } 

                        
    $news['signature'] =& $cachedsigs[$news['userid']]; 
                    } 

                    
    // News Avatar 
                    
    if ($mod_options['portal_news_showavatar']) 
                    { 
                        if (
    $news['avatarpath']) 
                        { 
                            
    $news['avatarpath'] = $vbulletin->options['bburl'] . '/' $news['avatarpath']; 
                        } 
                        else if (
    $news['hascustom']) 
                        { 
                            if (
    $vbulletin->options['usefileavatar']) 
                            { 
                                
    $news['avatarpath'] = $vbulletin->options['bburl'] . '/' $vbulletin->options['avatarurl'] . '/avatar' $news['postuserid']. '_' $news['avatarrevision'] . '.gif'
                            } 
                            else 
                            { 
                                
    $news['avatarpath'] = $vbulletin->options['bburl'] . '/image.php?' $session['sessionurl'] . 'u=' $news['postuserid'] . '&amp;dateline=' $news['avatardateline']; 
                            } 
                        } 
                    } 

                    if (!
    $mod_options['portal_news_enablesmilies']) 
                    { 
                        
    $news['allowsmilie'] = 0
                    } 

                    
    // Parse bb code if necessary 
                    
    if ($news['pagetext_html']) 
                    { 
                        
    $news['message'] = $news['pagetext_html']; 
                    } 
                    else 
                    { 
                        
    $news['message'] = $bbcode_parser->do_parse($news['pagetext'], $mod_options['portal_news_enablehtml'], $news['allowsmilie'], $mod_options['portal_news_enablevbcode'], $mod_options['portal_news_enablevbimage']); 
                    } 

                    
    // Strip characters and add "read more" 
                    
    if ($mod_options['portal_news_maxchars'] AND strlen($news['message']) > $mod_options['portal_news_maxchars']) 
                    { 
                        
    $news['message'] = substr($news['message'], 0strrpos(substr($news['message'], 0$mod_options['portal_news_maxchars']), ' ')) . '...' construct_phrase($vbphrase['read_more'], $vbulletin->options['bburl'], $news['threadid'], $session['sessionurl']); 
                    } 

                    if (empty(
    $newsforumperms["$news[forumid]"])) 
                    { 
                        
    $newsforumperms["$news[forumid]"] = fetch_permissions($news['forumid']); 
                    } 

                    
    $show['editbutton'] = false

                    if (((
    $newsforumperms["$news[forumid]"] & $vbulletin->bf_ugp_forumpermissions['caneditpost']) AND $vbulletin->userinfo['userid'] == $news['userid']) OR can_moderate($news['forumid'], 'caneditposts')) 
                    { 
                        
    $show['editbutton'] = true
                    } 

                    
    $show['replybutton'] = iif(($newsforumperms["$news[forumid]"] & $vbulletin->bf_ugp_forumpermissions['canreplyothers']) AND $mod_options['portal_news_allowreplies'], true); 

                    
    // Rating 
                    
    $news['votenum'] = $news['numbvote']; 
                    if (
    $mod_options['portal_news_showrating'] OR $mod_options['portal_news_orderby'] == 'voteavg')  
                    { 
                        
    $news['rating'] = intval(round($news['voteavg'])); 
                    } 

                    
    // News Attachments 
                    
    if ($nattachcache["$news[postid]"]) 
                    { 
                        foreach (
    $nattachcache["$news[postid]"] AS $attachid => $attachment
                        { 
                            if (
    $attachment['hasthumbnail'] AND $vbulletin->options['attachthumbs'] AND ($newsforumperms["$news[forumid]"] & $vbulletin->bf_ugp_forumpermissions['cangetattachment'])) 
                            { 
                                
    $show['newwindow'] = $attachment['newwindow']; 
                                eval(
    '$news[\'attachment\'] .= "' fetch_template('postbit_attachmentthumbnail') . '";'); 
                            } 
                            else 
                            { 
                                
    $attachment['attachmentextension'] = file_extension($attachment['filename']); 
                                
    $news['attachment'] .= '<img class="inlineimg" src="' $stylevar['imgdir_attach'] . '/' $attachment['attachmentextension'] . '.gif" alt="' construct_phrase($vbphrase['file_type_x'], $attachment['attachmentextension']) . '" width="16" height="16" border="0" style="vertical-align:baseline" /> <a href="' $vbulletin->options['bburl'] . '/attachment.php?' $session['sessionurl'] . 'attachmentid=' $attachment['attachmentid'] . '">' $attachment['filename'] . '</a> (' vb_number_format($attachment['filesize'], 1true) . ', ' construct_phrase($vbphrase['x_views'], $attachment['counter']) . ')'
                            } 
                        } 
                    } 

                    
    $blockbullet $vba_style['portal_blockbullet']; 
                    if (
    $mod_options['portal_news_showicon']) 
                    { 
                        
    $vba_style['portal_blockbullet'] = ''
                        if (
    $news['threadiconpath']) 
                        { 
                            
    $vba_style['portal_blockbullet'] = '<img alt="" border="0" src="' $news['threadiconpath'] . '" title="' $news['threadicontitle'] . '" />'
                        } 
                    } 

                    if (
    $mod_options['portal_news_legacy']) 
                    { 
                        
    $mods['title'] = '<a href="' $vbulletin->options['bburl'] . '/showthread.php?' $session['sessionurl'] . 't=' $news['threadid'] . '">' $news['title'] . '</a>'

                        
    $mods['collapse'] = $newsmod['modid'] . '_' $news['threadid']; 
                        
    $modcollapse $vbcollapse["collapseobj_module_" $mods['collapse'] . ""]; 
                        
    $modimgcollapse $vbcollapse["collapseimg_module_" $mods['collapse']. ""]; 

                        eval(
    '$modulehtml = "' fetch_template('adv_portal_newsbits') . '";'); 

                        if (
    $newsmod['useshell']) 
                        { 
                            eval(
    '$home[$newsmod[\'modid\']][\'content\'] .= "' fetch_template('adv_portal_module_shell') . '";'); 
                        } 
                        else 
                        { 
                            
    $home["$newsmod[modid]"]['content'] .= $modulehtml
                        } 
                    } 
                    else 
                    { 
                        eval(
    '$newsbits .= "' fetch_template('adv_portal_newsbits') . '";'); 
                    } 

                    
    $vba_style['portal_blockbullet'] = $blockbullet
                } 
                else if (
    $archivemod['modid']) 
                { 
                    
    $mods['modcol'] = $archivemod['modcol']; 
                    if (
    $mods['modcol'] != 1
                    { 
                        
    $bgclass exec_switch_bg(); 
                    } 

                    if (
    $archivemod['useshell']) 
                    { 
                        eval(
    '$newsarchivebits .= "' fetch_template('adv_portal_news_archivebits') . '";'); 
                    } 
                    else 
                    { 
                        eval(
    '$home[$archivemod[\'modid\']][\'content\'] = "' fetch_template('adv_portal_news_archivebits') . '";'); 
                    } 
                } 
            } 

            
    $db->free_result($getnews); 

            if (
    $newsarchivebits
            { 
                
    $modulehtml ''
                if (
    $mods['modcol'] == 1
                { 
                    eval(
    '$modulehtml = "' fetch_template('adv_portal_news_archive_head') . '";'); 
                } 

                
    $mods['link'] = ''
                if (
    $archivemod['link']) 
                { 
                    eval(
    '$mods[\'link\'] = "' addslashes($archivemod['link']) . '";'); 
                } 

                
    $modulehtml .= $newsarchivebits
                
    $mods['modid'] = $archivemod['modid']; 
                
    $mods['colspan'] = $archivemod['colspan']; 
                
    $mods['title'] = $archivemod['title']; 
                
    $modcollapse $vbcollapse["collapseobj_module_" $archivemod['modid'] . ""]; 
                
    $mods['collapse'] = $archivemod['modid']; 
                
    $modimgcollapse $vbcollapse["collapseimg_module_" $archivemod['modid'] . ""]; 
                eval(
    '$home[$archivemod[\'modid\']][\'content\'] = "' fetch_template('adv_portal_module_shell') . '";'); 
            } 

            if (
    $newsbits AND !$mod_options['portal_news_legacy']) 
            { 
                
    $modulehtml $newsbits
                
    $mods['modid'] = $newsmod['modid']; 
                
    $mods['colspan'] = $newsmod['colspan']; 
                
    $mods['title'] = $newsmod['title']; 
                
    $mods['collapse'] = $newsmod['modid']; 
                
    $modcollapse $vbcollapse["collapseobj_module_" $newsmod['modid'] . ""]; 
                
    $modimgcollapse $vbcollapse["collapseimg_module_" $newsmod['modid'] . ""]; 
                if (
    $newsmod['useshell']) 
                { 
                    eval(
    '$home[$newsmod[\'modid\']][\'content\'] = "' fetch_template('adv_portal_module_shell') . '";'); 
                } 
                else 
                { 
                    
    $home["$newsmod[modid]"]['content'] = $modulehtml
                } 
            } 
        } 

        unset(
    $news$newsarchivebits$attachment$newscount$newsforumbits$newsmod$archivemod$newsbits); 


    $mods['noshell'] = true

    ?>

  4. #24
    Join Date
    Nov 2006
    Posts
    27

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Very very Thanks Sir,

    It worked but...i wanted site layout like

    www.valuemd.com, but my site looks very

    different more over none of the links are working.......I am posting my site image here

    please check and help me out

    sir...

    Thank You very much sir.
    Shah

  5. #25
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    The image you're linking to is broken... Can you attach it here instead?

  6. #26
    Join Date
    Nov 2006
    Posts
    27

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Very very Thanks Sir,

    It worked but...i wanted site layout like

    www.valuemd.com, but my site looks very different more over none of the links are working.......I am posting my site image here

    please check and help me out http://www.ipremed.net/forums/images/misc/ipremed.gif

  7. #27
    Join Date
    Nov 2006
    Posts
    27

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    or sir check out my site http://www.ipremed.net/forums/
    I don't want a Image layout, just plain like valuemd.com

    Thanking You

  8. #28
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    For the links, please see the post in the FAQ forum regarding broken navbar links.
    As for the rest, it looks like the spacing and broken images is due to an incorrect "Forum URL" setting, which is covered in the FAQ thread.

  9. #29
    Join Date
    Nov 2006
    Posts
    27

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Sir,
    I have reinstalled vbulletin and vbadvance but still the same error, look at my site
    http://www.ipremed.net/forums/

    Please HELP, I cannot understand FAQ's....

    Please

  10. #30
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Admin CP => vBulletin Options => Site Name / URL / Contact Details => Forum URL

    Change that setting to "http://www.ipremed.net/forums" (without the quotes).

  11. #31
    Join Date
    Nov 2006
    Posts
    27

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Thaks Sir,

    http://www.ipremed.net/forums/
    Layout has come and I am able to control it through vbadvance.
    But navbar links are gone...that too can be solved...i know...
    Please help me sir.
    Thanks,
    Shah

  12. #32
    Join Date
    Nov 2006
    Posts
    27

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Thanks Sir,

    1. I got the layout, but the links are missing in nav bar...HELP!
    2. And what does "please chmod your modules folder to 777." means.

    Look at my sitehttp://www.ipremed.net/forums/index.php

    One more strange thing happening sir:

    When i am in my Admn. Control Panel I am getting all the modules, but once Loged out of it

    1. Quick Moderation and
    2. Buddy List
    Are not seen on my page.....HELP!

    Thanks Sir.
    HELP ME Again...Please
    Last edited by shah_b1; 01-17-2007 at 06:14 AM.

  13. #33
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Quote Originally Posted by shah_b1 View Post
    1. I got the layout, but the links are missing in nav bar...HELP!
    Admin CP => vBulletin Options => Site Name / URL / Contact Details => Forum URL

    Change that option to "http://www.ipremed.net/forums"

    2. And what does "please chmod your modules folder to 777." means.
    That means you change the permissions (chmod) on the folder to 0777 with your FTP program.

    When i am in my Admn. Control Panel I am getting all the modules, but once Loged out of it

    1. Quick Moderation and
    2. Buddy List
    Are not seen on my page.....HELP!
    Guests don't have a buddy list, nor do they have permission to moderate anything.

  14. #34
    Join Date
    Nov 2006
    Posts
    27

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Thank You Very much Sir.....you really helped me out....Thanks a lot!Sir,
    Site Navigation links are missing....what to be done.
    And

    Sir, I have site URL as
    http://www.ipremed.net/forums/
    but I want it to be like
    http://www.ipremed.net
    What to be done sir.
    Last edited by shah_b1; 01-18-2007 at 08:02 AM.

  15. #35
    Join Date
    Nov 2006
    Posts
    27

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Brain Please help........ which template should be changed for top ad display in all the pages.

    Thanks....Help Sir

    Thanks....Help Sir

    Sir, I have site URL as
    http://www.ipremed.net/forums/
    but I want it to be like
    http://www.ipremed.net
    What to be done sir.
    Last edited by shah_b1; 01-22-2007 at 12:45 AM. Reason: no responce

  16. #36
    Join Date
    Nov 2006
    Posts
    27

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Sir, I have site URL as
    http://www.ipremed.net/forums/
    but I want it to be like
    http://www.ipremed.net
    What to be done sir.

  17. #37
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Just move the old cmps_index.php file to your root directory and remove any other index.* files that you have there.

  18. #38
    Join Date
    Nov 2006
    Posts
    27

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Thanks got it!

  19. #39
    Join Date
    Nov 2006
    Posts
    27

    Default Re: I am getting database error after changing my cmps_index.php to index.php

    Sir,
    How to start new postings in my site....just see it's blank. Please HELP.
    http://www.ipremed.net/

    Thanks.
    Shah
    Last edited by shah_b1; 02-02-2007 at 02:27 AM.

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Changing cmps_index.php Directories
    By Strife in forum "How Do I..." Questions
    Replies: 2
    Last Post: 01-23-2007, 01:03 PM
  2. After changing the cmps_index.php to index.php I get this error message.
    By Ann Marie in forum Troubleshooting & Problems
    Replies: 4
    Last Post: 12-22-2006, 04:16 PM
  3. index and cmps_index
    By Jaegermeister-a in forum Troubleshooting & Problems
    Replies: 4
    Last Post: 02-14-2006, 06:06 PM
  4. cmps_index.php -> index.php
    By cLord in forum Troubleshooting / "How do I..." Questions
    Replies: 6
    Last Post: 01-29-2005, 01:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •