vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Need private messages bit 4 the page outside vbulletin (https://vborg.vbsupport.ru/showthread.php?t=19442)

Luke 06-06-2001 02:36 AM

I need a vbulletin pm hack .. that will enable me to show users on my main page of the website that they have new private messages or not.. I wrote my own code but for some reason it doesnt work.. can someone take a look at it at least.

I searched all over for it but couldnt find it.

Thanks

Quote:

<?
echo $bbuserid;

//PM HACK
if (isset($bbuserid)==0 or $bbuserid==0 or $bbuserid=="") {


echo("<font size=1 face=verdana,arial><b>Private Messages:</b><br><a href=forum/private.php>Login to read your private messages!</a></font><br><br>");

} else {

require("/www/site/forum/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassw ord) or die("Can't open connection to MySQL");
mysql_select_db($dbname) or die("Can't select database");

$username = $bbuserinfo[username];
$pmcounta = "SELECT COUNT(privatemessageid) AS privatemessageid FROM privatemessage WHERE touserid='$bbuserid'";
$pmcount = $pmcounta[privatemessageid];
$newpmcounta = 'SELECT COUNT(privatemessageid) AS privatemessageid FROM privatemessage WHERE touserid=$bbuserid AND UNIX_TIMESTAMP(dateline)>$bblastvisit';
$newpmcount = $newpmcounta[privatemessageid];

echo $pmcount.$row["privatemessageid"];
echo $pmcount;


if ($newpmcount == 0) {
$lightbulb = 'http://www.site.com/newmx6/board/images/off.gif';
} else {
$lightbulb = 'http://www.site.com/newmx6/board/images/on.gif';
}


if ($lastsent = 'SELECT privatemessageid,fromuserid,UNIX_TIMESTAMP(datetim e) AS dateline FROM privatemessage WHERE touserid=$bbuserid ORDER BY privatemessageid DESC') {
$lastid = trim($lastsent[fromuserid]);
$lastdate=date($dateformat,$lastsent[dateline]+(($timeoffset+$bbtimezoneoffset)*3600));
$lasttime=date($timeformat,$lastsent[dateline]+(($timeoffset+$bbtimezoneoffset)*3600));
$lastsentuser = 'SELECT username FROM user WHERE userid=$lastid';
$lastuser = htmlspecialchars($lastsentuser[username]);
$lastuserlink = "<a href=\"forum/private.php?action=show&msgid=$lastsent[msgid]&password=$bbpassword\">$lastuser</a>";
} else {
$lastuserlink = "<i>No one</i>";
}


echo mysql_error();


echo("<font size=1 face=verdana,arial><b>Private Messages:</b><br><a href=forum/private.php>Read them!</a><BR>You have $pmcount private message(s) ($newpmcount new) - Latest Message from $lastuserlink</font>");
}

//END PM HACK

?>


All times are GMT. The time now is 09:25 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01039 seconds
  • Memory Usage 1,712KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete