Get an SQL error on portal when i change force guest to login
#1
Posted 31 August 2006 - 10:36 PM
mySQL query error: SELECT COUNT(DISTINCT(t.tid)) as tcnt,
COUNT(DISTINCT(p.pid)) as pcnt FROM ibf_posts p, ibf_topics t WHERE
p.post_date > AND p.topic_id=t.tid
SQL error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND p.topic_id=t.tid' at line 3
SQL error code:
Date: Thursday 31st 2006f August 2006 09:35:32 PM
Any help is really appreciated.
sorry subscribing
#2
Posted 10 November 2006 - 12:39 PM
mySQL query error: SELECT COUNT(DISTINCT(t.tid)) as tcnt, COUNT(DISTINCT(p.pid)) as pcnt FROM ibf_posts p, ibf_topics t WHERE p.post_date > AND p.topic_id=t.tid SQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND p.topic_id=t.tid' at line 3 SQL error code: Date: Wednesday 08th 2006f November 2006 06:40:28 PM
I have a quick fix. Open your file "sources/action_public/uportal.php" Next, find
//*********************************************/ // Welcome Panel //*********************************************/and scroll down to find the code,
else
{
$this->ipsclass->offset_set = 0;
$data['time'] = $this->ipsclass->get_date(time(), LONG);
$today = mktime (0,0,0,date("M"),date("D"),date("Y"));
$query13 = $this->ipsclass->DB->query("SELECT COUNT(DISTINCT(t.tid)) as tcnt,
COUNT(DISTINCT(p.pid)) as pcnt FROM ibf_posts p, ibf_topics t WHERE
p.post_date > ".$today." AND p.topic_id=t.tid");
$row = $this->ipsclass->DB->fetch_row($query13);
$data['topics_since'] = $row[tcnt];
$data['posts_since'] = $row[pcnt];
//Replace Stuff
$this->ipsclass->lang['guestpanel'] = str_replace('<# BOARD URL #>',
$this->ipsclass->vars['board_url'], $this->ipsclass->lang['guestpanel']);
$this->ipsclass->lang['guestpanel'] = str_replace('<# REGISTER #>',
$this->ipsclass->lang['register'], $this->ipsclass->lang['guestpanel']);
$this->ipsclass->lang['guestpanel'] = str_replace('<# OR #>',
$this->ipsclass->lang['or'], $this->ipsclass->lang['guestpanel']);
$this->ipsclass->lang['guestpanel'] = str_replace('<# LOGIN #>',
$this->ipsclass->lang['login'], $this->ipsclass->lang['guestpanel']);
$output .= $this->ipsclass->compiled_templates['skin_uportal']->block_header(
$this->collapse("welcomepanel"), "guestpanel");
$output .= $this->ipsclass->compiled_templates['skin_uportal']->guestpanel($data);
$output .= $this->ipsclass->compiled_templates['skin_uportal']->block_footer();
return $output;
}Now make this block of code look like this
else
{}This fixed it for me. I'll look into what caused the problem so you can still have the guest welcome panel.
#3
Posted 10 November 2006 - 02:32 PM

#4
Posted 10 November 2006 - 03:06 PM
I am running:
- IPB 2.1.7
- Unreal Portal 2.1.0
- MySQL 5.0.24a
- PHP 2.1.7
#5
Posted 12 December 2006 - 05:32 AM
The error occur because there is no user that is log-in and there is an query happen to get the user status..
The best solution is to delete the bunch of code that cause the error..
Open your sources/action_public/Uportal.php
Find the Code
//*********************************************/ // Welcome Panel //*********************************************/
then find the code somewhere below it...
else
{
$this->ipsclass->offset_set = 0;
$data['time'] = $this->ipsclass->get_date(time(), LONG);
$today = mktime (0,0,0,date("M"),date("D"),date("Y"), LONG);
$query13 = $this->ipsclass->DB->query("SELECT COUNT(DISTINCT(t.tid)) as tcnt,
COUNT(DISTINCT(p.pid)) as pcnt FROM ibf_posts p, ibf_topics t WHERE
p.post_date > ".$today." AND p.topic_id=t.tid");
$row = $this->ipsclass->DB->fetch_row($query13);
$data['topics_since'] = $row[tcnt];
$data['posts_since'] = $row[pcnt];
//Replace Stuff
$this->ipsclass->lang['guestpanel'] = str_replace('<# BOARD URL #>',
$this->ipsclass->vars['board_url'], $this->ipsclass->lang['guestpanel']);
$this->ipsclass->lang['guestpanel'] = str_replace('<# REGISTER #>',
$this->ipsclass->lang['register'], $this->ipsclass->lang['guestpanel']);
$this->ipsclass->lang['guestpanel'] = str_replace('<# OR #>',
$this->ipsclass->lang['or'], $this->ipsclass->lang['guestpanel']);
$this->ipsclass->lang['guestpanel'] = str_replace('<# LOGIN #>',
$this->ipsclass->lang['login'], $this->ipsclass->lang['guestpanel']);
$output .= $this->ipsclass->compiled_templates['skin_uportal']->block_header(
$this->collapse("welcomepanel"), "guestpanel");
$output .= $this->ipsclass->compiled_templates['skin_uportal']->guestpanel($data);
$output .= $this->ipsclass->compiled_templates['skin_uportal']->block_footer();
return $output;
}
}
}Delete the following..
$this->ipsclass->offset_set = 0;
$data['time'] = $this->ipsclass->get_date(time(), LONG);
$today = mktime (0,0,0,date("M"),date("D"),date("Y"), LONG);
$query13 = $this->ipsclass->DB->query("SELECT COUNT(DISTINCT(t.tid)) as tcnt,
COUNT(DISTINCT(p.pid)) as pcnt FROM ibf_posts p, ibf_topics t WHERE
p.post_date > ".$today." AND p.topic_id=t.tid");
$row = $this->ipsclass->DB->fetch_row($query13);
$data['topics_since'] = $row[tcnt];
$data['posts_since'] = $row[pcnt];And I'm sure that the problem will not appear again..
#6
Posted 22 February 2007 - 12:38 PM
$query13 = $this->ipsclass->DB->query("SELECT COUNT(DISTINCT(t.tid)) as tcnt,
COUNT(DISTINCT(p.pid)) as pcnt FROM ibf_posts p, ibf_topics t WHERE
p.post_date > ".$today." AND p.topic_id=t.tid");When I changed the line to this, it worked fine. Hope this helps someone.$query13 = $this->ipsclass->DB->query("SELECT COUNT(DISTINCT(t.tid)) as tcnt,
COUNT(DISTINCT(p.pid)) as pcnt FROM ibf_posts p, ibf_topics t WHERE
p.post_date > '$today' AND p.topic_id=t.tid");All I did, was change the part p.post_date > ".$today." AND to p.post_date > '$today' AND
I seems the driver didn't like to closed from the quote then re opened. It shoudn't have caused the problem, but I tried it and it worked. I was just installing 2.1.7 for a friend and he wanted your portal system. I was in the process of removing the code when I saw that and thought I would see if editing it would work. I hope this helps someone.
#7
Posted 17 June 2008 - 02:37 AM
IPB WARNING [2] Invalid argument supplied for foreach() (Line: 156 of /sources/action_public/uportal.php)
And
mySQL query error: SELECT DISTINCT ibf_posts.author_id, ibf_topics.*,
ibf_forums.name, g.prefix as lprefix, g.suffix as lsuffix, me.mgroup,
gs.prefix as sprefix, gs.suffix as ssuffix, ms.mgroup
FROM ibf_topics, ibf_forums
LEFT JOIN ibf_posts ON (ibf_topics.tid = ibf_posts.topic_id AND
ibf_posts.author_id = '9')
LEFT join ibf_members me on (me.id = ibf_topics.last_poster_id)
LEFT join ibf_groups g on (g.g_id = me.mgroup)
LEFT join ibf_members ms on (ms.id = ibf_topics.starter_id)
LEFT join ibf_groups gs on (gs.g_id = ms.mgroup)
WHERE ibf_topics.forum_id = ibf_forums.id AND
ibf_topics.last_post > 1213665843
ORDER BY last_post DESC
SQL error: Unknown column 'ibf_topics.tid' in 'on clause'
SQL error code:
Date: Tuesday 17th 2008f June 2008 04:31:28 PM
Seems like another user had the same problem unsolved here....
http://www.unreal-solutions.org/index.php?...mp;hl=foreach()
Anyone found solution to this?
Thanks.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











