SmasherMaster
07-08-2004, 06:35 PM
I'm making a modification (http://www.vbulletin.org/forum/showthread.php?t=66969) And I need to insert some varibles into the cmps_index.php file without screwing it up with many errors. How can I do this correctly? Here's the phrases/varibles
// Require User Functions
require_once('./includes/functions_user.php');
// Top Row - Welcome Message
// Cell 1 - Avatar
$bbuserinfo['user_avatar']=fetch_avatar_url($bbuserinfo['userid']);
if($bbuserinfo['user_avatar']==""){
$bbuserinfo['user_avatar']="<img src='images/avatars/noavatar.gif' alt='Edit Your Avatar' border='0'>";
$bbuserinfo['user_avatar']="<a href='profile.php?{$session['sessionurl']}&do=editavatar'>{$bbuserinfo['user_avatar']}</a>";
$welcome_avatar=$bbuserinfo['user_avatar'];
} else {
$bbuserinfo['user_avatar']="<img src='{$bbuserinfo['user_avatar']}' alt='Edit Your Avatar' border='0'>";
$bbuserinfo['user_avatar']="<a href='profile.php?{$session['sessionurl']}&do=editavatar'>{$bbuserinfo['user_avatar']}</a>";
$welcome_avatar=$bbuserinfo['user_avatar'];
}
// Cell 2 - Quick Forum Stats
$welcome_new_posts=$DB_site->query_first("select count(*) as new_posts from ".TABLE_PREFIX."post where dateline > '{$bbuserinfo['lastvisit']}'");
$welcome_new_topics=$DB_site->query_first("select count(*) as new_topics from ".TABLE_PREFIX."thread where lastpost > '{$bbuserinfo['lastvisit']}'");
$total_members=$DB_site->query_first("select count(*) as all_users from ".TABLE_PREFIX."user");
$total_posts=$DB_site->query_first("select count(*) as all_posts from ".TABLE_PREFIX."post");
$total_topics=$DB_site->query_first("select count(*) as all_topics from ".TABLE_PREFIX."thread");
$welcome_members="{$total_members['all_users']}";
$welcome_topics="{$total_topics['all_topics']}";
$welcome_posts="{$total_posts['all_posts']}";
$welcome_pms="<if condition='$show[pmstats]'><br /><phrase 1='$vbphrase[unread_x_nav_compiled]' 2='$vbphrase[total_x_nav_compiled]' 3='$session[sessionurl]'>$vbphrase[private_messages_nav]</phrase></if>";
$welcome_newposts="<a href='search.php?{$session['sessionurl']}&do=getnew'>New Posts</a>: {$welcome_new_posts['new_posts']}<br>New Threads: {$welcome_new_topics['new_topics']}";
$welcome_time="<phrase 1='$vbphrase[last_visited_x_at_y]'>";
// Require User Functions
require_once('./includes/functions_user.php');
// Top Row - Welcome Message
// Cell 1 - Avatar
$bbuserinfo['user_avatar']=fetch_avatar_url($bbuserinfo['userid']);
if($bbuserinfo['user_avatar']==""){
$bbuserinfo['user_avatar']="<img src='images/avatars/noavatar.gif' alt='Edit Your Avatar' border='0'>";
$bbuserinfo['user_avatar']="<a href='profile.php?{$session['sessionurl']}&do=editavatar'>{$bbuserinfo['user_avatar']}</a>";
$welcome_avatar=$bbuserinfo['user_avatar'];
} else {
$bbuserinfo['user_avatar']="<img src='{$bbuserinfo['user_avatar']}' alt='Edit Your Avatar' border='0'>";
$bbuserinfo['user_avatar']="<a href='profile.php?{$session['sessionurl']}&do=editavatar'>{$bbuserinfo['user_avatar']}</a>";
$welcome_avatar=$bbuserinfo['user_avatar'];
}
// Cell 2 - Quick Forum Stats
$welcome_new_posts=$DB_site->query_first("select count(*) as new_posts from ".TABLE_PREFIX."post where dateline > '{$bbuserinfo['lastvisit']}'");
$welcome_new_topics=$DB_site->query_first("select count(*) as new_topics from ".TABLE_PREFIX."thread where lastpost > '{$bbuserinfo['lastvisit']}'");
$total_members=$DB_site->query_first("select count(*) as all_users from ".TABLE_PREFIX."user");
$total_posts=$DB_site->query_first("select count(*) as all_posts from ".TABLE_PREFIX."post");
$total_topics=$DB_site->query_first("select count(*) as all_topics from ".TABLE_PREFIX."thread");
$welcome_members="{$total_members['all_users']}";
$welcome_topics="{$total_topics['all_topics']}";
$welcome_posts="{$total_posts['all_posts']}";
$welcome_pms="<if condition='$show[pmstats]'><br /><phrase 1='$vbphrase[unread_x_nav_compiled]' 2='$vbphrase[total_x_nav_compiled]' 3='$session[sessionurl]'>$vbphrase[private_messages_nav]</phrase></if>";
$welcome_newposts="<a href='search.php?{$session['sessionurl']}&do=getnew'>New Posts</a>: {$welcome_new_posts['new_posts']}<br>New Threads: {$welcome_new_topics['new_topics']}";
$welcome_time="<phrase 1='$vbphrase[last_visited_x_at_y]'>";