vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   VB3-Style admin-login (https://vborg.vbsupport.ru/showthread.php?t=46137)

rylin 11-26-2002 10:00 PM

VB3-Style admin-login
 
Right..
Just for fun (well, for the looks, really ;)) I took a few minutes to re-write the vb2.2.8 admin-login screen to look like the vb3 preview one.

Note: the code does use images that are copyrighted to jelsoft, so you're *supposed* to use your own, unless jelsoft allow us all to use them :p

Step 1, download the hack (attachment to this post)
Step 2, unzip all the files to your admin/ directory
Step 3, open up global.php (in the admin dir!)
Step 4:
Look for
PHP Code:

if ($bbuserinfo[userid]==and $checkpwd) { 

Delete *everything* below it, and paste:
PHP Code:

  include 'vb3login.php';
  
cpfooter();
  exit;
// end of if ($bbuserinfo[userid]==0 and $checkpwd)
  
?> 

anyway.. have fun, and enjoy ;)

11/28: Made the username (if it was ever set) appear in the username box automatically.

CeleronXL 11-26-2002 11:11 PM

Thanks!

Btw, that URL should be http://www.vbulletin.com/forum/modcp , not just mod.]

Posting the HTML in the files creates a parse error. O_o

Erwin 11-26-2002 11:18 PM

Hehe...

I don't the images should be a problem, since we are using it with a licensed vB.

Post a demo or screenshot for the ones who would surely ask for one...

Erwin 11-26-2002 11:21 PM

To avoid parse errors when you place HTML in PHP files, make sure you put a \ slash behind every " like this:

<img src\"http://test.com/test.gif\">

Edit: Actually, this doesn't apply to global.php I've just had a look at it, as the HTML is not within php tags.

CeleronXL 11-26-2002 11:31 PM

The parse error is on the line that contains naught but <html>

Erwin 11-26-2002 11:49 PM

Cool... it worked for me. :) Your instructions need to be a bit clearer - what to copy, what to replace etc. But it looks nice. :)

It works for both the Admin and Mod CP logins - for the mod one, just edit the mod global.php in the same way. :)

CeleronXL 11-26-2002 11:51 PM

Eh? Can you post exactly what you have from
PHP Code:

if ($bbuserinfo[userid]==and $checkpwd) { 

and down?

I was adding "echo "";" tags all the way down and it was working until I got to


echo "<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"submitrow\">";

Whereupon it still gives a parse error.

Erwin 11-26-2002 11:59 PM

No, no need to put echo - just cut and paste the HTML code UNCHANGED - no need echo, no need backslash - that bit is not within PHP as the PHP tags have ended. :)

CeleronXL 11-27-2002 12:03 AM

So what does yours read then? Even without the echo's, it does not work. Without the backslashes, it does not work. O_o
Mine reads like this:

PHP Code:

if ($bbuserinfo[userid]==0 and $checkpwd) {
echo "<html>";
echo "<head>";
echo "<link rel=\"stylesheet\" href=\"../controlpanel.css\" />";
echo "<title>vBulletin Administrator Control Panel</title>";
echo "</head>";
echo "<body onload=\"document.forms.submitrow.loginusername.focus()\">";
echo "<p>&nbsp;</p><p>&nbsp;</p>";
echo "<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" width=\"450\" align=\"center\" class=\"tborder\"><tr><td>";
echo "<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td class=\"tcat\" align=\"center\"><b>Please Log In:</b></td>";
echo "</tr>";
echo "</table>";
//    <!-- logo and version -->
echo "<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"navbody\">";
echo "<tr valign=\"bottom\">";
echo "<td><img src=\"../images/cp/cp_logo.gif\" width=\"160\" height=\"66\" alt=\"cplogo\" title=\"vBulletin &copy;2000-2002 Jelsoft Enterprises Ltd.\" border=\"0\" /></td>";
echo "<td><b><a href=\"../index.php\">Forum Sector</a></b><br />vBulletin v<?php echo $template version ?><br />&nbsp;</td>";
echo "</tr>";
echo "</table>"
//    <!-- /logo and version -->
echo "<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"submitrow\">";
echo "<tr>";
echo "<td width=\"100\" align=\"right\" class=\"button\"><u>U</u>sername</td>";
echo "<td><input type=\"text\" name=\"loginusername\" value=\"StarCraftSector\" size=\"40\" accesskey=\"u\" /></td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"right\" class=\"button\"><u>P</u>assword</td>";
echo "<td><input type=\"password\" name=\"loginpassword\" size=\"40\" accesskey=\"p\" /></td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan=\"2\" align=\"center\">";
echo "<input type=\"submit\" value=\"  Log In  \" accesskey=\"s\" />";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td></tr></table>";
echo "</form>";
    
echo "</body>";
echo "</html>";
<p align="center"><font size="1">vBulletin v<?php echo $templateversion ?> Administrator Control Panel</font></p>
<?php
  cpfooter
();
  exit;
}

