The Arcive of vBulletin Modifications Site. |
|
|
Verify if user is logged in for non-vb pages, using Jquery
1 - vbconnect.php PHP Code:
Create this file using the code from this page 3- jquery_vbulletin.js Change XXX with any another prefix wich do you want Code:
$(document).ready(function ()
{
$.ajax({
url:'vbconnect.php',
type:'POST',
data:'&ajax=1',
cache:false,
async:false,
dataType:'json',
success:function(result){
$.cookie('XXXuserid', result['userid'], { expires: 7, path: '/' });
$.cookie('XXXusername', result['username'], { expires: 7, path: '/' });
$.cookie('XXXuserpost', result['userpost'], { expires: 7, path: '/' });},
error:function(){
$.cookie('XXXuserid', '', { expires: 7, path: '/' });
$.cookie('XXXusername', '', { expires: 7, path: '/' });
$.cookie('XXXuserpost', '', { expires: 7, path: '/' });}
})
});
Change XXX with your prefix using in jquery_vbulletin.js file PHP Code:
Code:
<script src="http://code.jquery.com/jquery-latest.js"></script> <script src="your/path/to/javascript/directory/jquery_cookie.js"></script> <script src="your/path/to/javascript/directory/jquery_vbulletin.js"></script> <?php echo $output; ?> |
|
#2
|
||||
|
||||
|
interesting...
thanks for sharing :up: |
|
#3
|
||||
|
||||
|
nice coding, but what versions are compatible?
|
|
#4
|
||||
|
||||
|
@Princeton: with pleasure
@abdobasha2004: vb3 - vb4 --> for vb5 I don't have this version but I think it is the same. You can do a simple test only with vbconnect.php (with little modification) PHP Code:
|
|
#5
|
|||
|
|||
|
Quote:
Hello, If you could please explain about part 4? I dont really understand if I should create a php file or where its located if there is one! Thank you very much in advance |
|
#6
|
||||
|
||||
|
Quote:
// The guest is logged in } else { // The guest is not logged in .Me |
![]() |
|
|