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

Topics - SleePy

#41
   function getLegacyAttachmentFilenameNew($filename, $attachment_id)
   {
      // Remove special accented characters - ie. sÃŒ (because they won't write to the filesystem well.)
      $clean_name = strtr($filename, array(chr(138) => 'S', chr(142) => 'Z', chr(154) => 's', chr(158) => 'z', chr(159) => 'Y', chr(192) => 'A', chr(193) => 'A', chr(194) => 'A', chr(195) => 'A', chr(196) => 'A', chr(197) => 'A', chr(199) => 'C', chr(200) => 'E', chr(201) => 'E', chr(202) => 'E', chr(203) => 'E', chr(204) => 'I', chr(205) => 'I', chr(206) => 'I', chr(207) => 'I', chr(209) => 'N', chr(210) => 'O', chr(211) => 'O', chr(212) => 'O', chr(213) => 'O', chr(214) => 'O', chr(216) => 'O', chr(217) => 'U', chr(218) => 'U', chr(219) => 'U', chr(220) => 'U', chr(221) => 'Y', chr(224) => 'a', chr(225) => 'a', chr(226) => 'a', chr(227) => 'a', chr(228) => 'a', chr(229) => 'a', chr(231) => 'c', chr(232) => 'e', chr(233) => 'e', chr(234) => 'e', chr(235) => 'e', chr(236) => 'i', chr(237) => 'i', chr(238) => 'i', chr(239) => 'i', chr(241) => 'n', chr(242) => 'o', chr(243) => 'o', chr(244) => 'o', chr(245) => 'o', chr(246) => 'o', chr(248) => 'o', chr(249) => 'u', chr(250) => 'u', chr(251) => 'u', chr(252) => 'u', chr(253) => 'y', chr(255) => 'y'));
      $clean_name = strtr($clean_name, array(chr(222) => 'TH', chr(254) => 'th', chr(208) => 'DH', chr(240) => 'dh', chr(223) => 'ss', chr(140) => 'OE', chr(156) => 'oe', chr(198) => 'AE', chr(230) => 'ae', chr(181) => 'u'));

      // Get rid of dots, spaces, and other weird characters.
      $clean_name = preg_replace(array('/\s/', '/[^\w_\.\-]/'), array('_', ''), $clean_name);

      return $attachment_id . '_' . strtr($clean_name, '.', '_') . md5($clean_name);
   }
