Code
<!-- // add this section into your page wherever you want the login to be. -->
<script language='JavaScript'>
<!--
function buddy_pop()
{
window.open('HTTP://DSMCentral.com/invision/index.php?act=buddy&','BrowserBuddy','width=200,height=450,resizable=yes,scrollbars=yes');
}
//-->
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="50%">
<?php
// Selecting members from the database
$sql_pm = mysql_query("SELECT * FROM `ibf_members` WHERE id='$ibf_member_id'") or die('cannot get members');
$pm = mysql_fetch_array($sql_pm);
// getting group info for admin and moderator links.
$sql_group = mysql_query("SELECT * FROM `ibf_groups` WHERE g_id='$pm[mgroup]'") or die('cannot get groups');
$group = mysql_fetch_array($sql_group);
// Starting making member bar
if(isset($ibf_member_id) && ($ibf_pass_hash == "$pm[password]")){
// log out link
$logout = "<a href=\"$url?s=$ibf_session_id&act=Login&CODE=03\">$gobyebye</a>";
// moderator control panel link.
if($group[g_is_supmod] == 1)
{
$modcp = " | <a href=\"$url?&act=modcp\">Mod CP</a>";
};
// admin control panel link.
if($group[g_access_cp] == 1)
{
$admincp = " | <a href=\"$short\">Admin CP</a>";
};
// the formated look of the end of the logout, admin cp and mod cp. Change the format here if wanted.
echo"$loggedin: <b>$pm[name]</b> ( $logout<b>$admincp$modcp </b>)";
} else {
// if not logged in will show this.
echo "Welcome <b>Visitor</b> <a href=\"$url?act=Login&CODE=00\">Login</a> | <a href=\"$url?&act=Reg&CODE=00\">Register</a>";
};
// pm pop-up. new feature of 2.1
$show_popup = $pm['show_popup'];
if($show_popup > 0)
{
$query = "UPDATE ibf_members SET show_popup='0' WHERE id='{$ibf_member_id}' ";
$result = mysql_query($query);
echo "<script language='JavaScript'>
<!--
window.open('$url?act=Msg&CODE=99&s={$ibf_session_id}','NewPM','width=500,height=250,resizable=yes,scrollbars=yes');
//-->
</script>";
};
?>
</td>
<td width="50%" align="right">
<?php
// left side of the member bar.
if (isset($ibf_member_id) AND $ibf_pass_hash == "$pm[password]")
{
echo "
<!-- control panel link -->
<a href=\"$url?s=$ibf_session_id&act=UserCP&CODE=00\">$yourcp</a> /
<!-- new messages thing. -->
<a href=\"$url?s=$ibf_session_id&act=Msg&CODE=01\">{$pm['new_msg']} new messages</a> /
<!-- My Assistant Link -->
<a href='javascript:buddy_pop();'>My Assistant</a> /
<!-- gets latest post info from your boards. -->
<a href=\"$url?&act=Search&CODE=getnew\">".date("F d")."</a>";
}
else
{
// shows the date.
echo "Today Is ".date("F d");
}
?>
</td>
</tr>
</table>
<!-- end of the script. have fun! -->
<script language='JavaScript'>
<!--
function buddy_pop()
{
window.open('HTTP://DSMCentral.com/invision/index.php?act=buddy&','BrowserBuddy','width=200,height=450,resizable=yes,scrollbars=yes');
}
//-->
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="50%">
<?php
// Selecting members from the database
$sql_pm = mysql_query("SELECT * FROM `ibf_members` WHERE id='$ibf_member_id'") or die('cannot get members');
$pm = mysql_fetch_array($sql_pm);
// getting group info for admin and moderator links.
$sql_group = mysql_query("SELECT * FROM `ibf_groups` WHERE g_id='$pm[mgroup]'") or die('cannot get groups');
$group = mysql_fetch_array($sql_group);
// Starting making member bar
if(isset($ibf_member_id) && ($ibf_pass_hash == "$pm[password]")){
// log out link
$logout = "<a href=\"$url?s=$ibf_session_id&act=Login&CODE=03\">$gobyebye</a>";
// moderator control panel link.
if($group[g_is_supmod] == 1)
{
$modcp = " | <a href=\"$url?&act=modcp\">Mod CP</a>";
};
// admin control panel link.
if($group[g_access_cp] == 1)
{
$admincp = " | <a href=\"$short\">Admin CP</a>";
};
// the formated look of the end of the logout, admin cp and mod cp. Change the format here if wanted.
echo"$loggedin: <b>$pm[name]</b> ( $logout<b>$admincp$modcp </b>)";
} else {
// if not logged in will show this.
echo "Welcome <b>Visitor</b> <a href=\"$url?act=Login&CODE=00\">Login</a> | <a href=\"$url?&act=Reg&CODE=00\">Register</a>";
};
// pm pop-up. new feature of 2.1
$show_popup = $pm['show_popup'];
if($show_popup > 0)
{
$query = "UPDATE ibf_members SET show_popup='0' WHERE id='{$ibf_member_id}' ";
$result = mysql_query($query);
echo "<script language='JavaScript'>
<!--
window.open('$url?act=Msg&CODE=99&s={$ibf_session_id}','NewPM','width=500,height=250,resizable=yes,scrollbars=yes');
//-->
</script>";
};
?>
</td>
<td width="50%" align="right">
<?php
// left side of the member bar.
if (isset($ibf_member_id) AND $ibf_pass_hash == "$pm[password]")
{
echo "
<!-- control panel link -->
<a href=\"$url?s=$ibf_session_id&act=UserCP&CODE=00\">$yourcp</a> /
<!-- new messages thing. -->
<a href=\"$url?s=$ibf_session_id&act=Msg&CODE=01\">{$pm['new_msg']} new messages</a> /
<!-- My Assistant Link -->
<a href='javascript:buddy_pop();'>My Assistant</a> /
<!-- gets latest post info from your boards. -->
<a href=\"$url?&act=Search&CODE=getnew\">".date("F d")."</a>";
}
else
{
// shows the date.
echo "Today Is ".date("F d");
}
?>
</td>
</tr>
</table>
<!-- end of the script. have fun! -->
Go to DSMCentral.com/news to see what it does.
If I put the code in a test.php and call it, it works fine. Ohh I also had put the code...
Code
<?
// Variables
$ibf_members = "ibf_members"; // Name of the table where your members are
$url = "forums/index.php"; // The full URL to your forums
$short = "forums/admin.php"; // The link to the admin control pane
$db_host = "localhost"; // Should work 99% of the time.
$db_user = "user"; // mySQL database "USER"
$db_pass = "pass"; // mySQL database "PASS"
$database = "ibf_database"; // mySQL "DATABASE" name
// langugage variables
// no need to change these.
$yourcp = "Your CP";
$gobyebye = "Go ByeBye";
$loggedin = "Logged In As:";
$login = "Login";
$register = "Register";
// ---------------
// Cookies... Yum.
// ---------------
### if you have a prefix on your cookies add it in $_COOKIE['prefix_member_id'];. like that.
$ibf_member_id = $_COOKIE['member_id']; // member name from the cookie.
$ibf_pass_hash = $_COOKIE['pass_hash']; // password encripted from the cookie. using md5();
$ibf_session_id = $_COOKIE['session_id']; // session id for links and what not.
// Connect to the Village. w00t. lol.
$link = mysql_connect("$db_host","$db_user","$db_pass") or die("cannot connect");
mysql_select_db("$database");
// Get those nasty villagers!
$sql_pm = mysql_query("SELECT * FROM `ibf_members` WHERE id='$ibf_member_id'") or print mysql_error();
$pm = mysql_fetch_array($sql_pm)
?>
// Variables
$ibf_members = "ibf_members"; // Name of the table where your members are
$url = "forums/index.php"; // The full URL to your forums
$short = "forums/admin.php"; // The link to the admin control pane
$db_host = "localhost"; // Should work 99% of the time.
$db_user = "user"; // mySQL database "USER"
$db_pass = "pass"; // mySQL database "PASS"
$database = "ibf_database"; // mySQL "DATABASE" name
// langugage variables
// no need to change these.
$yourcp = "Your CP";
$gobyebye = "Go ByeBye";
$loggedin = "Logged In As:";
$login = "Login";
$register = "Register";
// ---------------
// Cookies... Yum.
// ---------------
### if you have a prefix on your cookies add it in $_COOKIE['prefix_member_id'];. like that.
$ibf_member_id = $_COOKIE['member_id']; // member name from the cookie.
$ibf_pass_hash = $_COOKIE['pass_hash']; // password encripted from the cookie. using md5();
$ibf_session_id = $_COOKIE['session_id']; // session id for links and what not.
// Connect to the Village. w00t. lol.
$link = mysql_connect("$db_host","$db_user","$db_pass") or die("cannot connect");
mysql_select_db("$database");
// Get those nasty villagers!
$sql_pm = mysql_query("SELECT * FROM `ibf_members` WHERE id='$ibf_member_id'") or print mysql_error();
$pm = mysql_fetch_array($sql_pm)
?>
that is supposed to be at the top of the page in the theme.php. I also tried the header.php file in the postnuke directory. can some one please help me out?