?>

EDIT: Aight, you're not browsing this thread anymore, I take it you did not want to post your code.... O_o

LOD-squa 11-27-2002 12:36 AM

can someone post a way I can understand it better I'm confused and i wanna get this.

Linux 11-27-2002 12:42 AM

I Never seen the VB3-Style admin-login, could you please post a screenshot ?

CeleronXL 11-27-2002 01:01 AM

You can see the vB3 style mod login here: http://www.vbulletin.com/forum/modcp

The admin login looks the same.

Erwin 11-27-2002 01:17 AM

Just a few tips - you need to manually add the table background image to the HTML code to make it look exactly like the vB3 mod cp login.

Also, you need to remove the username from the login text input box.

Ensure you remove all the vB3 <form> and hidden input variables, and replace it with the vB2 ones as well as the PHP code needed in the middle of the HTML code - his instructions don't make it clear.

As the hack author has stated he will support this hack, I will leave the rest to him. :)

countryboy713 11-27-2002 05:15 AM

Quote:

Step 1, download the vb3 control-panel stylesheet, name it to eg admin/vb3cp.css
where do i download this?

Erwin 11-27-2002 05:34 AM

Another tip - in vB3cp.css, get rid of the references to the background gifs - they don't exist on your server and will slow down the loading of your login page.

rylin 11-27-2002 09:29 AM

Right,
after
PHP Code:

if ($bbuserinfo[userid]==and $checkpwd) { 

it should look like

PHP Code:

//  cpheader("<title>Forums admin</title>");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
        <meta content="text/html; charset=windows-1252" http-equiv="Content-Type" />
        <meta http-equiv="MSThemeCompatible" content="yes" />
        <link rel="stylesheet" href="cp2.css" />
        <title>vBulletin Moderators' Control Panel</title>      <script language="Javascript">

        // attempt to rename the frameset title
        if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown' && typeof(parent.document.title) == 'str$
        {
                if (document.title != '')
                {
                        parent.document.title = document.title;
                }
                else
                {
                        parent.document.title = "vBulletin Community Forum Control Panel";
                }
        }
        </script>
</head>
<body onload="document.forms.submitrow.loginusername.focus()">
        <p>&nbsp;</p><p>&nbsp;</p>
                
<br><br><br>
<form method="post" id="submitrow">
<input type="hidden" name="s" value="<?php echo $session[sessionhash]; ?>">
<input type="hidden" name="action" value="login">
<input type="hidden" name="redirect" value="<?php
                        
if ($HTTP_SERVER_VARS['REQUEST_URI']!="") {
  
$url $HTTP_SERVER_VARS['REQUEST_URI'];
} else {
  if (
$PATH_INFO) {
    
$url $PATH_INFO;
  } else {
    
$url $PHP_SELF;
  }

  if (
$QUERY_STRING) {
    
$url .= "?$QUERY_STRING";
  }
}                       

  
$url=ereg_replace("sessionhash=[a-z0-9]{32}&","",$url);
  
$url=ereg_replace("\\?sessionhash=[a-z0-9]{32}","",$url);
  
$url=ereg_replace("s=[a-z0-9]{32}&","",$url);
  
$url=ereg_replace("\\?s=[a-z0-9]{32}","",$url);
echo 
htmlspecialchars($url);
?>">
        <table cellpadding="1" cellspacing="0" border="0" width="450" align="center" class="tborder"><tr><td>
        <table cellpadding="4" cellspacing="0" border="0" width="100%">
        <tr>
        <td class="tcat" align="center"><b>Please Log In:</b></td>
</tr>
        </table>        
        <!-- logo and version -->
        <table cellpadding="4" cellspacing="0" border="0" width="100%" class="navbody">
        <tr valign="bottom">
                <td><img src="cp_newlogo.gif" width="160" height="66" alt="cplogo" title="vBulletin &copy;2000-2002 Jelsoft Enterpr$
                <td><b><a href="../index.php">MGOForum</a></b><br />vBulletin Administrators' Control Panel<br />&nbsp;</td>
        </tr>
        </table>
        <!-- /logo and version -->
        <table cellpadding="4" cellspacing="0" border="0" width="100%" class="submitrow">
        <tr>
                <td width="100" align="right" class="button"><u>U</u>sername</td>
                <td><input type="text" name="loginusername" value="" size="40" accesskey="u" /></td>
        </tr>           
        <tr>
                <td align="right" class="button"><u>P</u>assword</td>
                <td><input type="password" name="loginpassword" size="40" accesskey="p" /></td>
        </tr>
        <tr>
                <td colspan="2" align="center">
                        <input type="submit" value="  Log In  " accesskey="s" />
                </td>
        </tr>
        </table>
        </td></tr></table>
</form>
<p align="center"><font size="1">vBulletin v<?php echo $templateversion ?> Administrator Control Panel</font></p>
<?php
  cpfooter
();
  exit;
}

