Lampwrights Forum > Other Stuff > vBulletin Wordpress Bridge
Register Community Today's Posts Search

Reply
 
Thread Tools
04-26-2011, 08:19 PM   #1
dlx
Member
 
Join Date: Feb 2011
Posts: 31
Rep Power: 0
dlx is getting browny points
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
dlx is offline   Reply With Quote

04-26-2011, 08:21 PM   #2
Jeff
Administrator
 
Jeff's Avatar
 
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
I am not sure what the question is here?
Jeff is offline   Reply With Quote
04-27-2011, 03:29 AM   #3
dlx
Member
 
Join Date: Feb 2011
Posts: 31
Rep Power: 0
dlx is getting browny points
Quote:
Originally Posted by Jeff View Post
I am not sure what the question is here?
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]";
dlx is offline   Reply With Quote
04-27-2011, 09:39 AM   #4
Jeff
Administrator
 
Jeff's Avatar
 
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
Hmm did you try this?

Code:
global $vb;

echo "Last visit: " . $vb->userinfo[lastvisitdate] . " alle " . $vb->userinfo[lastvisittime];
Jeff is offline   Reply With Quote
04-27-2011, 07:26 PM   #5
dlx
Member
 
Join Date: Feb 2011
Posts: 31
Rep Power: 0
dlx is getting browny points
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.
dlx is offline   Reply With Quote
04-27-2011, 08:07 PM   #6
Jeff
Administrator
 
Jeff's Avatar
 
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
I do not know how you would do new posts, but I believe pmunread is the field for pms:

Code:
echo $vb->userinfo['pmunread'];
Jeff is offline   Reply With Quote
04-28-2011, 04:12 AM   #7
dlx
Member
 
Join Date: Feb 2011
Posts: 31
Rep Power: 0
dlx is getting browny points
New post:

dlx is offline   Reply With Quote
05-04-2011, 12:20 PM   #8
dlx
Member
 
Join Date: Feb 2011
Posts: 31
Rep Power: 0
dlx is getting browny points
Hi Jeff did you know vbulletin code to show New Post?
dlx is offline   Reply With Quote
05-04-2011, 12:30 PM   #9
Jeff
Administrator
 
Jeff's Avatar
 
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
Quote:
Originally Posted by dlx View Post
Hi Jeff did you know vbulletin code to show New Post?

I guess something along the line of:

Code:
echo "<a href=\"" . $vb->options['bburl'] . "/search.php?do=getnew\">New Posts</a>";
Jeff is offline   Reply With Quote
05-05-2011, 03:39 AM   #10
dlx
Member
 
Join Date: Feb 2011
Posts: 31
Rep Power: 0
dlx is getting browny points
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
dlx is offline   Reply With Quote
05-05-2011, 07:55 AM   #11
Jeff
Administrator
 
Jeff's Avatar
 
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
Quote:
Originally Posted by dlx View Post
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
That really falls outside the scope of this project. I am pretty pressed for time as it is..... I am just trying to find a nice and polite way of saying: you are going to have to that on your own.
Jeff is offline   Reply With Quote
05-11-2011, 03:48 AM   #12
dlx
Member
 
Join Date: Feb 2011
Posts: 31
Rep Power: 0
dlx is getting browny points
Thanks anyway
dlx is offline   Reply With Quote
Reply

Tags

vbulletin wordpress bridge



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 07:06 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2024, vBulletin Solutions, Inc.