vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Integration with vBulletin - Simple vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=228089)

Cface 01-09-2010 01:17 AM

If we hook this mod up can we extend it with features from deluxe (once it comes) without having to undo everything we installed from this mod?

ptiteuf 01-17-2010 04:55 PM

Hello everyone,

I have a little problem on my main page of my site and that with this change that you put up here and I want to have on my page.

Your code is only nickel but as I joined my current page that has a system of multi-language ca va plus.

Thank you for your help.

common.php
Code:

<?php
session_start();
header('Cache-control: private'); // IE 6 FIX

if(isSet($_GET['lang']))
{
$lang = $_GET['lang'];

// register the session and set the cookie
$_SESSION['lang'] = $lang;

setcookie("lang", $lang, time() + (3600 * 24 * 30));
}
else if(isSet($_SESSION['lang']))
{
$lang = $_SESSION['lang'];
}
else if(isSet($_COOKIE['lang']))
{
$lang = $_COOKIE['lang'];
}
else
{
$lang = 'fr';
}

switch ($lang) {
  case 'en':
  $lang_file = 'lang.en.php';
  break;

  case 'de':
  $lang_file = 'lang.de.php';
  break;

  case 'es':
  $lang_file = 'lang.es.php';
  break;

  case 'it':
  $lang_file = 'lang.it.php';
  break;

  case 'nl':
  $lang_file = 'lang.nl.php';
  break;

  case 'pt':
  $lang_file = 'lang.pt.php';
  break;

  case 'fr':
  $lang_file = 'lang.fr.php';
  break;

  default:
  $lang_file = 'lang.fr.php';

}

include_once 'languages/'.$lang_file;
?>

index.php

Code:

<?php
include_once 'common.php';
?>


ptiteuf 01-26-2010 07:11 PM

Hello,

I managed to set up your mod and now I telnet to see the game appear to say whether it has the message and what we are and what login into your mod.

Thank you in advance for your valuable help

dietpepsi 01-26-2010 08:30 PM

Do our webpages need to be named *.php? Virtually all of my non-vB pages are currently *.shtml as they pull dynamic data from another program. Will this mod work for me?

abdicar 01-31-2010 08:10 PM

It not works on 4.0.1 :(

Billspaintball 02-02-2010 02:51 AM

Quote:

Originally Posted by dietpepsi (Post 1967407)
Do our webpages need to be named *.php? Virtually all of my non-vB pages are currently *.shtml as they pull dynamic data from another program. Will this mod work for me?

Only works with php pages as it is.


Quote:

Originally Posted by abdicar (Post 1971605)
It not works on 4.0.1 :(

Well it does on my test site.
Unless you post some error messages its hard to guess whats happened.

Cface 02-05-2010 12:13 PM

I thought i'd throw out there that i'm getting the old "no such file or directory" error for
PHP Code:

<?php
$curdir 
getcwd ();
chdir('/forum');
require_once(
'/forum/global.php');
chdir ($curdir);
?>
// also tried
require_once('/global.php');

which does exist... I've also tried with full url
PHP Code:

Warningchdir() [function.chdir]: No such file or directory (errno 2in /home/wonderna/public_html/index.php  on line 3

Warning
: require_once(/global.php) [function.require-once]: failed to open streamNo such file or directory in /home/wonderna/public_html/index.php on line 4

Fatal error
: require_once() [function.require]: Failed opening required '/global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php'in /home/wonderna/public_html/index.php on line 4 

EDIT: nevermind got it fixed, i'm such a dumbass :P

Cface 02-05-2010 01:09 PM

You could add this code in the login_inc.php to have it show avatars:
PHP Code:

if ($vbulletin->userinfo['avatarid']) 

    
// using a predefined avatar 
    
$avatar $db->query_first("SELECT avatarpath FROM " TABLE_PREFIX "avatar WHERE avatarid = " $vbulletin->userinfo[avatarid] . ""); 
    
$avatarid $avatar['avatarid']; 
    
$navbaravatar "<img src=\"" $vbulletin->options[bburl] . "/$avatar[avatarpath]\" border=\"0\" />"
    echo 
$navbaravatar;
        echo 
"<br>";

else 

    
// not using a predefined avatar, check for custom 
    
if ($avatar $db->query_first("SELECT dateline, userid FROM " TABLE_PREFIX "customavatar WHERE userid = " $vbulletin->userinfo[userid] . "")) 
    { 
        
// using a custom avatar 
        
$navbaravatarurl = ($vbulletin->options['usefileavatar']) ? "" $vbulletin->options[avatarurl] . "/avatar$avatar[userid]_" $vbulletin->userinfo[avatarrevision] . ".gif" "" $vbulletin->options[bburl] . "/image.php?u=" $vbulletin->userinfo['userid'] . "&amp;dateline=" $avatar['dateline'] . "";
        
$navbaravatar "<img src=\"$navbaravatarurl\"  border=\"0\" />";
        echo 
$navbaravatar;
        echo 
"<br>";
    } 
    else
    { 
        
// no avatar specified 
        
$nouseavatarchecked HTML_CHECKED
        
$avatarchecked[0] = ''
        
$navbaravatar "<img src=\"" $vbulletin->options[bburl] . "/$stylevar[imgdir_misc]/noavatar.gif\" border=\"0\" />"// "<span class=\"smallfont\">No Avatar<br/ >Specified</span>";
        
echo $navbaravatar;
        echo 
"<br>";
    } 



dennisuello 02-06-2010 09:33 PM

How do I use it for a site on a different domain (and server) than my vB installation?

Prism27 02-24-2010 11:51 AM

Hey,

Having an issue with this mod, normally I can fix them myself being a developer. Cant seem to figure this one out tho!

I'm getting this error: Undefined variable: specialtemplates on line 20 of global.php.

The forum works fine stand-alone, it's just when I include this into my own system. I've already done all the normal error checking and directory checking, it's all fine.

Anyone recommend something I've missed?


All times are GMT. The time now is 06:01 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.01314 seconds
  • Memory Usage 1,773KB
  • 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
  • (3)bbcode_php_printable
  • (2)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