04-26-2011, 08:19 PM | #1 |
Member
Join Date: Feb 2011
Posts: 31
Rep Power: 0 |
An overview of user statistics
In Wordpress home page I've insert a button that log in /forum/login.php
I wanted to ask if possible also include an overview of user statistics such as: recent messages last visit etc. This is the code: Code:
<?php global $vbulletin; if ($vbulletin->userinfo['userid']!=0) { $username= $vbulletin->userinfo['username']; echo "Welcomeback, <b>"; echo $username; echo "!</b>"; } else { echo"<form action=\"/forum/login.php\" method=post onsubmit=md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)> <script type=text/javascript src=\"".$forumpath."/clientscript/vbulletin_md5.js\"></script> User:<input name=vb_login_username type=text id=navbar_username onfocus=\"if (this.value == '$vbphrase[username]') this.value = '';\" size=10 /> Password:<input id=navbar_username name=vb_login_password type=password size=10 /> <label for=cb_cookieuser_navbar><input name=cookieuser type=checkbox id=cb_cookieuser_navbar value=1 checked=checked />Ricordami</label> <input type=submit title=$vbphrase[enter_username_to_login_or_register] value=\"Log In\" /> <input type=hidden name=s value=$session[sessionhash] /> <input type=hidden name=do value=login /> <input type=hidden name=vb_login_md5password /> <input type=hidden name=vb_login_md5password_utf /> </form>"; } ?> And I need to put something like that Code:
// Display last visit time and date echo "Last visit: $pmbox[lastvisitdate] alle $pmbox[lastvisittime]"; // Display PM Details and generate link to PM box echo "<a href=\"".$forumpath."private.php?$session[sessionurl] \">Private message:</a> $vbphrase[unread_x_nav_compiled] $vbphrase[total_x_nav_compiled]"; Thanks |
Reply With Quote |
04-26-2011, 08:21 PM | #2 |
Administrator
Join Date: Jul 2010
Posts: 402
Rep Power: 10 |
I am not sure what the question is here?
|
Reply With Quote |
04-27-2011, 03:29 AM | #3 |
Member
Join Date: Feb 2011
Posts: 31
Rep Power: 0 |
I forgot the question ...eheh
I would like that this code show me the last visit and PM, but it isn't work. Can you hel me? Code:
// Display last visit time and date echo "Last visit: $pmbox[lastvisitdate] alle $pmbox[lastvisittime]"; // Display PM Details and generate link to PM box echo "<a href=\"".$forumpath."private.php?$session[sessionurl] \">Private message:</a> $vbphrase[unread_x_nav_compiled] $vbphrase[total_x_nav_compiled]"; |
Reply With Quote |
04-27-2011, 09:39 AM | #4 |
Administrator
Join Date: Jul 2010
Posts: 402
Rep Power: 10 |
Hmm did you try this?
Code:
global $vb; echo "Last visit: " . $vb->userinfo[lastvisitdate] . " alle " . $vb->userinfo[lastvisittime]; |
Reply With Quote |
04-27-2011, 07:26 PM | #5 |
Member
Join Date: Feb 2011
Posts: 31
Rep Power: 0 |
Thanks work!
Can you help me also to show unread private messages and New Posts? Last edited by dlx; 04-27-2011 at 07:29 PM. |
Reply With Quote |
04-27-2011, 08:07 PM | #6 |
Administrator
Join Date: Jul 2010
Posts: 402
Rep Power: 10 |
I do not know how you would do new posts, but I believe pmunread is the field for pms:
Code:
echo $vb->userinfo['pmunread']; |
Reply With Quote |
04-28-2011, 04:12 AM | #7 |
Member
Join Date: Feb 2011
Posts: 31
Rep Power: 0 |
New post:
|
Reply With Quote |
05-04-2011, 12:20 PM | #8 |
Member
Join Date: Feb 2011
Posts: 31
Rep Power: 0 |
Hi Jeff did you know vbulletin code to show New Post?
|
Reply With Quote |
05-04-2011, 12:30 PM | #9 |
Administrator
Join Date: Jul 2010
Posts: 402
Rep Power: 10 |
|
Reply With Quote |
05-05-2011, 03:39 AM | #10 |
Member
Join Date: Feb 2011
Posts: 31
Rep Power: 0 |
I wanted say something like:
Code:
// finds number of new posts $newposts = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post AS post " . iif($vbulletin->options['threadmarking'], 'LEFT JOIN ' . TABLE_PREFIX . 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' . $vbulletin->userinfo['userid'] . ')') . " WHERE dateline >= " . $vbulletin->userinfo['lastvisit'] . iif($vbulletin->options['threadmarking'], ' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)')); $newposts = vb_number_format($newposts['count']); echo"<a href=\"".$forumpath."search.php?$session[sessionurl]do=getnew\">$vbphrase[new_posts]</a>: $newposts<br />"; // end of number of new posts stuff |
Reply With Quote |
05-05-2011, 07:55 AM | #11 | |
Administrator
Join Date: Jul 2010
Posts: 402
Rep Power: 10 |
Quote:
|
|
Reply With Quote |
05-11-2011, 03:48 AM | #12 |
Member
Join Date: Feb 2011
Posts: 31
Rep Power: 0 |
Thanks anyway
|
Reply With Quote |
Reply |
Tags |
vbulletin wordpress bridge |
|
|