Author |
Message |
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm
![](modules/Forums/images/avatars/5ed231554a8492e2e09da.gif)
Joined: Aug 13, 2009
Posts: 1123
|
Posted:
Fri Jun 22, 2012 1:39 pm |
|
Hi Guys,
I was searching for a translation block for Ravennuke 2.5 but I couldn't find anything here. if anyone has one please let me know. I have one but I think it is pretty old.
![Question](modules/Forums/images/smiles/icon_question.gif) |
Last edited by hicuxunicorniobestbuildpc on Sat Jun 30, 2012 7:05 am; edited 3 times in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
Site Admin
![](modules/Forums/images/avatars/125904890252d880f79f312.png)
Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Fri Jun 22, 2012 9:58 pm |
|
Do you mean a block for switching languages?
This should appear only if you have multi-lingual turned on in the site preferences. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jun 23, 2012 6:29 am |
|
yes, I mean a block so users can switch to another language. I have one but it is pretty old. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jun 23, 2012 8:50 am |
|
There is one in the RN distro;
blocks/block-Languages.php
Code:
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
global $useflags, $currentlang, $languageslist, $multilingual;
if ($multilingual == 1) {
if ($useflags == 1) {
$content = '<div align="center"><span class="content">'._SELECTGUILANG.'<br /><br />';
$langdir = dir('language');
$menulist = '';
while($func=$langdir->read()) {
if(substr($func, 0, 5) == 'lang-') {
$menulist .= $func.' ';
}
}
closedir($langdir->handle);
$menulist = explode(' ', $menulist);
sort($menulist);
for ($i=0; $i < sizeof($menulist); $i++) {
if(!empty($menulist[$i])) {
$tl = str_replace('lang-','',$menulist[$i]);
$tl = str_replace('.php','',$tl);
$altlang = ucfirst($tl);
$content .= '<a href="index.php?newlang='.$tl.'"><img src="images/language/flag-'.$tl.'.png" border="0" alt="'.$altlang.'" title="'.$altlang.'" hspace="3" vspace="3" /></a> ';
}
}
$content .= '</span></div>';
} else {
$content = '<div align="center"><span class="content">'._SELECTGUILANG.'<br /><br /></span>'
. '<form action="index.php" method="get">'
. lang_select_list('newlang', $currentlang, false, ' onchange="javascript:this.form.submit();"')
. '</form></div>';
}
} else {
if (defined('_MULTILINGUALOFF')) {
$content = '<div class="text-center">'._MULTILINGUALOFF.'</div>';
} else {
$content = '<div class="text-center">We\'re sorry but there is no language translation available. Please contact the Webmaster for further help.</div>';
}
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jun 23, 2012 7:06 pm |
|
Thanks Guardian, sorry but I didn't see it but I guess it is not the same as my old one.
Take a look. This one shows modules too but something is wrong I guess because. It is too wide.
Code:<?php
if ( !defined('BLOCK_FILE') ) {
Header("Location: index.php");
die();
}
global $prefix, $db, $admin, $nukeurl;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/module.php")) {
include("themes/$ThemeSel/module.php");
if (is_active("$default_module") AND file_exists("modules/$default_module/index.php")) {
$def_module = $default_module;
} else {
$def_module = "";
}
}
$row = $db->sql_fetchrow($db->sql_query("SELECT main_module FROM ".$prefix."_main"));
$main_module = $row['main_module'];
/* If the module doesn't exist, it will be removed from the database automaticaly */
$result2 = $db->sql_query("SELECT title FROM " . $prefix . "_modules");
while ($row2 = $db->sql_fetchrow($result2)) {
$title = stripslashes($row2['title']);
$a = 0;
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ($file == $title) {
$a = 1;
}
}
closedir($handle);
if ($a == 0) {
$db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'");
}
}
/* If you copied a new module is the /modules/ directory, it will be added to the database */
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ( (!preg_match("/[.]/",$file)) ) {
$modlist .= "$file ";
}
}
closedir($handle);
$modlist = explode(" ", $modlist);
sort($modlist);
for ($i=0; $i < sizeof($modlist); $i++) {
if($modlist[$i] != "") {
$row4 = $db->sql_fetchrow($db->sql_query("SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'"));
$mid = intval($row4['mid']);
$mod_uname = preg_replace("/_/", " ", $modlist[$i]);
if ($mid == "") {
$db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$mod_uname', '0', '0', '1')");
}
}
}
$content .= "<table align='center' cellspacing='0' cellpadding='1' border='0'>";
$content .= "<tr>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Car&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_arab.gif' title='Arabic' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Czh-CN&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_china.gif' title='Chinese' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=nl'><img src='images/flags/22x14/flag_dutch.gif' title='Dutch' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cfr&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_france.gif' title='French' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cde&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_germany.gif' title='German' border='0'></a></td>";
$content .= "<td><a href='http://babelfish.altavista.com/babelfish/trurl_load?lp=en_el&url=$nukeurl'><img src='images/flags/22x14/flag_greece.gif' title='Greek' border='0'></a></td>";
$content .= "</tr><tr>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cit&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_italy.gif' title='Italy' border='0'></a></td>";
//$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cja&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_japan.gif' title='Japan' border='0'></a></td>";
//$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cko&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_korea.gif' title='Korea' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cpt&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_portugal.gif' title='Portugal' border='0'></a></td>";
$content .= "<td><a href='http://babelfish.altavista.com/babelfish/trurl_load?lp=en_ru&url=$nukeurl'><img src='images/flags/22x14/flag_russia.gif' title='Russia' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Ces&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_spain.gif' title='Spain' border='0'></a></td>";
$content .= "</tr></table>";
$content .= "<br /><a href=\"$nukeurl\" title=\"Home\"><b>♥ Home:</b></a><br /><a href=\"$nukeurl/modules.php?name=Subscription\" title=\"Subscribe\"><b>♥ Subscribe:</b></a><br /><a href=\"$nukeurl/modules.php?name=Forums\" title=\"Forums\"><b>♥ Forums:</b></a><br /><hr /><br />";
$content .= '<center><select class="" size="1" name="name" onchange="top.location.href=this.options[this.selectedIndex].value">';
$content .= "<option>Menu</option>";
$result3 = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC");
while ($row3 = $db->sql_fetchrow($result3)) {
$m_title = stripslashes($row3['title']);
$custom_title = $row3['custom_title'];
$view = intval($row3['view']);
$m_title2 = preg_replace("/_/", " ", $m_title);
if ($custom_title != "") {
$m_title2 = $custom_title;
}
if ($m_title != $main_module) {
if ((is_admin($admin) AND $view == 2) OR $view != 2) {
$selected = '';
$content .= "<option value=\"modules.php?name=$m_title\">→ $m_title2</option>";
}
}
}
$content .= "</center></select><br /><br /><hr />";
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Jun 24, 2012 12:59 am |
|
The one I posted is a standard RN file which switches languages based on the installed language files.
The one you posted seems to use Google and Babelfish for translations.
Just by looking at the code you posted, I cannot see anything that would cause it to be too big for a normal side block, though you do have a mis-matched number of TD's in the second row because two lines are commented out. You might be better to add two blank TD's in there.
Code:
//$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cja&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_japan.gif' title='Japan' border='0'></a></td>";
$content .="<td></td>"; // filler for above line
//$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cko&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_korea.gif' title='Korea' border='0'></a></td>";
$content .="<td></td>"; // filler for above line
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cpt&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_portugal.gif' title='Portugal' border='0'></a></td>";
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Jun 24, 2012 6:32 am |
|
hmmm, that was the problem but I wonder why if you comented out some lines we need to add extra TD's. I don't understand, is it better to remove these lines?
Actually what I wanted to do is to mix the info block with language block so we do not have so many blocks on the side. Is that possible? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Jun 24, 2012 11:12 am |
|
Well, as you know, TR is a table row and TD is a column cell in the row. To balance the table you either need the same number of TD's in each row or specify a COLSPAN attribute for the TD so it can span the gap. As an example;
Code:
$content .= "</tr><tr>"; // closes row 1 and starts row 2
$content .= "<td colspan="2"><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cit&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_italy.gif' title='Italy' border='0'></a></td>"; // row 2 cell 1 but spans 2 cells to compensate for the missing TD commented out below
//$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cja&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_japan.gif' title='Japan' border='0'></a></td>";
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Jun 24, 2012 7:20 pm |
|
Thanks for the explanation but is it possible to mix this block with the login block so users can switch languages? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Jun 25, 2012 12:54 am |
|
It should be really easy.
You would just need to add the code after the last $content line in the log-in block
Code:
global $prefix, $db, $admin, $nukeurl;
$content .= "<table align='center' cellspacing='0' cellpadding='1' border='0'>";
$content .= "<tr>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Car&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_arab.gif' title='Arabic' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Czh-CN&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_china.gif' title='Chinese' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=nl'><img src='images/flags/22x14/flag_dutch.gif' title='Dutch' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cfr&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_france.gif' title='French' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cde&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_germany.gif' title='German' border='0'></a></td>";
$content .= "<td><a href='http://babelfish.altavista.com/babelfish/trurl_load?lp=en_el&url=$nukeurl'><img src='images/flags/22x14/flag_greece.gif' title='Greek' border='0'></a></td>";
$content .= "</tr><tr>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cit&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_italy.gif' title='Italy' border='0'></a></td>";
//$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cja&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_japan.gif' title='Japan' border='0'></a></td>";
//$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cko&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_korea.gif' title='Korea' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cpt&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_portugal.gif' title='Portugal' border='0'></a></td>";
$content .= "<td><a href='http://babelfish.altavista.com/babelfish/trurl_load?lp=en_ru&url=$nukeurl'><img src='images/flags/22x14/flag_russia.gif' title='Russia' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Ces&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags/22x14/flag_spain.gif' title='Spain' border='0'></a></td>";
$content .= "</tr></table>";
|
Obviously you would need to change the commented out lines as before |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Jun 26, 2012 5:00 pm |
|
Yes I already did it and the result was ok but not what I wanted. I would like to have the flags on the top. Any sugesstion? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jun 27, 2012 1:41 am |
|
Put the code at the top of the file after Code:
if ( !defined('BLOCK_FILE') ) {
Header("Location: index.php");
die();
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jun 27, 2012 6:51 am |
|
This is what I did so far but it doesn't work
Code:<?php
/*************************************************************************/
/* Tableless CSS Sprite Powered Info Box Block by */
/* SpasticDonkey - web-cms-designs.com */
/* Inspired by: Info Box for RavenNuke by nukecoder.com */
/* RavenWebServices User Info Block www.ravenphpscripts.com */
/* nukeNAV by nukeSEO nukeseo.com */
/* Icons adapted from the Crystal project www.everaldo.com/crystal/ and */
/* the Tango Desktop Project tango.freedesktop.org/Tango_Desktop_Project */
/* Intended for use on RavenNuke(tm) v2.5+ */
/*************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
//Translation
global $prefix, $db, $admin, $nukeurl;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/module.php")) {
include("themes/$ThemeSel/module.php");
if (is_active("$default_module") AND file_exists("modules/$default_module/index.php")) {
$def_module = $default_module;
} else {
$def_module = "";
}
}
$row = $db->sql_fetchrow($db->sql_query("SELECT main_module FROM ".$prefix."_main"));
$main_module = $row['main_module'];
/* If the module doesn't exist, it will be removed from the database automaticaly */
$result2 = $db->sql_query("SELECT title FROM " . $prefix . "_modules");
while ($row2 = $db->sql_fetchrow($result2)) {
$title = stripslashes($row2['title']);
$a = 0;
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ($file == $title) {
$a = 1;
}
}
closedir($handle);
if ($a == 0) {
$db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'");
}
}
/* If you copied a new module is the /modules/ directory, it will be added to the database */
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ( (!preg_match("/[.]/",$file)) ) {
$modlist .= "$file ";
}
}
closedir($handle);
$modlist = explode(" ", $modlist);
sort($modlist);
for ($i=0; $i < sizeof($modlist); $i++) {
if($modlist[$i] != "") {
$row4 = $db->sql_fetchrow($db->sql_query("SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'"));
$mid = intval($row4['mid']);
$mod_uname = preg_replace("/_/", " ", $modlist[$i]);
if ($mid == "") {
$db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$mod_uname', '0', '0', '1')");
}
}
}
$content .= "<table align='center' cellspacing='0' cellpadding='1' border='0'>";
$content .= "<tr>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=nl'><img src='images/flags20x20/nl.png' title='Dutch' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cfr&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags20x20/fr.png' title='French' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cde&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags20x20/gr.png' title='German' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cit&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags20x20/it.png' title='Italy' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cpt&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags20x20/pt.png' title='Portugal' border='0'></a></td>";
$content .= "<td><a href='http://babelfish.altavista.com/babelfish/trurl_load?lp=en_ru&url=$nukeurl'><img src='images/flags20x20/flag_russia.gif' title='Russia' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Ces&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags20x20/es.png' title='Spain' border='0'></a></td>";
$content .= "</tr></table>";
$content .= "<br /><a href=\"$nukeurl\" title=\"Home\"><b>♥ Home:</b></a><br /><a href=\"$nukeurl/modules.php?name=Subscription\" title=\"Subscribe\"><b>♥ Subscribe:</b></a><br /><a href=\"$nukeurl/modules.php?name=Forums\" title=\"Forums\"><b>♥ Forums:</b></a><br /><hr /><br />";
$content .= '<center><select class="" size="1" name="name" onchange="top.location.href=this.options[this.selectedIndex].value">';
$content .= "<option>Menu</option>";
$result3 = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC");
while ($row3 = $db->sql_fetchrow($result3)) {
$m_title = stripslashes($row3['title']);
$custom_title = $row3['custom_title'];
$view = intval($row3['view']);
$m_title2 = preg_replace("/_/", " ", $m_title);
if ($custom_title != "") {
$m_title2 = $custom_title;
}
if ($m_title != $main_module) {
if ((is_admin($admin) AND $view == 2) OR $view != 2) {
$selected = '';
$content .= "<option value=\"modules.php?name=$m_title\">→ $m_title2</option>";
}
}
}
$content .= "</center></select><br /><br /><hr />";
///date_default_timezone_set('EST');
if (!isset($side)) { $side = ''; }
if ($side == 'c' || $side == 'd' || $side == 't') { $IBCentermode = true; } else { $IBCentermode = false; }
if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");
/*********************************************************************************************************/
/* Setup - Use these settings to control how the user info block displays to users/admins/anonymous. */
/*********************************************************************************************************/
/* MEMBER TOTALS SECTION */
$membercounter_view = 1; // MEMBER TOTALS SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$zero_in_column_view = 2; // If zero registrations during period show column to: 0=everyone 1=user-only 2=admin-only 3=disable
/* RECENT MEMBER SECTION */
$recent_member_view = 1; // RECENT MEMBER SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$recent_member_count = 1; // how many newest members to show to all
$recent_member_user = 2; // how many newest members to show to users
$recent_member_admin = 4; // how many newest members to show to admins
/* ONLINE NOW SECTION */
$who_is_online_view = 1; // ONLINE NOW SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$show_guest_guest = 2; // show online guests to 0=everyone 1=user-only 2=admin-only 3=disable
$max_display_guests = 6; // maximum number of online guests to display
$max_display_members = 6; // maximum number of online members to display
$showonlinecount = 1; // total count of online guests/members: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$max_session_mins = 60; // how long before inactive users are dropped from online list
/* LAST SEEN MEMBER SECTION */
$lastseen_user_view = 0; // LAST SEEN MEMBER SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$lastseen_count = 2; // how many last seen members to show to all
$lastseen_count_user = 4; // how many last seen members to show to users
$lastseen_count_admn = 6; // how many last seen members to show to admins
/* SERVER TRAFFIC SECTION */
$servertraffic_view = 0; // SERVER TRAFFIC SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$traffic_year_view = 1; // Traffic stats by year: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$how_many_years = 2; // how many years to display in traffic stats
/* GENERAL BLOCK SETTINGS */
$nameMaxLength = 13; // Max length for username display. Will truncate with ...
$langMaxLength = 17; // Max length for some problem language defines. Will display in smaller font-size
$LargeSectionIcons = false; // use 32x32 icons for the sections
$display_lost_pass = true; // set to false to hide the lost password link (displays in smaller font in some languages)
$pm_colorbox_notice = true; // if set to true, users will only be notified of private messages once per session
$UsemodalLogin = true; // modal login popup - nukeNAV module must be ACTIVE!
$UseSearchPopUp = true; // modal search popup - nukeNAV and Search modules must be ACTIVE!
$whoisUseModal = true; //admin ip lookup in modal window
$OnlineGuestsModal = true; //compact the online guests into one modal link
$whoisServerString = 'www.dnsstuff.com/tools/whois/?ip='; //admin ip lookup
if ($IBCentermode) { // <- do not edit
/*********************************************************************************************************/
/* CENTER BLOCK SETTINGS (only used when in center position, overrides settings above) */
/*********************************************************************************************************/
$membercounter_view = 0;
$zero_in_column_view = 2;
$recent_member_view = 0;
$recent_member_count = 2;
$recent_member_user = 2;
$recent_member_admin = 2;
$who_is_online_view = 0;
$show_guest_guest = 0;
$max_display_guests = 20;
$max_display_members = 6;
$showonlinecount = 0;
$lastseen_user_view = 0;
$lastseen_count = 6;
$lastseen_count_user = 6;
$lastseen_count_admn = 6;
$servertraffic_view = 0;
$traffic_year_view = 0;
$how_many_years = 2;
$LargeSectionIcons = true;
} // <- do not edit
/*********************************************************************************************************/
/* Sprite Settings - For more info see http://www.rtsforce.com/InfoBox-CSS/ */
/*********************************************************************************************************/
$IBtran = 'images/transparent.gif'; // source for the transparent gif sprite container
$IBicon = 'IBicon8'; // default classes for icons (changed by theme below unless $MultiThemeMode = false)
$rnIBicon = 'rnIBicon'; // default classes for icons (changed by theme below unless $MultiThemeMode = false)
$MultiThemeMode = true; // false to disable loading theme specific icons, and ignore array settings below - see readme
$rnIBWhite = array('3D-Fantasy', 'DeepBlue', 'ExtraLite', 'NukeNews', 'Slash', 'SlashOcean', 'Traditional'); // Themes with white block backgrounds
$rnIBGray = array('Anagram', 'Karate', 'Milo'); // Themes with gray block backgrounds
$rnIBCreme = array('Sunset'); // Themes with creme block backgrounds
$rnIBSimplyBlue = array('SimplyBlue'); // Themes with sky blue block backgrounds
$rnIBSandJourney = array('Sand_Journey'); // Themes with sand block backgrounds
$rnIBBlueBlog = array('Blue_Blog'); // Themes with taupe block backgrounds
$rnIBCTRN = array('CT_RN'); // Themes with crimson backgrounds
$rnIBRavenIce = array('RavenIce', 'fisubice'); // Themes with off-white/blue block backgrounds
$rnIBKaput = array('Kaput'); // Themes with blue/gray block backgrounds
$rnIBBlack = array(); // Themes with black block backgrounds
$rnIBExtra = array(); // An extra group for other themes (use class rnIBExtra and IBExtra to define your sprite background - see readme)
/*********************************************************************************************************/
/* You should not need to modify anything below this line */
/*********************************************************************************************************/
global $db, $prefix, $ya_config, $anonymous, $user_prefix, $user, $sitekey, $gfx_chk, $admin, $currentlang, $language, $startdate, $name;
if(file_exists('language/infobox/lang-' . $currentlang . '.php')) {
include_once 'language/infobox/lang-' . $currentlang . '.php';
} elseif(file_exists('language/infobox/lang-' . $language . '.php')) {
include_once 'language/infobox/lang-' . $language . '.php';
} else {
include_once 'language/infobox/lang-english.php';
}
if (!isset($name)) { $name = ''; }
if ($IBCentermode) {
$ListClass = 'IBblock-center';
addJSToBody('includes/jquery/jquery.masonry.min.js', 'file');
addJSToBody('includes/jquery/jquery.userinfo.js', 'file');
} else {
$ListClass = 'IBblock';
}
if (!isset($ya_config)) $ya_config = ya_get_configs();
if ($MultiThemeMode){
$ThemeSel = get_theme();
if (in_array($ThemeSel, $rnIBWhite)) {$rnIBicon = 'rnIBWhite';$IBicon = 'IBWhite';}
else if (in_array($ThemeSel, $rnIBGray)) {$rnIBicon = 'rnIBGray';$IBicon = 'IBGray';}
else if (in_array($ThemeSel, $rnIBCreme)) {$rnIBicon = 'rnIBCreme';$IBicon = 'IBCreme';}
else if (in_array($ThemeSel, $rnIBSimplyBlue)) {$rnIBicon = 'rnIBSimplyBlue';$IBicon = 'IBSimplyBlue';}
else if (in_array($ThemeSel, $rnIBSandJourney)) {$rnIBicon = 'rnIBSandJourney';$IBicon = 'IBSandJourney';}
else if (in_array($ThemeSel, $rnIBBlueBlog)) {$rnIBicon = 'rnIBBlueBlog';$IBicon = 'IBBlueBlog';}
else if (in_array($ThemeSel, $rnIBCTRN)) {$rnIBicon = 'rnIBCT-RN';$IBicon = 'IBCT-RN';}
else if (in_array($ThemeSel, $rnIBRavenIce)) {$rnIBicon = 'rnIBRavenIce';$IBicon = 'IBRavenIce';}
else if (in_array($ThemeSel, $rnIBKaput)) {$rnIBicon = 'rnIBKaput';$IBicon = 'IBKaput';}
else if (in_array($ThemeSel, $rnIBBlack)) {$rnIBicon = 'rnIBBlack';$IBicon = 'IBBlack';}
else if (in_array($ThemeSel, $rnIBExtra)) {$rnIBicon = 'rnIBExtra';$IBicon = 'IBExtra';}
else {$rnIBicon = 'rnIBicon';$IBicon = 'IBicon8';}
}
if ($LargeSectionIcons) {$IBadjust = 'LG';$IBicon = 'IBBigIcons';} else {$IBadjust = '';}
if (is_admin($admin)) {
$viewlevel = 2;
$lastseen_count=$lastseen_count_admn;
$recent_member_count=$recent_member_admin;
} else if (is_user($user)) {
$viewlevel = 1;
$lastseen_count=$lastseen_count_user;
$recent_member_count=$recent_member_user;
} else {
$viewlevel = 0;
}
$anonyname = 'Anonymous';
$displayname = '';
$show_pms = 0;
$onlinenames = array();
$content = '<!-- Start Info -->
<div id="' . $ListClass . '"><div class="fullwidth">
';
// get user info/show login
if (is_user($user)) {
$uinfo = cookiedecode($user);
$displayname = check_html($uinfo[1], 'nohtml');
$content .= '<div class="IBinfosection" id="IBsection1">'.PHP_EOL;
$content .= '<div><a href="modules.php?name=Your_Account&op=edituser" class="IBuser' . $IBadjust . '" title="' . _FSIYOURACCOUNT . '"><img src="' . $IBtran . '" class="' . $IBicon . '" alt="' . _FSIYOURACCOUNT . '" /><span class="IBtextpad">' . $displayname . '</span></a></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
if ($whoisUseModal){$iblinktype = 'class="IBmodal"';} else {$iblinktype = 'target="_blank"';}
$content .= '<li class="' . $rnIBicon . ' IByourip" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '"><span class="thick"><a ' . $iblinktype . ' href="http://' . $whoisServerString . $_SERVER['REMOTE_ADDR'] . '" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '">' . $_SERVER['REMOTE_ADDR'] . '</a></span></li>'.PHP_EOL;
if (is_active('Forums')) {
$adjustment = strlen(html_entity_decode(_INFOBOX_EGOPOSTS));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IByourposts' . $getsmall . '" title="' . _INFOBOX_EGOPOSTS . '"><a href="modules.php?name=Forums&file=search&search_id=egosearch" title="' . _INFOBOX_EGOPOSTS . '">' . _INFOBOX_EGOPOSTS . '</a></li>'.PHP_EOL;
}
if ($ya_config['allowusertheme']=='1') {
$content .= '<li class="' . $rnIBicon . ' IBchangetheme" title="' . _INFOBOX_CHANGETHEME . '"><a href="modules.php?name=Your_Account&op=chgtheme" title="' . _INFOBOX_CHANGETHEME . '">' . _INFOBOX_CHANGETHEME . '</a></li>'.PHP_EOL;
}
if (is_active('nukeNAV') and is_active('Search') and $UseSearchPopUp) $content .= '<li class="' . $rnIBicon . ' IBsearch" title="' . _SEARCH . '"><a href="modules.php?name=nukeNAV&op=search" class="colorbox" title="">' . _SEARCH . '</a></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGOUT . '"><a href="modules.php?name=Your_Account&op=logout" title="' . _LOGOUT . '">' . _LOGOUT . '</a></li>'.PHP_EOL;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
// check new pms
$sql = 'SELECT privmsgs_to_userid FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid=' . intval($uinfo[0]) . ' AND (privmsgs_type=5 OR privmsgs_type=1)';
if (!($result = $db->sql_query($sql))) {
// error
die('error checking new pms');
}
$new_pms = $db->sql_numrows($result);
$db->sql_freeresult($result);
// check old pms
$sql = 'SELECT privmsgs_to_userid FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid=' . intval($uinfo[0]) . ' AND (privmsgs_type=0)';
if (!($result = $db->sql_query($sql))) {
// error
die('error checking old pms');
}
$old_pms = $db->sql_numrows($result);
$db->sql_freeresult($result);
$show_pms = $new_pms+$old_pms;
if ($show_pms > 0 AND is_active('Private_Messages')) {
$content .= '<div class="IBinfosection" id="IBsection2">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBpms' . $IBadjust . '" alt="' . _BPM . '" /><span class="IBtextpad thick">' . _BPM . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBnewpms" title="' . _BPM . '"><a href="modules.php?name=Private_Messages" title="' . _BPM . '">' . _BUNREAD . ': ' . $new_pms . '</a></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBoldpms" title="' . _BREAD . '"> ' . _BREAD . ': <span class="thick">' . $old_pms . '</span></li>'.PHP_EOL;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
if (($pm_colorbox_notice && $new_pms > 0) and (!isset($_COOKIE["youhaveapm"])) and ($name!='Private_Messages')) {
setcookie('youhaveapm', 'checked');
$content .= '<div id="IByesnewpm" style="display:none">'.PHP_EOL;
$content .= '<div id="IBnewmessages">'.PHP_EOL;
$content .= '<span class="IBCBtext"><img src="' . $IBtran . '" class="' . $IBicon . ' IBoldpms" alt="' . _NEWPMSG . '" /> ' . _YOUHAVE . ' <a href="modules.php?name=Private_Messages">' . $new_pms . ' ' . _NEWPMSG . '.</a></span>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
}
} else {
$content .= '<div class="IBinfosection" id="IBsection3">'.PHP_EOL;
$content .= '<div><a href="modules.php?name=Your_Account" title="' . _FSIYOURACCOUNT . '" class="IBglobe' . $IBadjust . '"><img src="' . $IBtran . '" class="' . $IBicon . ' IBglobe' . $IBadjust . '" alt="' . $anonymous . '" /><span class="IBtextpad">' . $anonymous . '</span></a></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IByourip IBguestip" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '"><span class="thick">' . $_SERVER['REMOTE_ADDR'] . '</span></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IByourposts" title="' . _BREG . '"><a href="modules.php?name=Your_Account&op=new_user">' . _BREG . '</a></li>'.PHP_EOL;
if (is_active('nukeNAV') and is_active('Search') and $UseSearchPopUp) $content .= '<li class="' . $rnIBicon . ' IBsearch" title="' . _SEARCH . '"><a href="modules.php?name=nukeNAV&op=search" class="colorbox" title="">' . _SEARCH . '</a></li>'.PHP_EOL;
if ($UsemodalLogin){
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGIN . '"><a href="modules.php?name=nukeNAV&op=login" class="colorbox">' . _LOGIN . '</a></li>'.PHP_EOL;
} else {
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGIN . '"><a href="modules.php?name=Your_Account">' . _LOGIN . '</a></li>'.PHP_EOL;
}
if ($display_lost_pass) {
$adjustment = strlen(html_entity_decode(_PASSWORDLOST));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IBonlineguest' . $getsmall . '" title="' . _PASSWORDLOST . '"><a href="modules.php?name=Your_Account&op=pass_lost">' . _PASSWORDLOST . '</a></li>'.PHP_EOL;
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
if ($viewlevel>=$membercounter_view) {
// MEMBER COUNTS
$sql = 'SELECT username FROM ' . $user_prefix . '_users_temp';
$result = $db->sql_query($sql);
$waiting = $db->sql_numrows($result);
$content .= '<div class="IBinfosection" id="IBsection4">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBmembers' . $IBadjust . '" alt="' . _BMEM . '" /><span class="IBtextpad thick">' . _BMEM . '</span></div>'.PHP_EOL;
// 0001856: User Info block enhancements
$IBgetmonth = _UMONTH;
$IBgetyear = _YEAR;
// get new member info
$timestamp = time();
$today = date("M d, Y");
$yesterday = date("M d, Y", ($timestamp - 86400) );
$this_month = date("M");
$this_year = date("Y");
// today
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE user_regdate=\'' . $today . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting todays users');
}
list($new_today) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// yesterday
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE user_regdate=\'' . $yesterday . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting yesterdays users');
}
list($new_yesterday) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// this month
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE SUBSTRING(user_regdate, 1, 4)=\'' . $this_month . '\' AND SUBSTRING(user_regdate, 9, 12)=\'' . $this_year . '\'';
if (!($result = $db->sql_query($sql))){
// error
die('error getting this months users');
}
list($new_month) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// this year
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE SUBSTRING(user_regdate, 9, 12)=\'' . $this_year . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting this years users');
}
list($new_year) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// all time
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting total users');
}
if (is_admin($admin) AND @file_exists('modules/Resend_Email/index.php')) {
$waitLink = '<a href="modules.php?name=Resend_Email" title="' . _TTL_RESENDEMAIL . '">' . _WAITLINK . ': <span class="thick">' . $waiting . '</span></a>';
} else {
$waitLink = _WAITLINK . ': <span class="thick">' . $waiting . '</span>';
}
list($total_users) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$content .= '<ul class="rninfobox">'.PHP_EOL;
if (($new_today==0 AND $viewlevel>=$zero_in_column_view) OR ($new_today!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBtoday" title="' . _INFOBOX_BTD . '">' . _INFOBOX_BTD . ': <span class="thick">' . $new_today . '</span></li>'.PHP_EOL;
}
if (($new_yesterday==0 AND $viewlevel>=$zero_in_column_view) OR ($new_yesterday!=0)) {
$adjustment = strlen(html_entity_decode(_INFOBOX_BYD));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IByesterday' . $getsmall . '" title="' . _INFOBOX_BYD . '">' . _INFOBOX_BYD . ': <span class="thick">' . $new_yesterday . '</span></li>'.PHP_EOL;
}
if (($new_month==0 AND $viewlevel>=$zero_in_column_view) OR ($new_month!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBmonth" title="' . _UMONTH . '">' . $IBgetmonth . ': <span class="thick">' . $new_month . '</span></li>'.PHP_EOL;
}
if (($new_year==0 AND $viewlevel>=$zero_in_column_view) OR ($new_year!=0)) {
$content .= '<li class="' . $rnIBicon . ' IByear" title="' . _YEAR . '">' . $IBgetyear . ': <span class="thick">' . $new_year . '</span></li>'.PHP_EOL;
}
$content .= '<li class="' . $rnIBicon . ' IBtotalusers" title="' . _BTT . '">' . _BTT . ': <span class="thick">' . $total_users . '</span></li>'.PHP_EOL;
if (($waitLink==0 AND $viewlevel>=$zero_in_column_view) OR ($waitLink!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBwaiting" title="' . _WAITLINK . '">' . $waitLink . '</li>'.PHP_EOL;
}
$content .= '</ul></div>'.PHP_EOL;
}
// NEWEST MEMBERS
if ($viewlevel>=$recent_member_view) {
$sql = 'SELECT username FROM ' . $user_prefix . '_users WHERE username!=\'' . $anonyname . '\' ORDER BY user_id DESC LIMIT ' . intval($recent_member_count);
if (!($result = $db->sql_query($sql))) {
// error
die('error getting latest users');
}
$latestusers = $db->sql_numrows($result = $db->sql_query($sql));
$content .= '<div class="IBinfosection" id="IBsection5">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBnewusers' . $IBadjust . '" alt="' . _INFOBOX_NEW_MEMBERS . '" /><span class="IBtextpad thick">' . _INFOBOX_NEW_MEMBERS . '</span></div>'.PHP_EOL;
if ($latestusers > 0){
$content .= '<ul class="rninfobox">'.PHP_EOL;
$newusercounter = 0;
}
while($row = $db->sql_fetchrow($result)) {
$newusercounter += 1;
$TruncateUser = strlen($row['username'])<=$nameMaxLength?$row['username']:substr($row['username'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['username'];
$content .= '<li class="' . $rnIBicon . ' IBmembernew" title="' . _ALT_CHKPROFILE . $lastusername . '"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['username'] . '" title="' . _ALT_CHKPROFILE . $lastusername . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
if ($newusercounter==$latestusers){
$content .= '</ul>'.PHP_EOL;
}
}
$db->sql_freeresult($result);
$content .= '</div>'.PHP_EOL;
}
$m = 0;
if ($viewlevel>=$who_is_online_view) {
// WHOS ONLINE
$members = '';
$guests = '';
$m = $g = 0;
$sql = "SELECT uname, time, host_addr, guest FROM ". $prefix ."_session WHERE time > '".( time() - ($max_session_mins * 60) )."' ORDER BY guest ASC,time DESC";
if (!($result = $db->sql_query($sql))) {
// error
die('error getting online users');
}
$content .= '<div class="IBinfosection" id="IBsection6">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBmembers' . $IBadjust . $IBadjust . '" alt="' . _BON . '" /><span class="IBtextpad thick">' . _BON . '</span></div>'.PHP_EOL;
while($row = $db->sql_fetchrow($result)) {
if ($row['guest'] == 0) {
$m++;
if ($m <= $max_display_members) {
$TruncateUser = strlen($row['uname'])<=$nameMaxLength?$row['uname']:substr($row['uname'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['uname'];
$onlinenames[] = $lastusername;
$members .= '<li class="' . $rnIBicon . ' IBonline2" title="' . _BON . '"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['uname'] . '" title="' . _ALT_CHKPROFILE . $lastusername . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
}
} else {
$g++;
if ($viewlevel>=$show_guest_guest && $g <= $max_display_guests) {
if (is_admin($admin)) {
if ($whoisUseModal){
$uname = '<a class="IBmodal" href="http://' . $whoisServerString . $row['uname'] . '">' . $row['uname'] . '</a>';
} else {
$uname = '<a target="_blank" href="http://' . $whoisServerString . $row['uname'] . '">' . $row['uname'] . '</a>';
}
} else {
// hide last 2 octets of guest ip's.
$ip = explode('.', $row['uname']);
$uname = $ip[0] . '.' . $ip[1] . '.' . preg_replace("/(0|1|2|3|4|5|6|7|8|9)/", "x", $ip[2]) . '.' . preg_replace("/(0|1|2|3|4|5|6|7|8|9)/", "x", $ip[3]);
}
$guests .= '<li class="' . $rnIBicon . ' IBonlineguest" title="' . _BON . '">' . $uname . '</li>'.PHP_EOL;
}
}
}
$db->sql_freeresult($result);
if (($viewlevel>=$showonlinecount) AND (($m > 0) OR ($g > 0 AND !$OnlineGuestsModal))) {
$content .= '<div class="IBsmallnotes">';
if ($m > 0) {
$content .= _BMEM . ':<span class="thick">' . $m . '</span>';
}
if ($g > 0 AND !$OnlineGuestsModal) {
$content .= ' ' . _BVIS . ':<span class="thick">' . $g . '</span>';
}
$content .= ' </div>'.PHP_EOL;
}
if (($m > 0) OR ($viewlevel>=$show_guest_guest && $g > 0)) {
if ($g > 0 AND $OnlineGuestsModal AND $viewlevel == 2) {
$content .= '<div style="display:none">'.PHP_EOL;
$content .= '<div id="IBGuestsView" style="margin-left:20px;">'.PHP_EOL;
$content .= '<h1>' . _BON . '</h1>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= $guests;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
$content .= '<ul class="rninfobox">'.PHP_EOL;
}
if ($g > 0 AND $OnlineGuestsModal) {
$content .= '<li class="' . $rnIBicon . ' IBonlineguest" title="' . _BON . '">';
if ($viewlevel == 2) {
$content .= '<a class="IBGuestsModal" href="#">' . $g . ' ' . _BVIS . '</a>';
} else {
$content .= $g . ' ' . _BVIS;
}
$content .= '</li>' . PHP_EOL;
}
if ($m > 0) {
$content .= $members;
}
if ($g > 0 AND !$OnlineGuestsModal) {
$content .= $guests;
}
if (($m > 0) OR ($viewlevel>=$show_guest_guest && $g > 0)) {
$content .= '</ul>'.PHP_EOL;
}
$content .= '</div>'.PHP_EOL;
}
// LAST SEEN MEMBERS
if ($viewlevel>=$lastseen_user_view) {
$lastseennumber = intval($lastseen_count)+$m;
if (is_user($user)) {
$exclusion = 'AND username!=\'' . $displayname . '\' ';
} else {
$exclusion = '';
}
$sql = 'SELECT username, lastsitevisit FROM ' . $user_prefix . '_users WHERE username!=\'' . $anonyname . '\' ' . $exclusion . 'ORDER BY lastsitevisit DESC LIMIT ' . $lastseennumber;
$latestusers = $db->sql_numrows($result = $db->sql_query($sql));
$latestusercounter = 1;
if ($latestusers > 0) {
$latuse = '<div class="IBinfosection" id="IBsection7">'.PHP_EOL;
$latuse .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBlastseen' . $IBadjust . '" alt="' . _INFOBOX_LAST_SEEN . '" /><span class="IBtextpad thick">' . _INFOBOX_LAST_SEEN . '</span></div>'.PHP_EOL;
$latuse .= '<ul class="rninfobox">'.PHP_EOL;
while( $row = $db->sql_fetchrow($result) ) {
if ($latestusercounter <= $lastseen_count) {
$TruncateUser = strlen($row['username'])<=$nameMaxLength?$row['username']:substr($row['username'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['username'];
$row['lastsitevisit'] = date('d F Y H:i', $row['lastsitevisit']);
if (!in_array($lastusername, $onlinenames)){
$latestusercounter += 1;
$latuse .= '<li class="' . $rnIBicon . ' IBonline"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['username'] . '" title="' . _INFOBOX_LAST_SEEN . ': ' . $row['lastsitevisit'] . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
}
}
}
$latuse .= '</ul>'.PHP_EOL;
$db->sql_freeresult($result);
$latuse .= '</div>'.PHP_EOL;
}
if ($latestusercounter > 1) $content .= $latuse;
}
// SERVER TRAFFIC
if ($viewlevel>=$servertraffic_view) {
$content .= '<div class="IBinfosection" id="IBsection8">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBtraffic' . $IBadjust . '" alt="' . _INFOBOX_SERVERTRAFFIC . '" /><span class="IBtextpad thick">' . _INFOBOX_SERVERTRAFFIC . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$totalhits = 0;
$result = $db->sql_query('SELECT sum(hits) FROM ' . $prefix . '_stats_year');
list($totalhits) = $db->sql_fetchrow($result);
$content .= '<li class="' . $rnIBicon . ' IBtotalhits" title="' . _WERECEIVED . ' ' . number_format($totalhits,0) . ' ' . _PAGESVIEWS . ' ' . $startdate . '">' . _INFOBOX_TOTALHITS.number_format($totalhits,0) . '</li>'.PHP_EOL;
$today = 0;
$todayDST = date('I',time())*3600;
$t_time = time()-$todayDST;
$t_year = date('Y', $t_time);
$t_month = date('n', $t_time);
$t_date = date('j', $t_time);
$result = $db->sql_query('SELECT hits FROM ' . $prefix . '_stats_date WHERE year=' . $t_year . ' AND month=' . $t_month . ' AND date=' . $t_date);
list($today) = $db->sql_fetchrow($result);
$content .= '<li class="' . $rnIBicon . ' IBtodayhits" title="' . _INFOBOX_TODAYHITS.number_format($today,0) . '">' . _INFOBOX_TODAYHITS.number_format($today,0) . '</li>'.PHP_EOL;
if ($how_many_years>0 AND $viewlevel>=$traffic_year_view) {
$sql = 'SELECT year, hits FROM ' . $prefix . '_stats_year ORDER BY year DESC LIMIT ' . intval($how_many_years);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$content .= '<li class="' . $rnIBicon . ' IByearlyhits" title="' . $row['year'] . ': ' . number_format($row['hits']) . '">' . $row['year'] . ': ' . number_format($row['hits']) . '</li>'.PHP_EOL;
}
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
// SERVER DATE/TIME
$content .= '<div class="IBinfosection" id="IBsection9">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBserver' . $IBadjust . '" alt="' . _INFOBOX_SERVERINFO . '" /><span class="IBtextpad thick">' . _INFOBOX_SERVERINFO . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBserdate" title="' . _SERDT . '">' . date('M d, Y') . '</li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBtime" title="' . _SERDT . '">' . date('h:i a T') . '</li>'.PHP_EOL;
if ((is_admin($admin)) and (defined('RAVENNUKE_VERSION_FRIENDLY'))) {
$content .= '<li class="' . $rnIBicon . ' IBglobe" title="RN ' . RAVENNUKE_VERSION_FRIENDLY . '">RN ' . RAVENNUKE_VERSION_FRIENDLY . '</li>'.PHP_EOL;
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div></div>'.PHP_EOL;
// make sure content does not float outside the block
$content .= '<div class="block-spacer"> </div>'.PHP_EOL;
$content .= '<!-- END Info -->'.PHP_EOL;
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/3234de284ee21bd39eecd.jpg)
Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina
|
Posted:
Wed Jun 27, 2012 8:42 am |
|
Your first issue is the incorrect use of $content .=
Your very first instance of the $content variable should be $content = without the .
The $content = that is present in the original code needs to have the . place in front of it. |
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jun 27, 2012 4:04 pm |
|
Can you explain with more details, thanks. I have this
Code:
$content .= '
$content .= "
|
Edit: I tried lots of ways without and with . but no clue. Sorry. ![Sad](modules/Forums/images/smiles/icon_sad.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
Site Admin
![](modules/Forums/images/avatars/201442295664a46e4575d46.jpg)
Joined: Aug 22, 2007
Posts: 1775
|
Posted:
Wed Jun 27, 2012 4:30 pm |
|
unicornio, do you know the difference between HTML and PHP? Do you have take a look inside the other files of your RN? In all files you will found the HTML markup written with double quotes and the php code was written without the double quotes. Have you ever wondered why that is? Try to write the same writing style.
wrong:
Code:$content .= "<table align='center' cellspacing='0' cellpadding='1' border='0'>";
$content .= "<tr>";
|
right:
Code:$content = '<table align="center" cellspacing="0" cellpadding="1" border="0">';
$content .= '<tr>';
|
etc... |
Last edited by neralex on Wed Jun 27, 2012 4:47 pm; edited 2 times in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jun 27, 2012 4:46 pm |
|
When using the variable $content multiple times in the same file, you have to tie all the $content = variables together before it can be used as a single output in the block. You use the operator . to concatenate them. The first one used does not need the ., but anyone that you want to add to it need the concatenation operator.
Try googling php variable concatenation |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jun 27, 2012 10:54 pm |
|
If in doubt of which you need to use, simply null $content at the top of the file after making sure it is not nulled anywhere else.
Code:
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
$content = ''; // two single quotes
|
Then all other instances of $content should start as
$content .= |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jun 28, 2012 2:17 am |
|
Guy! You were right. After taking the time in the morning, fresh brain again I learned something today, one dot makes a lot of different I can't believe it.
This is my last last modification and I do know you guys can make it more beautiful.
This is what I wanted so far and I think removing server info and add some social options could be a nice block to get rid of some blocks. Thank you very much.
Uuser Info + Translation + Drop Menu block
Code:<?php
/*************************************************************************/
/* Tableless CSS Sprite Powered Info Box Block by */
/* SpasticDonkey - web-cms-designs.com */
/* Inspired by: Info Box for RavenNuke by nukecoder.com */
/* RavenWebServices User Info Block www.ravenphpscripts.com */
/* nukeNAV by nukeSEO nukeseo.com */
/* Icons adapted from the Crystal project www.everaldo.com/crystal/ and */
/* the Tango Desktop Project tango.freedesktop.org/Tango_Desktop_Project */
/* Intended for use on RavenNuke(tm) v2.5+ */
/*************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
//Translation
global $prefix, $db, $admin, $nukeurl;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/module.php")) {
include("themes/$ThemeSel/module.php");
if (is_active("$default_module") AND file_exists("modules/$default_module/index.php")) {
$def_module = $default_module;
} else {
$def_module = "";
}
}
$row = $db->sql_fetchrow($db->sql_query("SELECT main_module FROM ".$prefix."_main"));
$main_module = $row['main_module'];
/* If the module doesn't exist, it will be removed from the database automaticaly */
$result2 = $db->sql_query("SELECT title FROM " . $prefix . "_modules");
while ($row2 = $db->sql_fetchrow($result2)) {
$title = stripslashes($row2['title']);
$a = 0;
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ($file == $title) {
$a = 1;
}
}
closedir($handle);
if ($a == 0) {
$db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'");
}
}
/* If you copied a new module is the /modules/ directory, it will be added to the database */
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ( (!preg_match("/[.]/",$file)) ) {
$modlist .= "$file ";
}
}
closedir($handle);
$modlist = explode(" ", $modlist);
sort($modlist);
for ($i=0; $i < sizeof($modlist); $i++) {
if($modlist[$i] != "") {
$row4 = $db->sql_fetchrow($db->sql_query("SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'"));
$mid = intval($row4['mid']);
$mod_uname = preg_replace("/_/", " ", $modlist[$i]);
if ($mid == "") {
$db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$mod_uname', '0', '0', '1')");
}
}
}
$content = "<table align='center' cellspacing='0' cellpadding='1' border='0'>";
$content .= "<tr>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=nl'><img src='images/flags20x20/nl.png' title='Dutch' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cfr&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags20x20/fr.png' title='French' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cde&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags20x20/gr.png' title='German' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cit&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags20x20/it.png' title='Italy' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en&tl=pl&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags20x20/pl.png' title='Polish' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Cpt&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags20x20/pt.png' title='Portugal' border='0'></a></td>";
$content .= "<td><a href='http://babelfish.altavista.com/babelfish/trurl_load?lp=en_ru&url=$nukeurl'><img src='images/flags20x20/flag_russia.gif' title='Russia' border='0'></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&langpair=en%7Ces&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools'><img src='images/flags20x20/es.png' title='Spain' border='0'></a></td>";
$content .= "</tr></table>";
$content .= "<br /><a href=\"$nukeurl\" title=\"Home\"><b>♥ Home:</b></a><br /><a href=\"$nukeurl/modules.php?name=Subscription\" title=\"Subscribe\"><b>♥ Subscribe:</b></a><br /><a href=\"$nukeurl/modules.php?name=Forums\" title=\"Forums\"><b>♥ Forums:</b></a><br /><hr /><br />";
$content .= '<select class="" size="1" name="name" onchange="top.location.href=this.options[this.selectedIndex].value">';
$content .= "<option>Menu</option>";
$result3 = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC");
while ($row3 = $db->sql_fetchrow($result3)) {
$m_title = stripslashes($row3['title']);
$custom_title = $row3['custom_title'];
$view = intval($row3['view']);
$m_title2 = preg_replace("/_/", " ", $m_title);
if ($custom_title != "") {
$m_title2 = $custom_title;
}
if ($m_title != $main_module) {
if ((is_admin($admin) AND $view == 2) OR $view != 2) {
$selected = '';
$content .= "<option value=\"modules.php?name=$m_title\">→ $m_title2</option>";
}
}
}
$content .= "</center></select><br /><br /><hr />";
///date_default_timezone_set('EST');
if (!isset($side)) { $side = ''; }
if ($side == 'c' || $side == 'd' || $side == 't') { $IBCentermode = true; } else { $IBCentermode = false; }
if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");
/*********************************************************************************************************/
/* Setup - Use these settings to control how the user info block displays to users/admins/anonymous. */
/*********************************************************************************************************/
/* MEMBER TOTALS SECTION */
$membercounter_view = 1; // MEMBER TOTALS SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$zero_in_column_view = 2; // If zero registrations during period show column to: 0=everyone 1=user-only 2=admin-only 3=disable
/* RECENT MEMBER SECTION */
$recent_member_view = 1; // RECENT MEMBER SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$recent_member_count = 1; // how many newest members to show to all
$recent_member_user = 2; // how many newest members to show to users
$recent_member_admin = 4; // how many newest members to show to admins
/* ONLINE NOW SECTION */
$who_is_online_view = 1; // ONLINE NOW SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$show_guest_guest = 2; // show online guests to 0=everyone 1=user-only 2=admin-only 3=disable
$max_display_guests = 6; // maximum number of online guests to display
$max_display_members = 6; // maximum number of online members to display
$showonlinecount = 1; // total count of online guests/members: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$max_session_mins = 60; // how long before inactive users are dropped from online list
/* LAST SEEN MEMBER SECTION */
$lastseen_user_view = 0; // LAST SEEN MEMBER SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$lastseen_count = 2; // how many last seen members to show to all
$lastseen_count_user = 4; // how many last seen members to show to users
$lastseen_count_admn = 6; // how many last seen members to show to admins
/* SERVER TRAFFIC SECTION */
$servertraffic_view = 0; // SERVER TRAFFIC SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$traffic_year_view = 1; // Traffic stats by year: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$how_many_years = 2; // how many years to display in traffic stats
/* GENERAL BLOCK SETTINGS */
$nameMaxLength = 13; // Max length for username display. Will truncate with ...
$langMaxLength = 17; // Max length for some problem language defines. Will display in smaller font-size
$LargeSectionIcons = false; // use 32x32 icons for the sections
$display_lost_pass = true; // set to false to hide the lost password link (displays in smaller font in some languages)
$pm_colorbox_notice = true; // if set to true, users will only be notified of private messages once per session
$UsemodalLogin = true; // modal login popup - nukeNAV module must be ACTIVE!
$UseSearchPopUp = true; // modal search popup - nukeNAV and Search modules must be ACTIVE!
$whoisUseModal = true; //admin ip lookup in modal window
$OnlineGuestsModal = true; //compact the online guests into one modal link
$whoisServerString = 'www.dnsstuff.com/tools/whois/?ip='; //admin ip lookup
if ($IBCentermode) { // <- do not edit
/*********************************************************************************************************/
/* CENTER BLOCK SETTINGS (only used when in center position, overrides settings above) */
/*********************************************************************************************************/
$membercounter_view = 0;
$zero_in_column_view = 2;
$recent_member_view = 0;
$recent_member_count = 2;
$recent_member_user = 2;
$recent_member_admin = 2;
$who_is_online_view = 0;
$show_guest_guest = 0;
$max_display_guests = 20;
$max_display_members = 6;
$showonlinecount = 0;
$lastseen_user_view = 0;
$lastseen_count = 6;
$lastseen_count_user = 6;
$lastseen_count_admn = 6;
$servertraffic_view = 0;
$traffic_year_view = 0;
$how_many_years = 2;
$LargeSectionIcons = true;
} // <- do not edit
/*********************************************************************************************************/
/* Sprite Settings - For more info see http://www.rtsforce.com/InfoBox-CSS/ */
/*********************************************************************************************************/
$IBtran = 'images/transparent.gif'; // source for the transparent gif sprite container
$IBicon = 'IBicon8'; // default classes for icons (changed by theme below unless $MultiThemeMode = false)
$rnIBicon = 'rnIBicon'; // default classes for icons (changed by theme below unless $MultiThemeMode = false)
$MultiThemeMode = true; // false to disable loading theme specific icons, and ignore array settings below - see readme
$rnIBWhite = array('3D-Fantasy', 'DeepBlue', 'ExtraLite', 'NukeNews', 'Slash', 'SlashOcean', 'Traditional'); // Themes with white block backgrounds
$rnIBGray = array('Anagram', 'Karate', 'Milo'); // Themes with gray block backgrounds
$rnIBCreme = array('Sunset'); // Themes with creme block backgrounds
$rnIBSimplyBlue = array('SimplyBlue'); // Themes with sky blue block backgrounds
$rnIBSandJourney = array('Sand_Journey'); // Themes with sand block backgrounds
$rnIBBlueBlog = array('Blue_Blog'); // Themes with taupe block backgrounds
$rnIBCTRN = array('CT_RN'); // Themes with crimson backgrounds
$rnIBRavenIce = array('RavenIce', 'fisubice'); // Themes with off-white/blue block backgrounds
$rnIBKaput = array('Kaput'); // Themes with blue/gray block backgrounds
$rnIBBlack = array(); // Themes with black block backgrounds
$rnIBExtra = array(); // An extra group for other themes (use class rnIBExtra and IBExtra to define your sprite background - see readme)
/*********************************************************************************************************/
/* You should not need to modify anything below this line */
/*********************************************************************************************************/
global $db, $prefix, $ya_config, $anonymous, $user_prefix, $user, $sitekey, $gfx_chk, $admin, $currentlang, $language, $startdate, $name;
if(file_exists('language/infobox/lang-' . $currentlang . '.php')) {
include_once 'language/infobox/lang-' . $currentlang . '.php';
} elseif(file_exists('language/infobox/lang-' . $language . '.php')) {
include_once 'language/infobox/lang-' . $language . '.php';
} else {
include_once 'language/infobox/lang-english.php';
}
if (!isset($name)) { $name = ''; }
if ($IBCentermode) {
$ListClass = 'IBblock-center';
addJSToBody('includes/jquery/jquery.masonry.min.js', 'file');
addJSToBody('includes/jquery/jquery.userinfo.js', 'file');
} else {
$ListClass = 'IBblock';
}
if (!isset($ya_config)) $ya_config = ya_get_configs();
if ($MultiThemeMode){
$ThemeSel = get_theme();
if (in_array($ThemeSel, $rnIBWhite)) {$rnIBicon = 'rnIBWhite';$IBicon = 'IBWhite';}
else if (in_array($ThemeSel, $rnIBGray)) {$rnIBicon = 'rnIBGray';$IBicon = 'IBGray';}
else if (in_array($ThemeSel, $rnIBCreme)) {$rnIBicon = 'rnIBCreme';$IBicon = 'IBCreme';}
else if (in_array($ThemeSel, $rnIBSimplyBlue)) {$rnIBicon = 'rnIBSimplyBlue';$IBicon = 'IBSimplyBlue';}
else if (in_array($ThemeSel, $rnIBSandJourney)) {$rnIBicon = 'rnIBSandJourney';$IBicon = 'IBSandJourney';}
else if (in_array($ThemeSel, $rnIBBlueBlog)) {$rnIBicon = 'rnIBBlueBlog';$IBicon = 'IBBlueBlog';}
else if (in_array($ThemeSel, $rnIBCTRN)) {$rnIBicon = 'rnIBCT-RN';$IBicon = 'IBCT-RN';}
else if (in_array($ThemeSel, $rnIBRavenIce)) {$rnIBicon = 'rnIBRavenIce';$IBicon = 'IBRavenIce';}
else if (in_array($ThemeSel, $rnIBKaput)) {$rnIBicon = 'rnIBKaput';$IBicon = 'IBKaput';}
else if (in_array($ThemeSel, $rnIBBlack)) {$rnIBicon = 'rnIBBlack';$IBicon = 'IBBlack';}
else if (in_array($ThemeSel, $rnIBExtra)) {$rnIBicon = 'rnIBExtra';$IBicon = 'IBExtra';}
else {$rnIBicon = 'rnIBicon';$IBicon = 'IBicon8';}
}
if ($LargeSectionIcons) {$IBadjust = 'LG';$IBicon = 'IBBigIcons';} else {$IBadjust = '';}
if (is_admin($admin)) {
$viewlevel = 2;
$lastseen_count=$lastseen_count_admn;
$recent_member_count=$recent_member_admin;
} else if (is_user($user)) {
$viewlevel = 1;
$lastseen_count=$lastseen_count_user;
$recent_member_count=$recent_member_user;
} else {
$viewlevel = 0;
}
$anonyname = 'Anonymous';
$displayname = '';
$show_pms = 0;
$onlinenames = array();
$content .= '<!-- Start Info -->
<div id="' . $ListClass . '"><div class="fullwidth">
';
// get user info/show login
if (is_user($user)) {
$uinfo = cookiedecode($user);
$displayname = check_html($uinfo[1], 'nohtml');
$content .= '<div class="IBinfosection" id="IBsection1">'.PHP_EOL;
$content .= '<div><a href="modules.php?name=Your_Account&op=edituser" class="IBuser' . $IBadjust . '" title="' . _FSIYOURACCOUNT . '"><img src="' . $IBtran . '" class="' . $IBicon . '" alt="' . _FSIYOURACCOUNT . '" /><span class="IBtextpad">' . $displayname . '</span></a></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
if ($whoisUseModal){$iblinktype = 'class="IBmodal"';} else {$iblinktype = 'target="_blank"';}
$content .= '<li class="' . $rnIBicon . ' IByourip" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '"><span class="thick"><a ' . $iblinktype . ' href="http://' . $whoisServerString . $_SERVER['REMOTE_ADDR'] . '" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '">' . $_SERVER['REMOTE_ADDR'] . '</a></span></li>'.PHP_EOL;
if (is_active('Forums')) {
$adjustment = strlen(html_entity_decode(_INFOBOX_EGOPOSTS));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IByourposts' . $getsmall . '" title="' . _INFOBOX_EGOPOSTS . '"><a href="forums.html?amp;file=search&search_id=egosearch" title="' . _INFOBOX_EGOPOSTS . '">' . _INFOBOX_EGOPOSTS . '</a></li>'.PHP_EOL;
}
if ($ya_config['allowusertheme']=='1') {
$content .= '<li class="' . $rnIBicon . ' IBchangetheme" title="' . _INFOBOX_CHANGETHEME . '"><a href="modules.php?name=Your_Account&op=chgtheme" title="' . _INFOBOX_CHANGETHEME . '">' . _INFOBOX_CHANGETHEME . '</a></li>'.PHP_EOL;
}
if (is_active('nukeNAV') and is_active('Search') and $UseSearchPopUp) $content .= '<li class="' . $rnIBicon . ' IBsearch" title="' . _SEARCH . '"><a href="modules.php?name=nukeNAV&op=search" class="colorbox" title="">' . _SEARCH . '</a></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGOUT . '"><a href="modules.php?name=Your_Account&op=logout" title="' . _LOGOUT . '">' . _LOGOUT . '</a></li>'.PHP_EOL;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
// check new pms
$sql = 'SELECT privmsgs_to_userid FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid=' . intval($uinfo[0]) . ' AND (privmsgs_type=5 OR privmsgs_type=1)';
if (!($result = $db->sql_query($sql))) {
// error
die('error checking new pms');
}
$new_pms = $db->sql_numrows($result);
$db->sql_freeresult($result);
// check old pms
$sql = 'SELECT privmsgs_to_userid FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid=' . intval($uinfo[0]) . ' AND (privmsgs_type=0)';
if (!($result = $db->sql_query($sql))) {
// error
die('error checking old pms');
}
$old_pms = $db->sql_numrows($result);
$db->sql_freeresult($result);
$show_pms = $new_pms+$old_pms;
if ($show_pms > 0 AND is_active('Private_Messages')) {
$content .= '<div class="IBinfosection" id="IBsection2">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBpms' . $IBadjust . '" alt="' . _BPM . '" /><span class="IBtextpad thick">' . _BPM . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBnewpms" title="' . _BPM . '"><a href="modules.php?name=Private_Messages" title="' . _BPM . '">' . _BUNREAD . ': ' . $new_pms . '</a></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBoldpms" title="' . _BREAD . '"> ' . _BREAD . ': <span class="thick">' . $old_pms . '</span></li>'.PHP_EOL;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
if (($pm_colorbox_notice && $new_pms > 0) and (!isset($_COOKIE["youhaveapm"])) and ($name!='Private_Messages')) {
setcookie('youhaveapm', 'checked');
$content .= '<div id="IByesnewpm" style="display:none">'.PHP_EOL;
$content .= '<div id="IBnewmessages">'.PHP_EOL;
$content .= '<span class="IBCBtext"><img src="' . $IBtran . '" class="' . $IBicon . ' IBoldpms" alt="' . _NEWPMSG . '" /> ' . _YOUHAVE . ' <a href="modules.php?name=Private_Messages">' . $new_pms . ' ' . _NEWPMSG . '.</a></span>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
}
} else {
$content .= '<div class="IBinfosection" id="IBsection3">'.PHP_EOL;
$content .= '<div><a href="modules.php?name=Your_Account" title="' . _FSIYOURACCOUNT . '" class="IBglobe' . $IBadjust . '"><img src="' . $IBtran . '" class="' . $IBicon . ' IBglobe' . $IBadjust . '" alt="' . $anonymous . '" /><span class="IBtextpad">' . $anonymous . '</span></a></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IByourip IBguestip" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '"><span class="thick">' . $_SERVER['REMOTE_ADDR'] . '</span></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IByourposts" title="' . _BREG . '"><a href="modules.php?name=Your_Account&op=new_user">' . _BREG . '</a></li>'.PHP_EOL;
if (is_active('nukeNAV') and is_active('Search') and $UseSearchPopUp) $content .= '<li class="' . $rnIBicon . ' IBsearch" title="' . _SEARCH . '"><a href="modules.php?name=nukeNAV&op=search" class="colorbox" title="">' . _SEARCH . '</a></li>'.PHP_EOL;
if ($UsemodalLogin){
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGIN . '"><a href="modules.php?name=nukeNAV&op=login" class="colorbox">' . _LOGIN . '</a></li>'.PHP_EOL;
} else {
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGIN . '"><a href="modules.php?name=Your_Account">' . _LOGIN . '</a></li>'.PHP_EOL;
}
if ($display_lost_pass) {
$adjustment = strlen(html_entity_decode(_PASSWORDLOST));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IBonlineguest' . $getsmall . '" title="' . _PASSWORDLOST . '"><a href="modules.php?name=Your_Account&op=pass_lost">' . _PASSWORDLOST . '</a></li>'.PHP_EOL;
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
if ($viewlevel>=$membercounter_view) {
// MEMBER COUNTS
$sql = 'SELECT username FROM ' . $user_prefix . '_users_temp';
$result = $db->sql_query($sql);
$waiting = $db->sql_numrows($result);
$content .= '<div class="IBinfosection" id="IBsection4">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBmembers' . $IBadjust . '" alt="' . _BMEM . '" /><span class="IBtextpad thick">' . _BMEM . '</span></div>'.PHP_EOL;
// 0001856: User Info block enhancements
$IBgetmonth = _UMONTH;
$IBgetyear = _YEAR;
// get new member info
$timestamp = time();
$today = date("M d, Y");
$yesterday = date("M d, Y", ($timestamp - 86400) );
$this_month = date("M");
$this_year = date("Y");
// today
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE user_regdate=\'' . $today . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting todays users');
}
list($new_today) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// yesterday
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE user_regdate=\'' . $yesterday . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting yesterdays users');
}
list($new_yesterday) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// this month
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE SUBSTRING(user_regdate, 1, 4)=\'' . $this_month . '\' AND SUBSTRING(user_regdate, 9, 12)=\'' . $this_year . '\'';
if (!($result = $db->sql_query($sql))){
// error
die('error getting this months users');
}
list($new_month) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// this year
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE SUBSTRING(user_regdate, 9, 12)=\'' . $this_year . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting this years users');
}
list($new_year) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// all time
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting total users');
}
if (is_admin($admin) AND @file_exists('modules/Resend_Email/index.php')) {
$waitLink = '<a href="modules.php?name=Resend_Email" title="' . _TTL_RESENDEMAIL . '">' . _WAITLINK . ': <span class="thick">' . $waiting . '</span></a>';
} else {
$waitLink = _WAITLINK . ': <span class="thick">' . $waiting . '</span>';
}
list($total_users) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$content .= '<ul class="rninfobox">'.PHP_EOL;
if (($new_today==0 AND $viewlevel>=$zero_in_column_view) OR ($new_today!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBtoday" title="' . _INFOBOX_BTD . '">' . _INFOBOX_BTD . ': <span class="thick">' . $new_today . '</span></li>'.PHP_EOL;
}
if (($new_yesterday==0 AND $viewlevel>=$zero_in_column_view) OR ($new_yesterday!=0)) {
$adjustment = strlen(html_entity_decode(_INFOBOX_BYD));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IByesterday' . $getsmall . '" title="' . _INFOBOX_BYD . '">' . _INFOBOX_BYD . ': <span class="thick">' . $new_yesterday . '</span></li>'.PHP_EOL;
}
if (($new_month==0 AND $viewlevel>=$zero_in_column_view) OR ($new_month!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBmonth" title="' . _UMONTH . '">' . $IBgetmonth . ': <span class="thick">' . $new_month . '</span></li>'.PHP_EOL;
}
if (($new_year==0 AND $viewlevel>=$zero_in_column_view) OR ($new_year!=0)) {
$content .= '<li class="' . $rnIBicon . ' IByear" title="' . _YEAR . '">' . $IBgetyear . ': <span class="thick">' . $new_year . '</span></li>'.PHP_EOL;
}
$content .= '<li class="' . $rnIBicon . ' IBtotalusers" title="' . _BTT . '">' . _BTT . ': <span class="thick">' . $total_users . '</span></li>'.PHP_EOL;
if (($waitLink==0 AND $viewlevel>=$zero_in_column_view) OR ($waitLink!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBwaiting" title="' . _WAITLINK . '">' . $waitLink . '</li>'.PHP_EOL;
}
$content .= '</ul></div>'.PHP_EOL;
}
// NEWEST MEMBERS
if ($viewlevel>=$recent_member_view) {
$sql = 'SELECT username FROM ' . $user_prefix . '_users WHERE username!=\'' . $anonyname . '\' ORDER BY user_id DESC LIMIT ' . intval($recent_member_count);
if (!($result = $db->sql_query($sql))) {
// error
die('error getting latest users');
}
$latestusers = $db->sql_numrows($result = $db->sql_query($sql));
$content .= '<div class="IBinfosection" id="IBsection5">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBnewusers' . $IBadjust . '" alt="' . _INFOBOX_NEW_MEMBERS . '" /><span class="IBtextpad thick">' . _INFOBOX_NEW_MEMBERS . '</span></div>'.PHP_EOL;
if ($latestusers > 0){
$content .= '<ul class="rninfobox">'.PHP_EOL;
$newusercounter = 0;
}
while($row = $db->sql_fetchrow($result)) {
$newusercounter += 1;
$TruncateUser = strlen($row['username'])<=$nameMaxLength?$row['username']:substr($row['username'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['username'];
$content .= '<li class="' . $rnIBicon . ' IBmembernew" title="' . _ALT_CHKPROFILE . $lastusername . '"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['username'] . '" title="' . _ALT_CHKPROFILE . $lastusername . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
if ($newusercounter==$latestusers){
$content .= '</ul>'.PHP_EOL;
}
}
$db->sql_freeresult($result);
$content .= '</div>'.PHP_EOL;
}
$m = 0;
if ($viewlevel>=$who_is_online_view) {
// WHOS ONLINE
$members = '';
$guests = '';
$m = $g = 0;
$sql = "SELECT uname, time, host_addr, guest FROM ". $prefix ."_session WHERE time > '".( time() - ($max_session_mins * 60) )."' ORDER BY guest ASC,time DESC";
if (!($result = $db->sql_query($sql))) {
// error
die('error getting online users');
}
$content .= '<div class="IBinfosection" id="IBsection6">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBmembers' . $IBadjust . $IBadjust . '" alt="' . _BON . '" /><span class="IBtextpad thick">' . _BON . '</span></div>'.PHP_EOL;
while($row = $db->sql_fetchrow($result)) {
if ($row['guest'] == 0) {
$m++;
if ($m <= $max_display_members) {
$TruncateUser = strlen($row['uname'])<=$nameMaxLength?$row['uname']:substr($row['uname'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['uname'];
$onlinenames[] = $lastusername;
$members .= '<li class="' . $rnIBicon . ' IBonline2" title="' . _BON . '"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['uname'] . '" title="' . _ALT_CHKPROFILE . $lastusername . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
}
} else {
$g++;
if ($viewlevel>=$show_guest_guest && $g <= $max_display_guests) {
if (is_admin($admin)) {
if ($whoisUseModal){
$uname = '<a class="IBmodal" href="http://' . $whoisServerString . $row['uname'] . '">' . $row['uname'] . '</a>';
} else {
$uname = '<a target="_blank" href="http://' . $whoisServerString . $row['uname'] . '">' . $row['uname'] . '</a>';
}
} else {
// hide last 2 octets of guest ip's.
$ip = explode('.', $row['uname']);
$uname = $ip[0] . '.' . $ip[1] . '.' . preg_replace("/(0|1|2|3|4|5|6|7|8|9)/", "x", $ip[2]) . '.' . preg_replace("/(0|1|2|3|4|5|6|7|8|9)/", "x", $ip[3]);
}
$guests .= '<li class="' . $rnIBicon . ' IBonlineguest" title="' . _BON . '">' . $uname . '</li>'.PHP_EOL;
}
}
}
$db->sql_freeresult($result);
if (($viewlevel>=$showonlinecount) AND (($m > 0) OR ($g > 0 AND !$OnlineGuestsModal))) {
$content .= '<div class="IBsmallnotes">';
if ($m > 0) {
$content .= _BMEM . ':<span class="thick">' . $m . '</span>';
}
if ($g > 0 AND !$OnlineGuestsModal) {
$content .= ' ' . _BVIS . ':<span class="thick">' . $g . '</span>';
}
$content .= ' </div>'.PHP_EOL;
}
if (($m > 0) OR ($viewlevel>=$show_guest_guest && $g > 0)) {
if ($g > 0 AND $OnlineGuestsModal AND $viewlevel == 2) {
$content .= '<div style="display:none">'.PHP_EOL;
$content .= '<div id="IBGuestsView" style="margin-left:20px;">'.PHP_EOL;
$content .= '<h1>' . _BON . '</h1>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= $guests;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
$content .= '<ul class="rninfobox">'.PHP_EOL;
}
if ($g > 0 AND $OnlineGuestsModal) {
$content .= '<li class="' . $rnIBicon . ' IBonlineguest" title="' . _BON . '">';
if ($viewlevel == 2) {
$content .= '<a class="IBGuestsModal" href="#">' . $g . ' ' . _BVIS . '</a>';
} else {
$content .= $g . ' ' . _BVIS;
}
$content .= '</li>' . PHP_EOL;
}
if ($m > 0) {
$content .= $members;
}
if ($g > 0 AND !$OnlineGuestsModal) {
$content .= $guests;
}
if (($m > 0) OR ($viewlevel>=$show_guest_guest && $g > 0)) {
$content .= '</ul>'.PHP_EOL;
}
$content .= '</div>'.PHP_EOL;
}
// LAST SEEN MEMBERS
if ($viewlevel>=$lastseen_user_view) {
$lastseennumber = intval($lastseen_count)+$m;
if (is_user($user)) {
$exclusion = 'AND username!=\'' . $displayname . '\' ';
} else {
$exclusion = '';
}
$sql = 'SELECT username, lastsitevisit FROM ' . $user_prefix . '_users WHERE username!=\'' . $anonyname . '\' ' . $exclusion . 'ORDER BY lastsitevisit DESC LIMIT ' . $lastseennumber;
$latestusers = $db->sql_numrows($result = $db->sql_query($sql));
$latestusercounter = 1;
if ($latestusers > 0) {
$latuse = '<div class="IBinfosection" id="IBsection7">'.PHP_EOL;
$latuse .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBlastseen' . $IBadjust . '" alt="' . _INFOBOX_LAST_SEEN . '" /><span class="IBtextpad thick">' . _INFOBOX_LAST_SEEN . '</span></div>'.PHP_EOL;
$latuse .= '<ul class="rninfobox">'.PHP_EOL;
while( $row = $db->sql_fetchrow($result) ) {
if ($latestusercounter <= $lastseen_count) {
$TruncateUser = strlen($row['username'])<=$nameMaxLength?$row['username']:substr($row['username'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['username'];
$row['lastsitevisit'] = date('d F Y H:i', $row['lastsitevisit']);
if (!in_array($lastusername, $onlinenames)){
$latestusercounter += 1;
$latuse .= '<li class="' . $rnIBicon . ' IBonline"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['username'] . '" title="' . _INFOBOX_LAST_SEEN . ': ' . $row['lastsitevisit'] . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
}
}
}
$latuse .= '</ul>'.PHP_EOL;
$db->sql_freeresult($result);
$latuse .= '</div>'.PHP_EOL;
}
if ($latestusercounter > 1) $content .= $latuse;
}
// SERVER TRAFFIC
if ($viewlevel>=$servertraffic_view) {
$content .= '<div class="IBinfosection" id="IBsection8">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBtraffic' . $IBadjust . '" alt="' . _INFOBOX_SERVERTRAFFIC . '" /><span class="IBtextpad thick">' . _INFOBOX_SERVERTRAFFIC . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$totalhits = 0;
$result = $db->sql_query('SELECT sum(hits) FROM ' . $prefix . '_stats_year');
list($totalhits) = $db->sql_fetchrow($result);
$content .= '<li class="' . $rnIBicon . ' IBtotalhits" title="' . _WERECEIVED . ' ' . number_format($totalhits,0) . ' ' . _PAGESVIEWS . ' ' . $startdate . '">' . _INFOBOX_TOTALHITS.number_format($totalhits,0) . '</li>'.PHP_EOL;
$today = 0;
$todayDST = date('I',time())*3600;
$t_time = time()-$todayDST;
$t_year = date('Y', $t_time);
$t_month = date('n', $t_time);
$t_date = date('j', $t_time);
$result = $db->sql_query('SELECT hits FROM ' . $prefix . '_stats_date WHERE year=' . $t_year . ' AND month=' . $t_month . ' AND date=' . $t_date);
list($today) = $db->sql_fetchrow($result);
$content .= '<li class="' . $rnIBicon . ' IBtodayhits" title="' . _INFOBOX_TODAYHITS.number_format($today,0) . '">' . _INFOBOX_TODAYHITS.number_format($today,0) . '</li>'.PHP_EOL;
if ($how_many_years>0 AND $viewlevel>=$traffic_year_view) {
$sql = 'SELECT year, hits FROM ' . $prefix . '_stats_year ORDER BY year DESC LIMIT ' . intval($how_many_years);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$content .= '<li class="' . $rnIBicon . ' IByearlyhits" title="' . $row['year'] . ': ' . number_format($row['hits']) . '">' . $row['year'] . ': ' . number_format($row['hits']) . '</li>'.PHP_EOL;
}
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
// SERVER DATE/TIME
$content .= '<div class="IBinfosection" id="IBsection9">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBserver' . $IBadjust . '" alt="' . _INFOBOX_SERVERINFO . '" /><span class="IBtextpad thick">' . _INFOBOX_SERVERINFO . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBserdate" title="' . _SERDT . '">' . date('M d, Y') . '</li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBtime" title="' . _SERDT . '">' . date('h:i a T') . '</li>'.PHP_EOL;
if ((is_admin($admin)) and (defined('RAVENNUKE_VERSION_FRIENDLY'))) {
$content .= '<li class="' . $rnIBicon . ' IBglobe" title="RN ' . RAVENNUKE_VERSION_FRIENDLY . '">RN ' . RAVENNUKE_VERSION_FRIENDLY . '</li>'.PHP_EOL;
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div></div>'.PHP_EOL;
// make sure content does not float outside the block
$content .= '<div class="block-spacer"> </div>'.PHP_EOL;
$content .= '<!-- END Info -->'.PHP_EOL;
?>
|
Note: I do have very good ideas for Ravennuke and I hope I can share it with all you. Thanks again |
Last edited by hicuxunicorniobestbuildpc on Fri Jun 29, 2012 7:16 pm; edited 1 time in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Jun 29, 2012 6:58 pm |
|
Ok Guys! I fixed most of the error I had with this block. I was working validating the whole translation block which was poor coding. I still have one error.
Line 180, Column 1562: end tag for element "center" which is not open
Code:…r='0' /></a></td></tr></table></center><br /><a rel='nofollow' href='http://ww…
|
Now I remove </center> and the the problem is gone.
Code: <?php
/*************************************************************************/
/* Tableless CSS Sprite Powered Info Box Block by */
/* SpasticDonkey - web-cms-designs.com */
/* Inspired by: Info Box for RavenNuke by nukecoder.com */
/* RavenWebServices User Info Block www.ravenphpscripts.com */
/* nukeNAV by nukeSEO nukeseo.com */
/* Icons adapted from the Crystal project www.everaldo.com/crystal/ and */
/* the Tango Desktop Project tango.freedesktop.org/Tango_Desktop_Project */
/* Intended for use on RavenNuke(tm) v2.5+ */
/*************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
//Translation
global $prefix, $db, $admin, $nukeurl;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/module.php")) {
include("themes/$ThemeSel/module.php");
if (is_active("$default_module") AND file_exists("modules/$default_module/index.php")) {
$def_module = $default_module;
} else {
$def_module = "";
}
}
$row = $db->sql_fetchrow($db->sql_query("SELECT main_module FROM ".$prefix."_main"));
$main_module = $row['main_module'];
/* If the module doesn't exist, it will be removed from the database automaticaly */
$result2 = $db->sql_query("SELECT title FROM " . $prefix . "_modules");
while ($row2 = $db->sql_fetchrow($result2)) {
$title = stripslashes($row2['title']);
$a = 0;
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ($file == $title) {
$a = 1;
}
}
closedir($handle);
if ($a == 0) {
$db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'");
}
}
/* If you copied a new module is the /modules/ directory, it will be added to the database */
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ( (!preg_match("/[.]/",$file)) ) {
$modlist .= "$file ";
}
}
closedir($handle);
$modlist = explode(" ", $modlist);
sort($modlist);
for ($i=0; $i < sizeof($modlist); $i++) {
if($modlist[$i] != "") {
$row4 = $db->sql_fetchrow($db->sql_query("SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'"));
$mid = intval($row4['mid']);
$mod_uname = preg_replace("/_/", " ", $modlist[$i]);
if ($mid == "") {
$db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$mod_uname', '0', '0', '1')");
}
}
}
$content = "<table align='center' cellspacing='0' cellpadding='1' border='0'>";
$content .= "<tr>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=nl&hl=en&ie=UTF8'><img src='images/flags20x20/nl.png' title='Dutch' alt='Dutch' border='0' /></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=nl&hl=en&ie=UTF8'><img src='images/flags20x20/fr.png' title='French' alt='French' border='0' /></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=de&hl=en&ie=UTF8'><img src='images/flags20x20/gr.png' title='Germany' alt='Germany' border='0' /></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=it&hl=en&ie=UTF8'><img src='images/flags20x20/it.png' title='Italy' alt='Italy' border='0' /></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=pl&hl=en&ie=UTF8'><img src='images/flags20x20/pl.png' title='Poland' alt='Poland' border='0' /></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=pt&hl=en&ie=UTF8'><img src='images/flags20x20/pt.png' title='Portugal' alt='Portugal' border='0' /></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=es&hl=en&ie=UTF8'><img src='images/flags20x20/es.png' title='Spain' alt='Spain' border='0' /></a></td>";
$content .= '</tr></table>';
$content .= "<br /><a rel='nofollow' href='$nukeurl' title='Home'> <img src='images/flags20x20/home.png' alt='Home' /> <b>Home:</b></a><br /><a rel='nofollow' href='$nukeurl/modules.php?name=Donations' title='Donations'> <img src='images/flags20x20/donate.png' alt='Donations' /> <b>Donations:</b></a><br /><a rel='nofollow' href='$nukeurl/modules.php?name=Forums' title='Forums'> <img src='images/flags20x20/forum.png' alt='Forums' /> <b>Forums:</b></a><br /><hr /><br />";
$content .= '<select class="" size="1" name="name" onchange="top.location.href=this.options[this.selectedIndex].value">';
$content .= "<option>Menu</option>";
$result3 = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC");
while ($row3 = $db->sql_fetchrow($result3)) {
$m_title = stripslashes($row3['title']);
$custom_title = $row3['custom_title'];
$view = intval($row3['view']);
$m_title2 = preg_replace("/_/", " ", $m_title);
if ($custom_title != "") {
$m_title2 = $custom_title;
}
if ($m_title != $main_module) {
if ((is_admin($admin) AND $view == 2) OR $view != 2) {
$selected = '';
$content .= "<option value=\"modules.php?name=$m_title\">→ $m_title2</option>";
}
}
}
$content .= '</select><br /><br /><hr />';
///date_default_timezone_set('EST');
if (!isset($side)) { $side = ''; }
if ($side == 'c' || $side == 'd' || $side == 't') { $IBCentermode = true; } else { $IBCentermode = false; }
if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");
/*********************************************************************************************************/
/* Setup - Use these settings to control how the user info block displays to users/admins/anonymous. */
/*********************************************************************************************************/
/* MEMBER TOTALS SECTION */
$membercounter_view = 1; // MEMBER TOTALS SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$zero_in_column_view = 2; // If zero registrations during period show column to: 0=everyone 1=user-only 2=admin-only 3=disable
/* RECENT MEMBER SECTION */
$recent_member_view = 1; // RECENT MEMBER SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$recent_member_count = 1; // how many newest members to show to all
$recent_member_user = 2; // how many newest members to show to users
$recent_member_admin = 4; // how many newest members to show to admins
/* ONLINE NOW SECTION */
$who_is_online_view = 1; // ONLINE NOW SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$show_guest_guest = 2; // show online guests to 0=everyone 1=user-only 2=admin-only 3=disable
$max_display_guests = 6; // maximum number of online guests to display
$max_display_members = 6; // maximum number of online members to display
$showonlinecount = 1; // total count of online guests/members: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$max_session_mins = 60; // how long before inactive users are dropped from online list
/* LAST SEEN MEMBER SECTION */
$lastseen_user_view = 0; // LAST SEEN MEMBER SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$lastseen_count = 2; // how many last seen members to show to all
$lastseen_count_user = 4; // how many last seen members to show to users
$lastseen_count_admn = 6; // how many last seen members to show to admins
/* SERVER TRAFFIC SECTION */
$servertraffic_view = 0; // SERVER TRAFFIC SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$traffic_year_view = 1; // Traffic stats by year: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$how_many_years = 2; // how many years to display in traffic stats
/* GENERAL BLOCK SETTINGS */
$nameMaxLength = 13; // Max length for username display. Will truncate with ...
$langMaxLength = 17; // Max length for some problem language defines. Will display in smaller font-size
$LargeSectionIcons = false; // use 32x32 icons for the sections
$display_lost_pass = true; // set to false to hide the lost password link (displays in smaller font in some languages)
$pm_colorbox_notice = true; // if set to true, users will only be notified of private messages once per session
$UsemodalLogin = true; // modal login popup - nukeNAV module must be ACTIVE!
$UseSearchPopUp = true; // modal search popup - nukeNAV and Search modules must be ACTIVE!
$whoisUseModal = true; //admin ip lookup in modal window
$OnlineGuestsModal = true; //compact the online guests into one modal link
$whoisServerString = 'www.dnsstuff.com/tools/whois/?ip='; //admin ip lookup
if ($IBCentermode) { // <- do not edit
/*********************************************************************************************************/
/* CENTER BLOCK SETTINGS (only used when in center position, overrides settings above) */
/*********************************************************************************************************/
$membercounter_view = 0;
$zero_in_column_view = 2;
$recent_member_view = 0;
$recent_member_count = 2;
$recent_member_user = 2;
$recent_member_admin = 2;
$who_is_online_view = 0;
$show_guest_guest = 0;
$max_display_guests = 20;
$max_display_members = 6;
$showonlinecount = 0;
$lastseen_user_view = 0;
$lastseen_count = 6;
$lastseen_count_user = 6;
$lastseen_count_admn = 6;
$servertraffic_view = 0;
$traffic_year_view = 0;
$how_many_years = 2;
$LargeSectionIcons = true;
} // <- do not edit
/*********************************************************************************************************/
/* Sprite Settings - For more info see http://www.rtsforce.com/InfoBox-CSS/ */
/*********************************************************************************************************/
$IBtran = 'images/transparent.gif'; // source for the transparent gif sprite container
$IBicon = 'IBicon8'; // default classes for icons (changed by theme below unless $MultiThemeMode = false)
$rnIBicon = 'rnIBicon'; // default classes for icons (changed by theme below unless $MultiThemeMode = false)
$MultiThemeMode = true; // false to disable loading theme specific icons, and ignore array settings below - see readme
$rnIBWhite = array('3D-Fantasy', 'DeepBlue', 'ExtraLite', 'NukeNews', 'Slash', 'SlashOcean', 'Traditional'); // Themes with white block backgrounds
$rnIBGray = array('Anagram', 'Karate', 'Milo'); // Themes with gray block backgrounds
$rnIBCreme = array('Sunset'); // Themes with creme block backgrounds
$rnIBSimplyBlue = array('SimplyBlue'); // Themes with sky blue block backgrounds
$rnIBSandJourney = array('Sand_Journey'); // Themes with sand block backgrounds
$rnIBBlueBlog = array('Blue_Blog'); // Themes with taupe block backgrounds
$rnIBCTRN = array('CT_RN'); // Themes with crimson backgrounds
$rnIBRavenIce = array('RavenIce', 'fisubice'); // Themes with off-white/blue block backgrounds
$rnIBKaput = array('Kaput'); // Themes with blue/gray block backgrounds
$rnIBBlack = array(); // Themes with black block backgrounds
$rnIBExtra = array(); // An extra group for other themes (use class rnIBExtra and IBExtra to define your sprite background - see readme)
/*********************************************************************************************************/
/* You should not need to modify anything below this line */
/*********************************************************************************************************/
global $db, $prefix, $ya_config, $anonymous, $user_prefix, $user, $sitekey, $gfx_chk, $admin, $currentlang, $language, $startdate, $name;
if(file_exists('language/infobox/lang-' . $currentlang . '.php')) {
include_once 'language/infobox/lang-' . $currentlang . '.php';
} elseif(file_exists('language/infobox/lang-' . $language . '.php')) {
include_once 'language/infobox/lang-' . $language . '.php';
} else {
include_once 'language/infobox/lang-english.php';
}
if (!isset($name)) { $name = ''; }
if ($IBCentermode) {
$ListClass = 'IBblock-center';
addJSToBody('includes/jquery/jquery.masonry.min.js', 'file');
addJSToBody('includes/jquery/jquery.userinfo.js', 'file');
} else {
$ListClass = 'IBblock';
}
if (!isset($ya_config)) $ya_config = ya_get_configs();
if ($MultiThemeMode){
$ThemeSel = get_theme();
if (in_array($ThemeSel, $rnIBWhite)) {$rnIBicon = 'rnIBWhite';$IBicon = 'IBWhite';}
else if (in_array($ThemeSel, $rnIBGray)) {$rnIBicon = 'rnIBGray';$IBicon = 'IBGray';}
else if (in_array($ThemeSel, $rnIBCreme)) {$rnIBicon = 'rnIBCreme';$IBicon = 'IBCreme';}
else if (in_array($ThemeSel, $rnIBSimplyBlue)) {$rnIBicon = 'rnIBSimplyBlue';$IBicon = 'IBSimplyBlue';}
else if (in_array($ThemeSel, $rnIBSandJourney)) {$rnIBicon = 'rnIBSandJourney';$IBicon = 'IBSandJourney';}
else if (in_array($ThemeSel, $rnIBBlueBlog)) {$rnIBicon = 'rnIBBlueBlog';$IBicon = 'IBBlueBlog';}
else if (in_array($ThemeSel, $rnIBCTRN)) {$rnIBicon = 'rnIBCT-RN';$IBicon = 'IBCT-RN';}
else if (in_array($ThemeSel, $rnIBRavenIce)) {$rnIBicon = 'rnIBRavenIce';$IBicon = 'IBRavenIce';}
else if (in_array($ThemeSel, $rnIBKaput)) {$rnIBicon = 'rnIBKaput';$IBicon = 'IBKaput';}
else if (in_array($ThemeSel, $rnIBBlack)) {$rnIBicon = 'rnIBBlack';$IBicon = 'IBBlack';}
else if (in_array($ThemeSel, $rnIBExtra)) {$rnIBicon = 'rnIBExtra';$IBicon = 'IBExtra';}
else {$rnIBicon = 'rnIBicon';$IBicon = 'IBicon8';}
}
if ($LargeSectionIcons) {$IBadjust = 'LG';$IBicon = 'IBBigIcons';} else {$IBadjust = '';}
if (is_admin($admin)) {
$viewlevel = 2;
$lastseen_count=$lastseen_count_admn;
$recent_member_count=$recent_member_admin;
} else if (is_user($user)) {
$viewlevel = 1;
$lastseen_count=$lastseen_count_user;
$recent_member_count=$recent_member_user;
} else {
$viewlevel = 0;
}
$anonyname = 'Anonymous';
$displayname = '';
$show_pms = 0;
$onlinenames = array();
$content .= '<!-- Start Info -->
<div id="' . $ListClass . '"><div class="fullwidth">
';
// get user info/show login
if (is_user($user)) {
$uinfo = cookiedecode($user);
$displayname = check_html($uinfo[1], 'nohtml');
$content .= '<div class="IBinfosection" id="IBsection1">'.PHP_EOL;
$content .= '<div><a href="modules.php?name=Your_Account&op=edituser" class="IBuser' . $IBadjust . '" title="' . _FSIYOURACCOUNT . '"><img src="' . $IBtran . '" class="' . $IBicon . '" alt="' . _FSIYOURACCOUNT . '" /><span class="IBtextpad">' . $displayname . '</span></a></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
if ($whoisUseModal){$iblinktype = 'class="IBmodal"';} else {$iblinktype = 'target="_blank"';}
$content .= '<li class="' . $rnIBicon . ' IByourip" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '"><span class="thick"><a ' . $iblinktype . ' href="http://' . $whoisServerString . $_SERVER['REMOTE_ADDR'] . '" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '">' . $_SERVER['REMOTE_ADDR'] . '</a></span></li>'.PHP_EOL;
if (is_active('Forums')) {
$adjustment = strlen(html_entity_decode(_INFOBOX_EGOPOSTS));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IByourposts' . $getsmall . '" title="' . _INFOBOX_EGOPOSTS . '"><a href="forums.html?amp;file=search&search_id=egosearch" title="' . _INFOBOX_EGOPOSTS . '">' . _INFOBOX_EGOPOSTS . '</a></li>'.PHP_EOL;
}
if ($ya_config['allowusertheme']=='1') {
$content .= '<li class="' . $rnIBicon . ' IBchangetheme" title="' . _INFOBOX_CHANGETHEME . '"><a href="modules.php?name=Your_Account&op=chgtheme" title="' . _INFOBOX_CHANGETHEME . '">' . _INFOBOX_CHANGETHEME . '</a></li>'.PHP_EOL;
}
if (is_active('nukeNAV') and is_active('Search') and $UseSearchPopUp) $content .= '<li class="' . $rnIBicon . ' IBsearch" title="' . _SEARCH . '"><a href="modules.php?name=nukeNAV&op=search" class="colorbox" title="">' . _SEARCH . '</a></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGOUT . '"><a href="modules.php?name=Your_Account&op=logout" title="' . _LOGOUT . '">' . _LOGOUT . '</a></li>'.PHP_EOL;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
// check new pms
$sql = 'SELECT privmsgs_to_userid FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid=' . intval($uinfo[0]) . ' AND (privmsgs_type=5 OR privmsgs_type=1)';
if (!($result = $db->sql_query($sql))) {
// error
die('error checking new pms');
}
$new_pms = $db->sql_numrows($result);
$db->sql_freeresult($result);
// check old pms
$sql = 'SELECT privmsgs_to_userid FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid=' . intval($uinfo[0]) . ' AND (privmsgs_type=0)';
if (!($result = $db->sql_query($sql))) {
// error
die('error checking old pms');
}
$old_pms = $db->sql_numrows($result);
$db->sql_freeresult($result);
$show_pms = $new_pms+$old_pms;
if ($show_pms > 0 AND is_active('Private_Messages')) {
$content .= '<div class="IBinfosection" id="IBsection2">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBpms' . $IBadjust . '" alt="' . _BPM . '" /><span class="IBtextpad thick">' . _BPM . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBnewpms" title="' . _BPM . '"><a href="modules.php?name=Private_Messages" title="' . _BPM . '">' . _BUNREAD . ': ' . $new_pms . '</a></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBoldpms" title="' . _BREAD . '"> ' . _BREAD . ': <span class="thick">' . $old_pms . '</span></li>'.PHP_EOL;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
if (($pm_colorbox_notice && $new_pms > 0) and (!isset($_COOKIE["youhaveapm"])) and ($name!='Private_Messages')) {
setcookie('youhaveapm', 'checked');
$content .= '<div id="IByesnewpm" style="display:none">'.PHP_EOL;
$content .= '<div id="IBnewmessages">'.PHP_EOL;
$content .= '<span class="IBCBtext"><img src="' . $IBtran . '" class="' . $IBicon . ' IBoldpms" alt="' . _NEWPMSG . '" /> ' . _YOUHAVE . ' <a href="modules.php?name=Private_Messages">' . $new_pms . ' ' . _NEWPMSG . '.</a></span>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
}
} else {
$content .= '<div class="IBinfosection" id="IBsection3">'.PHP_EOL;
$content .= '<div><a href="modules.php?name=Your_Account" title="' . _FSIYOURACCOUNT . '" class="IBglobe' . $IBadjust . '"><img src="' . $IBtran . '" class="' . $IBicon . ' IBglobe' . $IBadjust . '" alt="' . $anonymous . '" /><span class="IBtextpad">' . $anonymous . '</span></a></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IByourip IBguestip" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '"><span class="thick">' . $_SERVER['REMOTE_ADDR'] . '</span></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IByourposts" title="' . _BREG . '"><a href="modules.php?name=Your_Account&op=new_user">' . _BREG . '</a></li>'.PHP_EOL;
if (is_active('nukeNAV') and is_active('Search') and $UseSearchPopUp) $content .= '<li class="' . $rnIBicon . ' IBsearch" title="' . _SEARCH . '"><a href="modules.php?name=nukeNAV&op=search" class="colorbox" title="">' . _SEARCH . '</a></li>'.PHP_EOL;
if ($UsemodalLogin){
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGIN . '"><a href="modules.php?name=nukeNAV&op=login" class="colorbox">' . _LOGIN . '</a></li>'.PHP_EOL;
} else {
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGIN . '"><a href="modules.php?name=Your_Account">' . _LOGIN . '</a></li>'.PHP_EOL;
}
if ($display_lost_pass) {
$adjustment = strlen(html_entity_decode(_PASSWORDLOST));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IBonlineguest' . $getsmall . '" title="' . _PASSWORDLOST . '"><a href="modules.php?name=Your_Account&op=pass_lost">' . _PASSWORDLOST . '</a></li>'.PHP_EOL;
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
if ($viewlevel>=$membercounter_view) {
// MEMBER COUNTS
$sql = 'SELECT username FROM ' . $user_prefix . '_users_temp';
$result = $db->sql_query($sql);
$waiting = $db->sql_numrows($result);
$content .= '<div class="IBinfosection" id="IBsection4">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBmembers' . $IBadjust . '" alt="' . _BMEM . '" /><span class="IBtextpad thick">' . _BMEM . '</span></div>'.PHP_EOL;
// 0001856: User Info block enhancements
$IBgetmonth = _UMONTH;
$IBgetyear = _YEAR;
// get new member info
$timestamp = time();
$today = date("M d, Y");
$yesterday = date("M d, Y", ($timestamp - 86400) );
$this_month = date("M");
$this_year = date("Y");
// today
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE user_regdate=\'' . $today . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting todays users');
}
list($new_today) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// yesterday
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE user_regdate=\'' . $yesterday . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting yesterdays users');
}
list($new_yesterday) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// this month
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE SUBSTRING(user_regdate, 1, 4)=\'' . $this_month . '\' AND SUBSTRING(user_regdate, 9, 12)=\'' . $this_year . '\'';
if (!($result = $db->sql_query($sql))){
// error
die('error getting this months users');
}
list($new_month) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// this year
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE SUBSTRING(user_regdate, 9, 12)=\'' . $this_year . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting this years users');
}
list($new_year) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// all time
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting total users');
}
if (is_admin($admin) AND @file_exists('modules/Resend_Email/index.php')) {
$waitLink = '<a href="modules.php?name=Resend_Email" title="' . _TTL_RESENDEMAIL . '">' . _WAITLINK . ': <span class="thick">' . $waiting . '</span></a>';
} else {
$waitLink = _WAITLINK . ': <span class="thick">' . $waiting . '</span>';
}
list($total_users) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$content .= '<ul class="rninfobox">'.PHP_EOL;
if (($new_today==0 AND $viewlevel>=$zero_in_column_view) OR ($new_today!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBtoday" title="' . _INFOBOX_BTD . '">' . _INFOBOX_BTD . ': <span class="thick">' . $new_today . '</span></li>'.PHP_EOL;
}
if (($new_yesterday==0 AND $viewlevel>=$zero_in_column_view) OR ($new_yesterday!=0)) {
$adjustment = strlen(html_entity_decode(_INFOBOX_BYD));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IByesterday' . $getsmall . '" title="' . _INFOBOX_BYD . '">' . _INFOBOX_BYD . ': <span class="thick">' . $new_yesterday . '</span></li>'.PHP_EOL;
}
if (($new_month==0 AND $viewlevel>=$zero_in_column_view) OR ($new_month!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBmonth" title="' . _UMONTH . '">' . $IBgetmonth . ': <span class="thick">' . $new_month . '</span></li>'.PHP_EOL;
}
if (($new_year==0 AND $viewlevel>=$zero_in_column_view) OR ($new_year!=0)) {
$content .= '<li class="' . $rnIBicon . ' IByear" title="' . _YEAR . '">' . $IBgetyear . ': <span class="thick">' . $new_year . '</span></li>'.PHP_EOL;
}
$content .= '<li class="' . $rnIBicon . ' IBtotalusers" title="' . _BTT . '">' . _BTT . ': <span class="thick">' . $total_users . '</span></li>'.PHP_EOL;
if (($waitLink==0 AND $viewlevel>=$zero_in_column_view) OR ($waitLink!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBwaiting" title="' . _WAITLINK . '">' . $waitLink . '</li>'.PHP_EOL;
}
$content .= '</ul></div>'.PHP_EOL;
}
// NEWEST MEMBERS
if ($viewlevel>=$recent_member_view) {
$sql = 'SELECT username FROM ' . $user_prefix . '_users WHERE username!=\'' . $anonyname . '\' ORDER BY user_id DESC LIMIT ' . intval($recent_member_count);
if (!($result = $db->sql_query($sql))) {
// error
die('error getting latest users');
}
$latestusers = $db->sql_numrows($result = $db->sql_query($sql));
$content .= '<div class="IBinfosection" id="IBsection5">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBnewusers' . $IBadjust . '" alt="' . _INFOBOX_NEW_MEMBERS . '" /><span class="IBtextpad thick">' . _INFOBOX_NEW_MEMBERS . '</span></div>'.PHP_EOL;
if ($latestusers > 0){
$content .= '<ul class="rninfobox">'.PHP_EOL;
$newusercounter = 0;
}
while($row = $db->sql_fetchrow($result)) {
$newusercounter += 1;
$TruncateUser = strlen($row['username'])<=$nameMaxLength?$row['username']:substr($row['username'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['username'];
$content .= '<li class="' . $rnIBicon . ' IBmembernew" title="' . _ALT_CHKPROFILE . $lastusername . '"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['username'] . '" title="' . _ALT_CHKPROFILE . $lastusername . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
if ($newusercounter==$latestusers){
$content .= '</ul>'.PHP_EOL;
}
}
$db->sql_freeresult($result);
$content .= '</div>'.PHP_EOL;
}
$m = 0;
if ($viewlevel>=$who_is_online_view) {
// WHOS ONLINE
$members = '';
$guests = '';
$m = $g = 0;
$sql = "SELECT uname, time, host_addr, guest FROM ". $prefix ."_session WHERE time > '".( time() - ($max_session_mins * 60) )."' ORDER BY guest ASC,time DESC";
if (!($result = $db->sql_query($sql))) {
// error
die('error getting online users');
}
$content .= '<div class="IBinfosection" id="IBsection6">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBmembers' . $IBadjust . $IBadjust . '" alt="' . _BON . '" /><span class="IBtextpad thick">' . _BON . '</span></div>'.PHP_EOL;
while($row = $db->sql_fetchrow($result)) {
if ($row['guest'] == 0) {
$m++;
if ($m <= $max_display_members) {
$TruncateUser = strlen($row['uname'])<=$nameMaxLength?$row['uname']:substr($row['uname'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['uname'];
$onlinenames[] = $lastusername;
$members .= '<li class="' . $rnIBicon . ' IBonline2" title="' . _BON . '"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['uname'] . '" title="' . _ALT_CHKPROFILE . $lastusername . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
}
} else {
$g++;
if ($viewlevel>=$show_guest_guest && $g <= $max_display_guests) {
if (is_admin($admin)) {
if ($whoisUseModal){
$uname = '<a class="IBmodal" href="http://' . $whoisServerString . $row['uname'] . '">' . $row['uname'] . '</a>';
} else {
$uname = '<a target="_blank" href="http://' . $whoisServerString . $row['uname'] . '">' . $row['uname'] . '</a>';
}
} else {
// hide last 2 octets of guest ip's.
$ip = explode('.', $row['uname']);
$uname = $ip[0] . '.' . $ip[1] . '.' . preg_replace("/(0|1|2|3|4|5|6|7|8|9)/", "x", $ip[2]) . '.' . preg_replace("/(0|1|2|3|4|5|6|7|8|9)/", "x", $ip[3]);
}
$guests .= '<li class="' . $rnIBicon . ' IBonlineguest" title="' . _BON . '">' . $uname . '</li>'.PHP_EOL;
}
}
}
$db->sql_freeresult($result);
if (($viewlevel>=$showonlinecount) AND (($m > 0) OR ($g > 0 AND !$OnlineGuestsModal))) {
$content .= '<div class="IBsmallnotes">';
if ($m > 0) {
$content .= _BMEM . ':<span class="thick">' . $m . '</span>';
}
if ($g > 0 AND !$OnlineGuestsModal) {
$content .= ' ' . _BVIS . ':<span class="thick">' . $g . '</span>';
}
$content .= ' </div>'.PHP_EOL;
}
if (($m > 0) OR ($viewlevel>=$show_guest_guest && $g > 0)) {
if ($g > 0 AND $OnlineGuestsModal AND $viewlevel == 2) {
$content .= '<div style="display:none">'.PHP_EOL;
$content .= '<div id="IBGuestsView" style="margin-left:20px;">'.PHP_EOL;
$content .= '<h1>' . _BON . '</h1>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= $guests;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
$content .= '<ul class="rninfobox">'.PHP_EOL;
}
if ($g > 0 AND $OnlineGuestsModal) {
$content .= '<li class="' . $rnIBicon . ' IBonlineguest" title="' . _BON . '">';
if ($viewlevel == 2) {
$content .= '<a class="IBGuestsModal" href="#">' . $g . ' ' . _BVIS . '</a>';
} else {
$content .= $g . ' ' . _BVIS;
}
$content .= '</li>' . PHP_EOL;
}
if ($m > 0) {
$content .= $members;
}
if ($g > 0 AND !$OnlineGuestsModal) {
$content .= $guests;
}
if (($m > 0) OR ($viewlevel>=$show_guest_guest && $g > 0)) {
$content .= '</ul>'.PHP_EOL;
}
$content .= '</div>'.PHP_EOL;
}
// LAST SEEN MEMBERS
if ($viewlevel>=$lastseen_user_view) {
$lastseennumber = intval($lastseen_count)+$m;
if (is_user($user)) {
$exclusion = 'AND username!=\'' . $displayname . '\' ';
} else {
$exclusion = '';
}
$sql = 'SELECT username, lastsitevisit FROM ' . $user_prefix . '_users WHERE username!=\'' . $anonyname . '\' ' . $exclusion . 'ORDER BY lastsitevisit DESC LIMIT ' . $lastseennumber;
$latestusers = $db->sql_numrows($result = $db->sql_query($sql));
$latestusercounter = 1;
if ($latestusers > 0) {
$latuse = '<div class="IBinfosection" id="IBsection7">'.PHP_EOL;
$latuse .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBlastseen' . $IBadjust . '" alt="' . _INFOBOX_LAST_SEEN . '" /><span class="IBtextpad thick">' . _INFOBOX_LAST_SEEN . '</span></div>'.PHP_EOL;
$latuse .= '<ul class="rninfobox">'.PHP_EOL;
while( $row = $db->sql_fetchrow($result) ) {
if ($latestusercounter <= $lastseen_count) {
$TruncateUser = strlen($row['username'])<=$nameMaxLength?$row['username']:substr($row['username'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['username'];
$row['lastsitevisit'] = date('d F Y H:i', $row['lastsitevisit']);
if (!in_array($lastusername, $onlinenames)){
$latestusercounter += 1;
$latuse .= '<li class="' . $rnIBicon . ' IBonline"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['username'] . '" title="' . _INFOBOX_LAST_SEEN . ': ' . $row['lastsitevisit'] . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
}
}
}
$latuse .= '</ul>'.PHP_EOL;
$db->sql_freeresult($result);
$latuse .= '</div>'.PHP_EOL;
}
if ($latestusercounter > 1) $content .= $latuse;
}
// SERVER TRAFFIC
if ($viewlevel>=$servertraffic_view) {
$content .= '<div class="IBinfosection" id="IBsection8">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBtraffic' . $IBadjust . '" alt="' . _INFOBOX_SERVERTRAFFIC . '" /><span class="IBtextpad thick">' . _INFOBOX_SERVERTRAFFIC . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$totalhits = 0;
$result = $db->sql_query('SELECT sum(hits) FROM ' . $prefix . '_stats_year');
list($totalhits) = $db->sql_fetchrow($result);
$content .= '<li class="' . $rnIBicon . ' IBtotalhits" title="' . _WERECEIVED . ' ' . number_format($totalhits,0) . ' ' . _PAGESVIEWS . ' ' . $startdate . '">' . _INFOBOX_TOTALHITS.number_format($totalhits,0) . '</li>'.PHP_EOL;
$today = 0;
$todayDST = date('I',time())*3600;
$t_time = time()-$todayDST;
$t_year = date('Y', $t_time);
$t_month = date('n', $t_time);
$t_date = date('j', $t_time);
$result = $db->sql_query('SELECT hits FROM ' . $prefix . '_stats_date WHERE year=' . $t_year . ' AND month=' . $t_month . ' AND date=' . $t_date);
list($today) = $db->sql_fetchrow($result);
$content .= '<li class="' . $rnIBicon . ' IBtodayhits" title="' . _INFOBOX_TODAYHITS.number_format($today,0) . '">' . _INFOBOX_TODAYHITS.number_format($today,0) . '</li>'.PHP_EOL;
if ($how_many_years>0 AND $viewlevel>=$traffic_year_view) {
$sql = 'SELECT year, hits FROM ' . $prefix . '_stats_year ORDER BY year DESC LIMIT ' . intval($how_many_years);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$content .= '<li class="' . $rnIBicon . ' IByearlyhits" title="' . $row['year'] . ': ' . number_format($row['hits']) . '">' . $row['year'] . ': ' . number_format($row['hits']) . '</li>'.PHP_EOL;
}
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
// SERVER DATE/TIME
$content .= '<div class="IBinfosection" id="IBsection9">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBserver' . $IBadjust . '" alt="' . _INFOBOX_SERVERINFO . '" /><span class="IBtextpad thick">' . _INFOBOX_SERVERINFO . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBserdate" title="' . _SERDT . '">' . date('M d, Y') . '</li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBtime" title="' . _SERDT . '">' . date('h:i a T') . '</li>'.PHP_EOL;
if ((is_admin($admin)) and (defined('RAVENNUKE_VERSION_FRIENDLY'))) {
$content .= '<li class="' . $rnIBicon . ' IBglobe" title="RN ' . RAVENNUKE_VERSION_FRIENDLY . '">RN ' . RAVENNUKE_VERSION_FRIENDLY . '</li>'.PHP_EOL;
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div></div>'.PHP_EOL;
// make sure content does not float outside the block
$content .= '<div class="block-spacer"> </div>'.PHP_EOL;
$content .= '<!-- END Info -->'.PHP_EOL;
?>
|
This is what I wanted to do with a translation block. ![Very Happy](modules/Forums/images/smiles/icon_biggrin.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jun 30, 2012 7:22 am |
|
Here is an example that works. Adjust it to your needs.
Code:
<?php
/*************************************************************************/
/* Tableless CSS Sprite Powered Info Box Block by */
/* SpasticDonkey - web-cms-designs.com */
/* Inspired by: Info Box for RavenNuke by nukecoder.com */
/* RavenWebServices User Info Block www.ravenphpscripts.com */
/* nukeNAV by nukeSEO nukeseo.com */
/* Icons adapted from the Crystal project www.everaldo.com/crystal/ and */
/* the Tango Desktop Project tango.freedesktop.org/Tango_Desktop_Project */
/* Intended for use on RavenNuke(tm) v2.5+ */
/*************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
if (!isset($side)) { $side = ''; }
if ($side == 'c' || $side == 'd' || $side == 't') { $IBCentermode = true; } else { $IBCentermode = false; }
if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");
/*********************************************************************************************************/
/* Setup - Use these settings to control how the user info block displays to users/admins/anonymous. */
/*********************************************************************************************************/
/* MEMBER TOTALS SECTION */
$membercounter_view = 1; // MEMBER TOTALS SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$zero_in_column_view = 2; // If zero registrations during period show column to: 0=everyone 1=user-only 2=admin-only 3=disable
/* RECENT MEMBER SECTION */
$recent_member_view = 1; // RECENT MEMBER SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$recent_member_count = 1; // how many newest members to show to all
$recent_member_user = 2; // how many newest members to show to users
$recent_member_admin = 4; // how many newest members to show to admins
/* ONLINE NOW SECTION */
$who_is_online_view = 1; // ONLINE NOW SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$show_guest_guest = 2; // show online guests to 0=everyone 1=user-only 2=admin-only 3=disable
$max_display_guests = 6; // maximum number of online guests to display
$max_display_members = 6; // maximum number of online members to display
$showonlinecount = 1; // total count of online guests/members: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$max_session_mins = 60; // how long before inactive users are dropped from online list
/* LAST SEEN MEMBER SECTION */
$lastseen_user_view = 0; // LAST SEEN MEMBER SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$lastseen_count = 2; // how many last seen members to show to all
$lastseen_count_user = 4; // how many last seen members to show to users
$lastseen_count_admn = 6; // how many last seen members to show to admins
/* SERVER TRAFFIC SECTION */
$servertraffic_view = 0; // SERVER TRAFFIC SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$traffic_year_view = 1; // Traffic stats by year: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$how_many_years = 2; // how many years to display in traffic stats
/* GENERAL BLOCK SETTINGS */
$nameMaxLength = 13; // Max length for username display. Will truncate with ...
$langMaxLength = 17; // Max length for some problem language defines. Will display in smaller font-size
$LargeSectionIcons = false; // use 32x32 icons for the sections
$display_lost_pass = true; // set to false to hide the lost password link (displays in smaller font in some languages)
$pm_colorbox_notice = true; // if set to true, users will only be notified of private messages once per session
$UsemodalLogin = true; // modal login popup - nukeNAV module must be ACTIVE!
$UseSearchPopUp = true; // modal search popup - nukeNAV and Search modules must be ACTIVE!
$whoisUseModal = true; //admin ip lookup in modal window
$OnlineGuestsModal = true; //compact the online guests into one modal link
$whoisServerString = 'whois.domaintools.com/'; //admin ip lookup
if ($IBCentermode) { // <- do not edit
/*********************************************************************************************************/
/* CENTER BLOCK SETTINGS (only used when in center position, overrides settings above) */
/*********************************************************************************************************/
$membercounter_view = 0;
$zero_in_column_view = 2;
$recent_member_view = 0;
$recent_member_count = 2;
$recent_member_user = 2;
$recent_member_admin = 2;
$who_is_online_view = 0;
$show_guest_guest = 0;
$max_display_guests = 20;
$max_display_members = 6;
$showonlinecount = 0;
$lastseen_user_view = 0;
$lastseen_count = 6;
$lastseen_count_user = 6;
$lastseen_count_admn = 6;
$servertraffic_view = 0;
$traffic_year_view = 0;
$how_many_years = 2;
$LargeSectionIcons = true;
} // <- do not edit
/*********************************************************************************************************/
/* Sprite Settings - For more info see http://www.rtsforce.com/InfoBox-CSS/ */
/*********************************************************************************************************/
$IBtran = 'images/transparent.gif'; // source for the transparent gif sprite container
$IBicon = 'IBicon8'; // default classes for icons (changed by theme below unless $MultiThemeMode = false)
$rnIBicon = 'rnIBicon'; // default classes for icons (changed by theme below unless $MultiThemeMode = false)
$MultiThemeMode = true; // false to disable loading theme specific icons, and ignore array settings below - see readme
$rnIBWhite = array('3D-Fantasy', 'DeepBlue', 'ExtraLite', 'NukeNews', 'Slash', 'SlashOcean', 'Traditional'); // Themes with white block backgrounds
$rnIBGray = array('Anagram', 'Karate', 'Milo'); // Themes with gray block backgrounds
$rnIBCreme = array('Sunset'); // Themes with creme block backgrounds
$rnIBSimplyBlue = array('SimplyBlue'); // Themes with sky blue block backgrounds
$rnIBSandJourney = array('Sand_Journey'); // Themes with sand block backgrounds
$rnIBBlueBlog = array('Blue_Blog'); // Themes with taupe block backgrounds
$rnIBCTRN = array('CT_RN'); // Themes with crimson backgrounds
$rnIBRavenIce = array('RavenIce', 'fisubice'); // Themes with off-white/blue block backgrounds
$rnIBKaput = array('Kaput'); // Themes with blue/gray block backgrounds
$rnIBBlack = array(); // Themes with black block backgrounds
$rnIBExtra = array(); // An extra group for other themes (use class rnIBExtra and IBExtra to define your sprite background - see readme)
/*********************************************************************************************************/
/* You should not need to modify anything below this line */
/*********************************************************************************************************/
global $db, $prefix, $ya_config, $anonymous, $nukeurl, $user_prefix, $user, $sitekey, $gfx_chk, $admin, $currentlang, $language, $startdate, $name;
$current=$_SERVER['REQUEST_URI'];
$content ='<center><a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=pl&hl=en&ie=UTF-8"><img src="images/pl.png" alt="Polish" title="Polish" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=es&hl=en&ie=UTF-8"><img src="images/sp.png" alt="Spanish" title="Spanish" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=nl&hl=en&ie=UTF-8"><img src="images/dt.png" alt="Dutch" title="Dutch" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=fr&hl=en&ie=UTF-8"><img src="images/fr.png" alt="French" title="French" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=it&hl=en&ie=UTF-8"><img src="images/it.png" alt="Italian" title="Italian" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=de&hl=en&ie=UTF-8"><img src="images/gr.png" alt="German" title="German" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=pt&hl=en&ie=UTF-8"><img src="images/pt.png" alt="Portuguese" title="Portuguese" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=fi&hl=en&ie=UTF-8"><img src="images/fi.png" alt="Finnish" title="Finnish" /></a></center>';
if(file_exists('language/infobox/lang-' . $currentlang . '.php')) {
include_once 'language/infobox/lang-' . $currentlang . '.php';
} elseif(file_exists('language/infobox/lang-' . $language . '.php')) {
include_once 'language/infobox/lang-' . $language . '.php';
} else {
include_once 'language/infobox/lang-english.php';
}
if (!isset($name)) { $name = ''; }
if ($IBCentermode) {
$ListClass = 'IBblock-center';
addJSToBody('includes/jquery/jquery.masonry.min.js', 'file');
addJSToBody('includes/jquery/jquery.userinfo.js', 'file');
} else {
$ListClass = 'IBblock';
}
if (!isset($ya_config)) $ya_config = ya_get_configs();
if ($MultiThemeMode){
$ThemeSel = get_theme();
if (in_array($ThemeSel, $rnIBWhite)) {$rnIBicon = 'rnIBWhite';$IBicon = 'IBWhite';}
else if (in_array($ThemeSel, $rnIBGray)) {$rnIBicon = 'rnIBGray';$IBicon = 'IBGray';}
else if (in_array($ThemeSel, $rnIBCreme)) {$rnIBicon = 'rnIBCreme';$IBicon = 'IBCreme';}
else if (in_array($ThemeSel, $rnIBSimplyBlue)) {$rnIBicon = 'rnIBSimplyBlue';$IBicon = 'IBSimplyBlue';}
else if (in_array($ThemeSel, $rnIBSandJourney)) {$rnIBicon = 'rnIBSandJourney';$IBicon = 'IBSandJourney';}
else if (in_array($ThemeSel, $rnIBBlueBlog)) {$rnIBicon = 'rnIBBlueBlog';$IBicon = 'IBBlueBlog';}
else if (in_array($ThemeSel, $rnIBCTRN)) {$rnIBicon = 'rnIBCT-RN';$IBicon = 'IBCT-RN';}
else if (in_array($ThemeSel, $rnIBRavenIce)) {$rnIBicon = 'rnIBRavenIce';$IBicon = 'IBRavenIce';}
else if (in_array($ThemeSel, $rnIBKaput)) {$rnIBicon = 'rnIBKaput';$IBicon = 'IBKaput';}
else if (in_array($ThemeSel, $rnIBBlack)) {$rnIBicon = 'rnIBBlack';$IBicon = 'IBBlack';}
else if (in_array($ThemeSel, $rnIBExtra)) {$rnIBicon = 'rnIBExtra';$IBicon = 'IBExtra';}
else {$rnIBicon = 'rnIBicon';$IBicon = 'IBicon8';}
}
if ($LargeSectionIcons) {$IBadjust = 'LG';$IBicon = 'IBBigIcons';} else {$IBadjust = '';}
if (is_admin($admin)) {
$viewlevel = 2;
$lastseen_count=$lastseen_count_admn;
$recent_member_count=$recent_member_admin;
} else if (is_user($user)) {
$viewlevel = 1;
$lastseen_count=$lastseen_count_user;
$recent_member_count=$recent_member_user;
} else {
$viewlevel = 0;
}
$anonyname = 'Anonymous';
$displayname = '';
$show_pms = 0;
$onlinenames = array();
$content .= '<!-- Start Info -->
<div id="' . $ListClass . '"><div class="fullwidth">
';
// get user info/show login
if (is_user($user)) {
$uinfo = cookiedecode($user);
$displayname = check_html($uinfo[1], 'nohtml');
$content .= '<div class="IBinfosection" id="IBsection1">'.PHP_EOL;
$content .= '<div><a href="modules.php?name=Your_Account&op=edituser" class="IBuser' . $IBadjust . '" title="' . _FSIYOURACCOUNT . '"><img src="' . $IBtran . '" class="' . $IBicon . '" alt="' . _FSIYOURACCOUNT . '" /><span class="IBtextpad">' . $displayname . '</span></a></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
if ($whoisUseModal){$iblinktype = 'class="IBmodal"';} else {$iblinktype = 'target="_blank"';}
$content .= '<li class="' . $rnIBicon . ' IByourip" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '"><span class="thick"><a ' . $iblinktype . ' href="http://' . $whoisServerString . $_SERVER['REMOTE_ADDR'] . '" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '">' . $_SERVER['REMOTE_ADDR'] . '</a></span></li>'.PHP_EOL;
if (is_active('Forums')) {
$adjustment = strlen(html_entity_decode(_INFOBOX_EGOPOSTS));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IByourposts' . $getsmall . '" title="' . _INFOBOX_EGOPOSTS . '"><a href="modules.php?name=Forums&file=search&search_id=egosearch" title="' . _INFOBOX_EGOPOSTS . '">' . _INFOBOX_EGOPOSTS . '</a></li>'.PHP_EOL;
}
if ($ya_config['allowusertheme']=='1') {
$content .= '<li class="' . $rnIBicon . ' IBchangetheme" title="' . _INFOBOX_CHANGETHEME . '"><a href="modules.php?name=Your_Account&op=chgtheme" title="' . _INFOBOX_CHANGETHEME . '">' . _INFOBOX_CHANGETHEME . '</a></li>'.PHP_EOL;
}
if (is_active('nukeNAV') and is_active('Search') and $UseSearchPopUp) $content .= '<li class="' . $rnIBicon . ' IBsearch" title="' . _SEARCH . '"><a href="modules.php?name=nukeNAV&op=search" class="colorbox" title="">' . _SEARCH . '</a></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGOUT . '"><a href="modules.php?name=Your_Account&op=logout" title="' . _LOGOUT . '">' . _LOGOUT . '</a></li>'.PHP_EOL;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
// check new pms
$sql = 'SELECT privmsgs_to_userid FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid=' . intval($uinfo[0]) . ' AND (privmsgs_type=5 OR privmsgs_type=1)';
if (!($result = $db->sql_query($sql))) {
// error
die('error checking new pms');
}
$new_pms = $db->sql_numrows($result);
$db->sql_freeresult($result);
// check old pms
$sql = 'SELECT privmsgs_to_userid FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid=' . intval($uinfo[0]) . ' AND (privmsgs_type=0)';
if (!($result = $db->sql_query($sql))) {
// error
die('error checking old pms');
}
$old_pms = $db->sql_numrows($result);
$db->sql_freeresult($result);
$show_pms = $new_pms+$old_pms;
if ($show_pms > 0 AND is_active('Private_Messages')) {
$content .= '<div class="IBinfosection" id="IBsection2">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBpms' . $IBadjust . '" alt="' . _BPM . '" /><span class="IBtextpad thick">' . _BPM . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBnewpms" title="' . _BPM . '"><a href="modules.php?name=Private_Messages" title="' . _BPM . '">' . _BUNREAD . ': ' . $new_pms . '</a></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBoldpms" title="' . _BREAD . '"> ' . _BREAD . ': <span class="thick">' . $old_pms . '</span></li>'.PHP_EOL;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
if (($pm_colorbox_notice && $new_pms > 0) and (!isset($_COOKIE["youhaveapm"])) and ($name!='Private_Messages')) {
setcookie('youhaveapm', 'checked');
$content .= '<div id="IByesnewpm" style="display:none">'.PHP_EOL;
$content .= '<div id="IBnewmessages">'.PHP_EOL;
$content .= '<span class="IBCBtext"><img src="' . $IBtran . '" class="' . $IBicon . ' IBoldpms" alt="' . _NEWPMSG . '" /> ' . _YOUHAVE . ' <a href="modules.php?name=Private_Messages">' . $new_pms . ' ' . _NEWPMSG . '.</a></span>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
}
} else {
$content .= '<div class="IBinfosection" id="IBsection3">'.PHP_EOL;
$content .= '<div><a href="modules.php?name=Your_Account" title="' . _FSIYOURACCOUNT . '" class="IBglobe' . $IBadjust . '"><img src="' . $IBtran . '" class="' . $IBicon . ' IBglobe' . $IBadjust . '" alt="' . $anonymous . '" /><span class="IBtextpad">' . $anonymous . '</span></a></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IByourip IBguestip" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '"><span class="thick">' . $_SERVER['REMOTE_ADDR'] . '</span></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IByourposts" title="' . _BREG . '"><a href="modules.php?name=Your_Account&op=new_user">' . _BREG . '</a></li>'.PHP_EOL;
if (is_active('nukeNAV') and is_active('Search') and $UseSearchPopUp) $content .= '<li class="' . $rnIBicon . ' IBsearch" title="' . _SEARCH . '"><a href="modules.php?name=nukeNAV&op=search" class="colorbox" title="">' . _SEARCH . '</a></li>'.PHP_EOL;
if ($UsemodalLogin){
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGIN . '"><a href="modules.php?name=nukeNAV&op=login" class="colorbox">' . _LOGIN . '</a></li>'.PHP_EOL;
} else {
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGIN . '"><a href="modules.php?name=Your_Account">' . _LOGIN . '</a></li>'.PHP_EOL;
}
if ($display_lost_pass) {
$adjustment = strlen(html_entity_decode(_PASSWORDLOST));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IBonlineguest' . $getsmall . '" title="' . _PASSWORDLOST . '"><a href="modules.php?name=Your_Account&op=pass_lost">' . _PASSWORDLOST . '</a></li>'.PHP_EOL;
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
if ($viewlevel>=$membercounter_view) {
// MEMBER COUNTS
$sql = 'SELECT username FROM ' . $user_prefix . '_users_temp';
$result = $db->sql_query($sql);
$waiting = $db->sql_numrows($result);
$content .= '<div class="IBinfosection" id="IBsection4">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBmembers' . $IBadjust . '" alt="' . _BMEM . '" /><span class="IBtextpad thick">' . _BMEM . '</span></div>'.PHP_EOL;
// 0001856: User Info block enhancements
$IBgetmonth = _UMONTH;
$IBgetyear = _YEAR;
// get new member info
$timestamp = time();
$today = date("M d, Y");
$yesterday = date("M d, Y", ($timestamp - 86400) );
$this_month = date("M");
$this_year = date("Y");
// today
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE user_regdate=\'' . $today . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting todays users');
}
list($new_today) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// yesterday
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE user_regdate=\'' . $yesterday . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting yesterdays users');
}
list($new_yesterday) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// this month
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE SUBSTRING(user_regdate, 1, 4)=\'' . $this_month . '\' AND SUBSTRING(user_regdate, 9, 12)=\'' . $this_year . '\'';
if (!($result = $db->sql_query($sql))){
// error
die('error getting this months users');
}
list($new_month) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// this year
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE SUBSTRING(user_regdate, 9, 12)=\'' . $this_year . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting this years users');
}
list($new_year) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// all time
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting total users');
}
if (is_admin($admin) AND @file_exists('modules/Resend_Email/index.php')) {
$waitLink = '<a href="modules.php?name=Resend_Email" title="' . _TTL_RESENDEMAIL . '">' . _WAITLINK . ': <span class="thick">' . $waiting . '</span></a>';
} else {
$waitLink = _WAITLINK . ': <span class="thick">' . $waiting . '</span>';
}
list($total_users) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$content .= '<ul class="rninfobox">'.PHP_EOL;
if (($new_today==0 AND $viewlevel>=$zero_in_column_view) OR ($new_today!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBtoday" title="' . _INFOBOX_BTD . '">' . _INFOBOX_BTD . ': <span class="thick">' . $new_today . '</span></li>'.PHP_EOL;
}
if (($new_yesterday==0 AND $viewlevel>=$zero_in_column_view) OR ($new_yesterday!=0)) {
$adjustment = strlen(html_entity_decode(_INFOBOX_BYD));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IByesterday' . $getsmall . '" title="' . _INFOBOX_BYD . '">' . _INFOBOX_BYD . ': <span class="thick">' . $new_yesterday . '</span></li>'.PHP_EOL;
}
if (($new_month==0 AND $viewlevel>=$zero_in_column_view) OR ($new_month!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBmonth" title="' . _UMONTH . '">' . $IBgetmonth . ': <span class="thick">' . $new_month . '</span></li>'.PHP_EOL;
}
if (($new_year==0 AND $viewlevel>=$zero_in_column_view) OR ($new_year!=0)) {
$content .= '<li class="' . $rnIBicon . ' IByear" title="' . _YEAR . '">' . $IBgetyear . ': <span class="thick">' . $new_year . '</span></li>'.PHP_EOL;
}
$content .= '<li class="' . $rnIBicon . ' IBtotalusers" title="' . _BTT . '">' . _BTT . ': <span class="thick">' . $total_users . '</span></li>'.PHP_EOL;
if (($waitLink==0 AND $viewlevel>=$zero_in_column_view) OR ($waitLink!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBwaiting" title="' . _WAITLINK . '">' . $waitLink . '</li>'.PHP_EOL;
}
$content .= '</ul></div>'.PHP_EOL;
}
// NEWEST MEMBERS
if ($viewlevel>=$recent_member_view) {
$sql = 'SELECT username FROM ' . $user_prefix . '_users WHERE username!=\'' . $anonyname . '\' ORDER BY user_id DESC LIMIT ' . intval($recent_member_count);
if (!($result = $db->sql_query($sql))) {
// error
die('error getting latest users');
}
$latestusers = $db->sql_numrows($result = $db->sql_query($sql));
$content .= '<div class="IBinfosection" id="IBsection5">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBnewusers' . $IBadjust . '" alt="' . _INFOBOX_NEW_MEMBERS . '" /><span class="IBtextpad thick">' . _INFOBOX_NEW_MEMBERS . '</span></div>'.PHP_EOL;
if ($latestusers > 0){
$content .= '<ul class="rninfobox">'.PHP_EOL;
$newusercounter = 0;
}
while($row = $db->sql_fetchrow($result)) {
$newusercounter += 1;
$TruncateUser = strlen($row['username'])<=$nameMaxLength?$row['username']:substr($row['username'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['username'];
$content .= '<li class="' . $rnIBicon . ' IBmembernew" title="' . _ALT_CHKPROFILE . $lastusername . '"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['username'] . '" title="' . _ALT_CHKPROFILE . $lastusername . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
if ($newusercounter==$latestusers){
$content .= '</ul>'.PHP_EOL;
}
}
$db->sql_freeresult($result);
$content .= '</div>'.PHP_EOL;
}
$m = 0;
if ($viewlevel>=$who_is_online_view) {
// WHOS ONLINE
$members = '';
$guests = '';
$m = $g = 0;
$sql = "SELECT uname, time, host_addr, guest FROM ". $prefix ."_session WHERE time > '".( time() - ($max_session_mins * 60) )."' ORDER BY guest ASC,time DESC";
if (!($result = $db->sql_query($sql))) {
// error
die('error getting online users');
}
$content .= '<div class="IBinfosection" id="IBsection6">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBmembers' . $IBadjust . $IBadjust . '" alt="' . _BON . '" /><span class="IBtextpad thick">' . _BON . '</span></div>'.PHP_EOL;
while($row = $db->sql_fetchrow($result)) {
if ($row['guest'] == 0) {
$m++;
if ($m <= $max_display_members) {
$TruncateUser = strlen($row['uname'])<=$nameMaxLength?$row['uname']:substr($row['uname'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['uname'];
$onlinenames[] = $lastusername;
$members .= '<li class="' . $rnIBicon . ' IBonline2" title="' . _BON . '"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['uname'] . '" title="' . _ALT_CHKPROFILE . $lastusername . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
}
} else {
$g++;
if ($viewlevel>=$show_guest_guest && $g <= $max_display_guests) {
if (is_admin($admin)) {
if ($whoisUseModal){
$uname = '<a class="IBmodal" href="http://' . $whoisServerString . $row['uname'] . '">' . $row['uname'] . '</a>';
} else {
$uname = '<a target="_blank" href="http://' . $whoisServerString . $row['uname'] . '">' . $row['uname'] . '</a>';
}
} else {
// hide last 2 octets of guest ip's.
$ip = explode('.', $row['uname']);
$uname = $ip[0] . '.' . $ip[1] . '.' . preg_replace("/(0|1|2|3|4|5|6|7|8|9)/", "x", $ip[2]) . '.' . preg_replace("/(0|1|2|3|4|5|6|7|8|9)/", "x", $ip[3]);
}
$guests .= '<li class="' . $rnIBicon . ' IBonlineguest" title="' . _BON . '">' . $uname . '</li>'.PHP_EOL;
}
}
}
$db->sql_freeresult($result);
if (($viewlevel>=$showonlinecount) AND (($m > 0) OR ($g > 0 AND !$OnlineGuestsModal))) {
$content .= '<div class="IBsmallnotes">';
if ($m > 0) {
$content .= _BMEM . ':<span class="thick">' . $m . '</span>';
}
if ($g > 0 AND !$OnlineGuestsModal) {
$content .= ' ' . _BVIS . ':<span class="thick">' . $g . '</span>';
}
$content .= ' </div>'.PHP_EOL;
}
if (($m > 0) OR ($viewlevel>=$show_guest_guest && $g > 0)) {
if ($g > 0 AND $OnlineGuestsModal AND $viewlevel == 2) {
$content .= '<div style="display:none">'.PHP_EOL;
$content .= '<div id="IBGuestsView" style="margin-left:20px;">'.PHP_EOL;
$content .= '<h1>' . _BON . '</h1>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= $guests;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
$content .= '<ul class="rninfobox">'.PHP_EOL;
}
if ($g > 0 AND $OnlineGuestsModal) {
$content .= '<li class="' . $rnIBicon . ' IBonlineguest" title="' . _BON . '">';
if ($viewlevel == 2) {
$content .= '<a class="IBGuestsModal" href="#">' . $g . ' ' . _BVIS . '</a>';
} else {
$content .= $g . ' ' . _BVIS;
}
$content .= '</li>' . PHP_EOL;
}
if ($m > 0) {
$content .= $members;
}
if ($g > 0 AND !$OnlineGuestsModal) {
$content .= $guests;
}
if (($m > 0) OR ($viewlevel>=$show_guest_guest && $g > 0)) {
$content .= '</ul>'.PHP_EOL;
}
$content .= '</div>'.PHP_EOL;
}
// LAST SEEN MEMBERS
if ($viewlevel>=$lastseen_user_view) {
$lastseennumber = intval($lastseen_count)+$m;
if (is_user($user)) {
$exclusion = 'AND username!=\'' . $displayname . '\' ';
} else {
$exclusion = '';
}
$sql = 'SELECT username, lastsitevisit FROM ' . $user_prefix . '_users WHERE username!=\'' . $anonyname . '\' ' . $exclusion . 'ORDER BY lastsitevisit DESC LIMIT ' . $lastseennumber;
$latestusers = $db->sql_numrows($result = $db->sql_query($sql));
$latestusercounter = 1;
if ($latestusers > 0) {
$latuse = '<div class="IBinfosection" id="IBsection7">'.PHP_EOL;
$latuse .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBlastseen' . $IBadjust . '" alt="' . _INFOBOX_LAST_SEEN . '" /><span class="IBtextpad thick">' . _INFOBOX_LAST_SEEN . '</span></div>'.PHP_EOL;
$latuse .= '<ul class="rninfobox">'.PHP_EOL;
while( $row = $db->sql_fetchrow($result) ) {
if ($latestusercounter <= $lastseen_count) {
$TruncateUser = strlen($row['username'])<=$nameMaxLength?$row['username']:substr($row['username'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['username'];
$row['lastsitevisit'] = date('d F Y H:i', $row['lastsitevisit']);
if (!in_array($lastusername, $onlinenames)){
$latestusercounter += 1;
$latuse .= '<li class="' . $rnIBicon . ' IBonline"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['username'] . '" title="' . _INFOBOX_LAST_SEEN . ': ' . $row['lastsitevisit'] . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
}
}
}
$latuse .= '</ul>'.PHP_EOL;
$db->sql_freeresult($result);
$latuse .= '</div>'.PHP_EOL;
}
if ($latestusercounter > 1) $content .= $latuse;
}
// SERVER TRAFFIC
if ($viewlevel>=$servertraffic_view) {
$content .= '<div class="IBinfosection" id="IBsection8">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBtraffic' . $IBadjust . '" alt="' . _INFOBOX_SERVERTRAFFIC . '" /><span class="IBtextpad thick">' . _INFOBOX_SERVERTRAFFIC . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$totalhits = 0;
$result = $db->sql_query('SELECT sum(hits) FROM ' . $prefix . '_stats_year');
list($totalhits) = $db->sql_fetchrow($result);
$content .= '<li class="' . $rnIBicon . ' IBtotalhits" title="' . _WERECEIVED . ' ' . number_format($totalhits,0) . ' ' . _PAGESVIEWS . ' ' . $startdate . '">' . _INFOBOX_TOTALHITS.number_format($totalhits,0) . '</li>'.PHP_EOL;
$today = 0;
$todayDST = date('I',time())*3600;
$t_time = time()-$todayDST;
$t_year = date('Y', $t_time);
$t_month = date('n', $t_time);
$t_date = date('j', $t_time);
$result = $db->sql_query('SELECT hits FROM ' . $prefix . '_stats_date WHERE year=' . $t_year . ' AND month=' . $t_month . ' AND date=' . $t_date);
list($today) = $db->sql_fetchrow($result);
$content .= '<li class="' . $rnIBicon . ' IBtodayhits" title="' . _INFOBOX_TODAYHITS.number_format($today,0) . '">' . _INFOBOX_TODAYHITS.number_format($today,0) . '</li>'.PHP_EOL;
if ($how_many_years>0 AND $viewlevel>=$traffic_year_view) {
$sql = 'SELECT year, hits FROM ' . $prefix . '_stats_year ORDER BY year DESC LIMIT ' . intval($how_many_years);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$content .= '<li class="' . $rnIBicon . ' IByearlyhits" title="' . $row['year'] . ': ' . number_format($row['hits']) . '">' . $row['year'] . ': ' . number_format($row['hits']) . '</li>'.PHP_EOL;
}
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
// SERVER DATE/TIME
$content .= '<div class="IBinfosection" id="IBsection9">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBserver' . $IBadjust . '" alt="' . _INFOBOX_SERVERINFO . '" /><span class="IBtextpad thick">' . _INFOBOX_SERVERINFO . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBserdate" title="' . _SERDT . '">' . date('M d, Y') . '</li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBtime" title="' . _SERDT . '">' . date('h:i a T') . '</li>'.PHP_EOL;
if ((is_admin($admin)) and (defined('RAVENNUKE_VERSION_FRIENDLY'))) {
$content .= '<li class="' . $rnIBicon . ' IBglobe" title="RN ' . RAVENNUKE_VERSION_FRIENDLY . '">RN ' . RAVENNUKE_VERSION_FRIENDLY . '</li>'.PHP_EOL;
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div></div>'.PHP_EOL;
// make sure content does not float outside the block
$content .= '<div class="block-spacer"> </div>'.PHP_EOL;
$content .= '<!-- END Info -->'.PHP_EOL;
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jun 30, 2012 8:33 am |
|
Thanks a lot, I spent so much time with this block and now you come with a different one. I can believe my eyes, can you tell me where I can place the drop menu? You are amazing boddy! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jun 30, 2012 8:39 am |
|
If yours works, use it. I didn't see that you had already posted that you had it fixed when I posted my reply. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jun 30, 2012 4:34 pm |
|
yes mine is done already and I would like you to check it in order to see if everything is ok. The validation was green.
This is the final and please correct me if you see anything you would like to change.
Code: <?php
/*************************************************************************/
/* Tableless CSS Sprite Powered Info Box Block by */
/* SpasticDonkey - web-cms-designs.com */
/* Inspired by: Info Box for RavenNuke by nukecoder.com */
/* RavenWebServices User Info Block www.ravenphpscripts.com */
/* nukeNAV by nukeSEO nukeseo.com */
/* Icons adapted from the Crystal project www.everaldo.com/crystal/ and */
/* the Tango Desktop Project tango.freedesktop.org/Tango_Desktop_Project */
/* Intended for use on RavenNuke(tm) v2.5+ */
/*************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
//Translation
global $prefix, $db, $admin, $nukeurl;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/module.php")) {
include("themes/$ThemeSel/module.php");
if (is_active("$default_module") AND file_exists("modules/$default_module/index.php")) {
$def_module = $default_module;
} else {
$def_module = "";
}
}
$row = $db->sql_fetchrow($db->sql_query("SELECT main_module FROM ".$prefix."_main"));
$main_module = $row['main_module'];
/* If the module doesn't exist, it will be removed from the database automaticaly */
$result2 = $db->sql_query("SELECT title FROM " . $prefix . "_modules");
while ($row2 = $db->sql_fetchrow($result2)) {
$title = stripslashes($row2['title']);
$a = 0;
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ($file == $title) {
$a = 1;
}
}
closedir($handle);
if ($a == 0) {
$db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'");
}
}
/* If you copied a new module is the /modules/ directory, it will be added to the database */
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ( (!preg_match("/[.]/",$file)) ) {
$modlist .= "$file ";
}
}
closedir($handle);
$modlist = explode(" ", $modlist);
sort($modlist);
for ($i=0; $i < sizeof($modlist); $i++) {
if($modlist[$i] != "") {
$row4 = $db->sql_fetchrow($db->sql_query("SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'"));
$mid = intval($row4['mid']);
$mod_uname = preg_replace("/_/", " ", $modlist[$i]);
if ($mid == "") {
$db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$mod_uname', '0', '0', '1')");
}
}
}
$content = "<table align='center' cellspacing='0' cellpadding='1' border='0'>";
$content .= "<tr>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=nl&hl=en&ie=UTF8'><img src='images/flags20x20/nl.png' title='Dutch' alt='Dutch' border='0' /></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=fr&hl=en&ie=UTF8'><img src='images/flags20x20/fr.png' title='French' alt='French' border='0' /></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=de&hl=en&ie=UTF8'><img src='images/flags20x20/gr.png' title='Germany' alt='Germany' border='0' /></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=it&hl=en&ie=UTF8'><img src='images/flags20x20/it.png' title='Italy' alt='Italy' border='0' /></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=pl&hl=en&ie=UTF8'><img src='images/flags20x20/pl.png' title='Poland' alt='Poland' border='0' /></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=pt&hl=en&ie=UTF8'><img src='images/flags20x20/pt.png' title='Portugal' alt='Portugal' border='0' /></a></td>";
$content .= "<td><a href='http://translate.google.com/translate?u=$nukeurl&sl=en&tl=es&hl=en&ie=UTF8'><img src='images/flags20x20/es.png' title='Spain' alt='Spain' border='0' /></a></td>";
$content .= '</tr></table>';
$content .= "<br /><a rel='nofollow' href='$nukeurl' title='Home'> <img src='images/flags20x20/home.png' alt='Home' /> <b>Home:</b></a><br /><a rel='nofollow' href='$nukeurl/modules.php?name=Donations' title='Donations'> <img src='images/flags20x20/donate.png' alt='Donations' /> <b>Donations:</b></a><br /><a rel='nofollow' href='$nukeurl/modules.php?name=Forums' title='Forums'> <img src='images/flags20x20/forum.png' alt='Forums' /> <b>Forums:</b></a><br /><hr /><br />";
$content .= '<select class="" size="1" name="name" onchange="top.location.href=this.options[this.selectedIndex].value">';
$content .= "<option>Menu</option>";
$result3 = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC");
while ($row3 = $db->sql_fetchrow($result3)) {
$m_title = stripslashes($row3['title']);
$custom_title = $row3['custom_title'];
$view = intval($row3['view']);
$m_title2 = preg_replace("/_/", " ", $m_title);
if ($custom_title != "") {
$m_title2 = $custom_title;
}
if ($m_title != $main_module) {
if ((is_admin($admin) AND $view == 2) OR $view != 2) {
$selected = '';
$content .= "<option value=\"modules.php?name=$m_title\">→ $m_title2</option>";
}
}
}
$content .= '</select><br /><br /><hr />';
///date_default_timezone_set('EST');
if (!isset($side)) { $side = ''; }
if ($side == 'c' || $side == 'd' || $side == 't') { $IBCentermode = true; } else { $IBCentermode = false; }
if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");
/*********************************************************************************************************/
/* Setup - Use these settings to control how the user info block displays to users/admins/anonymous. */
/*********************************************************************************************************/
/* MEMBER TOTALS SECTION */
$membercounter_view = 1; // MEMBER TOTALS SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$zero_in_column_view = 2; // If zero registrations during period show column to: 0=everyone 1=user-only 2=admin-only 3=disable
/* RECENT MEMBER SECTION */
$recent_member_view = 1; // RECENT MEMBER SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$recent_member_count = 1; // how many newest members to show to all
$recent_member_user = 2; // how many newest members to show to users
$recent_member_admin = 4; // how many newest members to show to admins
/* ONLINE NOW SECTION */
$who_is_online_view = 2; // ONLINE NOW SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$show_guest_guest = 2; // show online guests to 0=everyone 1=user-only 2=admin-only 3=disable
$max_display_guests = 6; // maximum number of online guests to display
$max_display_members = 6; // maximum number of online members to display
$showonlinecount = 1; // total count of online guests/members: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$max_session_mins = 60; // how long before inactive users are dropped from online list
/* LAST SEEN MEMBER SECTION */
$lastseen_user_view = 0; // LAST SEEN MEMBER SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$lastseen_count = 2; // how many last seen members to show to all
$lastseen_count_user = 4; // how many last seen members to show to users
$lastseen_count_admn = 6; // how many last seen members to show to admins
/* SERVER TRAFFIC SECTION */
$servertraffic_view = 0; // SERVER TRAFFIC SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$traffic_year_view = 1; // Traffic stats by year: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$how_many_years = 2; // how many years to display in traffic stats
/* GENERAL BLOCK SETTINGS */
$nameMaxLength = 13; // Max length for username display. Will truncate with ...
$langMaxLength = 17; // Max length for some problem language defines. Will display in smaller font-size
$LargeSectionIcons = false; // use 32x32 icons for the sections
$display_lost_pass = true; // set to false to hide the lost password link (displays in smaller font in some languages)
$pm_colorbox_notice = true; // if set to true, users will only be notified of private messages once per session
$UsemodalLogin = true; // modal login popup - nukeNAV module must be ACTIVE!
$UseSearchPopUp = true; // modal search popup - nukeNAV and Search modules must be ACTIVE!
$whoisUseModal = true; //admin ip lookup in modal window
$OnlineGuestsModal = true; //compact the online guests into one modal link
$whoisServerString = 'www.dnsstuff.com/tools/whois/?ip='; //admin ip lookup
if ($IBCentermode) { // <- do not edit
/*********************************************************************************************************/
/* CENTER BLOCK SETTINGS (only used when in center position, overrides settings above) */
/*********************************************************************************************************/
$membercounter_view = 0;
$zero_in_column_view = 2;
$recent_member_view = 0;
$recent_member_count = 2;
$recent_member_user = 2;
$recent_member_admin = 2;
$who_is_online_view = 0;
$show_guest_guest = 0;
$max_display_guests = 20;
$max_display_members = 6;
$showonlinecount = 0;
$lastseen_user_view = 0;
$lastseen_count = 6;
$lastseen_count_user = 6;
$lastseen_count_admn = 6;
$servertraffic_view = 0;
$traffic_year_view = 0;
$how_many_years = 2;
$LargeSectionIcons = true;
} // <- do not edit
/*********************************************************************************************************/
/* Sprite Settings - For more info see http://www.rtsforce.com/InfoBox-CSS/ */
/*********************************************************************************************************/
$IBtran = 'images/transparent.gif'; // source for the transparent gif sprite container
$IBicon = 'IBicon8'; // default classes for icons (changed by theme below unless $MultiThemeMode = false)
$rnIBicon = 'rnIBicon'; // default classes for icons (changed by theme below unless $MultiThemeMode = false)
$MultiThemeMode = true; // false to disable loading theme specific icons, and ignore array settings below - see readme
$rnIBWhite = array('3D-Fantasy', 'DeepBlue', 'ExtraLite', 'NukeNews', 'Slash', 'SlashOcean', 'Traditional'); // Themes with white block backgrounds
$rnIBGray = array('Anagram', 'Karate', 'Milo'); // Themes with gray block backgrounds
$rnIBCreme = array('Sunset'); // Themes with creme block backgrounds
$rnIBSimplyBlue = array('SimplyBlue'); // Themes with sky blue block backgrounds
$rnIBSandJourney = array('Sand_Journey'); // Themes with sand block backgrounds
$rnIBBlueBlog = array('Blue_Blog'); // Themes with taupe block backgrounds
$rnIBCTRN = array('CT_RN'); // Themes with crimson backgrounds
$rnIBRavenIce = array('RavenIce', 'fisubice'); // Themes with off-white/blue block backgrounds
$rnIBKaput = array('Kaput'); // Themes with blue/gray block backgrounds
$rnIBBlack = array(); // Themes with black block backgrounds
$rnIBExtra = array(); // An extra group for other themes (use class rnIBExtra and IBExtra to define your sprite background - see readme)
/*********************************************************************************************************/
/* You should not need to modify anything below this line */
/*********************************************************************************************************/
global $db, $prefix, $ya_config, $anonymous, $user_prefix, $user, $sitekey, $gfx_chk, $admin, $currentlang, $language, $startdate, $name;
if(file_exists('language/infobox/lang-' . $currentlang . '.php')) {
include_once 'language/infobox/lang-' . $currentlang . '.php';
} elseif(file_exists('language/infobox/lang-' . $language . '.php')) {
include_once 'language/infobox/lang-' . $language . '.php';
} else {
include_once 'language/infobox/lang-english.php';
}
if (!isset($name)) { $name = ''; }
if ($IBCentermode) {
$ListClass = 'IBblock-center';
addJSToBody('includes/jquery/jquery.masonry.min.js', 'file');
addJSToBody('includes/jquery/jquery.userinfo.js', 'file');
} else {
$ListClass = 'IBblock';
}
if (!isset($ya_config)) $ya_config = ya_get_configs();
if ($MultiThemeMode){
$ThemeSel = get_theme();
if (in_array($ThemeSel, $rnIBWhite)) {$rnIBicon = 'rnIBWhite';$IBicon = 'IBWhite';}
else if (in_array($ThemeSel, $rnIBGray)) {$rnIBicon = 'rnIBGray';$IBicon = 'IBGray';}
else if (in_array($ThemeSel, $rnIBCreme)) {$rnIBicon = 'rnIBCreme';$IBicon = 'IBCreme';}
else if (in_array($ThemeSel, $rnIBSimplyBlue)) {$rnIBicon = 'rnIBSimplyBlue';$IBicon = 'IBSimplyBlue';}
else if (in_array($ThemeSel, $rnIBSandJourney)) {$rnIBicon = 'rnIBSandJourney';$IBicon = 'IBSandJourney';}
else if (in_array($ThemeSel, $rnIBBlueBlog)) {$rnIBicon = 'rnIBBlueBlog';$IBicon = 'IBBlueBlog';}
else if (in_array($ThemeSel, $rnIBCTRN)) {$rnIBicon = 'rnIBCT-RN';$IBicon = 'IBCT-RN';}
else if (in_array($ThemeSel, $rnIBRavenIce)) {$rnIBicon = 'rnIBRavenIce';$IBicon = 'IBRavenIce';}
else if (in_array($ThemeSel, $rnIBKaput)) {$rnIBicon = 'rnIBKaput';$IBicon = 'IBKaput';}
else if (in_array($ThemeSel, $rnIBBlack)) {$rnIBicon = 'rnIBBlack';$IBicon = 'IBBlack';}
else if (in_array($ThemeSel, $rnIBExtra)) {$rnIBicon = 'rnIBExtra';$IBicon = 'IBExtra';}
else {$rnIBicon = 'rnIBicon';$IBicon = 'IBicon8';}
}
if ($LargeSectionIcons) {$IBadjust = 'LG';$IBicon = 'IBBigIcons';} else {$IBadjust = '';}
if (is_admin($admin)) {
$viewlevel = 2;
$lastseen_count=$lastseen_count_admn;
$recent_member_count=$recent_member_admin;
} else if (is_user($user)) {
$viewlevel = 1;
$lastseen_count=$lastseen_count_user;
$recent_member_count=$recent_member_user;
} else {
$viewlevel = 0;
}
$anonyname = 'Anonymous';
$displayname = '';
$show_pms = 0;
$onlinenames = array();
$content .= '<!-- Start Info -->
<div id="' . $ListClass . '"><div class="fullwidth">
';
// get user info/show login
if (is_user($user)) {
$uinfo = cookiedecode($user);
$displayname = check_html($uinfo[1], 'nohtml');
$content .= '<div class="IBinfosection" id="IBsection1">'.PHP_EOL;
$content .= '<div><a href="modules.php?name=Your_Account&op=edituser" class="IBuser' . $IBadjust . '" title="' . _FSIYOURACCOUNT . '"><img src="' . $IBtran . '" class="' . $IBicon . '" alt="' . _FSIYOURACCOUNT . '" /><span class="IBtextpad">' . $displayname . '</span></a></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
if ($whoisUseModal){$iblinktype = 'class="IBmodal"';} else {$iblinktype = 'target="_blank"';}
$content .= '<li class="' . $rnIBicon . ' IByourip" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '"><span class="thick"><a ' . $iblinktype . ' href="http://' . $whoisServerString . $_SERVER['REMOTE_ADDR'] . '" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '">' . $_SERVER['REMOTE_ADDR'] . '</a></span></li>'.PHP_EOL;
if (is_active('Forums')) {
$adjustment = strlen(html_entity_decode(_INFOBOX_EGOPOSTS));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IByourposts' . $getsmall . '" title="' . _INFOBOX_EGOPOSTS . '"><a href="forums.html?amp;file=search&search_id=egosearch" title="' . _INFOBOX_EGOPOSTS . '">' . _INFOBOX_EGOPOSTS . '</a></li>'.PHP_EOL;
}
if ($ya_config['allowusertheme']=='1') {
$content .= '<li class="' . $rnIBicon . ' IBchangetheme" title="' . _INFOBOX_CHANGETHEME . '"><a href="modules.php?name=Your_Account&op=chgtheme" title="' . _INFOBOX_CHANGETHEME . '">' . _INFOBOX_CHANGETHEME . '</a></li>'.PHP_EOL;
}
if (is_active('nukeNAV') and is_active('Search') and $UseSearchPopUp) $content .= '<li class="' . $rnIBicon . ' IBsearch" title="' . _SEARCH . '"><a href="modules.php?name=nukeNAV&op=search" class="colorbox" title="">' . _SEARCH . '</a></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGOUT . '"><a href="modules.php?name=Your_Account&op=logout" title="' . _LOGOUT . '">' . _LOGOUT . '</a></li>'.PHP_EOL;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
// check new pms
$sql = 'SELECT privmsgs_to_userid FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid=' . intval($uinfo[0]) . ' AND (privmsgs_type=5 OR privmsgs_type=1)';
if (!($result = $db->sql_query($sql))) {
// error
die('error checking new pms');
}
$new_pms = $db->sql_numrows($result);
$db->sql_freeresult($result);
// check old pms
$sql = 'SELECT privmsgs_to_userid FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid=' . intval($uinfo[0]) . ' AND (privmsgs_type=0)';
if (!($result = $db->sql_query($sql))) {
// error
die('error checking old pms');
}
$old_pms = $db->sql_numrows($result);
$db->sql_freeresult($result);
$show_pms = $new_pms+$old_pms;
if ($show_pms > 0 AND is_active('Private_Messages')) {
$content .= '<div class="IBinfosection" id="IBsection2">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBpms' . $IBadjust . '" alt="' . _BPM . '" /><span class="IBtextpad thick">' . _BPM . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBnewpms" title="' . _BPM . '"><a href="modules.php?name=Private_Messages" title="' . _BPM . '">' . _BUNREAD . ': ' . $new_pms . '</a></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBoldpms" title="' . _BREAD . '"> ' . _BREAD . ': <span class="thick">' . $old_pms . '</span></li>'.PHP_EOL;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
if (($pm_colorbox_notice && $new_pms > 0) and (!isset($_COOKIE["youhaveapm"])) and ($name!='Private_Messages')) {
setcookie('youhaveapm', 'checked');
$content .= '<div id="IByesnewpm" style="display:none">'.PHP_EOL;
$content .= '<div id="IBnewmessages">'.PHP_EOL;
$content .= '<span class="IBCBtext"><img src="' . $IBtran . '" class="' . $IBicon . ' IBoldpms" alt="' . _NEWPMSG . '" /> ' . _YOUHAVE . ' <a href="modules.php?name=Private_Messages">' . $new_pms . ' ' . _NEWPMSG . '.</a></span>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
}
} else {
$content .= '<div class="IBinfosection" id="IBsection3">'.PHP_EOL;
$content .= '<div><a href="modules.php?name=Your_Account" title="' . _FSIYOURACCOUNT . '" class="IBglobe' . $IBadjust . '"><img src="' . $IBtran . '" class="' . $IBicon . ' IBglobe' . $IBadjust . '" alt="' . $anonymous . '" /><span class="IBtextpad">' . $anonymous . '</span></a></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IByourip IBguestip" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '"><span class="thick">' . $_SERVER['REMOTE_ADDR'] . '</span></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IByourposts" title="' . _BREG . '"><a href="modules.php?name=Your_Account&op=new_user">' . _BREG . '</a></li>'.PHP_EOL;
if (is_active('nukeNAV') and is_active('Search') and $UseSearchPopUp) $content .= '<li class="' . $rnIBicon . ' IBsearch" title="' . _SEARCH . '"><a href="modules.php?name=nukeNAV&op=search" class="colorbox" title="">' . _SEARCH . '</a></li>'.PHP_EOL;
if ($UsemodalLogin){
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGIN . '"><a href="modules.php?name=nukeNAV&op=login" class="colorbox">' . _LOGIN . '</a></li>'.PHP_EOL;
} else {
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGIN . '"><a href="modules.php?name=Your_Account">' . _LOGIN . '</a></li>'.PHP_EOL;
}
if ($display_lost_pass) {
$adjustment = strlen(html_entity_decode(_PASSWORDLOST));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IBonlineguest' . $getsmall . '" title="' . _PASSWORDLOST . '"><a href="modules.php?name=Your_Account&op=pass_lost">' . _PASSWORDLOST . '</a></li>'.PHP_EOL;
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
if ($viewlevel>=$membercounter_view) {
// MEMBER COUNTS
$sql = 'SELECT username FROM ' . $user_prefix . '_users_temp';
$result = $db->sql_query($sql);
$waiting = $db->sql_numrows($result);
$content .= '<div class="IBinfosection" id="IBsection4">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBmembers' . $IBadjust . '" alt="' . _BMEM . '" /><span class="IBtextpad thick">' . _BMEM . '</span></div>'.PHP_EOL;
// 0001856: User Info block enhancements
$IBgetmonth = _UMONTH;
$IBgetyear = _YEAR;
// get new member info
$timestamp = time();
$today = date("M d, Y");
$yesterday = date("M d, Y", ($timestamp - 86400) );
$this_month = date("M");
$this_year = date("Y");
// today
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE user_regdate=\'' . $today . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting todays users');
}
list($new_today) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// yesterday
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE user_regdate=\'' . $yesterday . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting yesterdays users');
}
list($new_yesterday) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// this month
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE SUBSTRING(user_regdate, 1, 4)=\'' . $this_month . '\' AND SUBSTRING(user_regdate, 9, 12)=\'' . $this_year . '\'';
if (!($result = $db->sql_query($sql))){
// error
die('error getting this months users');
}
list($new_month) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// this year
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE SUBSTRING(user_regdate, 9, 12)=\'' . $this_year . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting this years users');
}
list($new_year) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// all time
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting total users');
}
if (is_admin($admin) AND @file_exists('modules/Resend_Email/index.php')) {
$waitLink = '<a href="modules.php?name=Resend_Email" title="' . _TTL_RESENDEMAIL . '">' . _WAITLINK . ': <span class="thick">' . $waiting . '</span></a>';
} else {
$waitLink = _WAITLINK . ': <span class="thick">' . $waiting . '</span>';
}
list($total_users) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$content .= '<ul class="rninfobox">'.PHP_EOL;
if (($new_today==0 AND $viewlevel>=$zero_in_column_view) OR ($new_today!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBtoday" title="' . _INFOBOX_BTD . '">' . _INFOBOX_BTD . ': <span class="thick">' . $new_today . '</span></li>'.PHP_EOL;
}
if (($new_yesterday==0 AND $viewlevel>=$zero_in_column_view) OR ($new_yesterday!=0)) {
$adjustment = strlen(html_entity_decode(_INFOBOX_BYD));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IByesterday' . $getsmall . '" title="' . _INFOBOX_BYD . '">' . _INFOBOX_BYD . ': <span class="thick">' . $new_yesterday . '</span></li>'.PHP_EOL;
}
if (($new_month==0 AND $viewlevel>=$zero_in_column_view) OR ($new_month!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBmonth" title="' . _UMONTH . '">' . $IBgetmonth . ': <span class="thick">' . $new_month . '</span></li>'.PHP_EOL;
}
if (($new_year==0 AND $viewlevel>=$zero_in_column_view) OR ($new_year!=0)) {
$content .= '<li class="' . $rnIBicon . ' IByear" title="' . _YEAR . '">' . $IBgetyear . ': <span class="thick">' . $new_year . '</span></li>'.PHP_EOL;
}
$content .= '<li class="' . $rnIBicon . ' IBtotalusers" title="' . _BTT . '">' . _BTT . ': <span class="thick">' . $total_users . '</span></li>'.PHP_EOL;
if (($waitLink==0 AND $viewlevel>=$zero_in_column_view) OR ($waitLink!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBwaiting" title="' . _WAITLINK . '">' . $waitLink . '</li>'.PHP_EOL;
}
$content .= '</ul></div>'.PHP_EOL;
}
// NEWEST MEMBERS
if ($viewlevel>=$recent_member_view) {
$sql = 'SELECT username FROM ' . $user_prefix . '_users WHERE username!=\'' . $anonyname . '\' ORDER BY user_id DESC LIMIT ' . intval($recent_member_count);
if (!($result = $db->sql_query($sql))) {
// error
die('error getting latest users');
}
$latestusers = $db->sql_numrows($result = $db->sql_query($sql));
$content .= '<div class="IBinfosection" id="IBsection5">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBnewusers' . $IBadjust . '" alt="' . _INFOBOX_NEW_MEMBERS . '" /><span class="IBtextpad thick">' . _INFOBOX_NEW_MEMBERS . '</span></div>'.PHP_EOL;
if ($latestusers > 0){
$content .= '<ul class="rninfobox">'.PHP_EOL;
$newusercounter = 0;
}
while($row = $db->sql_fetchrow($result)) {
$newusercounter += 1;
$TruncateUser = strlen($row['username'])<=$nameMaxLength?$row['username']:substr($row['username'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['username'];
$content .= '<li class="' . $rnIBicon . ' IBmembernew" title="' . _ALT_CHKPROFILE . $lastusername . '"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['username'] . '" title="' . _ALT_CHKPROFILE . $lastusername . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
if ($newusercounter==$latestusers){
$content .= '</ul>'.PHP_EOL;
}
}
$db->sql_freeresult($result);
$content .= '</div>'.PHP_EOL;
}
$m = 0;
if ($viewlevel>=$who_is_online_view) {
// WHOS ONLINE
$members = '';
$guests = '';
$m = $g = 0;
$sql = "SELECT uname, time, host_addr, guest FROM ". $prefix ."_session WHERE time > '".( time() - ($max_session_mins * 60) )."' ORDER BY guest ASC,time DESC";
if (!($result = $db->sql_query($sql))) {
// error
die('error getting online users');
}
$content .= '<div class="IBinfosection" id="IBsection6">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBmembers' . $IBadjust . $IBadjust . '" alt="' . _BON . '" /><span class="IBtextpad thick">' . _BON . '</span></div>'.PHP_EOL;
while($row = $db->sql_fetchrow($result)) {
if ($row['guest'] == 0) {
$m++;
if ($m <= $max_display_members) {
$TruncateUser = strlen($row['uname'])<=$nameMaxLength?$row['uname']:substr($row['uname'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['uname'];
$onlinenames[] = $lastusername;
$members .= '<li class="' . $rnIBicon . ' IBonline2" title="' . _BON . '"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['uname'] . '" title="' . _ALT_CHKPROFILE . $lastusername . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
}
} else {
$g++;
if ($viewlevel>=$show_guest_guest && $g <= $max_display_guests) {
if (is_admin($admin)) {
if ($whoisUseModal){
$uname = '<a class="IBmodal" href="http://' . $whoisServerString . $row['uname'] . '">' . $row['uname'] . '</a>';
} else {
$uname = '<a target="_blank" href="http://' . $whoisServerString . $row['uname'] . '">' . $row['uname'] . '</a>';
}
} else {
// hide last 2 octets of guest ip's.
$ip = explode('.', $row['uname']);
$uname = $ip[0] . '.' . $ip[1] . '.' . preg_replace("/(0|1|2|3|4|5|6|7|8|9)/", "x", $ip[2]) . '.' . preg_replace("/(0|1|2|3|4|5|6|7|8|9)/", "x", $ip[3]);
}
$guests .= '<li class="' . $rnIBicon . ' IBonlineguest" title="' . _BON . '">' . $uname . '</li>'.PHP_EOL;
}
}
}
$db->sql_freeresult($result);
if (($viewlevel>=$showonlinecount) AND (($m > 0) OR ($g > 0 AND !$OnlineGuestsModal))) {
$content .= '<div class="IBsmallnotes">';
if ($m > 0) {
$content .= _BMEM . ':<span class="thick">' . $m . '</span>';
}
if ($g > 0 AND !$OnlineGuestsModal) {
$content .= ' ' . _BVIS . ':<span class="thick">' . $g . '</span>';
}
$content .= ' </div>'.PHP_EOL;
}
if (($m > 0) OR ($viewlevel>=$show_guest_guest && $g > 0)) {
if ($g > 0 AND $OnlineGuestsModal AND $viewlevel == 2) {
$content .= '<div style="display:none">'.PHP_EOL;
$content .= '<div id="IBGuestsView" style="margin-left:20px;">'.PHP_EOL;
$content .= '<h1>' . _BON . '</h1>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= $guests;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
$content .= '<ul class="rninfobox">'.PHP_EOL;
}
if ($g > 0 AND $OnlineGuestsModal) {
$content .= '<li class="' . $rnIBicon . ' IBonlineguest" title="' . _BON . '">';
if ($viewlevel == 2) {
$content .= '<a class="IBGuestsModal" href="#">' . $g . ' ' . _BVIS . '</a>';
} else {
$content .= $g . ' ' . _BVIS;
}
$content .= '</li>' . PHP_EOL;
}
if ($m > 0) {
$content .= $members;
}
if ($g > 0 AND !$OnlineGuestsModal) {
$content .= $guests;
}
if (($m > 0) OR ($viewlevel>=$show_guest_guest && $g > 0)) {
$content .= '</ul>'.PHP_EOL;
}
$content .= '</div>'.PHP_EOL;
}
// LAST SEEN MEMBERS
if ($viewlevel>=$lastseen_user_view) {
$lastseennumber = intval($lastseen_count)+$m;
if (is_user($user)) {
$exclusion = 'AND username!=\'' . $displayname . '\' ';
} else {
$exclusion = '';
}
$sql = 'SELECT username, lastsitevisit FROM ' . $user_prefix . '_users WHERE username!=\'' . $anonyname . '\' ' . $exclusion . 'ORDER BY lastsitevisit DESC LIMIT ' . $lastseennumber;
$latestusers = $db->sql_numrows($result = $db->sql_query($sql));
$latestusercounter = 1;
if ($latestusers > 0) {
$latuse = '<div class="IBinfosection" id="IBsection7">'.PHP_EOL;
$latuse .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBlastseen' . $IBadjust . '" alt="' . _INFOBOX_LAST_SEEN . '" /><span class="IBtextpad thick">' . _INFOBOX_LAST_SEEN . '</span></div>'.PHP_EOL;
$latuse .= '<ul class="rninfobox">'.PHP_EOL;
while( $row = $db->sql_fetchrow($result) ) {
if ($latestusercounter <= $lastseen_count) {
$TruncateUser = strlen($row['username'])<=$nameMaxLength?$row['username']:substr($row['username'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['username'];
$row['lastsitevisit'] = date('d F Y H:i', $row['lastsitevisit']);
if (!in_array($lastusername, $onlinenames)){
$latestusercounter += 1;
$latuse .= '<li class="' . $rnIBicon . ' IBonline"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['username'] . '" title="' . _INFOBOX_LAST_SEEN . ': ' . $row['lastsitevisit'] . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
}
}
}
$latuse .= '</ul>'.PHP_EOL;
$db->sql_freeresult($result);
$latuse .= '</div>'.PHP_EOL;
}
if ($latestusercounter > 1) $content .= $latuse;
}
// SERVER TRAFFIC
if ($viewlevel>=$servertraffic_view) {
$content .= '<div class="IBinfosection" id="IBsection8">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBtraffic' . $IBadjust . '" alt="' . _INFOBOX_SERVERTRAFFIC . '" /><span class="IBtextpad thick">' . _INFOBOX_SERVERTRAFFIC . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$totalhits = 0;
$result = $db->sql_query('SELECT sum(hits) FROM ' . $prefix . '_stats_year');
list($totalhits) = $db->sql_fetchrow($result);
$content .= '<li class="' . $rnIBicon . ' IBtotalhits" title="' . _WERECEIVED . ' ' . number_format($totalhits,0) . ' ' . _PAGESVIEWS . ' ' . $startdate . '">' . _INFOBOX_TOTALHITS.number_format($totalhits,0) . '</li>'.PHP_EOL;
$today = 0;
$todayDST = date('I',time())*3600;
$t_time = time()-$todayDST;
$t_year = date('Y', $t_time);
$t_month = date('n', $t_time);
$t_date = date('j', $t_time);
$result = $db->sql_query('SELECT hits FROM ' . $prefix . '_stats_date WHERE year=' . $t_year . ' AND month=' . $t_month . ' AND date=' . $t_date);
list($today) = $db->sql_fetchrow($result);
$content .= '<li class="' . $rnIBicon . ' IBtodayhits" title="' . _INFOBOX_TODAYHITS.number_format($today,0) . '">' . _INFOBOX_TODAYHITS.number_format($today,0) . '</li>'.PHP_EOL;
if ($how_many_years>0 AND $viewlevel>=$traffic_year_view) {
$sql = 'SELECT year, hits FROM ' . $prefix . '_stats_year ORDER BY year DESC LIMIT ' . intval($how_many_years);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$content .= '<li class="' . $rnIBicon . ' IByearlyhits" title="' . $row['year'] . ': ' . number_format($row['hits']) . '">' . $row['year'] . ': ' . number_format($row['hits']) . '</li>'.PHP_EOL;
}
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
// SERVER DATE/TIME
$content .= '<div class="IBinfosection" id="IBsection9">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBserver' . $IBadjust . '" alt="' . _INFOBOX_SERVERINFO . '" /><span class="IBtextpad thick">' . _INFOBOX_SERVERINFO . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBserdate" title="' . _SERDT . '">' . date('M d, Y') . '</li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBtime" title="' . _SERDT . '">' . date('h:i a T') . '</li>'.PHP_EOL;
/*if ((is_admin($admin)) and (defined('RAVENNUKE_VERSION_FRIENDLY'))) {
$content .= '<li class="' . $rnIBicon . ' IBglobe" title="RN ' . RAVENNUKE_VERSION_FRIENDLY . '">RN ' . RAVENNUKE_VERSION_FRIENDLY . '</li>'.PHP_EOL;
}*/
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div></div>'.PHP_EOL;
// make sure content does not float outside the block
$content .= '<div class="block-spacer"> </div>'.PHP_EOL;
$content .= '<!-- END Info -->'.PHP_EOL;
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jun 30, 2012 4:51 pm |
|
Nuke, I took a look on your stuff, I think yours is better than mine and I do think I will use it and it should be the final, it is validated too, please correct me with this one too.
This is the same block with modification from nuken
Code:<?php
/*************************************************************************/
/* Tableless CSS Sprite Powered Info Box Block by */
/* SpasticDonkey - web-cms-designs.com */
/* Inspired by: Info Box for RavenNuke by nukecoder.com */
/* RavenWebServices User Info Block www.ravenphpscripts.com */
/* nukeNAV by nukeSEO nukeseo.com */
/* Icons adapted from the Crystal project www.everaldo.com/crystal/ and */
/* the Tango Desktop Project tango.freedesktop.org/Tango_Desktop_Project */
/* Intended for use on RavenNuke(tm) v2.5+ */
/*************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
if (!isset($side)) { $side = ''; }
if ($side == 'c' || $side == 'd' || $side == 't') { $IBCentermode = true; } else { $IBCentermode = false; }
if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");
/*********************************************************************************************************/
/* Setup - Use these settings to control how the user info block displays to users/admins/anonymous. */
/*********************************************************************************************************/
/* MEMBER TOTALS SECTION */
$membercounter_view = 1; // MEMBER TOTALS SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$zero_in_column_view = 2; // If zero registrations during period show column to: 0=everyone 1=user-only 2=admin-only 3=disable
/* RECENT MEMBER SECTION */
$recent_member_view = 1; // RECENT MEMBER SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$recent_member_count = 1; // how many newest members to show to all
$recent_member_user = 2; // how many newest members to show to users
$recent_member_admin = 4; // how many newest members to show to admins
/* ONLINE NOW SECTION */
$who_is_online_view = 1; // ONLINE NOW SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$show_guest_guest = 2; // show online guests to 0=everyone 1=user-only 2=admin-only 3=disable
$max_display_guests = 6; // maximum number of online guests to display
$max_display_members = 6; // maximum number of online members to display
$showonlinecount = 1; // total count of online guests/members: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$max_session_mins = 60; // how long before inactive users are dropped from online list
/* LAST SEEN MEMBER SECTION */
$lastseen_user_view = 0; // LAST SEEN MEMBER SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$lastseen_count = 2; // how many last seen members to show to all
$lastseen_count_user = 4; // how many last seen members to show to users
$lastseen_count_admn = 6; // how many last seen members to show to admins
/* SERVER TRAFFIC SECTION */
$servertraffic_view = 0; // SERVER TRAFFIC SECTION: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$traffic_year_view = 1; // Traffic stats by year: Who can view? 0=everyone 1=user-only 2=admin-only 3=disable
$how_many_years = 2; // how many years to display in traffic stats
/* GENERAL BLOCK SETTINGS */
$nameMaxLength = 13; // Max length for username display. Will truncate with ...
$langMaxLength = 17; // Max length for some problem language defines. Will display in smaller font-size
$LargeSectionIcons = false; // use 32x32 icons for the sections
$display_lost_pass = true; // set to false to hide the lost password link (displays in smaller font in some languages)
$pm_colorbox_notice = true; // if set to true, users will only be notified of private messages once per session
$UsemodalLogin = true; // modal login popup - nukeNAV module must be ACTIVE!
$UseSearchPopUp = true; // modal search popup - nukeNAV and Search modules must be ACTIVE!
$whoisUseModal = true; //admin ip lookup in modal window
$OnlineGuestsModal = true; //compact the online guests into one modal link
$whoisServerString = 'whois.domaintools.com/'; //admin ip lookup
if ($IBCentermode) { // <- do not edit
/*********************************************************************************************************/
/* CENTER BLOCK SETTINGS (only used when in center position, overrides settings above) */
/*********************************************************************************************************/
$membercounter_view = 0;
$zero_in_column_view = 2;
$recent_member_view = 0;
$recent_member_count = 2;
$recent_member_user = 2;
$recent_member_admin = 2;
$who_is_online_view = 0;
$show_guest_guest = 0;
$max_display_guests = 20;
$max_display_members = 6;
$showonlinecount = 0;
$lastseen_user_view = 0;
$lastseen_count = 6;
$lastseen_count_user = 6;
$lastseen_count_admn = 6;
$servertraffic_view = 0;
$traffic_year_view = 0;
$how_many_years = 2;
$LargeSectionIcons = true;
} // <- do not edit
/*********************************************************************************************************/
/* Sprite Settings - For more info see http://www.rtsforce.com/InfoBox-CSS/ */
/*********************************************************************************************************/
$IBtran = 'images/transparent.gif'; // source for the transparent gif sprite container
$IBicon = 'IBicon8'; // default classes for icons (changed by theme below unless $MultiThemeMode = false)
$rnIBicon = 'rnIBicon'; // default classes for icons (changed by theme below unless $MultiThemeMode = false)
$MultiThemeMode = true; // false to disable loading theme specific icons, and ignore array settings below - see readme
$rnIBWhite = array('3D-Fantasy', 'DeepBlue', 'ExtraLite', 'NukeNews', 'Slash', 'SlashOcean', 'Traditional'); // Themes with white block backgrounds
$rnIBGray = array('Anagram', 'Karate', 'Milo'); // Themes with gray block backgrounds
$rnIBCreme = array('Sunset'); // Themes with creme block backgrounds
$rnIBSimplyBlue = array('SimplyBlue'); // Themes with sky blue block backgrounds
$rnIBSandJourney = array('Sand_Journey'); // Themes with sand block backgrounds
$rnIBBlueBlog = array('Blue_Blog'); // Themes with taupe block backgrounds
$rnIBCTRN = array('CT_RN'); // Themes with crimson backgrounds
$rnIBRavenIce = array('RavenIce', 'fisubice'); // Themes with off-white/blue block backgrounds
$rnIBKaput = array('Kaput'); // Themes with blue/gray block backgrounds
$rnIBBlack = array(); // Themes with black block backgrounds
$rnIBExtra = array(); // An extra group for other themes (use class rnIBExtra and IBExtra to define your sprite background - see readme)
/*********************************************************************************************************/
/* You should not need to modify anything below this line */
/*********************************************************************************************************/
global $db, $prefix, $ya_config, $anonymous, $nukeurl, $user_prefix, $user, $sitekey, $gfx_chk, $admin, $currentlang, $language, $startdate, $name;
//Translation
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/module.php")) {
include("themes/$ThemeSel/module.php");
if (is_active("$default_module") AND file_exists("modules/$default_module/index.php")) {
$def_module = $default_module;
} else {
$def_module = "";
}
}
$row = $db->sql_fetchrow($db->sql_query("SELECT main_module FROM ".$prefix."_main"));
$main_module = $row['main_module'];
/* If the module doesn't exist, it will be removed from the database automaticaly */
$result2 = $db->sql_query("SELECT title FROM " . $prefix . "_modules");
while ($row2 = $db->sql_fetchrow($result2)) {
$title = stripslashes($row2['title']);
$a = 0;
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ($file == $title) {
$a = 1;
}
}
closedir($handle);
if ($a == 0) {
$db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'");
}
}
/* If you copied a new module is the /modules/ directory, it will be added to the database */
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ( (!preg_match("/[.]/",$file)) ) {
$modlist .= "$file ";
}
}
closedir($handle);
$modlist = explode(" ", $modlist);
sort($modlist);
for ($i=0; $i < sizeof($modlist); $i++) {
if($modlist[$i] != "") {
$row4 = $db->sql_fetchrow($db->sql_query("SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'"));
$mid = intval($row4['mid']);
$mod_uname = preg_replace("/_/", " ", $modlist[$i]);
if ($mid == "") {
$db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$mod_uname', '0', '0', '1')");
}
}
}
$current=$_SERVER['REQUEST_URI'];
$content ='<center><a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=pl&hl=en&ie=UTF-8"><img src="images/flags20x20/pl.png" alt="Polish" title="Polish" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=es&hl=en&ie=UTF-8"><img src="images/flags20x20/es.png" alt="Spanish" title="Spanish" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=nl&hl=en&ie=UTF-8"><img src="images/flags20x20/nl.png" alt="Dutch" title="Dutch" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=fr&hl=en&ie=UTF-8"><img src="images/flags20x20/fr.png" alt="French" title="French" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=it&hl=en&ie=UTF-8"><img src="images/flags20x20/it.png" alt="Italian" title="Italian" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=de&hl=en&ie=UTF-8"><img src="images/flags20x20/gr.png" alt="German" title="German" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=pt&hl=en&ie=UTF-8"><img src="images/flags20x20/pt.png" alt="Portuguese" title="Portuguese" /></a> <a rel="nofollow" href="http://translate.google.com/translate?u=' . $nukeurl . $current . '&sl=en&tl=fi&hl=en&ie=UTF-8"><img src="images/flags20x20/fi.png" alt="Finnish" title="Finnish" /></a></center>';
$content .= "<br /><a rel='nofollow' href='$nukeurl' title='Home'> <img src='images/flags20x20/home.png' alt='Home' /> <b>Home:</b></a><br /><a rel='nofollow' href='$nukeurl/modules.php?name=Donations' title='Donations'> <img src='images/flags20x20/donate.png' alt='Donations' /> <b>Donations:</b></a><br /><a rel='nofollow' href='$nukeurl/modules.php?name=Forums' title='Forums'> <img src='images/flags20x20/forum.png' alt='Forums' /> <b>Forums:</b></a><br /><hr /><br />";
$content .= '<select class="" size="1" name="name" onchange="top.location.href=this.options[this.selectedIndex].value">';
$content .= "<option>Menu</option>";
$result3 = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC");
while ($row3 = $db->sql_fetchrow($result3)) {
$m_title = stripslashes($row3['title']);
$custom_title = $row3['custom_title'];
$view = intval($row3['view']);
$m_title2 = preg_replace("/_/", " ", $m_title);
if ($custom_title != "") {
$m_title2 = $custom_title;
}
if ($m_title != $main_module) {
if ((is_admin($admin) AND $view == 2) OR $view != 2) {
$selected = '';
$content .= "<option value=\"modules.php?name=$m_title\">→ $m_title2</option>";
}
}
}
$content .= '</select><br /><br /><hr />';
if(file_exists('language/infobox/lang-' . $currentlang . '.php')) {
include_once 'language/infobox/lang-' . $currentlang . '.php';
} elseif(file_exists('language/infobox/lang-' . $language . '.php')) {
include_once 'language/infobox/lang-' . $language . '.php';
} else {
include_once 'language/infobox/lang-english.php';
}
if (!isset($name)) { $name = ''; }
if ($IBCentermode) {
$ListClass = 'IBblock-center';
addJSToBody('includes/jquery/jquery.masonry.min.js', 'file');
addJSToBody('includes/jquery/jquery.userinfo.js', 'file');
} else {
$ListClass = 'IBblock';
}
if (!isset($ya_config)) $ya_config = ya_get_configs();
if ($MultiThemeMode){
$ThemeSel = get_theme();
if (in_array($ThemeSel, $rnIBWhite)) {$rnIBicon = 'rnIBWhite';$IBicon = 'IBWhite';}
else if (in_array($ThemeSel, $rnIBGray)) {$rnIBicon = 'rnIBGray';$IBicon = 'IBGray';}
else if (in_array($ThemeSel, $rnIBCreme)) {$rnIBicon = 'rnIBCreme';$IBicon = 'IBCreme';}
else if (in_array($ThemeSel, $rnIBSimplyBlue)) {$rnIBicon = 'rnIBSimplyBlue';$IBicon = 'IBSimplyBlue';}
else if (in_array($ThemeSel, $rnIBSandJourney)) {$rnIBicon = 'rnIBSandJourney';$IBicon = 'IBSandJourney';}
else if (in_array($ThemeSel, $rnIBBlueBlog)) {$rnIBicon = 'rnIBBlueBlog';$IBicon = 'IBBlueBlog';}
else if (in_array($ThemeSel, $rnIBCTRN)) {$rnIBicon = 'rnIBCT-RN';$IBicon = 'IBCT-RN';}
else if (in_array($ThemeSel, $rnIBRavenIce)) {$rnIBicon = 'rnIBRavenIce';$IBicon = 'IBRavenIce';}
else if (in_array($ThemeSel, $rnIBKaput)) {$rnIBicon = 'rnIBKaput';$IBicon = 'IBKaput';}
else if (in_array($ThemeSel, $rnIBBlack)) {$rnIBicon = 'rnIBBlack';$IBicon = 'IBBlack';}
else if (in_array($ThemeSel, $rnIBExtra)) {$rnIBicon = 'rnIBExtra';$IBicon = 'IBExtra';}
else {$rnIBicon = 'rnIBicon';$IBicon = 'IBicon8';}
}
if ($LargeSectionIcons) {$IBadjust = 'LG';$IBicon = 'IBBigIcons';} else {$IBadjust = '';}
if (is_admin($admin)) {
$viewlevel = 2;
$lastseen_count=$lastseen_count_admn;
$recent_member_count=$recent_member_admin;
} else if (is_user($user)) {
$viewlevel = 1;
$lastseen_count=$lastseen_count_user;
$recent_member_count=$recent_member_user;
} else {
$viewlevel = 0;
}
$anonyname = 'Anonymous';
$displayname = '';
$show_pms = 0;
$onlinenames = array();
$content .= '<!-- Start Info -->
<div id="' . $ListClass . '"><div class="fullwidth">
';
// get user info/show login
if (is_user($user)) {
$uinfo = cookiedecode($user);
$displayname = check_html($uinfo[1], 'nohtml');
$content .= '<div class="IBinfosection" id="IBsection1">'.PHP_EOL;
$content .= '<div><a href="modules.php?name=Your_Account&op=edituser" class="IBuser' . $IBadjust . '" title="' . _FSIYOURACCOUNT . '"><img src="' . $IBtran . '" class="' . $IBicon . '" alt="' . _FSIYOURACCOUNT . '" /><span class="IBtextpad">' . $displayname . '</span></a></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
if ($whoisUseModal){$iblinktype = 'class="IBmodal"';} else {$iblinktype = 'target="_blank"';}
$content .= '<li class="' . $rnIBicon . ' IByourip" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '"><span class="thick"><a ' . $iblinktype . ' href="http://' . $whoisServerString . $_SERVER['REMOTE_ADDR'] . '" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '">' . $_SERVER['REMOTE_ADDR'] . '</a></span></li>'.PHP_EOL;
if (is_active('Forums')) {
$adjustment = strlen(html_entity_decode(_INFOBOX_EGOPOSTS));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IByourposts' . $getsmall . '" title="' . _INFOBOX_EGOPOSTS . '"><a href="forums.html?amp;file=search&search_id=egosearch" title="' . _INFOBOX_EGOPOSTS . '">' . _INFOBOX_EGOPOSTS . '</a></li>'.PHP_EOL;
}
if ($ya_config['allowusertheme']=='1') {
$content .= '<li class="' . $rnIBicon . ' IBchangetheme" title="' . _INFOBOX_CHANGETHEME . '"><a href="modules.php?name=Your_Account&op=chgtheme" title="' . _INFOBOX_CHANGETHEME . '">' . _INFOBOX_CHANGETHEME . '</a></li>'.PHP_EOL;
}
if (is_active('nukeNAV') and is_active('Search') and $UseSearchPopUp) $content .= '<li class="' . $rnIBicon . ' IBsearch" title="' . _SEARCH . '"><a href="modules.php?name=nukeNAV&op=search" class="colorbox" title="">' . _SEARCH . '</a></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGOUT . '"><a href="modules.php?name=Your_Account&op=logout" title="' . _LOGOUT . '">' . _LOGOUT . '</a></li>'.PHP_EOL;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
// check new pms
$sql = 'SELECT privmsgs_to_userid FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid=' . intval($uinfo[0]) . ' AND (privmsgs_type=5 OR privmsgs_type=1)';
if (!($result = $db->sql_query($sql))) {
// error
die('error checking new pms');
}
$new_pms = $db->sql_numrows($result);
$db->sql_freeresult($result);
// check old pms
$sql = 'SELECT privmsgs_to_userid FROM ' . $prefix . '_bbprivmsgs WHERE privmsgs_to_userid=' . intval($uinfo[0]) . ' AND (privmsgs_type=0)';
if (!($result = $db->sql_query($sql))) {
// error
die('error checking old pms');
}
$old_pms = $db->sql_numrows($result);
$db->sql_freeresult($result);
$show_pms = $new_pms+$old_pms;
if ($show_pms > 0 AND is_active('Private_Messages')) {
$content .= '<div class="IBinfosection" id="IBsection2">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBpms' . $IBadjust . '" alt="' . _BPM . '" /><span class="IBtextpad thick">' . _BPM . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBnewpms" title="' . _BPM . '"><a href="modules.php?name=Private_Messages" title="' . _BPM . '">' . _BUNREAD . ': ' . $new_pms . '</a></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBoldpms" title="' . _BREAD . '"> ' . _BREAD . ': <span class="thick">' . $old_pms . '</span></li>'.PHP_EOL;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
if (($pm_colorbox_notice && $new_pms > 0) and (!isset($_COOKIE["youhaveapm"])) and ($name!='Private_Messages')) {
setcookie('youhaveapm', 'checked');
$content .= '<div id="IByesnewpm" style="display:none">'.PHP_EOL;
$content .= '<div id="IBnewmessages">'.PHP_EOL;
$content .= '<span class="IBCBtext"><img src="' . $IBtran . '" class="' . $IBicon . ' IBoldpms" alt="' . _NEWPMSG . '" /> ' . _YOUHAVE . ' <a href="modules.php?name=Private_Messages">' . $new_pms . ' ' . _NEWPMSG . '.</a></span>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
}
} else {
$content .= '<div class="IBinfosection" id="IBsection3">'.PHP_EOL;
$content .= '<div><a href="modules.php?name=Your_Account" title="' . _FSIYOURACCOUNT . '" class="IBglobe' . $IBadjust . '"><img src="' . $IBtran . '" class="' . $IBicon . ' IBglobe' . $IBadjust . '" alt="' . $anonymous . '" /><span class="IBtextpad">' . $anonymous . '</span></a></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IByourip IBguestip" title="' . _YOURIP . ' ' . $_SERVER['REMOTE_ADDR'] . '"><span class="thick">' . $_SERVER['REMOTE_ADDR'] . '</span></li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IByourposts" title="' . _BREG . '"><a href="modules.php?name=Your_Account&op=new_user">' . _BREG . '</a></li>'.PHP_EOL;
if (is_active('nukeNAV') and is_active('Search') and $UseSearchPopUp) $content .= '<li class="' . $rnIBicon . ' IBsearch" title="' . _SEARCH . '"><a href="modules.php?name=nukeNAV&op=search" class="colorbox" title="">' . _SEARCH . '</a></li>'.PHP_EOL;
if ($UsemodalLogin){
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGIN . '"><a href="modules.php?name=nukeNAV&op=login" class="colorbox">' . _LOGIN . '</a></li>'.PHP_EOL;
} else {
$content .= '<li class="' . $rnIBicon . ' IBlogout" title="' . _LOGIN . '"><a href="modules.php?name=Your_Account">' . _LOGIN . '</a></li>'.PHP_EOL;
}
if ($display_lost_pass) {
$adjustment = strlen(html_entity_decode(_PASSWORDLOST));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IBonlineguest' . $getsmall . '" title="' . _PASSWORDLOST . '"><a href="modules.php?name=Your_Account&op=pass_lost">' . _PASSWORDLOST . '</a></li>'.PHP_EOL;
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
if ($viewlevel>=$membercounter_view) {
// MEMBER COUNTS
$sql = 'SELECT username FROM ' . $user_prefix . '_users_temp';
$result = $db->sql_query($sql);
$waiting = $db->sql_numrows($result);
$content .= '<div class="IBinfosection" id="IBsection4">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBmembers' . $IBadjust . '" alt="' . _BMEM . '" /><span class="IBtextpad thick">' . _BMEM . '</span></div>'.PHP_EOL;
// 0001856: User Info block enhancements
$IBgetmonth = _UMONTH;
$IBgetyear = _YEAR;
// get new member info
$timestamp = time();
$today = date("M d, Y");
$yesterday = date("M d, Y", ($timestamp - 86400) );
$this_month = date("M");
$this_year = date("Y");
// today
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE user_regdate=\'' . $today . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting todays users');
}
list($new_today) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// yesterday
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE user_regdate=\'' . $yesterday . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting yesterdays users');
}
list($new_yesterday) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// this month
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE SUBSTRING(user_regdate, 1, 4)=\'' . $this_month . '\' AND SUBSTRING(user_regdate, 9, 12)=\'' . $this_year . '\'';
if (!($result = $db->sql_query($sql))){
// error
die('error getting this months users');
}
list($new_month) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// this year
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users WHERE SUBSTRING(user_regdate, 9, 12)=\'' . $this_year . '\'';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting this years users');
}
list($new_year) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// all time
$sql = 'SELECT COUNT(user_id) FROM ' . $user_prefix . '_users';
if (!($result = $db->sql_query($sql))) {
// error
die('error getting total users');
}
if (is_admin($admin) AND @file_exists('modules/Resend_Email/index.php')) {
$waitLink = '<a href="modules.php?name=Resend_Email" title="' . _TTL_RESENDEMAIL . '">' . _WAITLINK . ': <span class="thick">' . $waiting . '</span></a>';
} else {
$waitLink = _WAITLINK . ': <span class="thick">' . $waiting . '</span>';
}
list($total_users) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$content .= '<ul class="rninfobox">'.PHP_EOL;
if (($new_today==0 AND $viewlevel>=$zero_in_column_view) OR ($new_today!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBtoday" title="' . _INFOBOX_BTD . '">' . _INFOBOX_BTD . ': <span class="thick">' . $new_today . '</span></li>'.PHP_EOL;
}
if (($new_yesterday==0 AND $viewlevel>=$zero_in_column_view) OR ($new_yesterday!=0)) {
$adjustment = strlen(html_entity_decode(_INFOBOX_BYD));
if ($adjustment>=$langMaxLength){$getsmall = ' smaller';} else {$getsmall = '';}
$content .= '<li class="' . $rnIBicon . ' IByesterday' . $getsmall . '" title="' . _INFOBOX_BYD . '">' . _INFOBOX_BYD . ': <span class="thick">' . $new_yesterday . '</span></li>'.PHP_EOL;
}
if (($new_month==0 AND $viewlevel>=$zero_in_column_view) OR ($new_month!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBmonth" title="' . _UMONTH . '">' . $IBgetmonth . ': <span class="thick">' . $new_month . '</span></li>'.PHP_EOL;
}
if (($new_year==0 AND $viewlevel>=$zero_in_column_view) OR ($new_year!=0)) {
$content .= '<li class="' . $rnIBicon . ' IByear" title="' . _YEAR . '">' . $IBgetyear . ': <span class="thick">' . $new_year . '</span></li>'.PHP_EOL;
}
$content .= '<li class="' . $rnIBicon . ' IBtotalusers" title="' . _BTT . '">' . _BTT . ': <span class="thick">' . $total_users . '</span></li>'.PHP_EOL;
if (($waitLink==0 AND $viewlevel>=$zero_in_column_view) OR ($waitLink!=0)) {
$content .= '<li class="' . $rnIBicon . ' IBwaiting" title="' . _WAITLINK . '">' . $waitLink . '</li>'.PHP_EOL;
}
$content .= '</ul></div>'.PHP_EOL;
}
// NEWEST MEMBERS
if ($viewlevel>=$recent_member_view) {
$sql = 'SELECT username FROM ' . $user_prefix . '_users WHERE username!=\'' . $anonyname . '\' ORDER BY user_id DESC LIMIT ' . intval($recent_member_count);
if (!($result = $db->sql_query($sql))) {
// error
die('error getting latest users');
}
$latestusers = $db->sql_numrows($result = $db->sql_query($sql));
$content .= '<div class="IBinfosection" id="IBsection5">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBnewusers' . $IBadjust . '" alt="' . _INFOBOX_NEW_MEMBERS . '" /><span class="IBtextpad thick">' . _INFOBOX_NEW_MEMBERS . '</span></div>'.PHP_EOL;
if ($latestusers > 0){
$content .= '<ul class="rninfobox">'.PHP_EOL;
$newusercounter = 0;
}
while($row = $db->sql_fetchrow($result)) {
$newusercounter += 1;
$TruncateUser = strlen($row['username'])<=$nameMaxLength?$row['username']:substr($row['username'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['username'];
$content .= '<li class="' . $rnIBicon . ' IBmembernew" title="' . _ALT_CHKPROFILE . $lastusername . '"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['username'] . '" title="' . _ALT_CHKPROFILE . $lastusername . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
if ($newusercounter==$latestusers){
$content .= '</ul>'.PHP_EOL;
}
}
$db->sql_freeresult($result);
$content .= '</div>'.PHP_EOL;
}
$m = 0;
if ($viewlevel>=$who_is_online_view) {
// WHOS ONLINE
$members = '';
$guests = '';
$m = $g = 0;
$sql = "SELECT uname, time, host_addr, guest FROM ". $prefix ."_session WHERE time > '".( time() - ($max_session_mins * 60) )."' ORDER BY guest ASC,time DESC";
if (!($result = $db->sql_query($sql))) {
// error
die('error getting online users');
}
$content .= '<div class="IBinfosection" id="IBsection6">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBmembers' . $IBadjust . $IBadjust . '" alt="' . _BON . '" /><span class="IBtextpad thick">' . _BON . '</span></div>'.PHP_EOL;
while($row = $db->sql_fetchrow($result)) {
if ($row['guest'] == 0) {
$m++;
if ($m <= $max_display_members) {
$TruncateUser = strlen($row['uname'])<=$nameMaxLength?$row['uname']:substr($row['uname'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['uname'];
$onlinenames[] = $lastusername;
$members .= '<li class="' . $rnIBicon . ' IBonline2" title="' . _BON . '"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['uname'] . '" title="' . _ALT_CHKPROFILE . $lastusername . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
}
} else {
$g++;
if ($viewlevel>=$show_guest_guest && $g <= $max_display_guests) {
if (is_admin($admin)) {
if ($whoisUseModal){
$uname = '<a class="IBmodal" href="http://' . $whoisServerString . $row['uname'] . '">' . $row['uname'] . '</a>';
} else {
$uname = '<a target="_blank" href="http://' . $whoisServerString . $row['uname'] . '">' . $row['uname'] . '</a>';
}
} else {
// hide last 2 octets of guest ip's.
$ip = explode('.', $row['uname']);
$uname = $ip[0] . '.' . $ip[1] . '.' . preg_replace("/(0|1|2|3|4|5|6|7|8|9)/", "x", $ip[2]) . '.' . preg_replace("/(0|1|2|3|4|5|6|7|8|9)/", "x", $ip[3]);
}
$guests .= '<li class="' . $rnIBicon . ' IBonlineguest" title="' . _BON . '">' . $uname . '</li>'.PHP_EOL;
}
}
}
$db->sql_freeresult($result);
if (($viewlevel>=$showonlinecount) AND (($m > 0) OR ($g > 0 AND !$OnlineGuestsModal))) {
$content .= '<div class="IBsmallnotes">';
if ($m > 0) {
$content .= _BMEM . ':<span class="thick">' . $m . '</span>';
}
if ($g > 0 AND !$OnlineGuestsModal) {
$content .= ' ' . _BVIS . ':<span class="thick">' . $g . '</span>';
}
$content .= ' </div>'.PHP_EOL;
}
if (($m > 0) OR ($viewlevel>=$show_guest_guest && $g > 0)) {
if ($g > 0 AND $OnlineGuestsModal AND $viewlevel == 2) {
$content .= '<div style="display:none">'.PHP_EOL;
$content .= '<div id="IBGuestsView" style="margin-left:20px;">'.PHP_EOL;
$content .= '<h1>' . _BON . '</h1>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= $guests;
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
$content .= '<ul class="rninfobox">'.PHP_EOL;
}
if ($g > 0 AND $OnlineGuestsModal) {
$content .= '<li class="' . $rnIBicon . ' IBonlineguest" title="' . _BON . '">';
if ($viewlevel == 2) {
$content .= '<a class="IBGuestsModal" href="#">' . $g . ' ' . _BVIS . '</a>';
} else {
$content .= $g . ' ' . _BVIS;
}
$content .= '</li>' . PHP_EOL;
}
if ($m > 0) {
$content .= $members;
}
if ($g > 0 AND !$OnlineGuestsModal) {
$content .= $guests;
}
if (($m > 0) OR ($viewlevel>=$show_guest_guest && $g > 0)) {
$content .= '</ul>'.PHP_EOL;
}
$content .= '</div>'.PHP_EOL;
}
// LAST SEEN MEMBERS
if ($viewlevel>=$lastseen_user_view) {
$lastseennumber = intval($lastseen_count)+$m;
if (is_user($user)) {
$exclusion = 'AND username!=\'' . $displayname . '\' ';
} else {
$exclusion = '';
}
$sql = 'SELECT username, lastsitevisit FROM ' . $user_prefix . '_users WHERE username!=\'' . $anonyname . '\' ' . $exclusion . 'ORDER BY lastsitevisit DESC LIMIT ' . $lastseennumber;
$latestusers = $db->sql_numrows($result = $db->sql_query($sql));
$latestusercounter = 1;
if ($latestusers > 0) {
$latuse = '<div class="IBinfosection" id="IBsection7">'.PHP_EOL;
$latuse .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBlastseen' . $IBadjust . '" alt="' . _INFOBOX_LAST_SEEN . '" /><span class="IBtextpad thick">' . _INFOBOX_LAST_SEEN . '</span></div>'.PHP_EOL;
$latuse .= '<ul class="rninfobox">'.PHP_EOL;
while( $row = $db->sql_fetchrow($result) ) {
if ($latestusercounter <= $lastseen_count) {
$TruncateUser = strlen($row['username'])<=$nameMaxLength?$row['username']:substr($row['username'],0,$nameMaxLength).'...'; // 2.2.0
$lastusername = $row['username'];
$row['lastsitevisit'] = date('d F Y H:i', $row['lastsitevisit']);
if (!in_array($lastusername, $onlinenames)){
$latestusercounter += 1;
$latuse .= '<li class="' . $rnIBicon . ' IBonline"><a href="modules.php?name=Your_Account&op=userinfo&username=' . $row['username'] . '" title="' . _INFOBOX_LAST_SEEN . ': ' . $row['lastsitevisit'] . '">' . $TruncateUser . '</a></li>'.PHP_EOL;
}
}
}
$latuse .= '</ul>'.PHP_EOL;
$db->sql_freeresult($result);
$latuse .= '</div>'.PHP_EOL;
}
if ($latestusercounter > 1) $content .= $latuse;
}
// SERVER TRAFFIC
if ($viewlevel>=$servertraffic_view) {
$content .= '<div class="IBinfosection" id="IBsection8">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBtraffic' . $IBadjust . '" alt="' . _INFOBOX_SERVERTRAFFIC . '" /><span class="IBtextpad thick">' . _INFOBOX_SERVERTRAFFIC . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$totalhits = 0;
$result = $db->sql_query('SELECT sum(hits) FROM ' . $prefix . '_stats_year');
list($totalhits) = $db->sql_fetchrow($result);
$content .= '<li class="' . $rnIBicon . ' IBtotalhits" title="' . _WERECEIVED . ' ' . number_format($totalhits,0) . ' ' . _PAGESVIEWS . ' ' . $startdate . '">' . _INFOBOX_TOTALHITS.number_format($totalhits,0) . '</li>'.PHP_EOL;
$today = 0;
$todayDST = date('I',time())*3600;
$t_time = time()-$todayDST;
$t_year = date('Y', $t_time);
$t_month = date('n', $t_time);
$t_date = date('j', $t_time);
$result = $db->sql_query('SELECT hits FROM ' . $prefix . '_stats_date WHERE year=' . $t_year . ' AND month=' . $t_month . ' AND date=' . $t_date);
list($today) = $db->sql_fetchrow($result);
$content .= '<li class="' . $rnIBicon . ' IBtodayhits" title="' . _INFOBOX_TODAYHITS.number_format($today,0) . '">' . _INFOBOX_TODAYHITS.number_format($today,0) . '</li>'.PHP_EOL;
if ($how_many_years>0 AND $viewlevel>=$traffic_year_view) {
$sql = 'SELECT year, hits FROM ' . $prefix . '_stats_year ORDER BY year DESC LIMIT ' . intval($how_many_years);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$content .= '<li class="' . $rnIBicon . ' IByearlyhits" title="' . $row['year'] . ': ' . number_format($row['hits']) . '">' . $row['year'] . ': ' . number_format($row['hits']) . '</li>'.PHP_EOL;
}
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
}
// SERVER DATE/TIME
$content .= '<div class="IBinfosection" id="IBsection9">'.PHP_EOL;
$content .= '<div><img src="' . $IBtran . '" class="' . $IBicon . ' IBserver' . $IBadjust . '" alt="' . _INFOBOX_SERVERINFO . '" /><span class="IBtextpad thick">' . _INFOBOX_SERVERINFO . '</span></div>'.PHP_EOL;
$content .= '<ul class="rninfobox">'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBserdate" title="' . _SERDT . '">' . date('M d, Y') . '</li>'.PHP_EOL;
$content .= '<li class="' . $rnIBicon . ' IBtime" title="' . _SERDT . '">' . date('h:i a T') . '</li>'.PHP_EOL;
if ((is_admin($admin)) and (defined('RAVENNUKE_VERSION_FRIENDLY'))) {
$content .= '<li class="' . $rnIBicon . ' IBglobe" title="RN ' . RAVENNUKE_VERSION_FRIENDLY . '">RN ' . RAVENNUKE_VERSION_FRIENDLY . '</li>'.PHP_EOL;
}
$content .= '</ul>'.PHP_EOL;
$content .= '</div>'.PHP_EOL;
$content .= '</div></div>'.PHP_EOL;
// make sure content does not float outside the block
$content .= '<div class="block-spacer"> </div>'.PHP_EOL;
$content .= '<!-- END Info -->'.PHP_EOL;
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|