News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - SleePy

#286
Spam, spam, spam; Your the man, If you can't do it nobody can! ;D
#287
ToDo / Re: First Todo Task!
Jul 12, 2007, 02:46 AM
More Comments
#288
SELECT m.subject, t.id_topic as topic_id, m.id_topic as mtopic_id
FROM smf_topics AS t
   INNER JOIN smf_messages AS m ON (m.id_topic = t.id_topic)
WHERE t.id_board = 6
   AND t.id_board = m.id_board
ORDER BY poster_time DESC
LIMIT 10


subject    topic_id    mtopic_id
Re: Ti::First Task:v:St::1:v:Co::00:v:Pr::0    63    63
Ti::Next Task:v:St::1:v:Co::10:v:Pr::0    66    66
Ti::First Task:v:St::1:v:Co::00:v:Pr::0    63    63
#289
SELECT m.subject, t.id_topic as topic_id, m.id_topic as mtopic_id
FROM smf_topics AS t
   INNER JOIN smf_messages AS m ON (m.id_topic = t.id_topic)
WHERE t.id_board = 6
   AND t.id_board = m.id_board
ORDER BY poster_time DESC
LIMIT 10
#290
ToDo / Re: First Todo Task!
Jul 12, 2007, 01:45 AM
Commenting on First Task
#291
 global $user_info, $sourcedir;

$dire='/home/tpnet/alpha';
$sdire='alpha/';

echo '<table align="center" width="500"><tr><td><h2>Alpha downloads</h2>';
$allowed=array('1','2','13','32','30','48','40','20','39','41','22','24');
$show=false;
for($b=0; $b<sizeof($allowed); $b++)
{
   if(in_array($allowed[$b], $user_info['groups']))
    $show=true;
}

if($show)
{
   if(isset($_GET['alpha']))
   {
      $name=$dire.'/'.$_GET['alpha'];
      $what=$_GET['alpha'];


      if(!file_exists($name))
         echo "File $what not found here";
      else
      {

         header('Content-Disposition: attachment; filename="' . $what . '"');
         //header('Content-Type: application/octet-stream');
         header('Content-Type: application/x-gzip');
         readfile($name);
      }
   }


   // read the directory
   $filer = array();
   if ($handle = opendir($dire))
   {
      while (false !== ($file = readdir($handle)))
      {
         if($file!= '.' && $file!='..' && $file!='.htaccess' )
                        {
                             $dato=substr($file,6);
                              $rt=substr($dato,3,2).substr($dato,0,2);
            $filer[] = $rt.'-'.$file;
                     
                        }
      }
      closedir($handle);
      sort($filer);
      $filer=array_reverse($filer);
   }
        $st=true;
   $max=0;
         foreach($filer as $al)
        {
         $max++;
         if($max<20)
          {
                   $al=substr($al,5);
                   $dato=substr($al,6);
                   $dt=substr($dato,0,2).'.'.substr($dato,3,2).'  20'.substr($dato,6,2);

      if($st)
                {
 
                 // open the file and read the changelog!
                 $zip = zip_open($dire.'/'.$al);
                 if ($zip)
                {
                    while ($zip_entry = zip_read($zip))
                    {
                        if(zip_entry_name($zip_entry)=='changelog_TP.txt')
                       {
                            if (zip_entry_open($zip, $zip_entry, "r"))
                           {
                                $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
                                $changelog=substr($buf,0,strpos($buf,'1.0',5));
                                zip_entry_close($zip_entry);
                           }
                       }
                     }
                    zip_close($zip);
                     
               }

                 echo '<div style="margin: 10px 0 10px 0; background: #f9f9f9; padding: 10px; border: solid 1px #d0d0d0;">
    Latest release: <a href="index.php?page=86;alpha='.$al.'">TPv1.0 alpha</a> [ '.$dt.' ]
           

Changes:
      <pre style="font-size: 10px; font-family: verdana; margin: 0;">'.$changelog.'</div>';
                   $st=false;
                 }
                else
                {
 
                 // open the file and read the changelog!
                 $zip = zip_open($dire.'/'.$al);
                 if ($zip)
                {
                    while ($zip_entry = zip_read($zip))
                    {
                        if(zip_entry_name($zip_entry)=='changelog_TP.txt')
                       {
                            if (zip_entry_open($zip, $zip_entry, "r"))
                           {
                                $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
                                $changelog2=substr($buf,0,strpos($buf,'1.0',5));
                                zip_entry_close($zip_entry);
                           }
                       }
                     }
                    zip_close($zip);
                     
               }
                   echo '<div><a href="index.php?page=86;alpha='.$al.'">TPv1.0 alpha</a> [ '.$dt.' ]</a>';
if($changelog2 != $changelog)
{
  echo '
Changes:
      <pre style="font-size: 10px; font-family: verdana; margin-top: 0;">'.$changelog2.'';
  $changelog=$changelog2;
}
echo '</div>';
               }
            }      
        }
}
else
  echo 'Sorry, no access.';
