Lampwrights Forum

Lampwrights Forum (http://www.lampwrights.com/index.php)
-   vBulletin Wordpress Bridge (http://www.lampwrights.com/forumdisplay.php?f=13)
-   -   An overview of user statistics (http://www.lampwrights.com/showthread.php?t=128)

dlx 04-26-2011 08:19 PM

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

Jeff 04-26-2011 08:21 PM

I am not sure what the question is here?

dlx 04-27-2011 03:29 AM

Quote:

Originally Posted by Jeff (Post 538)
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]";


Jeff 04-27-2011 09:39 AM

Hmm did you try this?

Code:

global $vb;

echo "Last visit: " . $vb->userinfo[lastvisitdate] . " alle " . $vb->userinfo[lastvisittime];


dlx 04-27-2011 07:26 PM

Thanks work!

Can you help me also to show unread private messages and New Posts?

Jeff 04-27-2011 08:07 PM

I do not know how you would do new posts, but I believe pmunread is the field for pms:

Code:

echo $vb->userinfo['pmunread'];

dlx 04-28-2011 04:12 AM

New post:

http://img96.imageshack.us/img96/641/newposto.jpg

dlx 05-04-2011 12:20 PM

Hi Jeff did you know vbulletin code to show New Post?

Jeff 05-04-2011 12:30 PM

Quote:

Originally Posted by dlx (Post 556)
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>";


dlx 05-05-2011 03:39 AM

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


Jeff 05-05-2011 07:55 AM

Quote:

Originally Posted by dlx (Post 558)
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. :o

dlx 05-11-2011 03:48 AM

Thanks anyway ;)


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

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