View Full Version : I am getting database error after changing my cmps_index.php to index.php
shah_b1
12-28-2006, 01:58 AM
:confused:
Hello every body!
I am shah from hyderabad, india.
I am getting database error after changing my cmps_index.php to index.php.Currently I have 3.6.1 and vbadvance installed.
It would be thankful if any body could help me out.
Thanks!
:confused:
Tom M
12-28-2006, 03:31 AM
It would be helpful if you could post the error that you are getting.
shah_b1
12-29-2006, 06:04 AM
only vbulletin logo is seen with text " Database Error" and IE page has navigation canceled.....no specific error....
Please help
Thanks.
Shah
Brian
12-29-2006, 12:56 PM
If you view the source of the page then it will show the DB error. Check that and post it here please.
shah_b1
12-30-2006, 01:11 AM
This is the error what i am encountring....please help me.
Database error in vBulletin 3.6.1:
Invalid SQL:
SELECT threadid, firstpostid FROM bkthread AS thread
WHERE visible = 1 AND open != 10 AND thread.forumid IN(3)
ORDER BY sticky DESC,voteavg DESC
LIMIT 10;
MySQL Error : Unknown column 'voteavg' in 'order clause'
Error Number : 1054
Date : Friday, December 29th 2006 @ 09:09:33 PM
Script : http://www.ipremed.net/forums/index.php
Referrer : http://www.ipremed.net/forums/admincp/index.php?do=head
IP Address : 59.93.79.248
Username : maxwell
Classname : vb_database
Regards
Shah
shah_b1
12-30-2006, 01:17 AM
So, now i have rolled back to earlier version. But up listed is the error i am getting .....
Shah
Brian
12-30-2006, 01:18 PM
It looks like there may be a small bug that can occur when you have your news posts ordered by rating, but don't display ratings with your news posts. If you'll look in your modules/news.php file for this code though:
if ($mod_options['portal_news_showrating'])
And replace with this:
if ($mod_options['portal_news_showrating'] OR $mod_options['portal_news_orderby'] == 'voteavg')
Then that should take care of the problem.
shah_b1
01-02-2007, 12:26 AM
Thanks Sir,
I tried the same but this time i am getting the error as stated below:
Database error
The ipremed.net database has encountered a problem.
--------------------------------------------------------------------------------
Please try the following:
Load the page again by clicking the Refresh button in your web browser.
Open the www.ipremed.net home page, then try to open another page.
Click the Back button to try another link.
The www.ipremed.net forum technical staff have been notified of the error, though you may contact them if the problem persists.
We apologise for any inconvenience.
shah_b1
01-02-2007, 12:45 AM
Sir, Can u please inform me how to get vbadvance installed on a fresh all total. It would be very kind of you. I know it's easy......
Thanking You.
Shah
Happy New Year
Brian
01-02-2007, 11:56 AM
Can you view the source of the page again so we can see the error?
shah_b1
01-03-2007, 01:47 AM
Sir here is the source code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>ipremed.net Database Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<style type="text/css">
<!--
body { background-color: white; color: black; }
#container { width: 400px; }
#message { width: 400px; color: black; background-color: #FFFFCC; }
#bodytitle { font: 13pt/15pt verdana, arial, sans-serif; height: 35px; vertical-align: top; }
.bodytext { font: 8pt/11pt verdana, arial, sans-serif; }
a:link { font: 8pt/11pt verdana, arial, sans-serif; color: red; }
a:visited { font: 8pt/11pt verdana, arial, sans-serif; color: #4e4e4e; }
-->
</style>
</head>
<body>
<table cellpadding="3" cellspacing="5" id="container">
<tr>
<td><img src="./image.php?type=dberror" alt="Database Error" width="48" height="48" /></td>
<td id="bodytitle" width="100%">Database error</td>
</tr>
<tr>
<td class="bodytext" colspan="2">The ipremed.net database has encountered a problem.</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td class="bodytext" colspan="2">
Please try the following:
<ul>
<li>Load the page again by clicking the <a href="#" onclick="window.location = window.location;">Refresh</a> button in your web browser.</li>
<li>Open the <a href="/">www.ipremed.net</a> home page, then try to open another page.</li>
<li>Click the <a href="javascript:history.back(1)">Back</a> button to try another link.</li>
</ul>
</td>
</tr>
<tr>
<td class="bodytext" colspan="2">The www.ipremed.net forum technical staff have been notified of the error, though you may <a href="mailto:dbmaster@ipremed.net">contact them</a> if the problem persists.</td>
</tr>
<tr>
<td class="bodytext" colspan="2"> <br />We apologise for any inconvenience.</td>
</tr>
</table>
<!--
Database error in vBulletin 3.6.1:
Invalid SQL:
SELECT threadid, firstpostid FROM bkthread AS thread
WHERE visible = 1 AND open != 10 AND thread.forumid IN(3)
ORDER BY sticky DESC,voteavg DESC
LIMIT 10;
MySQL Error : Unknown column 'voteavg' in 'order clause'
Error Number : 1054
Date : Tuesday, January 2nd 2007 @ 09:47:16 PM
Script : http://www.ipremed.net/forums/cmps_index.php
Referrer :
IP Address : 59.93.94.224
Username : Unregistered
Classname : vb_database
-->
</body>
</html>
Brian
01-03-2007, 04:36 PM
It looks like you didn't apply the changes I mentioned in post #7 in this thread.
shah_b1
01-04-2007, 01:45 AM
I have already made the changes...should i again re-install the.
shah_b1
01-04-2007, 01:48 AM
Sir, Again the same error in a box...
SELECT threadid, firstpostid FROM bkthread AS thread
WHERE visible = 1 AND open != 10 AND thread.forumid IN(3)
ORDER BY sticky DESC,voteavg DESC
LIMIT 10;
MySQL Error : Unknown column 'voteavg' in 'order clause'
Error Number : 1054
Date : Wednesday, January 3rd 2007 @ 09:47:56 PM
Script : http://www.ipremed.net/forums/cmps_index.php
Referrer :
IP Address : 59.93.94.115
Username : maxwell
Classname : vb_database
Brian
01-04-2007, 12:13 PM
Can you post the contents of your modules/news.php file here?
shah_b1
01-05-2007, 12:18 AM
Here Sir,
<?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.
// || http://vbadvanced.com
// || 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'], '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', true, false, $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'] . '&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'], 0, strrpos(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'], 1, true) . ', ' . 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;
?>
Deepsea WarrioR
01-05-2007, 01:03 AM
holy crap.
Brian
01-05-2007, 01:38 PM
There's the problem... I was looking at the code from v2.2.1, but you're still running v2.2.0. ;)
Try looking for this code instead:
SELECT " . iif($mod_options['portal_news_showrating']
Change to this:
SELECT " . iif($mod_options['portal_news_showrating'] OR $mod_options['portal_news_orderby'] == 'voteavg'
And that should take care of the problem.
shah_b1
01-06-2007, 02:57 AM
Sir, I liiked for the code - found it - changed it - but still getting database error, like
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>ipremed.net Database Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<style type="text/css">
<!--
body { background-color: white; color: black; }
#container { width: 400px; }
#message { width: 400px; color: black; background-color: #FFFFCC; }
#bodytitle { font: 13pt/15pt verdana, arial, sans-serif; height: 35px; vertical-align: top; }
.bodytext { font: 8pt/11pt verdana, arial, sans-serif; }
a:link { font: 8pt/11pt verdana, arial, sans-serif; color: red; }
a:visited { font: 8pt/11pt verdana, arial, sans-serif; color: #4e4e4e; }
-->
</style>
</head>
<body>
<table cellpadding="3" cellspacing="5" id="container">
<tr>
<td><img src="./image.php?type=dberror" alt="Database Error" width="48" height="48" /></td>
<td id="bodytitle" width="100%">Database error</td>
</tr>
<tr>
<td class="bodytext" colspan="2">The ipremed.net database has encountered a problem.</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td class="bodytext" colspan="2">
Please try the following:
<ul>
<li>Load the page again by clicking the <a href="#" onclick="window.location = window.location;">Refresh</a> button in your web browser.</li>
<li>Open the <a href="/">www.ipremed.net</a> home page, then try to open another page.</li>
<li>Click the <a href="javascript:history.back(1)">Back</a> button to try another link.</li>
</ul>
</td>
</tr>
<tr>
<td class="bodytext" colspan="2">The www.ipremed.net forum technical staff have been notified of the error, though you may <a href="mailto:dbmaster@ipremed.net">contact them</a> if the problem persists.</td>
</tr>
<tr>
<td class="bodytext" colspan="2"> <br />We apologise for any inconvenience.</td>
</tr>
</table>
<!--
Database error in vBulletin 3.6.1:
Invalid SQL:
SELECT threadid, firstpostid FROM bkthread AS thread
WHERE visible = 1 AND open != 10 AND thread.forumid IN(3)
ORDER BY sticky DESC,voteavg DESC
LIMIT 10;
MySQL Error : Unknown column 'voteavg' in 'order clause'
Error Number : 1054
Date : Friday, January 5th 2007 @ 10:52:15 PM
Script : http://www.ipremed.net/forums/
Referrer :
IP Address : 59.93.91.178
Username : Unregistered
Classname : vb_database
-->
</body>
</html>
Plese do something Sir.
shah_b1
01-06-2007, 02:59 AM
Sir, u can also check the error at:
http://www.ipremed.net/forums/cmps_index.php.
Brian
01-08-2007, 04:15 PM
Can you post your current news.php file here again?
shah_b1
01-09-2007, 01:01 AM
Certainly Sir,
Here it is
<?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.
// || http://vbadvanced.com
// || 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', true, false, $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'] . '&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'], 0, strrpos(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'], 1, true) . ', ' . 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!
Brian
01-09-2007, 05:39 PM
Try replacing the contents of that file with this and it should take care of the problem.
<?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.
// || http://vbadvanced.com
// || 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', true, false, $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'] . '&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'], 0, strrpos(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'], 1, true) . ', ' . 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;
?>
shah_b1
01-11-2007, 12:52 AM
Very very Thanks Sir,
It worked but...i wanted site layout like
www.valuemd.com (http://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...http://www.ipremed.net/forums/images/misc/ipremed.gif
Thank You very much sir.
Shah
Brian
01-11-2007, 04:03 PM
The image you're linking to is broken... Can you attach it here instead?
shah_b1
01-12-2007, 12:35 AM
Very very Thanks Sir,
It worked but...i wanted site layout like
www.valuemd.com, (http://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
shah_b1
01-12-2007, 04:26 AM
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
Brian
01-12-2007, 02:06 PM
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.
shah_b1
01-13-2007, 08:01 AM
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
Brian
01-13-2007, 02:44 PM
Admin CP => vBulletin Options => Site Name / URL / Contact Details => Forum URL
Change that setting to "http://www.ipremed.net/forums" (without the quotes).
shah_b1
01-17-2007, 02:51 AM
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
shah_b1
01-17-2007, 05:40 AM
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
Brian
01-17-2007, 02:04 PM
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.
shah_b1
01-18-2007, 12:44 AM
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.
shah_b1
01-20-2007, 12:59 AM
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.
shah_b1
01-24-2007, 01:00 AM
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.
Brian
01-24-2007, 08:42 PM
Just move the old cmps_index.php file to your root directory and remove any other index.* files that you have there.
shah_b1
01-29-2007, 02:11 AM
Thanks got it!
shah_b1
02-01-2007, 04:33 AM
Sir,
How to start new postings in my site....just see it's blank. Please HELP.
http://www.ipremed.net/
Thanks.
Shah
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.