echo '</td></tr></table>';
#292
 global $user_info, $sourcedir;

$dire='/home/tpnet/alpha';
$sdire='alpha/';

echo '<table align="center" width="500"><tr><td><h2>Alpha downloads</h2>';
$allowed=array('1','2','13','32','30','48','40','20','39','41','22','24');
$show=false;
for($b=0; $b<sizeof($allowed); $b++)
{
   if(in_array($allowed[$b], $user_info['groups']))
    $show=true;
}

if($show)
{
   if(isset($_GET['alpha']))
   {
      $name=$dire.'/'.$_GET['alpha'];
      $what=$_GET['alpha'];


      $fn = @fopen($name, "rb");
      if(!$fn)
         echo "File $what not found here";
      else
      {

         header('Content-Disposition: attachment; filename="' . $what . '"');
         //header('Content-Type: application/octet-stream');
         header('Content-Type: application/x-gzip');
         fpassthru($fn);
         fclose($fn);
      }
   }


   // read the directory
   $filer = array();
   if ($handle = opendir($dire))
   {
      while (false !== ($file = readdir($handle)))
      {
         if($file!= '.' && $file!='..' && $file!='.htaccess' )
                        {
                             $dato=substr($file,6);
                              $rt=substr($dato,3,2).substr($dato,0,2);
            $filer[] = $rt.'-'.$file;
                     
                        }
      }
      closedir($handle);
      sort($filer);
      $filer=array_reverse($filer);
   }
        $st=true;
   $max=0;
         foreach($filer as $al)
        {
         $max++;
         if($max<20)
          {
                   $al=substr($al,5);
                   $dato=substr($al,6);
                   $dt=substr($dato,0,2).'.'.substr($dato,3,2).'  20'.substr($dato,6,2);

      if($st)
                {
 
                 // open the file and read the changelog!
                 $zip = zip_open($dire.'/'.$al);
                 if ($zip)
                {
                    while ($zip_entry = zip_read($zip))
                    {
                        if(zip_entry_name($zip_entry)=='changelog_TP.txt')
                       {
                            if (zip_entry_open($zip, $zip_entry, "r"))
                           {
                                $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
                                $changelog=substr($buf,0,strpos($buf,'1.0',5));
                                zip_entry_close($zip_entry);
                           }
                       }
                     }
                    zip_close($zip);
                     
               }

                 echo '<div style="margin: 10px 0 10px 0; background: #f9f9f9; padding: 10px; border: solid 1px #d0d0d0;">
    Latest release: <a href="index.php?page=86;alpha='.$al.'">TPv1.0 alpha</a> [ '.$dt.' ]
           

Changes:
      <pre style="font-size: 10px; font-family: verdana; margin: 0;">'.$changelog.'</div>';
                   $st=false;
                 }
                else
                {
 
                 // open the file and read the changelog!
                 $zip = zip_open($dire.'/'.$al);
                 if ($zip)
                {
                    while ($zip_entry = zip_read($zip))
                    {
                        if(zip_entry_name($zip_entry)=='changelog_TP.txt')
                       {
                            if (zip_entry_open($zip, $zip_entry, "r"))
                           {
                                $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
                                $changelog2=substr($buf,0,strpos($buf,'1.0',5));
                                zip_entry_close($zip_entry);
                           }
                       }
                     }
                    zip_close($zip);
                     
               }
                   echo '<div><a href="index.php?page=86;alpha='.$al.'">TPv1.0 alpha</a> [ '.$dt.' ]</a>';
if($changelog2 != $changelog)
{
  echo '
Changes:
      <pre style="font-size: 10px; font-family: verdana; margin-top: 0;">'.$changelog2.'';
  $changelog=$changelog2;
}
echo '</div>';
               }
            }      
        }
}
else
  echo 'Sorry, no access.';
echo '</td></tr></table>';
#293
 global $user_info, $sourcedir;

$dire='/home/tpnet/alpha';
$sdire='alpha/';

echo '<table align="center" width="500"><tr><td><h2>Alpha downloads</h2>';
$allowed=array('1','2','13','32','30','48','40','20','39','41','22','24');
$show=false;
for($b=0; $b<sizeof($allowed); $b++)
{
   if(in_array($allowed[$b], $user_info['groups']))
    $show=true;
}