?>

(Note, this was to the actual *end* of the file, in other words, the last } bracket is the end of the
PHP Code:

if ($bbuserinfo[userid]==and $checkpwd) { 

check)

rylin 11-27-2002 09:43 AM

Now for the urls to stylesheets etc :p
Stylesheet: http://vbulletin.com/forum/clientscr...ntrolpanel.css
save it as admin/cp2.css
vBulletin logo: http://www.vbulletin.com/forum/images/cp/cp_logo.gif
save it as admin/cp_newlogo.gif
background image 1: http://vbulletin.com/forum/images/cp...lheader_bg.gif
save it as admin/cp_colheader_bg.gif
background image 2: http://vbulletin.com/forum/images/cp/cp_navbody_bg.gif
save it as admin/cp_navbody_bg.gif
background image 3:
http://vbulletin.com/forum/images/cp/cp_tblhead_bg.gif
save it as admin/cp_tblhead_bg.gif

now, the whole thing should look something like the attachment:

camikazi2k 11-27-2002 11:14 AM

ok ok ok
THIS IS WAY TOO CONFUSING
u should put everything in one file and release the hack
thanks

rylin 11-27-2002 11:17 AM

we're not allowed to release whole files though? (eg. vbulletin files) :/

Xenon 11-27-2002 01:16 PM

you can release files you've written yourself, or the instructions here can be put into a file, but you are not allowed to post full vb-files, no matter if you have changed some code in it or not..

rylin 11-27-2002 01:38 PM

Quote:

Originally posted by Xenon
you can release files you've written yourself, or the instructions here can be put into a file, but you are not allowed to post full vb-files, no matter if you have changed some code in it or not..
Hmm.. right, nice version coming up shortly :D

Floris 11-27-2002 01:51 PM

Was this rewritten at all or just a save as ... file.htm

rylin 11-27-2002 01:54 PM

Quote:

Originally posted by xiphoid
Was this rewritten at all or just a save as ... file.htm
the login page was ripped straight off, path-names to images & css changed, form-fields changed.
global.php was hacked to simply include() the page

wolfe 11-27-2002 01:59 PM

nice one for attaching that zip :D

The Ghost 11-27-2002 03:47 PM

looks great! thx

*installs*

SZ|TalonKarrde 11-27-2002 04:44 PM

heh...my co-admin messed up and installed it wrong...only he could log in for admin, wouldn't let me in. Uninstalled it, for now.

