vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Integration with vBulletin - Deluxe vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=173698)

txsbmw 03-25-2008 02:48 PM

Anyone know how to make this code validate with:
http://validator.w3.org/
under XHTML 1.0 Transitional?

Almost all of my errors are coming from this one mod on my non vb pages.

davide101 04-01-2008 03:47 PM

I have two tips for anyone using this system.

First, it's to change the wording of the private messages phrase to anything you want. I have it set to say "Private messages, "1 new message", and "2 new messages". Here's the code for that (it goes in the include):

Code:

// Display PM Details and generate link to PM box
$pmremove = array("Unread ", "<strong>", "</strong>");
$unreadPM = str_replace($pmremove,"",$vbphrase[unread_x_nav_compiled]);
if ($unreadPM==1) {
        echo "<a id=\"unreadpm\" href=\"".$forumpath."private.php?$session[sessionurl] \">1 new message</a>";
} else {
        if ($unreadPM>1) {
        echo "<a id=\"unreadpm\" href=\"".$forumpath."private.php?$session[sessionurl] \">" . $unreadPM . " new messages";
  } else {
    echo "<a href=\"".$forumpath."private.php?$session[sessionurl] \">Private Messages</a>"; 
        }
}

Similarly, it's easy to show new posts with the proper grammatical syntax. In other words, have it say 'No new posts' '1 new post' or '2 new posts'.

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']);

if ($newposts < 1) {
echo "<a href=\"".$forumpath."search.php?$session[sessionurl]do=getnew\">No new posts</a><br />";}

if ($newposts == 1) {
echo "<a href=\"".$forumpath."search.php?$session[sessionurl]do=getnew\">$newposts new post</a><br />";}

if ($newposts > 1) {
echo "<a href=\"".$forumpath."search.php?$session[sessionurl]do=getnew\">$newposts new posts</a><br />";}

Hope this helps someone. It took me a little bit of tinkering to get it just right.

Triky 04-04-2008 12:03 PM

I can't get it work.

Quote:

Notice: Undefined index: HTTPS in c:\programmi\easyphp1-8\www\vbtest\includes\class_core.php on line 1643

Notice: Undefined index: HTTPS in c:\programmi\easyphp1-8\www\vbtest\includes\class_core.php on line 1643

Notice: Undefined index: HTTP_REFERER in c:\programmi\easyphp1-8\www\vbtest\includes\class_core.php on line 1670




Unable to add cookies, header already sent.
File: c:\programmi\easyphp1-8\www\vbtest\includes\class_core.php
Line: 1643




davide101 04-10-2008 08:30 PM

Does anyone know how to access the profile url? It's not located in $vbulletin->userinfo and I'm sure where else to look. I'd like to link the avatar there.

Billspaintball 04-27-2008 05:39 AM

Quote:

Originally Posted by davide101 (Post 1480120)
I have two tips for anyone using this system.

First, it's to change the wording of the private messages phrase to anything you want. I have it set to say "Private messages, "1 new message", and "2 new messages". Here's the code for that (it goes in the include):

Hope this helps someone. It took me a little bit of tinkering to get it just right.

Thanks,
I will update the next version with those improvements.

Billspaintball 04-27-2008 05:40 AM

Quote:

Originally Posted by Triky (Post 1482762)
I can't get it work.

See item 1 in the troubleshooting guide.
https://vborg.vbsupport.ru/showpost....23&postcount=2

Ryan Ashbrook 04-30-2008 04:51 AM

I got file based avatars to work.

In the login_inc.php file find:

PHP Code:

$file $forumpath "image.php?u=$userid"

And replace it with:

PHP Code:

    if ( $vbulletin->options['usefileavatar'] == )
    {
        if ( 
$vbulletin->userinfo['avatarid'] == )
        {
            
$file $forumpath $vbulletin->options['avatarurl'] . "/avatar" $userid "_" $vbulletin->userinfo['avatarrevision'] . ".gif";
        }
        else
        {
             
// Unfortunately, need to query the database for the avatar, will work on array caching all avatars later.
             
$query $db->query_first "SELECT * FROM " TABLE_PREFIX "avatar WHERE avatarid = " $vbulletin->userinfo['avatarid'] . " ; " );
             
$avatar $db->fetch_array $query );
            
$file $forumpath $avatar['avatarpath'];
        }
    }
    else
    {
        
$file $forumpath "image.php?u=" $userid;
    } 

Individual users may need to tweak the avatar paths based on their settings, however this will probably work for most.

Ryan Ashbrook 04-30-2008 04:55 AM

Quote:

Originally Posted by davide101 (Post 1487778)
Does anyone know how to access the profile url? It's not located in $vbulletin->userinfo and I'm sure where else to look. I'd like to link the avatar there.

Use this:

PHP Code:

echo ( "<a href=\"" $forumpath "member.php?u=" $vbulletin->userinfo['userid'] . "\">avatar image code here</a>" ); 


Javi_gray 04-30-2008 05:22 AM

What would I do if I wanted it to show friend requests in addition to private messaging?

Ryan Ashbrook 04-30-2008 05:54 AM

Quote:

Originally Posted by Javi_gray (Post 1503016)
What would I do if I wanted it to show friend requests in addition to private messaging?

Add this:

PHP Code:

echo ( "You currently have <a href=\"" $forumpath "profile.php?do=buddylist\">" vb_number_format $vbulletin->userinfo['friendreqcount'] ) . "</a> friendship requests." ); 



All times are GMT. The time now is 04: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.01148 seconds
  • Memory Usage 1,767KB
  • 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
  • (4)bbcode_php_printable
  • (5)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