You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 94 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - sql call to retrieve PM's in IB [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
dwellersire
Nuke Cadet
Nuke Cadet


Joined: May 05, 2003
Posts: 5


PostPosted: Fri May 09, 2003 3:03 pm Reply with quoteBack to top

I'm using the pd2003 pro theme which displays how many new Private Messages you have in the header after you login. However, I am using IB forums now, and would like to set it up to display how many IB new messages I have. I know there's a way but I don't know php&sql enough to do it.

Here's the code for a nuke-block that displays what I want:
Code:

global $cookie, $db;
$pmname = $cookie[1];

// Edit if required
$forumdir = "module/Forum"; // Path from phpNuke root directory to forums directory.
$ibf = "ibf_";         // Invision tables prefix
$text1 ="You have";
$text2 ="new";
$text3 ="private message(s)";

$sql_pm = $db->sql_query("SELECT * FROM ".$ibf."_members WHERE name='$pmname'") or print sql_error();
$pm = sql_fetch_array($sql_pm);
$content = "<b>$pmname</b>,<br><center>$text1 <b>$pm[new_msg]</b> $text2<br><a href='$forumdir/index.php?s=&act=Msg&CODE=01'>$text3</a>.";


And here is the code for my current Private Messages in theme.php:
Code:

   if (is_active("Private_Messages")) {
      $sql = "SELECT user_id FROM ".$user_prefix."_users WHERE username='$uname'";
      $result = $db->sql_query($sql);
      $row = $db->sql_fetchrow($result);
      $uid = $row[user_id];
      $numrow = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM ".$prefix."_bbprivmsgs WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='1' OR privmsgs_type='5' OR privmsgs_type='0')"));
      $newpm = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_bbprivmsgs WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='5' OR privmsgs_type='1')"));
      
      if ($newpm > 0) {
      echo "<img border=\"0\" src=\"themes/pd2003/images/pmail.gif\" align=\"absmiddle\" width=\"21\" height=\"17\">";
      }
      echo "<b><font color=\"#FFFFFF\">"._YOUHAVE." <a href=\"modules/Forum/index.php?s=3fa89bfa4cd223f204c362d6eca08b5f&act=Msg&CODE=01\"><b><font color=\"#b3dbff\">$newpm</b> "._PRIVATEMSG."</a>&&&&&&&&&&&&<a href=\"modules.php?name=Your_Account&op=logout\"><font color=\"#FFFFFF\"><b>[Logout]</a></b>";
      }
Find all posts by dwellersireView user's profileSend private messageVisit poster's website
dwellersire
Nuke Cadet
Nuke Cadet


Joined: May 05, 2003
Posts: 5


PostPosted: Sun May 18, 2003 11:11 pm Reply with quoteBack to top

I fixed this by myself awhile ago. If anybody wants the code send me an email.
Find all posts by dwellersireView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.179 Seconds - 261 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::