if($show)
{
   if(isset($_GET['alpha']))
   {
      $name=$dire.'/'.$_GET['alpha'];
      $what=$_GET['alpha'];


      $fn = @fopen($name, "rb");
      if(!$fn)
         echo "File $what not found here";
      else
      {

         header('Content-Disposition: attachment; filename="' . $what . '"');
         //header('Content-Type: application/octet-stream');            header('Content-Type: application/x-gzip');
         fpassthru($fn);
         fclose($fn);
      }
   }


   // read the directory
   $filer = array();
   if ($handle = opendir($dire))
   {
      while (false !== ($file = readdir($handle)))
      {
         if($file!= '.' && $file!='..' && $file!='.htaccess' )
                        {
                             $dato=substr($file,6);
                              $rt=substr($dato,3,2).substr($dato,0,2);
            $filer[] = $rt.'-'.$file;
                     
                        }
      }
      closedir($handle);
      sort($filer);
      $filer=array_reverse($filer);
   }
        $st=true;
   $max=0;
         foreach($filer as $al)
        {
         $max++;
         if($max<20)
          {
                   $al=substr($al,5);
                   $dato=substr($al,6);
                   $dt=substr($dato,0,2).'.'.substr($dato,3,2).'  20'.substr($dato,6,2);

      if($st)
                {
 
                 // open the file and read the changelog!
                 $zip = zip_open($dire.'/'.$al);
                 if ($zip)
                {
                    while ($zip_entry = zip_read($zip))
                    {
                        if(zip_entry_name($zip_entry)=='changelog_TP.txt')
                       {
                            if (zip_entry_open($zip, $zip_entry, "r"))
                           {
                                $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
                                $changelog=substr($buf,0,strpos($buf,'1.0',5));
                                zip_entry_close($zip_entry);
                           }
                       }
                     }
                    zip_close($zip);
                     
               }

                 echo '<div style="margin: 10px 0 10px 0; background: #f9f9f9; padding: 10px; border: solid 1px #d0d0d0;">
    Latest release: <a href="index.php?page=86;alpha='.$al.'">TPv1.0 alpha</a> [ '.$dt.' ]
           

Changes:
      <pre style="font-size: 10px; font-family: verdana; margin: 0;">'.$changelog.'</div>';
                   $st=false;
                 }
                else
                {
 
                 // open the file and read the changelog!
                 $zip = zip_open($dire.'/'.$al);
                 if ($zip)
                {
                    while ($zip_entry = zip_read($zip))
                    {
                        if(zip_entry_name($zip_entry)=='changelog_TP.txt')
                       {
                            if (zip_entry_open($zip, $zip_entry, "r"))
                           {
                                $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
                                $changelog2=substr($buf,0,strpos($buf,'1.0',5));
                                zip_entry_close($zip_entry);
                           }
                       }
                     }
                    zip_close($zip);
                     
               }
                   echo '<div><a href="index.php?page=86;alpha='.$al.'">TPv1.0 alpha</a> [ '.$dt.' ]</a>';
if($changelog2 != $changelog)
{
  echo '
Changes:
      <pre style="font-size: 10px; font-family: verdana; margin-top: 0;">'.$changelog2.'';
  $changelog=$changelog2;
}
echo '</div>';
               }
            }      
        }
}
else
  echo 'Sorry, no access.';
echo '</td></tr></table>';
#294
echo '<div>';

$i = 0;

echo '
<table>
   <tr>';

while ($row = mysql_fetch_assoc($query))
{
  echo '<td><a href="' . $scripturl . '?page=' . $row['id'] . '">' . $row['subject'] . '</a></td>';  
   $i++;
   //if ($i > 2)
   //{
   //   echo '</tr><tr>';
   //   $i = 0;
   //}
   if($i % 3 == 0 && $i != 0)
      echo '</tr><tr>';
}
echo '
   </tr>
</table>
</div>';
#295
echo '<div>';

$i = 0;

echo '
<table>
   <tr>';

while ($row = mysql_fetch_assoc($query))
{
  echo '<td><a href="' . $scripturl . '?page=' . $row['id'] . '">' . $row['subject'] . '</a></td>';  
   $i++;
   //if ($i > 2)
   //{
   //   echo '</tr><tr>';
   //   $i = 0;
   //}
   if($i % 3 == 0)
      echo '</tr><tr>';
}
echo '
   </tr>
</table>
</div>';
#296
<?php

$i = 0;
foreach($context as $junk)
{
   ++$i;

   echo $junk;

   // If you can divide it by 2 evenly its time for a new row.
   if($i % 2 == 0 && $i != 0)
      echo '
';
}