#42
// Close bugs.
function svnProjectTools($data, $id_member)
{
   global $smcFunc, $sourcedir, $context, $user_profile, $issue, $project;

   $project = 2;

   if (empty($data->log))
      return;

   $entries = explode("\n", $data->log);
   $bugs = array();
   foreach ($entries as $entry)
   {
      $bug_data = array();
      preg_match('~\[[Bug|Feature]+\s+([\d,]+)\]~i', $entry, $matches);

      // Nothing to log?
      if (empty($matches[1]))
         continue;

      $temp = array_unique(array_map('intval', explode(',', $matches[1])));;

      foreach ($temp as $id)
         $bugs[$id][] = str_replace($matches[0], 'Revision: ' . $data->revision, $entry);
   }

   // Now loop our bugs.
   foreach ($bugs as $id => $bug)
      $bugs[$id] = implode("\n", array_unique($bug));

   // Still nothing?
   if (empty($bugs))
      return;

   require_once($sourcedir . '/Subs-Post.php');
   require_once($sourcedir . '/Subs-Issue.php');
   require_once($sourcedir . '/Subs-Project.php');
   require_once($sourcedir . '/IssueReport.php');
   require_once($sourcedir . '/IssueComment.php');

   // Get their data.
   loadMemberData($id_member);

   // Prep the changes.
   $posterOptions = array(
      'id' => $id_member,
      'ip' => $user_profile[$id_member]['member_ip'],
      'name' => $data->author,
      'email' => $user_profile[$id_member]['email_address'],
   );
   $issueOptions = array(
      'mark_read' => true,
      'assignee' => $id_member,
      'status' => 5, // Resolved.
   );
   $commentOptions = array('body' => '');
   loadProjectTools();

   // Lets do some loops.
   foreach ($bugs as $bug => $message)
   {
      $issue = $bug;
      loadIssue();

      // Update our body message
      $commentOptions['body'] = $smcFunc['htmlspecialchars']($message, ENT_QUOTES);

      $event_data = updateIssue($bug, $issueOptions, $posterOptions, true);

      if ($event_data === true)
         $event_data = array();

      $id_comment = createComment($project, $bug, $commentOptions, $posterOptions);
      $commentOptions['id'] = $id_comment;

      sendIssueNotification(array('id' => $bug, 'project' => $project), $commentOptions, $event_data, 'new_comment', $id_member);

   }
}
#43
         'member_groups' => array(
            'header' => array(
               'value' => $txt['sitead_download_access'],
            ),
            'data' => array(
               'function' => create_function('$rowData', '
                  global $context, $txt;

                  $return = \'
                     <input type="text" name="branch_\' . $row[\'id_branch\'] . \'" id="branch_\' . $row[\'id_branch\'] . \'" value="\' . $rowData[\'member_groups\'] . \'" />
                     <div id="branch_\' . $row[\'id_branch\'] . \'_container"></div>
                     <script language="JavaScript" type="text/javascript" defer="defer"><!-- // --><![CDATA[
                        var oBranchMember\' . $rowData[\'id_branch\'] . \'Suggest = new smc_AutoSuggest({
                           sSelf: \\\'oBranchMember\' . $rowData[\'id_branch\'] . \'Suggest\\\',
                           sSessionId: \\\'\' . $context[\'session_id\'] . \'\\\',
                           sSessionVar: \\\'\' . $context[\'session_var\'] . \'\\\',
                           sSuggestId: \\\'branch_\' . $row[\'id_branch\'] . \'\\\',
                           sControlId: \\\'branch_\' . $row[\'id_branch\'] . \'\\\',
                           sSearchType: \\\'member\\\',
                           sTextDeleteItem: \\\'\' . $txt[\'autosuggest_delete_item\'] . \'\\\',
                           bItemList: true,
                           sPostName: \\\'branch_\' . $row[\'id_branch\'] . \'_input\\\',
                           sURLMask: \\\'action=profile;u=%item_id%\\\',
                           sItemListContainerId: \\\'branch_\' . $row[\'id_branch\'] . \'_container\\\',
                           aListItems: [\';

                  $temp = explode(\',\', $rowData[\'member_groups\']);
                  foreach ($temp as $id)
                     $return .= \'
                                    {
                                       sItemId: \' . JavaScriptEscape($id) . \',
                                       sItemName: \' . JavaScriptEscape($context[\'membergroups\'][$id]) . \'
                                    },\';
                  // Clean up that last comma.
                  $return = substr($return, 0, -1);

                  $return .= \'
                           ]
                        });
                     // ]]></script>\';

                  return $return;
               '),
            ),
         ),