rylin 11-27-2002 04:47 PM

Quote:

Originally posted by SZ|TalonKarrde
heh...my co-admin messed up and installed it wrong...only he could log in for admin, wouldn't let me in. Uninstalled it, for now.
did he use the zip file, or did he use the original instructions?
might wanna try the zip

Dean C 11-27-2002 05:21 PM

hehe this is cool

Thanks for sharing it with the community :)

Regards

- miSt

countryboy713 11-27-2002 08:50 PM

can someone explain better how to do this for the mod CP also? i cant find
Code:

if ($bbuserinfo[userid]==0 and $checkpwd) {
in the global.php in the mod folder

rylin 11-27-2002 08:55 PM

Quote:

Originally posted by countryboy713
can someone explain better how to do this for the mod CP also? i cant find
Code:

if ($bbuserinfo[userid]==0 and $checkpwd) {
in the global.php in the mod folder

after a quick look, i believe it should be enough if you follow the above instructions but look for
PHP Code:

if (!ismoderator() or !$permissions['canview']) { 

instead

also, a few rows after this, you should see
PHP Code:

<?php
  cpfooter
();
  exit;
}

you should *not* do anything past that ;)
I'll verify it by fixing on my site.. gimme a few minutes :)

rylin 11-27-2002 08:59 PM

yep, that did it for me.
In other words, you should have the permission-check section look like
PHP Code:

if (!ismoderator() or !$permissions['canview']) { 
  include 
"vb3login.php";
  
cpfooter();
  exit;
}
 
// ###################### Start makemodchoosercode ####################### 

Also, note that you'll have to edit the vb3login.php page if you want to use the same stylesheet & pics for mod & admin panel (basically create absolute paths for them)

Velocd 11-27-2002 09:10 PM

A complete waste of my time just to enhance the aesthetics of the admin panel to appear like vBulletin 3. Which is why I will probably install it. :p

Good job maestro.

[high]* Velocd clicks install.[/high]

Link14716 11-27-2002 09:11 PM

[high]* Link14716 installs onto Admin and Mod CP's.
[/high]

And yea, I found that out about the mod pannel too, okidoki, I was actually about to post it, but you beat me to it :)

CeleronXL 11-27-2002 09:19 PM

By the way, it finally worked for me. Thanks okidoki!

/me installed it to the admin and mod panels.

Xenon 11-27-2002 09:28 PM

hmm, you have to say, this hack has no use if you want to hear the truth...

but it's a very nice feeling to see that cp-loginscreen ;)
*installs*

rylin 11-27-2002 09:32 PM

Quote:

Originally posted by Xenon
hmm, you have to say, this hack has no use if you want to hear the truth...
I can't agree more :p
But hey, it's a two minute job that makes you waste^H^H^H^H^Hspend 5 minutes of your time staring at the pretty screen instead of just logging in :D

Mike Gaidin 11-27-2002 11:29 PM

I wouldn't mind installing this, but it's too much of a pain to follow this thread. Could someone release a good text file of how this should be installed? Thanks.

Erwin 11-28-2002 12:24 AM

Quote:

Originally posted by J-OST
I wouldn't mind installing this, but it's too much of a pain to follow this thread. Could someone release a good text file of how this should be installed? Thanks.
There is a ZIP file in the first post. :)

Sebastian 11-28-2002 06:11 AM

how do I get it to automatically put my username in the username field like: http://www.vbulletin.com/forum/modcp when I go there is puts my vbulletin.com username in the box and puts the cursor on the password box.

NTLDR 11-28-2002 09:06 AM

Quote:

Originally posted by Sebastian
how do I get it to automatically put my username in the username field like: http://www.vbulletin.com/forum/modcp when I go there is puts my vbulletin.com username in the box and puts the cursor on the password box.
I will post my version later on if no one has done this. Mine works just like the vB3 one does, adding in your username automatically if its set etc


All times are GMT. The time now is 04:50 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.01623 seconds
  • Memory Usage 1,865KB
  • 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_code_printable
  • (10)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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