?>
#297
function CanDo($permission, $creater = false)
{
   global $user_info, $tSettings;

   if($creater && $creater == $user_info['id'])
   {
      if($tSettings['moderate_own'][0] == 'all' || in_array($permission, $tSettings['moderate_own']))
         return true;
   }

   $todo_groups = $tSettings['moderation'][$permission];

   $smf_groups = array();
   foreach($todo_groups as $grp)
   {
      if(isset($tSettings['groups'][$grp]))
         $smf_groups[] = $tSettings['groups'][$grp];
   }

   if(array_intersect($smf_groups, $user_info['groups']))
   {
      foreach($smf_groups as $smf_group)
      {
         $tgroup = $tSettings['groups'][$smf_group];
         foreach($todo_groups as $thegroup)
         {
            if($thegroup == $tgroup)
            {
               foreach($tSettings['moderation'][$permission] as $tperm)
               {
                  if($tperm == $tgroup)
                     return true;
               }
            }
         }
      }
   }

   return false;
}
#298
function CanDo($smf_groups, $todo_groups, $permission)
{
   global $user_info, $tSettings;

   if(!is_array($smf_groups))
      $smf_groups = array($smf_groups);

   if(!is_array($todo_groups))
      $todo_groups = array($todo_groups);

   if(array_intersect($smf_groups, $user_info['groups']))
   {
      foreach($smf_groups as $smf_group)
      {
         $tgroup = $tSettings['permissions'][$smf_group];
         foreach($todo_groups as $thegroup)
         {
            if($thegroup == $tgroup)
            {
               foreach($tSettings['moderation'][$permission] as $tperm)
               {
                  if($tperm == $tgroup)
                     return true;
               }
            }
         }
      }
   }

   return false;
}
#299
function CanDo($smf_groups, $todo_groups, $permission)
{
   global $user_info, $tSettings;

   if(is_array($smf_groups))
      $TheSMFunc = 'array_intersect';
   else
      $TheSMFunc = 'in_array';

   if(!is_array($todo_groups))
      $todo_groups = array($todo_groups);

   if($TheSMFunc($smf_groups, $user_info['groups']))
   {
      if($TheSMFunc == 'array_intersect')
      {
         foreach($smf_groups as $smf_group)
         {
            $tgroup = $tSettings['permissions'][$smf_group];

            foreach($todo_groups as $thegroup)
            {
               if($thegroup == $tgroup)
               {
                  foreach($tSettings['moderation'][$permission] as $tperm)
                  {
                     if($tperm == $tgroup)
                        return true;
                  }
               }
            }
         }
      }
      else
      {
         $tgroup = $tSettings['permissions'][$smf_groups];

         foreach($todo_groups as $thegroup)
         {
            if($thegroup == $tgroup)
            {
               foreach($tSettings['moderation'][$permission] as $tperm)
               {
                  if($tperm == $tgroup)
                     return true;
               }
            }
         }
      }
   }

   return false;
}
#300
Traceroute to (69.72.214.163)
1 * (71.115.192.1) 8 ms 10 ms 8 ms
2 at-4-2-0-134.CORE-RTR1.SEA01.verizon-gni.net (130.81.36.96) 16 ms 16 ms 16 ms
3 so-0-3-0-0.BB-RTR1.SEA01.verizon-gni.net (130.81.20.76) 14 ms 16 ms 16 ms
4 so-7-2-0-0.BB-RTR1.SJC01.verizon-gni.net (130.81.19.4) 34 ms 34 ms 34 ms
5 so-6-0-0-0.PEER-RTR1.SJC80.verizon-gni.net (130.81.17.133) 34 ms 34 ms 36 ms
6 g4-1.ar1.sjc1.us.nlayer.net (69.22.153.45) 36 ms 36 ms 34 ms
7 tge1-3.ar1.pao1.us.nlayer.net (69.22.143.154) 38 ms 40 ms 38 ms
8 ge-2-1-1.cr1.sfo1.us.nlayer.net (69.22.143.161) 38 ms 72 ms 70 ms
9 so-0-2-0.cr1.ord1.us.nlayer.net (69.22.142.77) 80 ms 80 ms 80 ms
10 so-1-1-0.cr1.nyc3.us.nlayer.net (69.22.142.105) 98 ms 98 ms 98 ms
11 po1.ar1.nyc3.us.nlayer.net (69.31.95.130) 100 ms 100 ms 100 ms
12 fortressitx.g4-26.ar1.nyc3.us.nlayer.net (69.31.95.26) 132 ms 138 ms 200 ms
13 * (208.116.63.229) 100 ms 100 ms 102 ms
14 simplemachines.org (69.72.214.163) 100 ms 102 ms 110 ms