vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Ultimate Forum Stats Integration for Non-VB Page (https://vborg.vbsupport.ru/showthread.php?t=63223)

Agent Richard 04-05-2004 08:58 PM

I personally wouldn't mind it - I removed a lot of the stuff also. :)

msimonds 04-05-2004 09:10 PM

This is what I have on my index.php in my root folder

PHP Code:

<?php
error_reporting
(7);
//////////////////////////////////////
// You need to EDIT your PATHS or this will not WORK properly
//////////////////////////////////////
//  STEP #1
chdir('/home/yourpath/to/forums');
//chdir('..');
//////////////////////////////////////////////////////////////////
//You WILL Need to Enter your full path to global.php, below is just a Generic Version
//////////////////////////////////////////////////////////////////
//require_once("/home/rantman/public_html/forums/global.php");
require_once('./global.php');
//////////////////////////////////////////////////////////////////
//
// NO NEED TO EDIT ANYTHING IN THIS AREA!  PLEASE SCROLL DOWN!!
//
//////////////////////////////////////////////////////////////////
//
?>

and where I wanted to place the login form, I have this


PHP Code:

<?
                            $getnewestusers=$DB_site->query_first("SELECT userid,username FROM user ORDER BY joindate DESC LIMIT 1");
                            $newusername=$getnewestusers['username'];
                            $newuserid=$getnewestusers['userid'];
                            $numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
                            $numbermembers=number_format($numbersmembers['users']);
                            if ($enablepms==1 and $permissions['canusepm'] and $bbuserinfo['receivepm']) {
                              $ignoreusers="";
                              if (trim($bbuserinfo['ignorelist'])!="") {
                                $ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' ', trim($bbuserinfo['ignorelist'])));
                              }
                              $allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
                              $newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
                              $unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");
                              if ($newpm['messages']==0) {
                                echo "";
                              } else {
                                echo "";
                              }
                            } else {
                              $pminfo='';
                            }
                            require_once('/home/rantman/public_html/forums/includes/functions_user.php');
                            $indexpage = true;
                            $bbuserinfo['avatarurl'] =
                            fetch_avatar_url($bbuserinfo['userid']);
                            $newposts = $DB_site->query_first("
                                SELECT COUNT(*) AS count
                                FROM ".TABLE_PREFIX."post
                                WHERE dateline > '".$bbuserinfo['lastvisit']."'
                            ");
                            $activethreads = $DB_site->query_first("
                                SELECT COUNT(*) AS count
                                FROM ".TABLE_PREFIX."thread
                                WHERE lastpost > '".$bbuserinfo['lastvisit']."'
                            ");
                            fetch_options_overrides($bbuserinfo);
                            $newdate = vbdate($vboptions['timeformat'], $bbuserinfo['lastvisit'], 0);
                            $pmbox = array();
$pmbox['lastvisitdate'] = vbdate($vboptions['dateformat'], $bbuserinfo['lastvisit'], 1);
$pmbox['lastvisittime'] = vbdate($vboptions['timeformat'], $bbuserinfo['lastvisit']);
$pmunread_html = iif($bbuserinfo['pmunread'], "<strong>$bbuserinfo[pmunread]</strong>", $bbuserinfo['pmunread']);
$vbphrase['unread_x_nav_compiled'] = construct_phrase($vbphrase['unread_x_nav'], $pmunread_html);
$vbphrase['total_x_nav_compiled'] = construct_phrase($vbphrase['total_x_nav'], $bbuserinfo['pmtotal']);
                            // ########## \\__> Added from Hwulex's Welcome Hack THANKS!!!<__// ########## \\
                            $getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'");
                            $getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
                            if ($bbuserinfo['userid']!=0) {
                              $username=$bbuserinfo['username'];
                            ?>
                            <?                                   
                            echo "
                        
                            <td width=\"33%\" class=\"RantMenuLight\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\" color=\"#EEEEEE\">Welcome Back, <strong><b>$username!</b></strong><br><phrase 1=\"$pmbox[lastvisitdate]\" 2=\"$pmbox[lastvisittime]\">Last visited: $pmbox[lastvisitdate] at $pmbox[lastvisittime]</phrase><br></font></td>
                            <td width=\"33%\" align=\"center\"><div align=\"center\">
                            <a class=\"RantMenuLight\" href=\"http://www.sportsrant.com/forums/login.php?do=logout\" target=\"_parent\"><b>Logout</b></a>&nbsp;|&nbsp;
                            <a class=\"RantMenuLight\" href=\"http://www.sportsrant.com/forums/search.php?&do=getnew\" target=\"_parent\"><b>View New Posts</b></a>&nbsp;|&nbsp;
                            <a class=\"RantMenuLight\" href=\"http://www.sportsrant.com/forums/usercp.php\" target=\"_parent\"><b>User CP</b></a>&nbsp;
                            </div></td>
                                                
                            <td width=\"33%\"><div align=\"right\">
                                  <font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\" color=\"#EEEEEE\"><b>$bbuserinfo[pmunread] new message(s)<br>
                                  <a class=\"RantMenuLight\" href=\"http://www.sportsrant.com/forums\" target=\"_parent\">Go To The Forums</a>
                            </div></td>
                                  <td width=\"1%\">&nbsp;
                                                
                            
                            ";
                            
                            } else {
                            echo "
                            
                            
                            <td>
                            
                              <form action=\"http://www.sportsrant.com/forums/login.php\" method=\"post\" onsubmit=\"md5hash(vb_login_password,vb_login_md5password)\">
                                               <script type=\"text/javascript\" src=\"http://www.sportsrant.com/forums/clientscript/vbulletin_md5.js\"></script>
                            
                                                <td width=\"0%\">&nbsp;</td>
                                                <td><table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
                                                    <tr> 
                                                      <td width=\"150\"><strong><font color=\"#EEEEEE\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">Nickname: 
                                                        </font></strong>
                                                      <input type=\"text\"  class=\"RantMenuTop\" name=\"vb_login_username\" id=\"navbar_username\" size=\"10\" accesskey=\"u\" tabindex=\"1\" value=\"User Name\" onfocus=\"if (this.value == 'User Name') this.value = '';\" /></td>
                                                      <td width=\"150\"><strong><font color=\"#EEEEEE\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">Password:</font></strong> 
                                                        <input type=\"password\" class=\"RantMenuTop\" name=\"vb_login_password\" size=\"10\" accesskey=\"p\" tabindex=\"2\" /></td>
                                                      <td><input type=\"image\" src=\"images/srlogin.gif\" value=\"Log in\" tabindex=\"4\" title=\"Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself.\" accesskey=\"s\" /></td>
                                                       <td class=\"RantMenuLight\"><label for=\"cb_cookieuser_navbar\"><input type=\"checkbox\" name=\"cookieuser\" value=\"1\" tabindex=\"3\" id=\"cb_cookieuser_navbar\" accesskey=\"c\" checked=\"checked\" />Remember?</label></td>
                                                       </tr>
                                                  </table></td>
                                    <input type=\"hidden\" name=\"s\" value=\"\" />
                                    <input type=\"hidden\" name=\"do\" value=\"login\" />
                                    <input type=\"hidden\" name=\"forceredirect\" value=\"1\" />            
                                    <input type=\"hidden\" name=\"vb_login_md5password\" />
                                    </form>
                                    </td>
                            <td width=\"60%\" class=\"RantMenuLight\"><div align=\"right\">Welcome Guest!<br>
                            <a class=\"RantMenuLight\" href=\"http://www.sportsrant.com/forums/register.php\" target=\"_parent\">Register</a>
                            </div></td>
                                                <td width=\"1%\">&nbsp;
                                            
                            ";
                            }                            
                            echo "
                            </td>
                            ";
                            ?>



I can make modifications to work to try and help anyone out that wants to get this to work and I also attahed a modified login.php that can go into your root folder, NOT THE FORUMS FOLDER


Mike

BlackxRam 04-07-2004 03:54 AM

yes one thing i forgot was the CHDIR thing. That was one of the things i added but my computer was overtaken by college freaks finishing up homeworks. Ill look over MSIMONDS stuff and finish it up in about an hour or so.

msimonds 04-07-2004 12:03 PM

hey if this works for anyone else then that is great. I fI Can help out in anyway just let me know. I have been trying to correct a different login for months becuase of a javescript error, but if it was not for your code, BlackxRam, then I would have never been able to get this to work. Great job man, really!!

BlackxRam 04-08-2004 02:30 AM

One problem I am upset about is the seemingly longer loading time. It was MUCH faster with VB2... Im not sure if its a VB3 issue but I would like to try to get it more streamlined.

BlackxRam 04-08-2004 05:18 AM

Updated the Zip File so everyone can understand it better.

Bro_Joey_Gowdy 04-08-2004 01:49 PM

/me clicks install

msimonds 04-08-2004 02:17 PM

Quote:

Originally Posted by BlackxRam
One problem I am upset about is the seemingly longer loading time. It was MUCH faster with VB2... Im not sure if its a VB3 issue but I would like to try to get it more streamlined.


I actually have to agree with you there. It does seem to load slower, I will also look into this and see if I can somehow speed it up

Billspaintball 04-10-2004 12:58 PM

Gave it a go.
All works fine except it wont display an avatar.
Just the little box with a red cross in it.

If I look at the html page produced I get

HTML Code:

<a href="http://www.billspaintball.com/vb3/profile.php?&do=editavatar"><img src="image.php?u=1&amp;dateline=1036410394" border="0"></a>
However, If I use the image part of that and enter it straight into the browser like
HTML Code:

http://www.billspaintball.com/vb3/image.php?u=1&amp;dateline=1036410394" border="0"
The image will display.

What wrong???


EDIT:

Doh!!
Stupid mistake on my part.
FIxed :)

Great script, using on my site. :D

egyptsons 04-12-2004 01:43 PM

greatttttttttt ;)


All times are GMT. The time now is 07:59 AM.

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.01136 seconds
  • Memory Usage 1,820KB
  • 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
  • (2)bbcode_html_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete