1
coops
Adding SQL to theme.html
  • 2005/7/24 11:42

  • coops

  • Just popping in

  • Posts: 82

  • Since: 2005/6/15


I want to query the database (for how many messages there are in my inbox), so I can add it to my theme.

I have the ipboard module so the answer on the FAQ doesnt work. Heres the query:

Quote:
//<<<--------------------------------------------
//-+- IPB messages new -- Koudadnshi
//<<<--------------------------------------------
if ($isbb)
{
list($new_messages) = $xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("ipb_messages")." WHERE recipient_id = '".$xoopsUser->getVar("uid")."' AND vid='in' AND read_state='0' "));
$block['new_messages'] = $new_messages;
}
else
$block['new_messages'] = $pm_handler->getCount($criteria);
//>>>--------------------------------------------


Now, how do I get that query ...

($xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("ipb_messages")." WHERE recipient_id = '".$xoopsUser->getVar("uid")."' AND vid='in' AND read_state='0' "));)

...to display the count of messages
eg Inbox (1)

??

2
coops
Re: Adding SQL to theme.html
  • 2005/7/25 4:10

  • coops

  • Just popping in

  • Posts: 82

  • Since: 2005/6/15


anyone?

did i post in the wrong forum?

Login

Who's Online

473 user(s) are online (56 user(s) are browsing Support Forums)


Members: 0


Guests: 473


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits