31
zer0fill
Re: Alerts for Private Messaging
  • 2004/6/11 18:56

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


^bump

Has there been any updates that allow this in 2.0.6; receiving an email and/or popup alert when a new PM arrives?



32
zer0fill
Re: Jokes Module
  • 2004/6/11 17:53

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


this is something I'm looking for as well. We just started a jokes thread on my website and wanted some way of ranking them than replying to the message.

my suggestion, after the above mentioned features:
- searchable
- add comments
- sort by: rank, views, comments
- group permission on categories
- move jokes to different categories (owner/admin can do it)
- approval system (set groups are auto-approved)
- multi-sub categories
- notifications



33
zer0fill
Re: Turn On/Off Blocks? (My Proposal)
  • 2004/6/10 11:49

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


DoH! hehe, for some reason I thought you were referring to something along the lines of: delete the user_block_hidden link when the admin disables/hides the block. my mistake



34
zer0fill
NewBB Hack: Let the user decide how many new topics to view (Block)
  • 2004/6/10 11:36

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


This is more for webmasters or very active members who want to see x new posts to have a chance to respond to all of them. This can also be used for aesthetic reasons: On my website, I only set it to show 5 new topics and increasing that makes the site look too "busy." This hack will allow the user to specify how many new topics to show.

./modules/newbb/blocks/newbb_new.php ~line 52
$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)) {

./modules/newbb/templates/blocks/newbb_block_new.html ~line 48
<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>

Now update the module (or edit your cloned template set) and now you'll see a small textbox like Display [¯¯] new topics. The user will type in a number, press enter on the keyboard and the page will reload with a new number of recent topics.



35
zer0fill
Re: Turn On/Off Blocks? (My Proposal)
  • 2004/6/10 11:04

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


I like your idea about having status == "hidden" which cleans up the code a lot. The user_block_hidden table is nice too which prevents orphan block_ids but should only be deleted when the module is deleted, no?

Other than that, this seems like a good place to start. Supporting specific user block locations would be the next hurdle.



36
zer0fill
Re: Turn On/Off Blocks? (My Proposal)
  • 2004/6/10 10:17

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Quote:
A question, though, is how to set a block VISIBLE again.


Sorry about my ramblings if you saw this post earlier; my brain isn't functioning properly at this time (4am). Let me try to rephrase this, now that I have re-read your comment.

1. Why the $_SESSION at all? The session variable would be used to fetch what block to display than checking against the database on each page. [update] Actually, it would be doing both: checking db for the complete list then the session for blocks to close.

2. Re-Opening Hidden Blocks It will be those X or [¯] image links which point to user.php?op=mod_block&choice=open&blockid=5 to re-open a block. the $open_close assigned variable would determine if a block would be re-opened or closed.

3. Why filter in the theme? My method wouldn't totally hide a block, it would just "shade/minimize" it showing only the title but not its contents.

4. SELECT ...
As far as my "SELECT" blurb above, I haven't looked too deep into the XOOPS core to see where this takes place. Although I can guess we could do something like 'SELECT ... WHERE ... AND NOT IN('.implode(',',$_SESSION['xoops']['hidden_blocks']).')';

Other Side This would totally remove the block from the user's interface where the X and [¯] won't get a chance to be displayed. I guess doing this method would require the user to re-open the block from his/her user account preferences :-/

5. In any case, this kind of dynamic feature might not work at all if the site is cached (don't quote me on that, I've never used that feature).

I hope my rambling is now somewhat comprehensive at this time of night.



37
zer0fill
Spy on anonymous users :-)
  • 2004/6/10 9:51

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Updated 9/1/04 to work with 2.0.7.1 Zip File

I'm the curious type so I made this hack to find out who my normal visitors are that are just looking "anonymous"ly. This script is hard-coded for only admins.

./misc.php ~line 208 & 215 (red text)
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="" />' '&nbsp;';
                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>&nbsp;</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 == && 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 />';

create a folder called admintools in your modules directory (./modules/admintools/)

./modules/admintools/header.php
include "../../mainfile.php";

./modules/admintools/index.php
<?php
include "header.php";
include 
XOOPS_ROOT_PATH."/header.php";
global 
$xoopsDB;
$isadmin = ($xoopsUser && $xoopsUser->isAdmin()) ? 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($lookupSORT_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";
?>

The new popup box when clicking "more..." from who's online with "anonymous lookup"
Resized Image
The result page. It checks from exact to broad comparing against ip's from forum posts. eg: full ip is 1.2.3.4, it will check 1.2.3.4 then 1.2.3.% then 1.2.% then 1.% for every anonymous user. there were 2 in this example.
Resized Image


You might notice that my who's online popup shows the reverse dns, it's because i also edited the ./misc.php file ~line 194 to
$onlineUsers[$i]['ip'] =[b]gethostbyaddr([/b]$onlines[$i]['online_ip']);



38
zer0fill
Re: site hacked
  • 2004/6/10 9:18

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


I'm sure your server admin has already gotten a lot of complaints, but send him/her a nice letter about the problem anyways just to make sure s/he is solving the issue.



39
zer0fill
Re: why use css instead of tables?
  • 2004/6/10 9:13

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


But if you have a lot of users that still use Netscape 4.x, stick with tables or force them to update to a more modern browser because the pages wont look "right." Know your audience.



40
zer0fill
Re: Turn On/Off Blocks? (My Proposal)
  • 2004/6/10 9:06

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


I like this feature too. This is my proposal, albiet maybe too newbieish, for the user to open/minimize blocks on any page they're on.

Database
Add another field to the user table such as `hidden_blocks`. It will be a list of comma separated block_id's to hide

User login
during login, it will pouplate (eg: explode() the field) to $_SESSION['xoops']['hidden_blocks'] array list to avoid excessive DB access when checking which blocks to keep open or closed upon each page load.

theme.html
Add the X or [¯] img link next to the block's title, which points to <{$xoops_url}>/user.php?op=mod_block&choice=<open|close>&blockid=<#>&from=<url user clicked this>

In addition, setup an <{if}> statement for which blocks to omit its contents (maybe do this in the SELECT statement?)
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 &fromto 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 -->

The above would, of course, be applied to every block area (left, lcenter, ccenter, rcenter, right)

user.php
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;


Having maintained only small sites, I am unsure of the performance hit this propsal would create with the amount of additional if statements when checking if a block should be closed or opened.

After this is all said and done, it would be nice to have an admin site survey area to find out which blocks are closed the most so we, as admins, know which blocks people don't like (or for just our [read: my] nosy curiosity).




TopTop
« 1 2 3 (4) 5 6 7 ... 12 »



Login

Who's Online

161 user(s) are online (86 user(s) are browsing Support Forums)


Members: 0


Guests: 161


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits