Has there been any updates that allow this in 2.0.6; receiving an email and/or popup alert when a new PM arrives?
$query='SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.topic_time, t.topic_views, t.topic_replies, t.forum_id, f.forum_name FROM '.$db->prefix('bb_topics').' t, '.$db->prefix('bb_forums').' f WHERE f.forum_id=t.forum_id AND f.forum_type <> 1 ORDER BY '.$order.' DESC';
[b]// edit start: customized block to show the default amount of topics or x results from user input
$options[0] = (is_numeric($_GET['new_topics'])) ? intval($_GET['new_topics']) : $options[0];[/b]
// edit stop
if (!$result = $db->query($query,$options[0],0)) {
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<{* EDIT START *}>
[b]<td align="left" valign="top">
<form method="get" action="<{$xoops_requesturi}>" style="margin:0px;">
Display <input type="text" name="new_topics" value="<{$smarty.get.new_topics}>" size="2" maxlength="3" title="Press Enter to submit" /> new topics
</form>
</td>[/b]
<{* EDIT END *}>
<td align="right"><a href="<{$xoops_url}>/modules/newbb/"><{$block.lang_visitforums}></a></td>
</tr>
</table>
A question, though, is how to set a block VISIBLE again.
for ($i = 0; $i < $count; $i++) {
$class = ($class == 'odd') ? 'even' : 'odd';
echo '<tr valign="middle" align="center" class="'.$class.'">';
if (is_object($onlineUsers[$i]['user'])) {
$avatar = $onlineUsers[$i]['user']->getVar('user_avatar') ? '<img src="'.XOOPS_UPLOAD_URL.'/'.$onlineUsers[$i]['user']->getVar('user_avatar').'" alt="" />' : ' ';
echo '<td>'.$avatar."</td><td><a href="javascript:window.opener.location='".XOOPS_URL."/userinfo.php?uid=".$onlineUsers[$i]['user']->getVar('uid')."';window.close();">".$onlineUsers[$i]['user']->getVar('uname')."</a>";
} else {
echo '<td> </td><td>'.$xoopsConfig['anonymous'];
[color=ff0000]// create the list of anonymous user ips
$anon_ips[] = $onlines[$i]['online_ip'];[/color]
}
if ($isadmin == 1) {
echo '<br />('.$onlineUsers[$i]['ip'].')';
}
echo '</td><td>'.$onlineUsers[$i]['module'].'</td></tr>';
[color=ff0000]// show link to spy on every anonymous ip
if ($isadmin == 1 && count($anon_ips))
{
$anon_ips = implode('|',$anon_ips);
echo '<tr><td colspan="3" align="center"><a href="javascript:window.opener.location=''.XOOPS_URL.'/modules/admintools/index.php?tool=iplookup&ip='.$anon_ips.'';window.close();">Anonymous Lookup</a></td></tr>';
}[/color]
}
echo '</table><br />';
include "../../mainfile.php";
<?php
include "header.php";
include XOOPS_ROOT_PATH."/header.php";
global $xoopsDB;
$isadmin = ($xoopsUser && $xoopsUser->isAdmin()) ? 1 : 0;
if ($isadmin===1)
{
// find which tool to use
switch ($_GET['tool'])
{
case 'iplookup':
// convert the string of ip#s from the uri to an array
$iplist = explode('|',$_GET['ip']);
// go though each ip
foreach($iplist as $ip)
{
// separate ip into ocets
$ip_array = explode('.',$ip);
// find the possible user
$partial_ip = '';
echo '<h3 style="color:#00F;">Looking up '.$ip.' ('.gethostbyaddr($ip).')</h3>';
// used to append the dotted decimal to the parial ip's;
// prevents matching 24% which could match 244. than the intendd 24.
$dot = '.';
$wild = '%';
foreach ($ip_array as $key=>$octet)
{
$lookup[$key]['result'] = '';
// removes the dotted decimal if on the last octet and wildcard
if ($key > 2)
{
$dot = '';
$wild = '';
}
$partial_ip .= $octet.$dot;
$sql = 'SELECT u.uname, bb.poster_ip, u.uid
FROM xoops_bb_posts as bb
INNER
JOIN xoops_users as u
ON bb.uid = u.uid
WHERE bb.poster_ip LIKE "'.$partial_ip.$wild.'"
GROUP BY u.uname';
$result = $xoopsDB->query($sql);
$sql.'<br /><br />';
// display output
$lookup[$key]['ip'] = '<br /><u>IP: '.$partial_ip.'<br /></u>';
while ($user = $xoopsDB->fetchArray($result))
{
$lookup[$key]['result'] .= '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$user['uid'].'" target="_blank">'.$user['uname'].'</a><br />';
}
// append the dotted decimal to the octet
}
// display the results in reverse order (exact ip to broad)
// first flip the order of the array
rsort($lookup, SORT_NUMERIC);
foreach ($lookup as $output)
{
echo $output['ip'].$output['result'];
}
}
break;
default:
echo 'No tool selected';
}
}
else
{
echo 'You must have administrative access to enter this area';
}
include XOOPS_ROOT_PATH."/footer.php";
?>
$onlineUsers[$i]['ip'] =[b]gethostbyaddr([/b]$onlines[$i]['online_ip']);
FROM
<!-- Start center-center blocks loop -->
<{foreach item=block from=$xoops_ccblocks}> <table align="center" cellpadding="0" cellspacing="2">
<tr>
<td> <div class="blockTitle"><{$block.title}></div>
<div class="blockContent"><{$block.content}></div></td>
</tr>
</table>
<{/foreach}>
<!-- End center-center blocks loop -->
TO
<!-- Start center-center blocks loop -->
<{foreach item=block from=$xoops_ccblocks}> <table align="center" cellpadding="0" cellspacing="2">
<tr>
<td> <div class="blockTitle"><{$block.title}>
<{* check whether to display the open or close icon *}>
<{if $block.hidden}>
<{assign var="open_close" value="open"}>
<{else}>
<{assign var="open_close" value="close"}>
<{/if}>
<{* uses &from= to send the user back to where s/he was *}>
<a href="$xoops_url/user.php?op=mod_block&choice=<{$open_close}>&blockid=<{$block.id}>&from=<{$xoops.server.PHP_SELF}>"><img src="<{$xoops_url}>/images/<{$open_close}>.gif" alt="<{$open_close}> block" /></a>
</div>
<{* check whether or not to display the contents *}>
<{if $open_close == "close"}>
<div class="blockContent"><{$block.content}></div></td>
<{if}>
</tr>
</table>
<{/foreach}>
<!-- End center-center blocks loop -->
Pseudo
case 'mod_block':
Grab the $_GET['choice'] and $_GET['blockid']
update the database with the choice (open/close)
update the $_SESSION
show the updating screen
send the user back to &from (link in themes.html)
break;