#44
// Combat mode!
function smc_combat_initiate(&$smcFunc, $db_server, $db_name, $db_user, $db_passwd, $db_prefix, $db_options = array())
{
   global $mysql_set_mod, $sourcedir, $db_connection, $db_prefix;

   if (!empty($db_options['persist']))
      $db_connection = @mysql_pconnect($db_server, $db_user, $db_passwd);
   else
      $db_connection = @mysql_connect($db_server, $db_user, $db_passwd);

   // Something's wrong, show an error if its fatal (which we assume it is)
   if (!$db_connection)
   {
      if (!empty($db_options['non_fatal']))
         return null;
      else
      {
         if (file_exists($sourcedir . '/Subs-Auth.php'))
         {
            require_once($sourcedir . '/Subs-Auth.php');
            show_db_error();
         }
         exit('Sorry, SMF was unable to connect to database.');
      }
   }

   // Select the database, unless told not to
   if (empty($db_options['dont_select_db']) && !@mysql_select_db($db_name, $connection) && empty($db_options['non_fatal']))
   {
      if (file_exists($sourcedir . '/Subs-Auth.php'))
      {
         require_once($sourcedir . '/Subs-Auth.php');
         show_db_error();
      }
      exit('Sorry, SMF was unable to connect to database.');
   }
   else
      $db_prefix = is_numeric(substr($db_prefix, 0, 1)) ? $db_name . '.' . $db_prefix : '`' . $db_name . '`.' . $db_prefix;

   // Some core functions.
   function smf_db_replacement__callback($matches)
   {
      global $db_callback, $user_info, $db_prefix;

      list ($values, $connection) = $db_callback;

      if ($matches[1] === 'db_prefix')
         return $db_prefix;

      if ($matches[1] === 'query_see_board')
         return $user_info['query_see_board'];

      if ($matches[1] === 'query_wanna_see_board')
         return $user_info['query_wanna_see_board'];

      if (!isset($matches[2]))
         smf_db_error_backtrace('Invalid value inserted or no type specified.', '', E_USER_ERROR, __FILE__, __LINE__);

      if (!isset($values[$matches[2]]))
         smf_db_error_backtrace('The database value you\'re trying to insert does not exist: ' . htmlspecialchars($matches[2]), '', E_USER_ERROR, __FILE__, __LINE__);

      $replacement = $values[$matches[2]];

      switch ($matches[1])
      {
         case 'int':
            if (!is_numeric($replacement) || (string) $replacement !== (string) (int) $replacement)
               smf_db_error_backtrace('Wrong value type sent to the database. Integer expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
            return (string) (int) $replacement;
         break;

         case 'string':
         case 'text':
            return sprintf('\'%1$s\'', mysql_real_escape_string($replacement, $connection));
         break;

         case 'array_int':
            if (is_array($replacement))
            {
               if (empty($replacement))
                  smf_db_error_backtrace('Database error, given array of integer values is empty. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);

               foreach ($replacement as $key => $value)
               {
                  if (!is_numeric($value) || (string) $value !== (string) (int) $value)
                     smf_db_error_backtrace('Wrong value type sent to the database. Array of integers expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);

                  $replacement[$key] = (string) (int) $value;
               }

               return implode(', ', $replacement);
            }
            else
               smf_db_error_backtrace('Wrong value type sent to the database. Array of integers expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);

         break;

         case 'array_string':
            if (is_array($replacement))
            {
               if (empty($replacement))
                  smf_db_error_backtrace('Database error, given array of string values is empty. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);

               foreach ($replacement as $key => $value)
                  $replacement[$key] = sprintf('\'%1$s\'', mysql_real_escape_string($value, $connection));

               return implode(', ', $replacement);
            }
            else
               smf_db_error_backtrace('Wrong value type sent to the database. Array of strings expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
         break;

         case 'date':
            if (preg_match('~^(\d{4})-([0-1]?\d)-([0-3]?\d)$~', $replacement, $date_matches) === 1)
               return sprintf('\'%04d-%02d-%02d\'', $date_matches[1], $date_matches[2], $date_matches[3]);
            else
               smf_db_error_backtrace('Wrong value type sent to the database. Date expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
         break;

         case 'float':
            if (!is_numeric($replacement))
               smf_db_error_backtrace('Wrong value type sent to the database. Floating point number expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);
            return (string) (float) $replacement;
         break;

         case 'identifier':
            // Backticks inside identifiers are supported as of MySQL 4.1. We don't need them for SMF.
            return '`' . strtr($replacement, array('`' => '', '.' => '')) . '`';
         break;

         case 'raw':
            return $replacement;
         break;

         default:
            smf_db_error_backtrace('Undefined type used in the database query. (' . $matches[1] . ':' . $matches[2] . ')', '', false, __FILE__, __LINE__);
         break;
      }
   }

   // Because this is just combat mode, this is good enough.
   function smf_db_query($execute = true, $db_string, $db_values)
   {
      global $db_callback, $db_connection;

      // Only bother if there's something to replace.
      if (strpos($db_string, '{') !== false)
      {
         // This is needed by the callback function.
         $db_callback = array($db_values, $db_connection);

         // Do the quoting and escaping
         $db_string = preg_replace_callback('~{([a-z_]+)(?::([a-zA-Z0-9_-]+))?}~', 'smf_db_replacement__callback', $db_string);

         // Clear this global variable.
         $db_callback = array();
      }

      // We actually make the query in combat mode.
      if ($execute === false)
         return $db_string;
      return mysql_query($db_string, $db_connection);
   }

   // Insert some data...
   function smf_db_insert($method = 'replace', $table, $columns, $data, $keys, $disable_trans = false)
   {
      global $smcFunc, $db_connection, $db_prefix;

      // With nothing to insert, simply return.
      if (empty($data))
         return;

      // Replace the prefix holder with the actual prefix.
      $table = str_replace('{db_prefix}', $db_prefix, $table);

      // Inserting data as a single row can be done as a single array.
      if (!is_array($data[array_rand($data)]))
         $data = array($data);

      // Create the mold for a single row insert.
      $insertData = '(';
      foreach ($columns as $columnName => $type)
      {
         // Are we restricting the length?
         if (strpos($type, 'string-') !== false)
            $insertData .= sprintf('SUBSTRING({string:%1$s}, 1, ' . substr($type, 7) . '), ', $columnName);
         else
            $insertData .= sprintf('{%1$s:%2$s}, ', $type, $columnName);
      }
      $insertData = substr($insertData, 0, -2) . ')';

      // Create an array consisting of only the columns.
      $indexed_columns = array_keys($columns);

      // Here's where the variables are injected to the query.
      $insertRows = array();
      foreach ($data as $dataRow)
         $insertRows[] = smf_db_query(true, $insertData, array_combine($indexed_columns, $dataRow));

      // Determine the method of insertion.
      $queryTitle = $method == 'replace' ? 'REPLACE' : ($method == 'ignore' ? 'INSERT IGNORE' : 'INSERT');

      // Do the insert.
      $smcFunc['db_query']('', '
         ' . $queryTitle . ' INTO ' . $table . '(`' . implode('`, `', $indexed_columns) . '`)
         VALUES
            ' . implode(',
            ', $insertRows),
         array(
            'security_override' => true,
         )
      );
   }

   // Now, go functions, spread your love.
   $smcFunc['db_free_result'] = 'mysql_free_result';
   $smcFunc['db_fetch_row'] = 'mysql_fetch_row';
   $smcFunc['db_fetch_assoc'] = 'mysql_fetch_assoc';
   $smcFunc['db_num_rows'] = 'mysql_num_rows';
   $smcFunc['db_insert'] = 'smf_db_insert';
   $smcFunc['db_query'] = 'smf_db_query';
}
#45
$helptxt['custom_mask'] = 'The input mask is important for your forums security. Validating the input from a user can help ensure that data is not used in a way in which you do not expect it. We have provided some simple regular expressions as hints.


   <span class="smalltext">
      &nbsp;&nbsp;"[A-Za-z]+" - Match all upper and lower case alphabet characters.

      &nbsp;&nbsp;"[0-9]+" - Match all numeric characters.

      &nbsp;&nbsp;"[A-Za-z0-9]{7}" - Match all upper and loser case alphabet and numeric characters seven times.

   </span>


   Additionally, ?+* and {xx} mean how much to match of the expression.
   <span class="smalltext">
      &nbsp;&nbsp;? - None or one match of previous expression.

      &nbsp;&nbsp;+ - One or more of previous expression.

      &nbsp;&nbsp;* - None or more of previous expression.e

      &nbsp;&nbsp;{xx} - An exact number from previous expression.

      &nbsp;&nbsp;{xx,} - An exact number or more from previous expression.

      &nbsp;&nbsp;{,xx} - An exact number or less from previous expression.

      &nbsp;&nbsp;{xx,yy} - An exact match between the two numbers from previous expression.

   </span>
';
#46
The test zone / test post
Jun 09, 2009, 12:17 AM
test post
#47
Index: trunk/subscriptions.php
===================================================================
--- trunk/subscriptions.php   (revision 8394)
+++ trunk/subscriptions.php   (working copy)
@@ -121,7 +121,7 @@
 
 // We wish to check the pending payments to make sure we are expecting this.
 $request = $smcFunc['db_query']('', '
-   SELECT id_sublog, payments_pending, pending_details
+   SELECT id_sublog, payments_pending, pending_details, end_time
    FROM {db_prefix}log_subscribed
    WHERE id_subscribe = {int:current_subscription}
       AND id_member = {int:current_member}
@@ -142,6 +142,18 @@
    // Delete user subscription.
    removeSubscription($subscription_id, $member_id);
 
+   // If the end time subtracted by current time, is not greater than the duration (ie length of subscription), then we close it.
+   // !!! IE, Duration is 1 Year (31536000 seconds)
+   // !!! Subscription ends on 1273542875 (May 9th 2010 18:54 PDT)
+   // !!! Current time is 1242006935 (May 10th 2009 19:54 PDT)
+   // !!! So, 1273542875 - 1242006935 = 31535940
+   // !!! 31535940 is less than 31536000. So we would close it.
+   // !!! If the subscription was twice as long, We would just remove 1 subscription.
+   if ($subscription_info['end_time'] - time() < $subscription_info['length'])
+      $subscription_act = time();
+   else
+      $subscription_act = $subscription_info['end_time'] - $subscription_info['length'];
+
    // Mark it as complete so we have a record.
    $smcFunc['db_query']('', '
       UPDATE {db_prefix}log_subscribed
@@ -150,7 +162,7 @@
          AND id_member = {int:current_member}
          AND status = {int:not_active}',
       array(
-         'current_time' => time(),
+         'current_time' => $subscription_act,
          'current_subscription' => $subscription_id,
          'current_member' => $member_id,
          'not_active' => 0,
#48
Index: trunk/index.php
===================================================================
--- trunk/index.php   (revision 8325)
+++ trunk/index.php   (working copy)
@@ -38,6 +38,7 @@
 
 // Get everything started up...
 define('SMF', 1);
+ob_start();
 if (function_exists('set_magic_quotes_runtime'))
    @set_magic_quotes_runtime(0);
 error_reporting(defined('E_STRICT') ? E_ALL | E_STRICT : E_ALL);
@@ -94,17 +95,17 @@
 }
 
 // Check if compressed output is enabled, supported, and not already being done.
-if (!empty($modSettings['enableCompressedOutput']) && !headers_sent() && ob_get_length() == 0)
+if (!empty($modSettings['enableCompressedOutput']) && !headers_sent())
 {
    // If zlib is being used, turn off output compression.
    if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') == 'ob_gzhandler' || @version_compare(PHP_VERSION, '4.2.0') == -1)
       $modSettings['enableCompressedOutput'] = '0';
    else
+   {
+      ob_end_clean();
       ob_start('ob_gzhandler');
+   }
 }
-// This makes it so headers can be sent!
-if (empty($modSettings['enableCompressedOutput']))
-   ob_start();
 
 // Register an error handler.
 set_error_handler('error_handler');
#49
// Recursive function for displaying generic XML data.
function template_mod_generic_xml_recursive($xml_data, $parent_ident, $child_ident, $old_level, $no_parent = false)
{
   // This is simply for neat indentation.
   $level = $old_level;
   if (!$no_parent)
      ++$level;

   if (!$no_parent)
      echo "\n" . str_repeat("\t", $old_level), '<', $parent_ident, '>';

   foreach ($xml_data as $key => $data)
   {
      // A group?
      if (is_array($data) && isset($data['children']) && (isset($data['identifier']) || isset($data['parent_identifier'])))
         template_mod_generic_xml_recursive($data['children'], isset($data['parent_identifier']) ? $data['parent_identifier'] : $key, $data['identifier'], $level, isset($data['no_parent']) ? true : false);
      // An item...
      elseif (is_array($data) && isset($data['value']))
      {
         if (!empty($data['identifier']))
            $index_key = $data['identifier'];
         else
            $index_key = $child_ident;

         echo "\n", str_repeat("\t", $level), '<', $index_key;

         if (!empty($data['attributes']))
            foreach ($data['attributes'] as $k => $v)
               echo ' ' . $k . '="' . $v . '"';
         echo '><![CDATA[', cleanXml($data['value']), ']]></', $index_key, '>';
      }
      else
         echo "\n", str_repeat("\t", $level), '<', $key, '><![CDATA[', cleanXml($data), ']]></', $key, '>';
   }

   if (!$no_parent)
      echo "\n", str_repeat("\t", $old_level), '</', $parent_ident, '>';
}
#50
  * The interactive version ("make install") asks for pathnames for Postfix
    data and program files, and stores your preferences in the main.cf file. IIff
    yyoouu ddoonn''tt wwaanntt PPoossttffiixx ttoo oovveerrwwrriittee nnoonn--PPoossttffiixx ""sseennddmmaaiill"",, ""mmaaiillqq"" aanndd
    ""nneewwaalliiaasseess"" ffiilleess,, ssppeecciiffyy ppaatthhnnaammeess tthhaatt eenndd iinn ""..ppoossttffiixx"".
#51
The test zone / Code Tags disppear
Mar 14, 2009, 05:51 PM
Quote from: digger on Feb 13, 2009, 06:39 AM
Quote from: LinK187 on Feb 13, 2009, 03:07 AM
Is there a way to disable this mod in an image tag? It's preventing a banner add (.gif) from working. You click on it and it just hangs on the spinny load thing when it should link to a thread on the forum.

Read the first post of topic.

Sorry for inconvenience, but I can't figure it out.

The first toppic say's: How disable highslide for linked images.
But the solution will comment out the whole mod, if I'm right.

I have two kinds of image links.
First one: No URL warped around the image.
[img width=150 height=94]http://img113.imageshack.us/img113/5954/20gr7707672.th.jpg[/img]
Second one: Own URL warped around image.
[URL=http://www.firopolis.de][img]http://img211.imageshack.us/img211/348/24gr7628668.th.jpg[/img][/URL]
Third one: Link-URL to image warped around image.
[URL=http://img15.imageshack.us/my.php?image=25gr7610059.jpg][img width=150 height=85]http://img15.imageshack.us/img15/2678/25gr7610059.th.jpg[/img][/URL]

If I put /* */ around the highslide code in subs.php, the first one is shown (without highslide), the second one is linked to source (obviously).

If I remove /* */ highsilde is working for the first one but not for the second one with a different url than the image url.

If the given URL leads to the image source, highslide is workung also.


Maybe I get something wrong?
#52
Last login: Sun Mar  8 14:01:18 on ttys000
You have mail.
The-SleePy-Laptop:~ jeremy$ mail
mail: /var/mail/jeremy: Permission denied
The-SleePy-Laptop:~ jeremy$
#53
The test zone / Test BBC Lists
Mar 05, 2009, 05:09 AM

  • Item 1
  • Item 2
  • Item 3

    • Sub-Item 1
    • Sub-Item 2
    • Sub-Item 3
#54
The test zone / Images
Feb 21, 2009, 11:05 PM
#55
The test zone / Attachment test
Feb 20, 2009, 02:19 AM
test
#56
The test zone / weeeee
Feb 03, 2009, 11:49 PM
#57
// Try to see if we can't find the previous version.
function upgrade_previous_version($version)
{
   // A Release Canidate?
   if (strpos($version, 'rc') !== false)
   {
      // It is something like rc2-1 (rc2.1)
      if ((substr($version, -2, 1) == '-' || substr($version, -2, 1) == '.') && substr($version, -1, 1) == 1)
         return substr($version, 0, -2);
      // Alright, maybe just a normal version?
      elseif (substr($version, -1, 1) > 1)
         return substr($version, 0, -1) . (substr($version, -1, 1) - 1);
   }
   // Maybe a Beta?
   elseif (strpos($version, 'b') !== false || strpos($version, 'beta') !== false)
   {
      // A weird case.
      if (substr($version, -5, 4) == '-fix')
         return substr($version, 0, -5);
      // It is something like b1.1 (b1-1)
      if (substr($version, -2, 1) == '-' || substr($version, -2, 1) == '.')
         return substr($version, 0, -2);
      // Alright, maybe just a normal version?
      elseif (substr($version, -1, 1) > 1)
         return substr($version, 0, -1) . (substr($version, -1, 1) - 1);
   }
   // Hopefully just a normal upgrade.
   else
      return substr($version, 0, -1) . (substr($version, -1, 1) - 1);
}
#58
On Laptop, PHP 5.3:
./configure --prefix=/home/software/php/v5 \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/share/man \
--with-mysql \
--with-apxs2=/home/software/apache/bin/apxs \
--enable-maintainer-zts \
--with-zlib-dir=/home/software/zlib \
--with-pgsql=/sw \
--enable-mbstring \
--with-gd \
--with-png-dir=/usr/local/libpng \
--enable-debug

Laptop, PHP6:
./configure --prefix=/home/software/php/v6 \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/share/man \
--with-mysql \
--with-apxs2=/home/software/apache/bin/apxs \
--enable-maintainer-zts \
--with-zlib-dir=/home/software/zlib \
--with-iconv \
--with-pgsql=/sw \
--with-sqlite \
--with-gd \
--with-png-dir=/usr/local/libpng \
--enable-debug

Laptop, PHP 5.2
./configure --prefix=/home/software/php/v52 \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/share/man \
--with-mysql \
--with-apxs2=/home/software/apache/bin/apxs \
--enable-maintainer-zts \
--with-zlib-dir=/home/software/zlib \
--enable-debug \
--with-pgsql=/sw \
--enable-mbstring

Laptop, PHP 5.3, with mysqlnd:
./configure --prefix=/home/software/php/v5 \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/share/man \
--with-mysql \
--with-apxs2=/home/software/apache/bin/apxs \
--enable-maintainer-zts \
--with-zlib-dir=/home/software/zlib \
--with-pgsql=/sw \
--enable-mbstring \
--with-gd \
--with-png-dir=/usr/local/libpng \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-debug


Litespeed:
--sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man --with-mysql --with-zlib-dir=/home/software/zlib --enable-debug --with-pgsql=/sw --enable-mbstring

#59
// Remove the short joins
function convert_update_short_join()
{
   global $files, $path;

   // Now we loop through all file and do a strtr fix.
   $replaces = array();
   foreach ($files as $file)
   {
      // Get the contents of the file.
      $file_contents = file_get_contents($path . '/' . $file);

      // Try to find any short joins.
      preg_match_all('~(\t)*FROM \(([^\)]+)\)~is', $file_contents, $matches);

      // Lets loop trhough all the matches.
      foreach ($matches[2] as $key => $string)
      {
         // Explode the short join.
         $temp = explode(', ', $string);

         // Start off the new string with some padding (maybe).
         $newstring = $matches[1][$key] . 'FROM ' . $temp[0];
         unset($temp[0]);

         // Now all others we will inner join.
         foreach ($temp as $str)
            $newstring .= "\n" . $matches[1][$key] . '   INNER JOIN ' . $str;

         // Now get it ready to go out.
         $replaces[$matches[0][$key]] = $newstring;
      }
   }

   // Now do updates to all files.
   DoUpdates('strtr', $replaces);
}
#60
input[type="file"]
{
       background: #2d2d2d;
       color: #353535;
}
input.file
{
       background: #2d2d2d;
       color: #353535;
}